mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-05-24 16:28:40 -04:00
discount in item_kits
This commit is contained in:
@@ -37,8 +37,9 @@ class Item_kits extends Secure_Controller
|
||||
}
|
||||
}
|
||||
|
||||
$discount_fraction = bcdiv($item_kit->kit_discount_percent, 100);
|
||||
$item_kit->total_unit_price = $item_kit->total_unit_price - round(bcadd(bcmul($item_kit->total_unit_price, $discount_fraction),bcmul($item_kit->kit_discount_fixed,$total_quantity)), totals_decimals(), PHP_ROUND_HALF_UP);
|
||||
$discount_fraction = bcdiv($item_kit->kit_discount, 100);
|
||||
|
||||
$item_kit->total_unit_price = $item_kit->total_unit_price - round(($item_kit->kit_discount_type == PERCENT)?bcmul($item_kit->total_unit_price, $discount_fraction): $item_kit->kit_discount, totals_decimals(), PHP_ROUND_HALF_UP);
|
||||
|
||||
return $item_kit;
|
||||
}
|
||||
@@ -131,8 +132,8 @@ class Item_kits extends Secure_Controller
|
||||
$item_kit_data = array(
|
||||
'name' => $this->input->post('name'),
|
||||
'item_id' => $this->input->post('kit_item_id'),
|
||||
'kit_discount_percent' => $this->input->post('kit_discount_percent'),
|
||||
'kit_discount_fixed' => $this->input->post('kit_discount_fixed'),
|
||||
'kit_discount' => $this->input->post('kit_discount'),
|
||||
'kit_discount_type' => $this->input->post('kit_discount_type') == NULL ? PERCENT : $this->input->post('kit_discount_type'),
|
||||
'price_option' => $this->input->post('price_option'),
|
||||
'print_option' => $this->input->post('print_option'),
|
||||
'description' => $this->input->post('description')
|
||||
|
||||
@@ -413,7 +413,7 @@ class Sales extends Secure_Controller
|
||||
if($item_kit_info->kit_discount != 0 && $item_kit_info->kit_discount > $discount)
|
||||
{
|
||||
$discount = $item_kit_info->kit_discount;
|
||||
$discount_type = $item_kit_info->discount_type;
|
||||
$discount_type = $item_kit_info->kit_discount_type;
|
||||
}
|
||||
|
||||
$price = NULL;
|
||||
|
||||
@@ -30,3 +30,7 @@ $lang["item_kits_successful_adding"] = "You have successfully added Item Kit";
|
||||
$lang["item_kits_successful_deleted"] = "You have successfully deleted";
|
||||
$lang["item_kits_successful_updating"] = "You have successfully updated Item Kit";
|
||||
$lang["item_kits_update"] = "Update Item Kit";
|
||||
$lang["item_kits_discount"] = "Discount";
|
||||
$lang["item_kits_discount_type"] = "Discount Type";
|
||||
$lang["item_kits_discount_fixed"] = "Fixed Discount";
|
||||
$lang["item_kits_discount_percent"] = "Percentage Discount";
|
||||
|
||||
@@ -30,3 +30,7 @@ $lang["item_kits_successful_adding"] = "Has agregado satisfactoriamente un Kit d
|
||||
$lang["item_kits_successful_deleted"] = "Has borrado satisfactoriamente";
|
||||
$lang["item_kits_successful_updating"] = "Has actualizado satisfactoriamente un Kit de Artículos";
|
||||
$lang["item_kits_update"] = "Actualizar Kit de Artículos";
|
||||
$lang["item_kits_discount"] = "Descuento";
|
||||
$lang["item_kits_discount_type"] = "Tipo de Descuento";
|
||||
$lang["item_kits_discount_fixed"] = "Descuento Fijo";
|
||||
$lang["item_kits_discount_percent"] = "Descuento en Porcentaje";
|
||||
|
||||
@@ -58,8 +58,8 @@ class Item_kit extends CI_Model
|
||||
item_kits.description,
|
||||
items.description as item_description,
|
||||
item_kits.item_id as kit_item_id,
|
||||
kit_discount_percent,
|
||||
kit_discount_fixed,
|
||||
kit_discount,
|
||||
kit_discount_type,
|
||||
price_option,
|
||||
print_option,
|
||||
category,
|
||||
|
||||
@@ -34,32 +34,41 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('item_kits_discount_percent'), 'kit_discount_percent', array('class' => 'control-label col-xs-3')); ?>
|
||||
<div class='col-xs-3'>
|
||||
<div class="input-group input-group-sm">
|
||||
<?php echo form_input(array(
|
||||
'name'=>'kit_discount_percent',
|
||||
'size'=>'5',
|
||||
'maxlength'=>'5',
|
||||
'id'=>'kit_discount_percent',
|
||||
'class'=>'form-control input-sm',
|
||||
'value'=>$item_kit_info->kit_discount_percent)
|
||||
);?>
|
||||
<span class="input-group-addon input-sm"><b>%</b></span>
|
||||
</div>
|
||||
<?php echo form_label($this->lang->line('item_kits_discount_type'), 'kit_discount_type', array('class'=>'control-label col-xs-3')); ?>
|
||||
<div class="col-xs-8">
|
||||
<label class="radio-inline">
|
||||
<?php echo form_radio(array(
|
||||
'name'=>'kit_discount_type',
|
||||
'type'=>'radio',
|
||||
'id'=>'kit_discount_type',
|
||||
'value'=>0,
|
||||
'checked'=>$item_kit_info->kit_discount_type == PERCENT)
|
||||
); ?> <?php echo $this->lang->line('item_kits_discount_percent'); ?>
|
||||
</label>
|
||||
<label class="radio-inline">
|
||||
<?php echo form_radio(array(
|
||||
'name'=>'kit_discount_type',
|
||||
'type'=>'radio',
|
||||
'id'=>'kit_discount_type',
|
||||
'value'=>1,
|
||||
'checked'=>$item_kit_info->kit_discount_type == FIXED)
|
||||
); ?> <?php echo $this->lang->line('item_kits_discount_fixed'); ?>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('item_kits_discount'), 'kit_discount', array('class' => 'control-label col-xs-3')); ?>
|
||||
<div class='col-xs-3'>
|
||||
<div class="input-group input-group-sm">
|
||||
<span class="input-group-addon input-sm"><b><?php echo $this->config->item('currency_symbol'); ?></b></span>
|
||||
<?php echo form_input(array(
|
||||
'name'=>'kit_discount_fixed',
|
||||
'name'=>'kit_discount',
|
||||
'size'=>'5',
|
||||
'maxlength'=>'5',
|
||||
'id'=>'kit_discount_fixed',
|
||||
'id'=>'kit_discount',
|
||||
'class'=>'form-control input-sm',
|
||||
'value'=>$item_kit_info->kit_discount_fixed)
|
||||
);?>
|
||||
'value'=>$item_kit_info->kit_discount)
|
||||
);?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user