From 3b3c99cdeeb1533eeefb1a798f216f712f09dd1b Mon Sep 17 00:00:00 2001 From: luis daniel lucio quiroz Date: Thu, 24 Jul 2014 03:48:26 +0000 Subject: [PATCH] discount new destination value from balance when billing --- app/destinations/destination_edit.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/destinations/destination_edit.php b/app/destinations/destination_edit.php index bd6270a6ff..802b0e192d 100644 --- a/app/destinations/destination_edit.php +++ b/app/destinations/destination_edit.php @@ -389,6 +389,10 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { $billing_currency = (strlen($db2->result[0]['currency'])?$db2->result[0]['currency']:$default_currency); $destination_sell_current_currency = currency_convert($destination_sell,$billing_currency,$currency); unset($db2->sql, $db2->result); + + $db2->sql = "UPDATE v_billings SET balance = balance - $destination_sell_current_currency, old_balance = old_balance - $destination_sell_current_currency WHERE type_value='$destination_accountcode'"; + $db2->result = $db2->execute(); + unset($db2->sql, $db2->result); } } if ($action == "update") {