mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-04-16 04:50:09 -04:00
@@ -78,6 +78,7 @@ class Cashups extends Secure_Controller
|
||||
}
|
||||
// if all the amounts are null or 0 that means it's a close cashup
|
||||
elseif(floatval($cash_ups_info->closed_amount_cash) == 0 &&
|
||||
floatval($cash_ups_info->closed_amount_due) == 0 &&
|
||||
floatval($cash_ups_info->closed_amount_card) == 0 &&
|
||||
floatval($cash_ups_info->closed_amount_check) == 0)
|
||||
{
|
||||
@@ -111,7 +112,7 @@ class Cashups extends Secure_Controller
|
||||
}
|
||||
elseif($row['payment_type'] == $this->lang->line('sales_due'))
|
||||
{
|
||||
$cash_ups_info->closed_amount_cash -= $this->xss_clean($row['payment_amount']);
|
||||
$cash_ups_info->closed_amount_due += $this->xss_clean($row['payment_amount']);
|
||||
}
|
||||
elseif($row['payment_type'] == $this->lang->line('sales_debit') ||
|
||||
$row['payment_type'] == $this->lang->line('sales_credit'))
|
||||
@@ -139,7 +140,7 @@ class Cashups extends Secure_Controller
|
||||
$cash_ups_info->closed_amount_cash -= $this->xss_clean($row['amount']);
|
||||
}
|
||||
|
||||
$cash_ups_info->closed_amount_total = $this->_calculate_total($cash_ups_info->open_amount_cash, $cash_ups_info->transfer_amount_cash, $cash_ups_info->closed_amount_cash, $cash_ups_info->closed_amount_card, $cash_ups_info->closed_amount_check);
|
||||
$cash_ups_info->closed_amount_total = $this->_calculate_total($cash_ups_info->open_amount_cash, $cash_ups_info->transfer_amount_cash, $cash_ups_info->closed_amount_cash, $cash_ups_info->closed_amount_due, $cash_ups_info->closed_amount_card, $cash_ups_info->closed_amount_check);
|
||||
}
|
||||
|
||||
$data['cash_ups_info'] = $cash_ups_info;
|
||||
@@ -169,6 +170,7 @@ class Cashups extends Secure_Controller
|
||||
'open_amount_cash' => parse_decimals($this->input->post('open_amount_cash')),
|
||||
'transfer_amount_cash' => parse_decimals($this->input->post('transfer_amount_cash')),
|
||||
'closed_amount_cash' => parse_decimals($this->input->post('closed_amount_cash')),
|
||||
'closed_amount_due' => parse_decimals($this->input->post('closed_amount_due')),
|
||||
'closed_amount_card' => parse_decimals($this->input->post('closed_amount_card')),
|
||||
'closed_amount_check' => parse_decimals($this->input->post('closed_amount_check')),
|
||||
'closed_amount_total' => parse_decimals($this->input->post('closed_amount_total')),
|
||||
@@ -221,10 +223,11 @@ class Cashups extends Secure_Controller
|
||||
$open_amount_cash = parse_decimals($this->input->post('open_amount_cash'));
|
||||
$transfer_amount_cash = parse_decimals($this->input->post('transfer_amount_cash'));
|
||||
$closed_amount_cash = parse_decimals($this->input->post('closed_amount_cash'));
|
||||
$closed_amount_due = parse_decimals($this->input->post('closed_amount_due'));
|
||||
$closed_amount_card = parse_decimals($this->input->post('closed_amount_card'));
|
||||
$closed_amount_check = parse_decimals($this->input->post('closed_amount_check'));
|
||||
|
||||
$total = $this->_calculate_total($open_amount_cash, $transfer_amount_cash, $closed_amount_cash, $closed_amount_card, $closed_amount_check);
|
||||
$total = $this->_calculate_total($open_amount_cash, $transfer_amount_cash, $closed_amount_due, $closed_amount_cash, $closed_amount_card, $closed_amount_check);
|
||||
|
||||
echo json_encode(array('total' => to_currency_no_money($total)));
|
||||
}
|
||||
@@ -232,9 +235,9 @@ class Cashups extends Secure_Controller
|
||||
/*
|
||||
Calculate total
|
||||
*/
|
||||
private function _calculate_total($open_amount_cash, $transfer_amount_cash, $closed_amount_cash, $closed_amount_card, $closed_amount_check)
|
||||
private function _calculate_total($open_amount_cash, $transfer_amount_cash, $closed_amount_due, $closed_amount_cash, $closed_amount_card, $closed_amount_check)
|
||||
{
|
||||
return ($closed_amount_cash - $open_amount_cash - $transfer_amount_cash + $closed_amount_card + $closed_amount_check);
|
||||
return ($closed_amount_cash - $open_amount_cash - $transfer_amount_cash + $closed_amount_due + $closed_amount_card + $closed_amount_check);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -660,6 +660,7 @@ function get_cashups_manage_table_headers()
|
||||
array('close_employee_id' => $CI->lang->line('cashups_close_employee')),
|
||||
array('closed_amount_cash' => $CI->lang->line('cashups_closed_amount_cash')),
|
||||
array('note' => $CI->lang->line('cashups_note')),
|
||||
array('closed_amount_due' => $CI->lang->line('cashups_closed_amount_due')),
|
||||
array('closed_amount_card' => $CI->lang->line('cashups_closed_amount_card')),
|
||||
array('closed_amount_check' => $CI->lang->line('cashups_closed_amount_check')),
|
||||
array('closed_amount_total' => $CI->lang->line('cashups_closed_amount_total'))
|
||||
@@ -685,6 +686,7 @@ function get_cash_up_data_row($cash_up)
|
||||
'close_employee_id' => $cash_up->close_first_name . ' ' . $cash_up->close_last_name,
|
||||
'closed_amount_cash' => to_currency($cash_up->closed_amount_cash),
|
||||
'note' => $cash_up->note ? '<span class="glyphicon glyphicon-ok"></span>' : '<span class="glyphicon glyphicon-remove"></span>',
|
||||
'closed_amount_due' => to_currency($cash_up->closed_amount_due),
|
||||
'closed_amount_card' => to_currency($cash_up->closed_amount_card),
|
||||
'closed_amount_check' => to_currency($cash_up->closed_amount_check),
|
||||
'closed_amount_total' => to_currency($cash_up->closed_amount_total),
|
||||
|
||||
@@ -20,6 +20,7 @@ $lang['cashups_transfer_amount_cash'] = "In/Out Cash";
|
||||
$lang['cashups_closed_amount_cash'] = "Closed Cash";
|
||||
$lang['cashups_closed_amount_card'] = "Cards";
|
||||
$lang['cashups_closed_amount_check'] = "Cheques";
|
||||
$lang['cashups_closed_amount_due'] = "Dues";
|
||||
$lang["cashups_new"] = "New Cashup";
|
||||
$lang["cashups_no_cashups_to_display"] = "There are no Cashups to display";
|
||||
$lang["cashups_none_selected"] = "You have not selected any Cashups";
|
||||
|
||||
@@ -20,6 +20,7 @@ $lang['cashups_transfer_amount_cash'] = "In/Out Cash";
|
||||
$lang['cashups_closed_amount_cash'] = "Closed Cash";
|
||||
$lang['cashups_closed_amount_card'] = "Cards";
|
||||
$lang['cashups_closed_amount_check'] = "Checks";
|
||||
$lang['cashups_closed_amount_due'] = "Dues";
|
||||
$lang["cashups_new"] = "New Cashup";
|
||||
$lang["cashups_no_cashups_to_display"] = "There are no Cashups to display";
|
||||
$lang["cashups_none_selected"] = "You have not selected any Cashups";
|
||||
|
||||
@@ -69,6 +69,7 @@ CREATE TABLE `ospos_cash_up` (
|
||||
`transfer_amount_cash` decimal(15,2) NOT NULL,
|
||||
`note` int(1) NOT NULL,
|
||||
`closed_amount_cash` decimal(15,2) NOT NULL,
|
||||
`closed_amount_due` decimal(15,2) NOT NULL,
|
||||
`closed_amount_card` decimal(15,2) NOT NULL,
|
||||
`closed_amount_check` decimal(15,2) NOT NULL,
|
||||
`closed_amount_total` decimal(15,2) NOT NULL,
|
||||
|
||||
@@ -63,6 +63,7 @@ class Cashup extends CI_Model
|
||||
MAX(cash_up.open_amount_cash) AS open_amount_cash,
|
||||
MAX(cash_up.transfer_amount_cash) AS transfer_amount_cash,
|
||||
MAX(cash_up.closed_amount_cash) AS closed_amount_cash,
|
||||
MAX(cash_up.closed_amount_due) AS closed_amount_due,
|
||||
MAX(cash_up.closed_amount_card) AS closed_amount_card,
|
||||
MAX(cash_up.closed_amount_check) AS closed_amount_check,
|
||||
MAX(cash_up.closed_amount_total) AS closed_amount_total,
|
||||
@@ -131,6 +132,7 @@ class Cashup extends CI_Model
|
||||
cash_up.open_amount_cash AS open_amount_cash,
|
||||
cash_up.transfer_amount_cash AS transfer_amount_cash,
|
||||
cash_up.closed_amount_cash AS closed_amount_cash,
|
||||
cash_up.closed_amount_due AS closed_amount_due,
|
||||
cash_up.closed_amount_card AS closed_amount_card,
|
||||
cash_up.closed_amount_check AS closed_amount_check,
|
||||
cash_up.closed_amount_total AS closed_amount_total,
|
||||
|
||||
@@ -125,6 +125,26 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('cashups_closed_amount_due'), 'closed_amount_due', array('class'=>'control-label col-xs-3')); ?>
|
||||
<div class='col-xs-4'>
|
||||
<div class="input-group input-group-sm">
|
||||
<?php if (!currency_side()): ?>
|
||||
<span class="input-group-addon input-sm"><b><?php echo $this->config->item('currency_symbol'); ?></b></span>
|
||||
<?php endif; ?>
|
||||
<?php echo form_input(array(
|
||||
'name'=>'closed_amount_due',
|
||||
'id'=>'closed_amount_due',
|
||||
'class'=>'form-control input-sm',
|
||||
'value'=>to_currency_no_money($cash_ups_info->closed_amount_due))
|
||||
);?>
|
||||
<?php if (currency_side()): ?>
|
||||
<span class="input-group-addon input-sm"><b><?php echo $this->config->item('currency_symbol'); ?></b></span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('cashups_closed_amount_card'), 'closed_amount_card', array('class'=>'control-label col-xs-3')); ?>
|
||||
<div class='col-xs-4'>
|
||||
@@ -279,10 +299,11 @@ $(document).ready(function()
|
||||
language: '<?php echo current_language_code(); ?>'
|
||||
});
|
||||
|
||||
$('#open_amount_cash, #transfer_amount_cash, #closed_amount_cash, #closed_amount_card, #closed_amount_check').keyup(function() {
|
||||
$('#open_amount_cash, #transfer_amount_cash, #closed_amount_cash, #closed_amount_due, #closed_amount_card, #closed_amount_check').keyup(function() {
|
||||
$.post("<?php echo site_url($controller_name . '/ajax_cashup_total')?>", {
|
||||
'open_amount_cash': $('#open_amount_cash').val(),
|
||||
'transfer_amount_cash': $('#transfer_amount_cash').val(),
|
||||
'closed_amount_due': $('#closed_amount_due').val(),
|
||||
'closed_amount_cash': $('#closed_amount_cash').val(),
|
||||
'closed_amount_card': $('#closed_amount_card').val(),
|
||||
'closed_amount_check': $('#closed_amount_check').val()
|
||||
|
||||
Reference in New Issue
Block a user