From 573bc3187d50050a6a4ea5b2d56aa3afb2cf9332 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 26 Mar 2019 20:01:06 +0100 Subject: [PATCH] Update invoice.php --- htdocs/takepos/invoice.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 5c5d1cd1163..8981966b802 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -47,18 +47,22 @@ $invoice = new Facture($db); $ret = $invoice->fetch('', '(PROV-POS-'.$place.')'); if ($ret > 0) $placeid = $invoice->id; - +$paycode = $pay; +if ($pay == 'cash') $paycode = 'LIQ'; +if ($pay == 'card') $paycode = 'CB'; +if ($pay == 'cheque') $paycode = 'CHQ'; + // Retrieve paiementid $sql = "SELECT id FROM ".MAIN_DB_PREFIX."c_paiement"; $sql.= " WHERE entity IN (".getEntity('c_paiement').")"; -$sql.= " AND code = '$pay'"; +$sql.= " AND code = '".$paycode."'"; $resql = $db->query($sql); $codes = $db->fetch_array($resql); $paiementid=$codes[0]; /* -* Actions -*/ + * Actions + */ if ($action == 'valid' && $user->rights->facture->creer) {