cleaning spaces

This commit is contained in:
Erastus
2018-09-02 17:58:41 -05:00
parent 53efbdb3b7
commit 3b659526f3
11 changed files with 30 additions and 54 deletions

View File

@@ -385,7 +385,7 @@ class Sales extends Secure_Controller
}
// if the customer discount is 0 or no customer is selected apply the default sales discount
if($discount == 0 )
if($discount == 0)
{
$discount = $this->config->item('default_sales_discount');
}

View File

@@ -226,7 +226,8 @@ class Receiving_lib
1 => 'x1');
}
if(is_null($receiving_quantity)){
if(is_null($receiving_quantity))
{
$receiving_quantity = $item_info->receiving_quantity;
}
@@ -279,7 +280,8 @@ class Receiving_lib
$line['quantity'] = $quantity;
$line['receiving_quantity'] = $receiving_quantity;
$line['discount'] = $discount;
if(!is_null($discount_type)){
if(!is_null($discount_type))
{
$line['discount_type'] = $discount_type;
}
$line['price'] = $price;
@@ -367,7 +369,6 @@ class Receiving_lib
$discount_fraction = bcdiv($discount, 100);
$discount_amount = bcmul($total, $discount_fraction);
}
return bcsub($total, $discount_amount);
}

View File

@@ -949,7 +949,8 @@ class Sale_lib
$line['serialnumber'] = $serialnumber;
$line['quantity'] = $quantity;
$line['discount'] = $discount;
if(!is_null($discount_type)){
if(!is_null($discount_type))
{
$line['discount_type'] = $discount_type;
}
$line['price'] = $price;

View File

@@ -1,20 +0,0 @@
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class Migration_Discount_on_sales extends CI_Migration
{
public function __construct()
{
parent::__construct();
}
public function up()
{
execute_script(APPPATH . 'migrations/sqlscripts/discount_on_sales.sql');
}
public function down()
{
}
}
?>

View File

@@ -3,7 +3,8 @@
--
INSERT INTO `ospos_app_config` (`key`, `value`) VALUES
('multi_pack_enabled', '0');
('multi_pack_enabled', '0'),
('default_sales_discount_type', '0');
ALTER TABLE `ospos_items`
ADD COLUMN `qty_per_pack` decimal(15,3) NOT NULL DEFAULT 1,
@@ -13,3 +14,23 @@ ALTER TABLE `ospos_items`
UPDATE `ospos_items`
SET `low_sell_item_id` = `item_id`
WHERE `low_sell_item_id` = 0;
--
-- Add support for Discount on Sales Fixed
--
ALTER TABLE `ospos_item_kits`
CHANGE COLUMN `kit_discount_percent` `kit_discount` DECIMAL(15,2) NOT NULL DEFAULT 0 AFTER `item_id`,
ADD COLUMN `kit_discount_type` TINYINT(2) NOT NULL DEFAULT '0' AFTER `kit_discount`;
ALTER TABLE `ospos_customers`
CHANGE COLUMN `discount_percent` `discount` DECIMAL(15,2) NOT NULL DEFAULT 0 AFTER `sales_tax_code`,
ADD COLUMN `discount_type` TINYINT(2) NOT NULL DEFAULT '0' AFTER `discount`;
ALTER TABLE `ospos_sales_items`
CHANGE COLUMN `discount_percent` `discount` DECIMAL(15,2) NOT NULL DEFAULT 0 AFTER `item_unit_price`,
ADD COLUMN `discount_type` TINYINT(2) NOT NULL DEFAULT '0' AFTER `discount`;
ALTER TABLE `ospos_receivings_items`
CHANGE COLUMN `discount_percent` `discount` DECIMAL(15,2) NOT NULL DEFAULT 0 AFTER `item_unit_price`,
ADD COLUMN `discount_type` TINYINT(2) NOT NULL DEFAULT '0' AFTER `discount`;

View File

@@ -1,23 +0,0 @@
--
-- Add support for Discount on Sales Fixed
--
INSERT INTO `ospos_app_config` (`key`, `value`) VALUES
('default_sales_discount_type', '0');
ALTER TABLE `ospos_item_kits`
CHANGE COLUMN `kit_discount_percent` `kit_discount` DECIMAL(15,2) NOT NULL DEFAULT '0.00' AFTER `item_id`,
ADD COLUMN `kit_discount_type` TINYINT(2) NOT NULL DEFAULT '0' AFTER `kit_discount`;
ALTER TABLE `ospos_customers`
CHANGE COLUMN `discount_percent` `discount` DECIMAL(15,2) NOT NULL DEFAULT '0.00' AFTER `sales_tax_code`,
ADD COLUMN `discount_type` TINYINT(2) NOT NULL DEFAULT '0' AFTER `discount`;
ALTER TABLE `ospos_sales_items`
CHANGE COLUMN `discount_percent` `discount` DECIMAL(15,2) NOT NULL DEFAULT '0.00' AFTER `item_unit_price`,
ADD COLUMN `discount_type` TINYINT(2) NOT NULL DEFAULT '0' AFTER `discount`;
ALTER TABLE `ospos_receivings_items`
CHANGE COLUMN `discount_percent` `discount` DECIMAL(15,2) NOT NULL DEFAULT '0.00' AFTER `item_unit_price`,
ADD COLUMN `discount_type` TINYINT(2) NOT NULL DEFAULT '0' AFTER `discount`;

View File

@@ -141,7 +141,6 @@ class Specific_discount extends Report
$this->db->where('discount >=', $inputs['discount']);
$this->db->where('discount_type',$inputs['discount_type']);
if($inputs['sale_type'] == 'complete')
{

View File

@@ -59,8 +59,7 @@
'id'=>'kit_discount_fixed',
'class'=>'form-control input-sm',
'value'=>$item_kit_info->kit_discount_fixed)
);?>
);?>
</div>
</div>
</div>

View File

@@ -516,7 +516,6 @@ $(document).ready(function()
});
$('[name="discount_toggle"]').change(function() {
var input = $("<input>").attr("type", "hidden").attr("name", "discount_type").val(($(this).prop('checked'))?1:0);
$('#cart_'+ $(this).attr('data-line')).append($(input));
$('#cart_'+ $(this).attr('data-line')).submit();

View File

@@ -906,7 +906,6 @@ $(document).ready(function()
});
$('[name="discount_toggle"]').change(function() {
var input = $("<input>").attr("type", "hidden").attr("name", "discount_type").val(($(this).prop('checked'))?1:0);
$('#cart_'+ $(this).attr('data-line')).append($(input));
$('#cart_'+ $(this).attr('data-line')).submit();