Allow return to Giftcard with 0 balance (#1620)

This commit is contained in:
FrancescoUK
2017-09-24 20:23:53 +01:00
parent 7aca0a57c5
commit b1b6301b93

View File

@@ -296,7 +296,7 @@ class Sales extends Secure_Controller
{
$data['error'] = $this->lang->line('giftcards_cannot_use', $giftcard_num);
}
elseif(($cur_giftcard_value - $current_payments_with_giftcard) <= 0)
elseif(($cur_giftcard_value - $current_payments_with_giftcard) <= 0 && $this->sale_lib->get_mode() == 'sale')
{
$data['error'] = $this->lang->line('giftcards_remaining_balance', $giftcard_num, to_currency($cur_giftcard_value));
}
@@ -320,7 +320,7 @@ class Sales extends Secure_Controller
{
$package_name = $this->Customer_rewards->get_name($package_id);
$points = $this->Customer->get_info($customer_id)->points;
$points = ($points==NULL ? 0 : $points);
$points = ($points == NULL ? 0 : $points);
$payments = $this->sale_lib->get_payments();
$payment_type = $payment_type;