From d076ffe73b0bd87cb9172712cb31f39d0338bd1d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 24 Jan 2017 15:03:33 +0100 Subject: [PATCH] Use correct thirdparty for numbering module --- htdocs/cashdesk/validation_verif.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/htdocs/cashdesk/validation_verif.php b/htdocs/cashdesk/validation_verif.php index afe73820568..5775a3c9388 100644 --- a/htdocs/cashdesk/validation_verif.php +++ b/htdocs/cashdesk/validation_verif.php @@ -47,15 +47,25 @@ switch ($action) case 'valide_achat': - + + $thirdpartyid = $_SESSION['CASHDESK_ID_THIRDPARTY']; + $company=new Societe($db); - $company->fetch($conf->global->CASHDESK_ID_THIRDPARTY); + $company->fetch($thirdpartyid); $invoice=new Facture($db); $invoice->date=dol_now(); $invoice->type= Facture::TYPE_STANDARD; + + // TODO + // To use a specific numbering module for POS, reset $conf->global->FACTURE_ADDON and other vars here + // and restore after values just after + $num=$invoice->getNextNumRef($company); + // TODO Restore save values + + $obj_facturation->numInvoice($num); $obj_facturation->getSetPaymentMode($_POST['hdnChoix']);