mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-10-23 08:38:37 -04:00
* Ver. 2.0.2
+ Fixed multiple giftcards issue per Bug #4 reported on Sourceforge where a second giftcard added would have its balance set to $0 even if the sale did not require the total of the second giftcard to pay the remaining amount due. + Small code cleanup git-svn-id: svn+ssh://jekkos@svn.code.sf.net/p/opensourcepos/code/@58 c3eb156b-1dc0-44e1-88ae-e38439141b53
This commit is contained in:
1 parent
70c172f7bb
commit
a8dfa2dbe8
6 files changed
+43
-36
No files matched your search
@@ -66,28 +66,28 @@ class Sale_lib
|
||||
$this->CI->session->unset_userdata('email_receipt');
|
||||
}
|
||||
|
||||
function add_payment($payment_id,$payment_amount)
|
||||
function add_payment( $payment_id, $payment_amount )
|
||||
{
|
||||
$payments=$this->get_payments();
|
||||
$payment = array($payment_id=>
|
||||
$payments = $this->get_payments();
|
||||
$payment = array( $payment_id=>
|
||||
array(
|
||||
'payment_type'=>$payment_id,
|
||||
'payment_amount'=>$payment_amount
|
||||
'payment_type' => $payment_id,
|
||||
'payment_amount' => $payment_amount
|
||||
)
|
||||
);
|
||||
|
||||
//payment_method already exists, add to payment_amount
|
||||
if(isset($payments[$payment_id]))
|
||||
if( isset( $payments[$payment_id] ) )
|
||||
{
|
||||
$payments[$payment_id]['payment_amount']+=$payment_amount;
|
||||
$payments[$payment_id]['payment_amount'] += $payment_amount;
|
||||
}
|
||||
else
|
||||
{
|
||||
//add to existing array
|
||||
$payments+=$payment;
|
||||
$payments += $payment;
|
||||
}
|
||||
|
||||
$this->set_payments($payments);
|
||||
$this->set_payments( $payments );
|
||||
return true;
|
||||
|
||||
}
|
||||
@@ -484,7 +484,7 @@ class Sale_lib
|
||||
$total = 0;
|
||||
foreach($this->get_cart() as $item)
|
||||
{
|
||||
$total+=($item['price']*$item['quantity']-$item['price']*$item['quantity']*$item['discount']/100);
|
||||
$total += ( $item['price'] * $item['quantity'] - $item['price'] * $item['quantity'] * $item['discount'] / 100);
|
||||
}
|
||||
|
||||
foreach($this->get_taxes() as $tax)
|
||||
|
||||
Reference in new issue
Block a user