From 4624f1b1b84d036b6eac7ca9e747217affef2555 Mon Sep 17 00:00:00 2001 From: atm-greg Date: Wed, 6 Feb 2019 17:19:16 +0100 Subject: [PATCH 001/135] FIX positive values creating diff on addline rounding --- htdocs/fourn/class/fournisseur.facture.class.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 086f154184d..a006b5391b1 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -1665,9 +1665,9 @@ class FactureFournisseur extends CommonInvoice $this->line->rang=$rang; $this->line->info_bits=$info_bits; $this->line->total_ht= (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_ht):$total_ht); // For credit note and if qty is negative, total is negative - $this->line->total_tva= $total_tva; - $this->line->total_localtax1=$total_localtax1; - $this->line->total_localtax2=$total_localtax2; + $this->line->total_tva= (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_tva):$total_tva); + $this->line->total_localtax1=(($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_localtax1):$total_localtax1); + $this->line->total_localtax2=(($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_localtax2):$total_localtax2); $this->line->total_ttc= (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_ttc):$total_ttc); $this->line->special_code=$this->special_code; $this->line->fk_parent_line=$this->fk_parent_line; @@ -1837,11 +1837,11 @@ class FactureFournisseur extends CommonInvoice $line->localtax2_tx = $txlocaltax2; $line->localtax1_type = $localtaxes_type[0]; $line->localtax2_type = $localtaxes_type[2]; - $line->total_ht = $total_ht; - $line->total_tva = $total_tva; + $line->total_ht = (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_ht):$total_ht); + $line->total_tva = (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_tva):$total_tva); $line->total_localtax1 = $total_localtax1; $line->total_localtax2 = $total_localtax2; - $line->total_ttc = $total_ttc; + $line->total_ttc = (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_ttc):$total_ttc); $line->fk_product = $idproduct; $line->product_type = $product_type; $line->info_bits = $info_bits; From 288a876491ec67529bc0166ba266ec345fa18234 Mon Sep 17 00:00:00 2001 From: Dan Rusu Date: Mon, 11 Feb 2019 09:14:06 +0200 Subject: [PATCH 002/135] add API method to create credit note from invoice --- .../facture/class/api_invoices.class.php | 112 ++++++++++++++++++ 1 file changed, 112 insertions(+) diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index 555b6179677..0fb203f50d1 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -839,6 +839,118 @@ class Invoices extends DolibarrApi return $this->_cleanObjectDatas($this->invoice); } + /** + * Make credt note from invoice + * + * @param int $id Invoice ID + * @url POST {id}/makecreditnote + * + * @return array An invoice object + * + * @throws 200 + * @throws 304 + * @throws 401 + * @throws 404 + * @throws 500 + */ + function makecreditnote($id) + { + if(! DolibarrApiAccess::$user->rights->facture->creer) { + throw new RestException(401); + } + + $this->db->begin(); + + $result = $this->invoice->fetch($id); + if( ! $result ) { + throw new RestException(404, 'Invoice not found'); + } + + if( ! DolibarrApi::_checkAccessToResource('facture',$this->invoice->id)) { + throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + } + + $result = $this->invoice->fetch_thirdparty(); + if( ! $result ) { + throw new RestException(404, 'Thirdparty not found'); + } + + if (! $object->paye) // protection against multiple submit + { + $this->invoice->fetch_lines(); + + // Boucle sur chaque taux de tva + $i=0; + foreach($this->invoice->lines as $line) + { + $amount_ht[$line->tva_tx]+=$line->total_ht; + $amount_tva[$line->tva_tx]+=$line->total_tva; + $amount_ttc[$line->tva_tx]+=$line->total_ttc; + $i++; + } + + // Insert one discount by VAT rate category + $discount = new DiscountAbsolute($this->db); + if ($this->invoice->type == 2) $discount->description='(CREDIT_NOTE)'; + elseif ($this->invoice->type == 3) $discount->description='(DEPOSIT)'; + else { + $this->error="CantConvertToReducAnInvoiceOfThisType"; + return -1; + } + $discount->tva_tx=abs($this->invoice->total_ttc); + $discount->fk_soc=$this->invoice->socid; + $discount->fk_facture_source=$this->invoice->id; + + $error=0; + foreach($amount_ht as $tva_tx => $xxx) + { + $discount->amount_ht=abs($amount_ht[$tva_tx]); + $discount->amount_tva=abs($amount_tva[$tva_tx]); + $discount->amount_ttc=abs($amount_ttc[$tva_tx]); + $discount->tva_tx=abs($tva_tx); + + $result=$discount->create(DolibarrApiAccess::$user); + if ($result < 0) + { + $error++; + break; + } + } + + if (! $error) + { + // Classe facture + $result=$this->invoice->set_paid(DolibarrApiAccess::$user); + if ($result > 0) + { + //$mesg='OK'.$discount->id; + $this->db->commit(); + } + else + { + throw new RestException(500, 'Could not set paid'); + $this->db->rollback(); + } + } + else + { + throw new RestException(500, 'Discount error'); + $this->db->rollback(); + } + } + + $result = $this->invoice->fetch($id); + if( ! $result ) { + throw new RestException(404, 'Invoice not found'); + } + + if( ! DolibarrApi::_checkAccessToResource('facture',$this->invoice->id)) { + throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + } + + return $this->_cleanObjectDatas($this->invoice); + } + /** * Add a discount line into an invoice (as an invoice line) using an existing absolute discount * From 0698ddbd7779a6eec7c546c470d63c8c65e6d1cc Mon Sep 17 00:00:00 2001 From: Dan Rusu Date: Mon, 11 Feb 2019 09:24:16 +0200 Subject: [PATCH 003/135] Revert "add API method to create credit note from invoice" This reverts commit 288a876491ec67529bc0166ba266ec345fa18234. --- .../facture/class/api_invoices.class.php | 112 ------------------ 1 file changed, 112 deletions(-) diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index 0fb203f50d1..555b6179677 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -839,118 +839,6 @@ class Invoices extends DolibarrApi return $this->_cleanObjectDatas($this->invoice); } - /** - * Make credt note from invoice - * - * @param int $id Invoice ID - * @url POST {id}/makecreditnote - * - * @return array An invoice object - * - * @throws 200 - * @throws 304 - * @throws 401 - * @throws 404 - * @throws 500 - */ - function makecreditnote($id) - { - if(! DolibarrApiAccess::$user->rights->facture->creer) { - throw new RestException(401); - } - - $this->db->begin(); - - $result = $this->invoice->fetch($id); - if( ! $result ) { - throw new RestException(404, 'Invoice not found'); - } - - if( ! DolibarrApi::_checkAccessToResource('facture',$this->invoice->id)) { - throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); - } - - $result = $this->invoice->fetch_thirdparty(); - if( ! $result ) { - throw new RestException(404, 'Thirdparty not found'); - } - - if (! $object->paye) // protection against multiple submit - { - $this->invoice->fetch_lines(); - - // Boucle sur chaque taux de tva - $i=0; - foreach($this->invoice->lines as $line) - { - $amount_ht[$line->tva_tx]+=$line->total_ht; - $amount_tva[$line->tva_tx]+=$line->total_tva; - $amount_ttc[$line->tva_tx]+=$line->total_ttc; - $i++; - } - - // Insert one discount by VAT rate category - $discount = new DiscountAbsolute($this->db); - if ($this->invoice->type == 2) $discount->description='(CREDIT_NOTE)'; - elseif ($this->invoice->type == 3) $discount->description='(DEPOSIT)'; - else { - $this->error="CantConvertToReducAnInvoiceOfThisType"; - return -1; - } - $discount->tva_tx=abs($this->invoice->total_ttc); - $discount->fk_soc=$this->invoice->socid; - $discount->fk_facture_source=$this->invoice->id; - - $error=0; - foreach($amount_ht as $tva_tx => $xxx) - { - $discount->amount_ht=abs($amount_ht[$tva_tx]); - $discount->amount_tva=abs($amount_tva[$tva_tx]); - $discount->amount_ttc=abs($amount_ttc[$tva_tx]); - $discount->tva_tx=abs($tva_tx); - - $result=$discount->create(DolibarrApiAccess::$user); - if ($result < 0) - { - $error++; - break; - } - } - - if (! $error) - { - // Classe facture - $result=$this->invoice->set_paid(DolibarrApiAccess::$user); - if ($result > 0) - { - //$mesg='OK'.$discount->id; - $this->db->commit(); - } - else - { - throw new RestException(500, 'Could not set paid'); - $this->db->rollback(); - } - } - else - { - throw new RestException(500, 'Discount error'); - $this->db->rollback(); - } - } - - $result = $this->invoice->fetch($id); - if( ! $result ) { - throw new RestException(404, 'Invoice not found'); - } - - if( ! DolibarrApi::_checkAccessToResource('facture',$this->invoice->id)) { - throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); - } - - return $this->_cleanObjectDatas($this->invoice); - } - /** * Add a discount line into an invoice (as an invoice line) using an existing absolute discount * From 9ce4b91f5d17e07617abe5c818f7b49289b39fa2 Mon Sep 17 00:00:00 2001 From: Dan Rusu Date: Mon, 11 Feb 2019 09:31:43 +0200 Subject: [PATCH 004/135] NEW | make credit note from invoice inspired from the action of the button "Make credit note" from UI. - load invoice data and lines - check invoice type - calculate totals and create new credit notes - create DiscountAbsolute & commit changes --- .../facture/class/api_invoices.class.php | 112 ++++++++++++++++++ 1 file changed, 112 insertions(+) diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index 555b6179677..dede6f735c6 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -839,6 +839,118 @@ class Invoices extends DolibarrApi return $this->_cleanObjectDatas($this->invoice); } + /** + * Make credt note from invoice + * + * @param int $id Invoice ID + * @url POST {id}/makecreditnote + * + * @return array An invoice object + * + * @throws 200 + * @throws 304 + * @throws 401 + * @throws 404 + * @throws 500 + */ + function makecreditnote($id) + { + if(! DolibarrApiAccess::$user->rights->facture->creer) { + throw new RestException(401); + } + + $this->db->begin(); + + $result = $this->invoice->fetch($id); + if( ! $result ) { + throw new RestException(404, 'Invoice not found'); + } + + if( ! DolibarrApi::_checkAccessToResource('facture',$this->invoice->id)) { + throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + } + + $result = $this->invoice->fetch_thirdparty(); + if( ! $result ) { + throw new RestException(404, 'Thirdparty not found'); + } + + if (! $object->paye) // protection against multiple submit + { + $this->invoice->fetch_lines(); + + // Boucle sur chaque taux de tva + $i=0; + foreach($this->invoice->lines as $line) + { + $amount_ht[$line->tva_tx]+=$line->total_ht; + $amount_tva[$line->tva_tx]+=$line->total_tva; + $amount_ttc[$line->tva_tx]+=$line->total_ttc; + $i++; + } + + // Insert one discount by VAT rate category + $discount = new DiscountAbsolute($this->db); + if ($this->invoice->type == 2) $discount->description='(CREDIT_NOTE)'; + elseif ($this->invoice->type == 3) $discount->description='(DEPOSIT)'; + else { + $this->error="CantConvertToReducAnInvoiceOfThisType"; + return -1; + } + $discount->tva_tx=abs($this->invoice->total_ttc); + $discount->fk_soc=$this->invoice->socid; + $discount->fk_facture_source=$this->invoice->id; + + $error=0; + foreach($amount_ht as $tva_tx => $xxx) + { + $discount->amount_ht=abs($amount_ht[$tva_tx]); + $discount->amount_tva=abs($amount_tva[$tva_tx]); + $discount->amount_ttc=abs($amount_ttc[$tva_tx]); + $discount->tva_tx=abs($tva_tx); + + $result=$discount->create(DolibarrApiAccess::$user); + if ($result < 0) + { + $error++; + break; + } + } + + if (! $error) + { + // Classe facture + $result=$this->invoice->set_paid(DolibarrApiAccess::$user); + if ($result > 0) + { + //$mesg='OK'.$discount->id; + $this->db->commit(); + } + else + { + throw new RestException(500, 'Could not set paid'); + $this->db->rollback(); + } + } + else + { + throw new RestException(500, 'Discount error'); + $this->db->rollback(); + } + } + + $result = $this->invoice->fetch($id); + if( ! $result ) { + throw new RestException(404, 'Invoice not found'); + } + + if( ! DolibarrApi::_checkAccessToResource('facture',$this->invoice->id)) { + throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + } + + return $this->_cleanObjectDatas($this->invoice); + } + /** * Add a discount line into an invoice (as an invoice line) using an existing absolute discount * From 57e2971a22ad350b96e2a1bc8f303d909e9d7d41 Mon Sep 17 00:00:00 2001 From: Dan Rusu Date: Mon, 11 Feb 2019 19:58:01 +0200 Subject: [PATCH 005/135] fix code indent --- htdocs/compta/facture/class/api_invoices.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index dede6f735c6..8fbfa34bce9 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -866,7 +866,7 @@ class Invoices extends DolibarrApi throw new RestException(404, 'Invoice not found'); } - if( ! DolibarrApi::_checkAccessToResource('facture',$this->invoice->id)) { + if( ! DolibarrApi::_checkAccessToResource('facture', $this->invoice->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } @@ -944,7 +944,7 @@ class Invoices extends DolibarrApi throw new RestException(404, 'Invoice not found'); } - if( ! DolibarrApi::_checkAccessToResource('facture',$this->invoice->id)) { + if( ! DolibarrApi::_checkAccessToResource('facture', $this->invoice->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } From 45d05da6ed7d563b44c8b0e77c3e2d5c5a918d6a Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 14 Feb 2019 16:14:19 +0100 Subject: [PATCH 006/135] FIX missing $ismultientitymanaged for previous/next ref --- htdocs/product/stock/class/entrepot.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index add121b902e..850c652c59f 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -36,6 +36,7 @@ class Entrepot extends CommonObject public $element='stock'; public $table_element='entrepot'; public $picto='stock'; + public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe /** * Warehouse closed, inactive @@ -716,7 +717,7 @@ class Entrepot extends CommonObject return $TChildWarehouses; } - + /** * Create object on disk * From 69f350eb0e0d6f066f81fb356541fcd852ebb216 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 14 Feb 2019 16:33:38 +0100 Subject: [PATCH 007/135] update with html5 compliant code --- htdocs/compta/tva/index.php | 56 ++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/htdocs/compta/tva/index.php b/htdocs/compta/tva/index.php index e307a86ade9..f0c96dccdd6 100644 --- a/htdocs/compta/tva/index.php +++ b/htdocs/compta/tva/index.php @@ -101,8 +101,8 @@ function pt($db, $sql, $date) print ''; print ''.$date.''; - print ''.$langs->trans("ClaimedForThisPeriod").''; - print ''.$langs->trans("PaidDuringThisPeriod").''; + print ''.$langs->trans("ClaimedForThisPeriod").''; + print ''.$langs->trans("PaidDuringThisPeriod").''; print "\n"; $totalclaimed = 0; @@ -122,8 +122,8 @@ function pt($db, $sql, $date) { print ''; print ''.$previousmonth."\n"; - print ''.price($amountclaimed)."\n"; - print ''.price($amountpaid)."\n"; + print ''.price($amountclaimed)."\n"; + print ''.price($amountpaid)."\n"; print "\n"; $amountclaimed = 0; @@ -145,8 +145,8 @@ function pt($db, $sql, $date) { print ''; print ''.$obj->dm."\n"; - print ''.price($amountclaimed)."\n"; - print ''.price($amountpaid)."\n"; + print ''.price($amountclaimed)."\n"; + print ''.price($amountpaid)."\n"; print "\n"; $amountclaimed = 0; $amountpaid = 0; @@ -166,8 +166,8 @@ function pt($db, $sql, $date) { print ''; print ''.$previousmonth."\n"; - print ''.price($amountclaimed)."\n"; - print ''.price($amountpaid)."\n"; + print ''.price($amountclaimed)."\n"; + print ''.price($amountpaid)."\n"; print "\n"; $amountclaimed = 0; @@ -175,9 +175,9 @@ function pt($db, $sql, $date) } print ''; - print ''.$langs->trans("Total").''; - print ''.price($totalclaimed).''; - print ''.price($totalpaid).''; + print ''.$langs->trans("Total").''; + print ''.price($totalclaimed).''; + print ''.price($totalpaid).''; print ""; print ""; @@ -242,9 +242,9 @@ print load_fiche_titre($langs->trans("VATSummary"), '', ''); print ''; print ''; print ''; -print ''; -print ''; -print ''; +print ''; +print ''; +print ''; print ''."\n"; print ''."\n"; @@ -444,7 +444,7 @@ while ((($y < $yend) || ($y == $yend && $m <= $mend)) && $mcursor < 1000) // $mc $x_coll_sum += $temp_vat; } } - print ""; + print ''; $x_paye_sum = 0; foreach (array_keys($x_paye) as $rate) @@ -488,7 +488,7 @@ while ((($y < $yend) || ($y == $yend && $m <= $mend)) && $mcursor < 1000) // $mc $x_paye_sum += $temp_vat; } } - print ""; + print ''; $subtotalcoll = $subtotalcoll + $x_coll_sum; $subtotalpaye = $subtotalpaye + $x_paye_sum; @@ -497,7 +497,7 @@ while ((($y < $yend) || ($y == $yend && $m <= $mend)) && $mcursor < 1000) // $mc $total = $total + $diff; $subtotal = price2num($subtotal + $diff, 'MT'); - print "\n"; + print ''."\n"; print "\n"; print "\n"; @@ -505,16 +505,16 @@ while ((($y < $yend) || ($y == $yend && $m <= $mend)) && $mcursor < 1000) // $mc if ($i > 2) { print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; print ''; $i = 0; $subtotalcoll=0; $subtotalpaye=0; $subtotal=0; } } -print ''; +print ''; print "\n"; print ''; @@ -575,19 +575,19 @@ if (! empty($conf->global->MAIN_FEATURES_LEVEL)) print '
'.$langs->trans("Year")." ".$y.''.$langs->trans("VATToPay").''.$langs->trans("VATToCollect").''.$langs->trans("Balance").''.$langs->trans("VATToPay").''.$langs->trans("VATToCollect").''.$langs->trans("Balance").' 
".price(price2num($x_coll_sum, 'MT'))."'.price(price2num($x_coll_sum, 'MT')).'".price(price2num($x_paye_sum, 'MT'))."'.price(price2num($x_paye_sum, 'MT')).'".price(price2num($diff, 'MT'))."'.price(price2num($diff, 'MT')).' 
'.$langs->trans("SubTotal").':'.price(price2num($subtotalcoll, 'MT')).''.price(price2num($subtotalpaye, 'MT')).''.price(price2num($subtotal, 'MT')).''.$langs->trans("SubTotal").':'.price(price2num($subtotalcoll, 'MT')).''.price(price2num($subtotalpaye, 'MT')).''.price(price2num($subtotal, 'MT')).' 
'.$langs->trans("TotalToPay").':'.price(price2num($total, 'MT')).'
'.$langs->trans("TotalToPay").':'.price(price2num($total, 'MT')).' 
'; print ""; - print ''; - print ''; + print ''; + print ''; print "\n"; print ""; - print ''; - print '\n"; + print ''; + print '\n"; print "\n"; $restopay = $total - $obj->mm; print ""; - print ''; - print ''; + print ''; + print ''; print "\n"; print '
' . $langs->trans("VATDue") . '' . price(price2num($total, 'MT')) . '' . $langs->trans("VATDue") . '' . price(price2num($total, 'MT')) . '
' . $langs->trans("VATPaid") . '' . price(price2num($obj->mm, 'MT')) . "' . $langs->trans("VATPaid") . '' . price(price2num($obj->mm, 'MT')) . "
' . $langs->trans("RemainToPay") . '' . price(price2num($restopay, 'MT')) . '' . $langs->trans("RemainToPay") . '' . price(price2num($restopay, 'MT')) . '
'; From 1f2dd3bc29348bcccb62145723842e44044c2f98 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 14 Feb 2019 16:38:03 +0100 Subject: [PATCH 008/135] update with html5 compliant code --- htdocs/compta/tva/list.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/htdocs/compta/tva/list.php b/htdocs/compta/tva/list.php index d3ec5e53f71..dcac389b988 100644 --- a/htdocs/compta/tva/list.php +++ b/htdocs/compta/tva/list.php @@ -188,8 +188,8 @@ if ($result) $form->select_comptes($search_account, 'search_account', 0, '', 1); print ''; } - print ''; - print ''; + print ''; + print ''; $searchpicto=$form->showFilterAndCheckAddButtons(0); print $searchpicto; print ''; @@ -202,7 +202,7 @@ if ($result) print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "t.datep", "", $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "type", "", $param, 'align="left"', $sortfield, $sortorder); if (! empty($conf->banque->enabled)) print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder); - print_liste_field_titre("PayedByThisPayment", $_SERVER["PHP_SELF"], "t.amount", "", $param, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("PayedByThisPayment", $_SERVER["PHP_SELF"], "t.amount", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch '); print "\n"; @@ -265,7 +265,7 @@ if ($result) $colspan=5; if (! empty($conf->banque->enabled)) $colspan++; print ''.$langs->trans("Total").''; - print ''.price($total).''; + print ''.price($total).''; print " "; print ""; @@ -280,7 +280,6 @@ else dol_print_error($db); } - +// End of page llxFooter(); - $db->close(); From ed1a59d00bac40174b35e36fc138f9006c7b8417 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 14 Feb 2019 16:43:40 +0100 Subject: [PATCH 009/135] update with html5 compliant code --- htdocs/compta/tva/quadri_detail.php | 78 ++++++++++++++--------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php index f749df2b548..8b58bde4199 100644 --- a/htdocs/compta/tva/quadri_detail.php +++ b/htdocs/compta/tva/quadri_detail.php @@ -344,11 +344,11 @@ if (! is_array($x_coll) || ! is_array($x_paye)) print ''.$productcust.''; if ($modetax != 1) { - print ''.$amountcust.''; - print ''.$langs->trans("Payment").' ('.$langs->trans("PercentOfInvoice").')'; + print ''.$amountcust.''; + print ''.$langs->trans("Payment").' ('.$langs->trans("PercentOfInvoice").')'; } - print ''.$langs->trans("AmountHTVATRealReceived").''; - print ''.$vatcust.''; + print ''.$langs->trans("AmountHTVATRealReceived").''; + print ''.$vatcust.''; print ''; $action = "tvadetail"; @@ -390,7 +390,7 @@ if (! is_array($x_coll) || ! is_array($x_paye)) print ''; // Ref - print ''.$fields['link'].''; + print ''.$fields['link'].''; // Invoice date print '' . dol_print_date($fields['datef'], 'day') . ''; @@ -440,7 +440,7 @@ if (! is_array($x_coll) || ! is_array($x_paye)) // Total HT if ($modetax != 1) { - print ''; + print ''; print price($fields['totalht']); if (price2num($fields['ftotal_ttc'])) { @@ -455,7 +455,7 @@ if (! is_array($x_coll) || ! is_array($x_paye)) $ratiopaymentinvoice=1; if ($modetax != 1) { - print ''; + print ''; //print $fields['totalht']."-".$fields['payment_amount']."-".$fields['ftotal_ttc']; if ($fields['payment_amount'] && $fields['ftotal_ttc']) { @@ -479,13 +479,13 @@ if (! is_array($x_coll) || ! is_array($x_paye)) } // Total collected - print ''; + print ''; $temp_ht=$fields['totalht']*$ratiopaymentinvoice; print price(price2num($temp_ht, 'MT'), 1); print ''; // VAT - print ''; + print ''; $temp_vat=$fields['vat']*$ratiopaymentinvoice; print price(price2num($temp_vat, 'MT'), 1); //print price($fields['vat']); @@ -500,13 +500,13 @@ if (! is_array($x_coll) || ! is_array($x_paye)) // Total customers for this vat rate print ''; print ''; - print ''.$langs->trans("Total").':'; + print ''.$langs->trans("Total").':'; if ($modetax != 1) { - print ' '; - print ' '; + print ' '; + print ' '; } - print ''.price(price2num($subtot_coll_total_ht, 'MT')).''; - print ''.price(price2num($subtot_coll_vat, 'MT')).''; + print ''.price(price2num($subtot_coll_total_ht, 'MT')).''; + print ''.price(price2num($subtot_coll_vat, 'MT')).''; print ''; } @@ -514,13 +514,13 @@ if (! is_array($x_coll) || ! is_array($x_paye)) { print ''; print ''; - print ''.$langs->trans("Total").':'; + print ''.$langs->trans("Total").':'; if ($modetax != 1) { - print ' '; - print ' '; + print ' '; + print ' '; } - print ''.price(price2num(0, 'MT')).''; - print ''.price(price2num(0, 'MT')).''; + print ''.price(price2num(0, 'MT')).''; + print ''.price(price2num(0, 'MT')).''; print ''; } @@ -536,11 +536,11 @@ if (! is_array($x_coll) || ! is_array($x_paye)) print ''.$namesup.''; print ''.$productsup.''; if ($modetax != 1) { - print ''.$amountsup.''; - print ''.$langs->trans("Payment").' ('.$langs->trans("PercentOfInvoice").')'; + print ''.$amountsup.''; + print ''.$langs->trans("Payment").' ('.$langs->trans("PercentOfInvoice").')'; } - print ''.$langs->trans("AmountHTVATRealPaid").''; - print ''.$vatsup.''; + print ''.$langs->trans("AmountHTVATRealPaid").''; + print ''.$vatsup.''; print ''."\n"; foreach (array_keys($x_paye) as $rate) @@ -571,7 +571,7 @@ if (! is_array($x_coll) || ! is_array($x_paye)) print ''; // Ref - print ''.$fields['link'].''; + print ''.$fields['link'].''; // Invoice date print '' . dol_print_date($fields['datef'], 'day') . ''; @@ -621,7 +621,7 @@ if (! is_array($x_coll) || ! is_array($x_paye)) // Total HT if ($modetax != 1) { - print ''; + print ''; print price($fields['totalht']); if (price2num($fields['ftotal_ttc'])) { @@ -636,7 +636,7 @@ if (! is_array($x_coll) || ! is_array($x_paye)) $ratiopaymentinvoice=1; if ($modetax != 1) { - print ''; + print ''; if ($fields['payment_amount'] && $fields['ftotal_ttc']) { $paymentfourn_static->id=$fields['payment_id']; @@ -662,13 +662,13 @@ if (! is_array($x_coll) || ! is_array($x_paye)) } // VAT paid - print ''; + print ''; $temp_ht=$fields['totalht']*$ratiopaymentinvoice; print price(price2num($temp_ht, 'MT'), 1); print ''; // VAT - print ''; + print ''; $temp_vat=$fields['vat']*$ratiopaymentinvoice; print price(price2num($temp_vat, 'MT'), 1); //print price($fields['vat']); @@ -683,26 +683,26 @@ if (! is_array($x_coll) || ! is_array($x_paye)) // Total suppliers for this vat rate print ''; print ''; - print ''.$langs->trans("Total").':'; + print ''.$langs->trans("Total").':'; if ($modetax != 1) { - print ' '; - print ' '; + print ' '; + print ' '; } - print ''.price(price2num($subtot_paye_total_ht, 'MT')).''; - print ''.price(price2num($subtot_paye_vat, 'MT')).''; + print ''.price(price2num($subtot_paye_total_ht, 'MT')).''; + print ''.price(price2num($subtot_paye_vat, 'MT')).''; print ''; } if (count($x_paye) == 0) { // Show a total line if nothing shown print ''; print ''; - print ''.$langs->trans("Total").':'; + print ''.$langs->trans("Total").':'; if ($modetax != 1) { - print ' '; - print ' '; + print ' '; + print ' '; } - print ''.price(price2num(0, 'MT')).''; - print ''.price(price2num(0, 'MT')).''; + print ''.price(price2num(0, 'MT')).''; + print ''.price(price2num(0, 'MT')).''; print ''; } @@ -714,7 +714,7 @@ if (! is_array($x_coll) || ! is_array($x_paye)) $diff = $x_coll_sum - $x_paye_sum; print ''; print ''.$langs->trans("TotalToPay").($q?', '.$langs->trans("Quadri").' '.$q:'').''; - print ''.price(price2num($diff, 'MT'))."\n"; + print ''.price(price2num($diff, 'MT'))."\n"; print "\n"; $i++; From 2507ff9684eb3ad6c7b31b0d78987c3933fb4d13 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 14 Feb 2019 16:45:49 +0100 Subject: [PATCH 010/135] update with html5 compliant code --- htdocs/compta/clients.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/compta/clients.php b/htdocs/compta/clients.php index 06e818db0a3..6e9d1acc174 100644 --- a/htdocs/compta/clients.php +++ b/htdocs/compta/clients.php @@ -148,26 +148,26 @@ if ($resql) print_liste_field_titre("Town", $_SERVER["PHP_SELF"], "s.town", "", "", 'valign="center"', $sortfield, $sortorder); print_liste_field_titre("CustomerCode", $_SERVER["PHP_SELF"], "s.code_client", "", "", 'align="left"', $sortfield, $sortorder); print_liste_field_titre("AccountancyCode", $_SERVER["PHP_SELF"], "s.code_compta", "", "", 'align="left"', $sortfield, $sortorder); - print_liste_field_titre("DateCreation", $_SERVER["PHP_SELF"], "datec", $addu, "", 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("DateCreation", $_SERVER["PHP_SELF"], "datec", $addu, "", 'class="right"', $sortfield, $sortorder); print "\n"; // Lignes des champs de filtre print ''; - print ''; + print ''; print ''; print ' '; - print ''; + print ''; print ''; print ''; - print ''; + print ''; print ''; print ''; - print ''; + print ''; print ''; print ''; print "\n"; @@ -186,7 +186,7 @@ if ($resql) print ''.$obj->town.' '; print ''.$obj->code_client.' '; print ''.$obj->code_compta.' '; - print ''.dol_print_date($db->jdate($obj->datec)).''; + print ''.dol_print_date($db->jdate($obj->datec)).''; print "\n"; $i++; } From 91fca7a1af6c2380c720d33848908d120b181ded Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 14 Feb 2019 16:48:10 +0100 Subject: [PATCH 011/135] update with html5 compliant code --- htdocs/compta/compta-files.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/compta/compta-files.php b/htdocs/compta/compta-files.php index 7bfd7565ab5..e91fa1ffac5 100644 --- a/htdocs/compta/compta-files.php +++ b/htdocs/compta/compta-files.php @@ -374,9 +374,9 @@ if (!empty($date_start) && !empty($date_stop)) print ''.$langs->trans("Ref").''; print ''.$langs->trans("Link").''; print ''.$langs->trans("Paid").''; - print ''.$langs->trans("Debit").''; - print ''.$langs->trans("Credit").''; - print ''.$langs->trans("Balance").''; + print ''.$langs->trans("Debit").''; + print ''.$langs->trans("Credit").''; + print ''.$langs->trans("Balance").''; print ''; if ($result) { @@ -421,21 +421,21 @@ if (!empty($date_start) && !empty($date_stop)) // File link print '".$data['name']."\n"; - print ''.$data['paid'].''; - print ''.(($data['amount'] > 0) ? price(abs($data['amount'])) : '')."\n"; + print ''.$data['paid'].''; + print ''.(($data['amount'] > 0) ? price(abs($data['amount'])) : '')."\n"; $totalDebit += ($data['amount'] > 0) ? abs($data['amount']) : 0; - print ''.(($data['amount'] > 0) ? '' : price(abs($data['amount'])))."\n"; + print ''.(($data['amount'] > 0) ? '' : price(abs($data['amount'])))."\n"; $totalCredit += ($data['amount'] > 0) ? 0 : abs($data['amount']); // Balance - print ''.price($data['balance'])."\n"; + print ''.price($data['balance'])."\n"; print "\n"; } print ''; print ' '; - print ''.price($totalDebit).''; - print ''.price($totalCredit).''; - print ''.price(price2num($totalDebit - $totalCredit, 'MT')).''; + print ''.price($totalDebit).''; + print ''.price($totalCredit).''; + print ''.price(price2num($totalDebit - $totalCredit, 'MT')).''; print "\n"; } } From 5b2c80b62d50981663ce98845d486ebdc2845111 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 14 Feb 2019 16:51:09 +0100 Subject: [PATCH 012/135] update with html5 compliant code --- htdocs/compta/index.php | 124 ++++++++++++++++++++-------------------- 1 file changed, 62 insertions(+), 62 deletions(-) diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index bac1b724504..c872fae3def 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -200,14 +200,14 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) print ''; print $companystatic->getNomUrl(1, 'customer', 16); print ''; - print ''.price($obj->total_ttc).''; + print ''.price($obj->total_ttc).''; print ''; $tot_ttc+=$obj->total_ttc; $i++; } print ''.$langs->trans("Total").''; - print ''.price($tot_ttc).''; + print ''.price($tot_ttc).''; print ''; } else @@ -287,14 +287,14 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture- print ''; print $companystatic->getNomUrl(1, 'supplier', 16); print ''; - print ''.price($obj->total_ttc).''; + print ''.price($obj->total_ttc).''; print ''; $tot_ttc+=$obj->total_ttc; $i++; } print ''.$langs->trans("Total").''; - print ''.price($tot_ttc).''; + print ''.price($tot_ttc).''; print ''; } else @@ -353,9 +353,9 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) print ''; print ''; - if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; - print ''; - print ''; + if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; + print ''; + print ''; print ''; print ''; if ($num) @@ -398,7 +398,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) print img_warning($langs->trans("Late")); } print ''; - print ''; - if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; - print ''; - print ''; + if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; + print ''; + print ''; print ''; print ''; @@ -474,9 +474,9 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture- print '
'.$langs->trans("BoxTitleLastCustomerBills", $max).''.$langs->trans("AmountHT").''.$langs->trans("AmountTTC").''.$langs->trans("DateModificationShort").''.$langs->trans("AmountHT").''.$langs->trans("AmountTTC").''.$langs->trans("DateModificationShort").' 
'; + print ''; $filename=dol_sanitizeFileName($obj->ref); $filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($obj->ref); $urlsource=$_SERVER['PHP_SELF'].'?facid='.$obj->rowid; @@ -409,9 +409,9 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) print ''; print $thirdpartystatic->getNomUrl(1, 'customer', 44); print ''.price($obj->total_ht).''.price($obj->total_ttc).''.dol_print_date($db->jdate($obj->tms), 'day').''.price($obj->total_ht).''.price($obj->total_ttc).''.dol_print_date($db->jdate($obj->tms), 'day').''.$facstatic->LibStatut($obj->paye, $obj->fk_statut, 3, $obj->am).'
'; print ''; - if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; - print ''; - print ''; + if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; + print ''; + print ''; print ''; print "\n"; if ($num) @@ -507,9 +507,9 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture- print ''; - if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; - print ''; - print ''; + if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; + print ''; + print ''; print ''; print ''; $total += $obj->total_ht; @@ -565,8 +565,8 @@ if (! empty($conf->don->enabled) && $user->rights->societe->lire) print ''; print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; print ''; if ($num) @@ -588,8 +588,8 @@ if (! empty($conf->don->enabled) && $user->rights->societe->lire) print ''; print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; print ''; @@ -638,8 +638,8 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) print ''; print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; print ''; if ($num) @@ -658,18 +658,18 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) print ''; print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; print ''; $tot_ttc+=$obj->amount; $i++; } - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; print ''; } else @@ -729,9 +729,9 @@ if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $us print '
'.$langs->trans("BoxTitleLastSupplierBills", $max).''.$langs->trans("AmountHT").''.$langs->trans("AmountTTC").''.$langs->trans("DateModificationShort").''.$langs->trans("AmountHT").''.$langs->trans("AmountTTC").''.$langs->trans("DateModificationShort").' 
'; print $thirdpartystatic->getNomUrl(1, 'supplier', 44); print ''.price($obj->total_ht).''.price($obj->total_ttc).''.dol_print_date($db->jdate($obj->tms), 'day').''.price($obj->total_ht).''.price($obj->total_ttc).''.dol_print_date($db->jdate($obj->tms), 'day').''.$facstatic->LibStatut($obj->paye, $obj->fk_statut, 3).'
'.$langs->trans("BoxTitleLastModifiedDonations", $max).''.$langs->trans("AmountTTC").''.$langs->trans("DateModificationShort").''.$langs->trans("AmountTTC").''.$langs->trans("DateModificationShort").' 
'.$donationstatic->getNomUrl(1).''.$label.''.price($objp->amount).''.dol_print_date($db->jdate($objp->dm), 'day').''.price($objp->amount).''.dol_print_date($db->jdate($objp->dm), 'day').''.$donationstatic->LibStatut($objp->fk_statut, 3).'
'.$langs->trans("ContributionsToPay").($num?' '.$num.'':'').''.$langs->trans("DateDue").''.$langs->trans("AmountTTC").''.$langs->trans("Paid").''.$langs->trans("AmountTTC").''.$langs->trans("Paid").' 
'.$chargestatic->getNomUrl(1).''.dol_print_date($db->jdate($obj->date_ech), 'day').''.price($obj->amount).''.price($obj->sumpaid).''.price($obj->amount).''.price($obj->sumpaid).''.$chargestatic->getLibStatut(3).'
'.$langs->trans("Total").''.price($tot_ttc).' 
'.$langs->trans("Total").''.price($tot_ttc).' 
'; print ""; print ''; - if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; - print ''; - print ''; + if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; + print ''; + print ''; print ''; print ''; @@ -765,7 +765,7 @@ if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $us print ''; - print ''; - if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; - print ''; - print ''; + if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; + print ''; + print ''; print ''; print ''; $tot_ht += $obj->total_ht; @@ -790,9 +790,9 @@ if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $us } print ''; - if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; - print ''; - print ''; + if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; + print ''; + print ''; print ''; print ''; print '
'.$langs->trans("OrdersDeliveredToBill").' '.$num.''.$langs->trans("AmountHT").''.$langs->trans("AmountTTC").''.$langs->trans("ToBill").''.$langs->trans("AmountHT").''.$langs->trans("AmountTTC").''.$langs->trans("ToBill").' 
'; print ' '; print ''; + print ''; $filename=dol_sanitizeFileName($obj->ref); $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; @@ -777,9 +777,9 @@ if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $us print ''; print $societestatic->getNomUrl(1, 'customer', 44); print ''.price($obj->total_ht).''.price($obj->total_ttc).''.price($obj->total_ttc-$obj->tot_fttc).''.price($obj->total_ht).''.price($obj->total_ttc).''.price($obj->total_ttc-$obj->tot_fttc).''.$commandestatic->LibStatut($obj->fk_statut, $obj->facture, 3).'
'.$langs->trans("Total").'   ('.$langs->trans("RemainderToBill").': '.price($tot_tobill).') '.price($tot_ht).''.price($tot_ttc).''.price($tot_tobill).''.price($tot_ht).''.price($tot_ttc).''.price($tot_tobill).' 

'; @@ -844,10 +844,10 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) print '
'; print ''; print ''; - print ''; - if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; - print ''; - print ''; + print ''; + if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; + print ''; + print ''; print ''; print ''; if ($num) @@ -890,7 +890,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) print img_warning($langs->trans("Late")); } print ''; - print ''; - print ''; - if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; - print ''; - print ''; + print ''; + if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; + print ''; + print ''; print ''; print ''; @@ -917,9 +917,9 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) print ''; print ''; - if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; - print ''; - print ''; + if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; + print ''; + print ''; print ''; print ''; } @@ -978,10 +978,10 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture- print '
'; print '
'.$langs->trans("BillsCustomersUnpaid", $num).' '.$num.''.$langs->trans("DateDue").''.$langs->trans("AmountHT").''.$langs->trans("AmountTTC").''.$langs->trans("Received").''.$langs->trans("DateDue").''.$langs->trans("AmountHT").''.$langs->trans("AmountTTC").''.$langs->trans("Received").' 
'; + print ''; $filename=dol_sanitizeFileName($obj->ref); $filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($obj->ref); $urlsource=$_SERVER['PHP_SELF'].'?facid='.$obj->rowid; @@ -901,10 +901,10 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) print '' ; print $societestatic->getNomUrl(1, 'customer', 44); print ''.dol_print_date($db->jdate($obj->datelimite), 'day').''.price($obj->total_ht).''.price($obj->total_ttc).''.price($obj->am).''.dol_print_date($db->jdate($obj->datelimite), 'day').''.price($obj->total_ht).''.price($obj->total_ttc).''.price($obj->am).''.$facstatic->LibStatut($obj->paye, $obj->fk_statut, 3, $obj->am).'
'.$langs->trans("Total").'   ('.$langs->trans("RemainderToTake").': '.price($total_ttc-$totalam).')  '.price($total).''.price($total_ttc).''.price($totalam).''.price($total).''.price($total_ttc).''.price($totalam).' 
'; print ''; - print ''; - if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; - print ''; - print ''; + print ''; + if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; + print ''; + print ''; print ''; print "\n"; $societestatic = new Societe($db); @@ -1013,10 +1013,10 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture- print $facstatic->getNomUrl(1, ''); print ''; print ''; - print ''; - if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; - print ''; - print ''; + print ''; + if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; + print ''; + print ''; print ''; print ''; $total += $obj->total_ht; @@ -1027,9 +1027,9 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture- print ''; print ''; - if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; - print ''; - print ''; + if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; + print ''; + print ''; print ''; print ''; } From a6cc8278c841b2c8396c38e261b5aae7259262f7 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 14 Feb 2019 16:54:53 +0100 Subject: [PATCH 013/135] update with html5 compliant code --- htdocs/compta/paiement_charge.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php index aa4cf649bf2..94bbc9b87b6 100644 --- a/htdocs/compta/paiement_charge.php +++ b/htdocs/compta/paiement_charge.php @@ -265,9 +265,9 @@ if ($action == 'create') print ''; //print ''; print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; print ''; print "\n"; @@ -282,18 +282,18 @@ if ($action == 'create') if ($objp->date_ech > 0) { - print "\n"; + print '."\n"; } else { print "\n"; } - print '"; + print '"; - print '"; + print '"; - print '"; + print '"; print ''; - print ''; - print ""; - print ""; - print ""; + print ''; + print ''; + print ''; + print ''; print ''; print "\n"; } From 43486828dbd9c01e1a0bc98ba09449a35e81362a Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 14 Feb 2019 16:56:49 +0100 Subject: [PATCH 014/135] update with html5 compliant code --- htdocs/compta/paiement.php | 50 +++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index 887c1d9993e..f0caba60230 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -583,16 +583,16 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ''; if (!empty($conf->multicurrency->enabled)) { print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; } - print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; print "\n"; $total=0; @@ -659,12 +659,12 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie // Multicurrency Price if (!empty($conf->multicurrency->enabled)) { - print ''; // Multicurrency Price - print ''; // Multicurrency Price - print ''; - print ''; + print ''; // Received or paid back - print ''; // Remain to take or to pay back - print ''; + print ''; //$test= price(price2num($objp->total_ttc - $paiement - $creditnotes - $deposits)); // Amount - print ''; - print ''; + print ''; if (!empty($conf->multicurrency->enabled)) { print ''; print ''; print ''; print ''; - print ''; + print ''; } - print ''; - print ''; + print ''; - print ''; - print ''; // Autofilled + print ''; + print ''; // Autofilled print ''; print "\n"; } @@ -873,7 +873,7 @@ if (! GETPOST('action', 'aZ09')) print_liste_field_titre('Invoice', $_SERVER["PHP_SELF"], 'ref', '', '', '', $sortfield, $sortorder); print_liste_field_titre('Date', $_SERVER["PHP_SELF"], 'dp', '', '', '', $sortfield, $sortorder); print_liste_field_titre('Type', $_SERVER["PHP_SELF"], 'libelle', '', '', '', $sortfield, $sortorder); - print_liste_field_titre('Amount', $_SERVER["PHP_SELF"], 'fa_amount', '', '', 'align="right"', $sortfield, $sortorder); + print_liste_field_titre('Amount', $_SERVER["PHP_SELF"], 'fa_amount', '', '', 'class="right"', $sortfield, $sortorder); print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch '); print "\n"; @@ -885,7 +885,7 @@ if (! GETPOST('action', 'aZ09')) print '\n"; print '\n"; print '\n"; - print ''; + print ''; $parameters=array(); $reshook=$hookmanager->executeHooks('printObjectLine', $parameters, $objp, $action); // Note that $action and $object may have been modified by hook From ec370e247a8213c79fa4504a007c30c261752073 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 14 Feb 2019 16:59:24 +0100 Subject: [PATCH 015/135] update with html5 compliant code --- htdocs/compta/recap-compta.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/compta/recap-compta.php b/htdocs/compta/recap-compta.php index c8ba8806c36..f7b2ec89008 100644 --- a/htdocs/compta/recap-compta.php +++ b/htdocs/compta/recap-compta.php @@ -109,10 +109,10 @@ if ($id > 0) if (! empty($arrayfields['f.datef']['checked'])) print_liste_field_titre($arrayfields['f.datef']['label'], $_SERVER["PHP_SELF"], "f.datef", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder); print ''; print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; print ''; $TData = array(); @@ -261,18 +261,18 @@ if ($id > 0) print ''; - print '\n"; + print '\n"; $totalDebit += ($data['amount'] > 0) ? abs($data['amount']) : 0; - print '\n"; + print '\n"; $totalCredit += ($data['amount'] > 0) ? 0 : abs($data['amount']); // Balance - print '\n"; + print '\n"; // Author - print ''; @@ -281,9 +281,9 @@ if ($id > 0) print ''; print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; print ''; print "\n"; } From bd031bd29419770dea8b78841a8c6ad69d4a99d8 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 14 Feb 2019 17:02:17 +0100 Subject: [PATCH 016/135] update with html5 compliant code --- htdocs/contact/consumption.php | 36 +++++++++++++++++----------------- htdocs/contact/list.php | 2 +- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/htdocs/contact/consumption.php b/htdocs/contact/consumption.php index ebbe7332236..d4f6f2cb9e5 100644 --- a/htdocs/contact/consumption.php +++ b/htdocs/contact/consumption.php @@ -372,7 +372,7 @@ if ($sql_select) // Filters print ''; - print ''; print ''; print ''; - print ''; print ''; print ''; - print ''; @@ -398,14 +398,14 @@ if ($sql_select) // Titles with sort buttons print ''; - print_liste_field_titre('Ref', $_SERVER['PHP_SELF'], 'doc_number', '', $param, 'align="left"', $sortfield, $sortorder); + print_liste_field_titre('Ref', $_SERVER['PHP_SELF'], 'doc_number', '', $param, 'class="left"', $sortfield, $sortorder); print_liste_field_titre('Date', $_SERVER['PHP_SELF'], 'dateprint', '', $param, 'align="center" width="150"', $sortfield, $sortorder); print_liste_field_titre('Status', $_SERVER['PHP_SELF'], 'fk_statut', '', $param, 'align="center"', $sortfield, $sortorder); - print_liste_field_titre('Product', $_SERVER['PHP_SELF'], '', '', $param, 'align="left"', $sortfield, $sortorder); - print_liste_field_titre('ContactType', $_SERVER['PHP_SELF'], '', '', $param, 'align="left"', $sortfield, $sortorder); - print_liste_field_titre('Quantity', $_SERVER['PHP_SELF'], 'prod_qty', '', $param, 'align="right"', $sortfield, $sortorder); - print_liste_field_titre('TotalHT', $_SERVER['PHP_SELF'], 'total_ht', '', $param, 'align="right"', $sortfield, $sortorder); - print_liste_field_titre('UnitPrice', $_SERVER['PHP_SELF'], '', '', $param, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre('Product', $_SERVER['PHP_SELF'], '', '', $param, 'class="left"', $sortfield, $sortorder); + print_liste_field_titre('ContactType', $_SERVER['PHP_SELF'], '', '', $param, 'class="left"', $sortfield, $sortorder); + print_liste_field_titre('Quantity', $_SERVER['PHP_SELF'], 'prod_qty', '', $param, 'class="right"', $sortfield, $sortorder); + print_liste_field_titre('TotalHT', $_SERVER['PHP_SELF'], 'total_ht', '', $param, 'class="right"', $sortfield, $sortorder); + print_liste_field_titre('UnitPrice', $_SERVER['PHP_SELF'], '', '', $param, 'class="right"', $sortfield, $sortorder); print "\n"; @@ -590,13 +590,13 @@ if ($sql_select) //print ''; print ''; - print ''; + print ''; $total_qty+=$objp->prod_qty; - print ''; + print ''; $total_ht+=$objp->total_ht; - print ''; + print ''; print "\n"; $i++; @@ -606,9 +606,9 @@ if ($sql_select) print ''; print ''; print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; print "
'.$langs->trans("BillsSuppliersUnpaid", $num).' '.$num.''.$langs->trans("DateDue").''.$langs->trans("AmountHT").''.$langs->trans("AmountTTC").''.$langs->trans("Paid").''.$langs->trans("DateDue").''.$langs->trans("AmountHT").''.$langs->trans("AmountTTC").''.$langs->trans("Paid").' 
'.$societestatic->getNomUrl(1, 'supplier', 44).''.dol_print_date($db->jdate($obj->date_lim_reglement), 'day').''.price($obj->total_ht).''.price($obj->total_ttc).''.price($obj->am).''.dol_print_date($db->jdate($obj->date_lim_reglement), 'day').''.price($obj->total_ht).''.price($obj->total_ttc).''.price($obj->am).''.$facstatic->LibStatut($obj->paye, $obj->fk_statut, 3).'
'.$langs->trans("Total").'   ('.$langs->trans("RemainderToPay").': '.price($total_ttc-$totalam).')  '.price($total).''.price($total_ttc).''.price($totalam).''.price($total).''.price($total_ttc).''.price($totalam).' 
'.$langs->trans("SocialContribution").''.$langs->trans("DateDue").''.$langs->trans("Amount").''.$langs->trans("AlreadyPaid").''.$langs->trans("RemainderToPay").''.$langs->trans("Amount").''.$langs->trans("AlreadyPaid").''.$langs->trans("RemainderToPay").''.$langs->trans("Amount").'
".dol_print_date($objp->date_ech, 'day')."'.dol_print_date($objp->date_ech, 'day').'!!!'.price($objp->amount)."'.price($objp->amount)."'.price($sumpaid)."'.price($sumpaid)."'.price($objp->amount - $sumpaid)."'.price($objp->amount - $sumpaid)."'; if ($sumpaid < $objp->amount) @@ -322,10 +322,10 @@ if ($action == 'create') { // Print total print '
'.$langs->trans("Total").':".price($total_ttc)."".price($totalrecu)."".price($total_ttc - $totalrecu)."'.$langs->trans("Total").':'.price($total_ttc).''.price($totalrecu).''.price($total_ttc - $totalrecu).' 
'.$langs->trans('DateMaxPayment').''.$langs->trans('Currency').''.$langs->trans('MulticurrencyAmountTTC').''.$multicurrencyalreadypayedlabel.''.$multicurrencyremaindertopay.''.$langs->trans('MulticurrencyPaymentAmount').''.$langs->trans('MulticurrencyAmountTTC').''.$multicurrencyalreadypayedlabel.''.$multicurrencyremaindertopay.''.$langs->trans('MulticurrencyPaymentAmount').''.$langs->trans('AmountTTC').''.$alreadypayedlabel.''.$remaindertopay.''.$langs->trans('PaymentAmount').' '.$langs->trans('AmountTTC').''.$alreadypayedlabel.''.$remaindertopay.''.$langs->trans('PaymentAmount').' 
'; + print ''; if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) print price($sign * $objp->multicurrency_total_ttc); print ''; + print ''; if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) { print price($sign * $multicurrency_payment); @@ -674,11 +674,11 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ''; + print ''; if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) print price($sign * $multicurrency_remaintopay); print ''; + print ''; // Add remind multicurrency amount $namef = 'multicurrency_amount_'.$objp->facid; @@ -703,20 +703,20 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie } // Price - print 'id==$facid)?' style="font-weight: bold" ':'').'>'.price($sign * $objp->total_ttc).'id==$facid)?' style="font-weight: bold" ':'').'>'.price($sign * $objp->total_ttc).''.price($sign * $paiement); + print ''.price($sign * $paiement); if ($creditnotes) print '+'.price($creditnotes); if ($deposits) print '+'.price($deposits); print ''.price($sign * $remaintopay).''.price($sign * $remaintopay).''; + print ''; // Add remind amount $namef = 'amount_'.$objp->facid; @@ -763,21 +763,21 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie { // Print total print '
'.$langs->trans('TotalTTC').''.$langs->trans('TotalTTC').''.price($sign * $total_ttc).''.price($sign * $totalrecu); + print ''.price($sign * $total_ttc).''.price($sign * $totalrecu); if ($totalrecucreditnote) print '+'.price($totalrecucreditnote); if ($totalrecudeposits) print '+'.price($totalrecudeposits); print ''.price($sign * price2num($total_ttc - $totalrecu - $totalrecucreditnote - $totalrecudeposits, 'MT')).''.price($sign * price2num($total_ttc - $totalrecu - $totalrecucreditnote - $totalrecudeposits, 'MT')).' 
'.$objp->ref."'.dol_print_date($db->jdate($objp->dp))."'.$objp->paiement_type.' '.$objp->num_paiement."'.price($objp->amount).' '.price($objp->amount).' '.$langs->trans("Element").''.$langs->trans("Status").''.$langs->trans("Debit").''.$langs->trans("Credit").''.$langs->trans("Balance").''.$langs->trans("Author").''.$langs->trans("Debit").''.$langs->trans("Credit").''.$langs->trans("Balance").''.$langs->trans("Author").'
'.$data['status'].''.(($data['amount'] > 0) ? price(abs($data['amount'])) : '')."'.(($data['amount'] > 0) ? price(abs($data['amount'])) : '')."'.(($data['amount'] > 0) ? '' : price(abs($data['amount'])))."'.(($data['amount'] > 0) ? '' : price(abs($data['amount'])))."'.price($data['balance'])."'.price($data['balance'])."'; + print ''; print $data['author']; print '
 '.price($totalDebit).''.price($totalCredit).''.price(price2num($totalDebit - $totalCredit, 'MT')).''.price($totalDebit).''.price($totalCredit).''.price(price2num($totalDebit - $totalCredit, 'MT')).'
'; + print ''; print ''; print ''; // date @@ -381,7 +381,7 @@ if ($sql_select) print ''; print ''; + print ''; print ''; print ''; // TODO: Add filters ! @@ -390,7 +390,7 @@ if ($sql_select) print ''; print ''; + print ''; $searchpicto=$form->showFilterAndCheckAddButtons(0); print $searchpicto; print '
'.$prodreftxt.''.$objp->libelle.''.$objp->prod_qty.''.$objp->prod_qty.''.price($objp->total_ht).''.price($objp->total_ht).''.price($objp->total_ht/(empty($objp->prod_qty)?1:$objp->prod_qty)).''.price($objp->total_ht/(empty($objp->prod_qty)?1:$objp->prod_qty)).'
' . $langs->trans('Total') . '' . $total_qty . '' . price($total_ht) . '' . price($total_ht/(empty($total_qty)?1:$total_qty)) . '' . $total_qty . '' . price($total_ht) . '' . price($total_ht/(empty($total_qty)?1:$total_qty)) . '
"; print '
'; @@ -624,11 +624,11 @@ elseif (empty($type_element) || $type_element == -1) print ''."\n"; // Titles with sort buttons print ''; - print_liste_field_titre('Ref', $_SERVER['PHP_SELF'], 'doc_number', '', $param, 'align="left"', $sortfield, $sortorder); + print_liste_field_titre('Ref', $_SERVER['PHP_SELF'], 'doc_number', '', $param, 'class="left"', $sortfield, $sortorder); print_liste_field_titre('Date', $_SERVER['PHP_SELF'], 'dateprint', '', $param, 'align="center" width="150"', $sortfield, $sortorder); print_liste_field_titre('Status', $_SERVER['PHP_SELF'], 'fk_status', '', $param, 'align="center"', $sortfield, $sortorder); - print_liste_field_titre('Product', $_SERVER['PHP_SELF'], '', '', $param, 'align="left"', $sortfield, $sortorder); - print_liste_field_titre('Quantity', $_SERVER['PHP_SELF'], 'prod_qty', '', $param, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre('Product', $_SERVER['PHP_SELF'], '', '', $param, 'class="left"', $sortfield, $sortorder); + print_liste_field_titre('Quantity', $_SERVER['PHP_SELF'], 'prod_qty', '', $param, 'class="right"', $sortfield, $sortorder); print "\n"; print ''; diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 244dffcc0e1..cd25107d744 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -670,7 +670,7 @@ if (! empty($arrayfields['p.import_key']['checked'])) print ''; } // Action column -print ''; From a9407f3b4eaedbfa53371816e4c9f0afcbc89ee2 Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Fri, 15 Feb 2019 09:35:38 +0100 Subject: [PATCH 017/135] Update consumption.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit following the remark of Frédéric France --- htdocs/contact/consumption.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/contact/consumption.php b/htdocs/contact/consumption.php index d4f6f2cb9e5..8cf3d52b6be 100644 --- a/htdocs/contact/consumption.php +++ b/htdocs/contact/consumption.php @@ -398,14 +398,14 @@ if ($sql_select) // Titles with sort buttons print ''; - print_liste_field_titre('Ref', $_SERVER['PHP_SELF'], 'doc_number', '', $param, 'class="left"', $sortfield, $sortorder); + print_liste_field_titre('Ref', $_SERVER['PHP_SELF'], 'doc_number', '', $param, $sortfield, $sortorder, 'left '); print_liste_field_titre('Date', $_SERVER['PHP_SELF'], 'dateprint', '', $param, 'align="center" width="150"', $sortfield, $sortorder); print_liste_field_titre('Status', $_SERVER['PHP_SELF'], 'fk_statut', '', $param, 'align="center"', $sortfield, $sortorder); - print_liste_field_titre('Product', $_SERVER['PHP_SELF'], '', '', $param, 'class="left"', $sortfield, $sortorder); - print_liste_field_titre('ContactType', $_SERVER['PHP_SELF'], '', '', $param, 'class="left"', $sortfield, $sortorder); - print_liste_field_titre('Quantity', $_SERVER['PHP_SELF'], 'prod_qty', '', $param, 'class="right"', $sortfield, $sortorder); - print_liste_field_titre('TotalHT', $_SERVER['PHP_SELF'], 'total_ht', '', $param, 'class="right"', $sortfield, $sortorder); - print_liste_field_titre('UnitPrice', $_SERVER['PHP_SELF'], '', '', $param, 'class="right"', $sortfield, $sortorder); + print_liste_field_titre('Product', $_SERVER['PHP_SELF'], '', '', $param, $sortfield, $sortorder, 'left '); + print_liste_field_titre('ContactType', $_SERVER['PHP_SELF'], '', '', $param, $sortfield, $sortorder, 'left '); + print_liste_field_titre('Quantity', $_SERVER['PHP_SELF'], 'prod_qty', '', $param, $sortfield, $sortorder, 'right '); + print_liste_field_titre('TotalHT', $_SERVER['PHP_SELF'], 'total_ht', '', $param, $sortfield, $sortorder, 'right '); + print_liste_field_titre('UnitPrice', $_SERVER['PHP_SELF'], '', '', $param, $sortfield, $sortorder, 'right '); print "\n"; From a8fdcff9348e56d2f2f9bcbb6636ca9fa4c95904 Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Fri, 15 Feb 2019 09:38:57 +0100 Subject: [PATCH 018/135] Update paiement.php --- htdocs/compta/paiement.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index f0caba60230..8ec7dda2dc5 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -873,7 +873,7 @@ if (! GETPOST('action', 'aZ09')) print_liste_field_titre('Invoice', $_SERVER["PHP_SELF"], 'ref', '', '', '', $sortfield, $sortorder); print_liste_field_titre('Date', $_SERVER["PHP_SELF"], 'dp', '', '', '', $sortfield, $sortorder); print_liste_field_titre('Type', $_SERVER["PHP_SELF"], 'libelle', '', '', '', $sortfield, $sortorder); - print_liste_field_titre('Amount', $_SERVER["PHP_SELF"], 'fa_amount', '', '', 'class="right"', $sortfield, $sortorder); + print_liste_field_titre('Amount', $_SERVER["PHP_SELF"], 'fa_amount', '', '', $sortfield, $sortorder, 'right '); print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch '); print "\n"; From 88d84332e918f401832475d153c413184418c2d5 Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Fri, 15 Feb 2019 09:42:39 +0100 Subject: [PATCH 019/135] Update clients.php --- htdocs/compta/clients.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/clients.php b/htdocs/compta/clients.php index 6e9d1acc174..05b315b2e76 100644 --- a/htdocs/compta/clients.php +++ b/htdocs/compta/clients.php @@ -148,7 +148,7 @@ if ($resql) print_liste_field_titre("Town", $_SERVER["PHP_SELF"], "s.town", "", "", 'valign="center"', $sortfield, $sortorder); print_liste_field_titre("CustomerCode", $_SERVER["PHP_SELF"], "s.code_client", "", "", 'align="left"', $sortfield, $sortorder); print_liste_field_titre("AccountancyCode", $_SERVER["PHP_SELF"], "s.code_compta", "", "", 'align="left"', $sortfield, $sortorder); - print_liste_field_titre("DateCreation", $_SERVER["PHP_SELF"], "datec", $addu, "", 'class="right"', $sortfield, $sortorder); + print_liste_field_titre("DateCreation", $_SERVER["PHP_SELF"], "datec", $addu, "", $sortfield, $sortorder, 'right '); print "\n"; // Lignes des champs de filtre From 348b6c9f697b9abe3d175b03f1b433ed063a7397 Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Fri, 15 Feb 2019 09:45:08 +0100 Subject: [PATCH 020/135] Update list.php --- htdocs/compta/tva/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/tva/list.php b/htdocs/compta/tva/list.php index dcac389b988..87aff422b05 100644 --- a/htdocs/compta/tva/list.php +++ b/htdocs/compta/tva/list.php @@ -200,9 +200,9 @@ if ($result) print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "t.label", "", $param, 'align="left"', $sortfield, $sortorder); print_liste_field_titre("PeriodEndDate", $_SERVER["PHP_SELF"], "t.datev", "", $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "t.datep", "", $param, 'align="center"', $sortfield, $sortorder); - print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "type", "", $param, 'align="left"', $sortfield, $sortorder); + print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "type", "", $param, $sortfield, $sortorder, 'left '); if (! empty($conf->banque->enabled)) print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder); - print_liste_field_titre("PayedByThisPayment", $_SERVER["PHP_SELF"], "t.amount", "", $param, 'class="right"', $sortfield, $sortorder); + print_liste_field_titre("PayedByThisPayment", $_SERVER["PHP_SELF"], "t.amount", "", $param, $sortfield, $sortorder, 'right '); print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch '); print "\n"; From 18dbad0d4222a5a5c5f8d45f10d1f72a0d37871c Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Fri, 15 Feb 2019 10:38:03 +0100 Subject: [PATCH 021/135] Update list.php We gone make it :) --- htdocs/compta/tva/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/tva/list.php b/htdocs/compta/tva/list.php index 87aff422b05..6d5f5ffbc13 100644 --- a/htdocs/compta/tva/list.php +++ b/htdocs/compta/tva/list.php @@ -200,9 +200,9 @@ if ($result) print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "t.label", "", $param, 'align="left"', $sortfield, $sortorder); print_liste_field_titre("PeriodEndDate", $_SERVER["PHP_SELF"], "t.datev", "", $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "t.datep", "", $param, 'align="center"', $sortfield, $sortorder); - print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "type", "", $param, $sortfield, $sortorder, 'left '); + print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "type", "", $param, '', $sortfield, $sortorder, 'left '); if (! empty($conf->banque->enabled)) print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder); - print_liste_field_titre("PayedByThisPayment", $_SERVER["PHP_SELF"], "t.amount", "", $param, $sortfield, $sortorder, 'right '); + print_liste_field_titre("PayedByThisPayment", $_SERVER["PHP_SELF"], "t.amount", "", $param, '', $sortfield, $sortorder, 'right '); print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch '); print "\n"; From 55dc5677b26a1cb9b4e9912adda0325fbe1cbce8 Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Fri, 15 Feb 2019 10:40:30 +0100 Subject: [PATCH 022/135] Update clients.php --- htdocs/compta/clients.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/clients.php b/htdocs/compta/clients.php index 05b315b2e76..36cc40c851c 100644 --- a/htdocs/compta/clients.php +++ b/htdocs/compta/clients.php @@ -146,9 +146,9 @@ if ($resql) print_liste_field_titre("Company", $_SERVER["PHP_SELF"], "s.nom", "", "", 'valign="center"', $sortfield, $sortorder); print_liste_field_titre("Town", $_SERVER["PHP_SELF"], "s.town", "", "", 'valign="center"', $sortfield, $sortorder); - print_liste_field_titre("CustomerCode", $_SERVER["PHP_SELF"], "s.code_client", "", "", 'align="left"', $sortfield, $sortorder); - print_liste_field_titre("AccountancyCode", $_SERVER["PHP_SELF"], "s.code_compta", "", "", 'align="left"', $sortfield, $sortorder); - print_liste_field_titre("DateCreation", $_SERVER["PHP_SELF"], "datec", $addu, "", $sortfield, $sortorder, 'right '); + print_liste_field_titre("CustomerCode", $_SERVER["PHP_SELF"], "s.code_client", "", "", '', $sortfield, $sortorder, 'left '); + print_liste_field_titre("AccountancyCode", $_SERVER["PHP_SELF"], "s.code_compta", "", "", '', $sortfield, $sortorder, 'left '); + print_liste_field_titre("DateCreation", $_SERVER["PHP_SELF"], "datec", $addu, "", '', $sortfield, $sortorder, 'right '); print "\n"; // Lignes des champs de filtre From 7cb4455729101a21d8a58c9e3191c42a11146c2b Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Fri, 15 Feb 2019 10:42:06 +0100 Subject: [PATCH 023/135] Update paiement.php --- htdocs/compta/paiement.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index 8ec7dda2dc5..5fd3e7ddd63 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -873,7 +873,7 @@ if (! GETPOST('action', 'aZ09')) print_liste_field_titre('Invoice', $_SERVER["PHP_SELF"], 'ref', '', '', '', $sortfield, $sortorder); print_liste_field_titre('Date', $_SERVER["PHP_SELF"], 'dp', '', '', '', $sortfield, $sortorder); print_liste_field_titre('Type', $_SERVER["PHP_SELF"], 'libelle', '', '', '', $sortfield, $sortorder); - print_liste_field_titre('Amount', $_SERVER["PHP_SELF"], 'fa_amount', '', '', $sortfield, $sortorder, 'right '); + print_liste_field_titre('Amount', $_SERVER["PHP_SELF"], 'fa_amount', '', '', '', $sortfield, $sortorder, 'right '); print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch '); print "\n"; From b301ed0040c7649d7e0eae08a4c45e306517605c Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Fri, 15 Feb 2019 10:44:04 +0100 Subject: [PATCH 024/135] Update consumption.php --- htdocs/contact/consumption.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/contact/consumption.php b/htdocs/contact/consumption.php index 8cf3d52b6be..df5c3238933 100644 --- a/htdocs/contact/consumption.php +++ b/htdocs/contact/consumption.php @@ -398,14 +398,14 @@ if ($sql_select) // Titles with sort buttons print ''; - print_liste_field_titre('Ref', $_SERVER['PHP_SELF'], 'doc_number', '', $param, $sortfield, $sortorder, 'left '); + print_liste_field_titre('Ref', $_SERVER['PHP_SELF'], 'doc_number', '', $param, '', $sortfield, $sortorder, 'left '); print_liste_field_titre('Date', $_SERVER['PHP_SELF'], 'dateprint', '', $param, 'align="center" width="150"', $sortfield, $sortorder); print_liste_field_titre('Status', $_SERVER['PHP_SELF'], 'fk_statut', '', $param, 'align="center"', $sortfield, $sortorder); - print_liste_field_titre('Product', $_SERVER['PHP_SELF'], '', '', $param, $sortfield, $sortorder, 'left '); - print_liste_field_titre('ContactType', $_SERVER['PHP_SELF'], '', '', $param, $sortfield, $sortorder, 'left '); - print_liste_field_titre('Quantity', $_SERVER['PHP_SELF'], 'prod_qty', '', $param, $sortfield, $sortorder, 'right '); - print_liste_field_titre('TotalHT', $_SERVER['PHP_SELF'], 'total_ht', '', $param, $sortfield, $sortorder, 'right '); - print_liste_field_titre('UnitPrice', $_SERVER['PHP_SELF'], '', '', $param, $sortfield, $sortorder, 'right '); + print_liste_field_titre('Product', $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'left '); + print_liste_field_titre('ContactType', $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'left '); + print_liste_field_titre('Quantity', $_SERVER['PHP_SELF'], 'prod_qty', '', $param, '', $sortfield, $sortorder, 'right '); + print_liste_field_titre('TotalHT', $_SERVER['PHP_SELF'], 'total_ht', '', $param, '', $sortfield, $sortorder, 'right '); + print_liste_field_titre('UnitPrice', $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'right '); print "\n"; From f2b057f376ecb072f8ae9da09322b15d70de4208 Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Fri, 15 Feb 2019 10:46:37 +0100 Subject: [PATCH 025/135] Update consumption.php --- htdocs/contact/consumption.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/contact/consumption.php b/htdocs/contact/consumption.php index df5c3238933..de8beeb1af5 100644 --- a/htdocs/contact/consumption.php +++ b/htdocs/contact/consumption.php @@ -624,11 +624,11 @@ elseif (empty($type_element) || $type_element == -1) print '
'.$langs->trans("SelectElementAndClick", $langs->transnoentitiesnoconv("Search")).'
'; +print ''; $searchpicto=$form->showFilterButtons(); print $searchpicto; print '
'."\n"; // Titles with sort buttons print ''; - print_liste_field_titre('Ref', $_SERVER['PHP_SELF'], 'doc_number', '', $param, 'class="left"', $sortfield, $sortorder); + print_liste_field_titre('Ref', $_SERVER['PHP_SELF'], 'doc_number', '', $param, '', $sortfield, $sortorder, 'left '); print_liste_field_titre('Date', $_SERVER['PHP_SELF'], 'dateprint', '', $param, 'align="center" width="150"', $sortfield, $sortorder); print_liste_field_titre('Status', $_SERVER['PHP_SELF'], 'fk_status', '', $param, 'align="center"', $sortfield, $sortorder); - print_liste_field_titre('Product', $_SERVER['PHP_SELF'], '', '', $param, 'class="left"', $sortfield, $sortorder); - print_liste_field_titre('Quantity', $_SERVER['PHP_SELF'], 'prod_qty', '', $param, 'class="right"', $sortfield, $sortorder); + print_liste_field_titre('Product', $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'left '); + print_liste_field_titre('Quantity', $_SERVER['PHP_SELF'], 'prod_qty', '', $param, '', $sortfield, $sortorder, 'right '); print "\n"; print ''; From 70f1a9d13d63d7e6392fd1392d5a718a6557c6d5 Mon Sep 17 00:00:00 2001 From: gauthier Date: Fri, 15 Feb 2019 11:26:29 +0100 Subject: [PATCH 026/135] FIX : we want to be able to reopen fourn credit note --- htdocs/fourn/facture/card.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index bbec3ea6ed6..c6f6d560f34 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -3014,8 +3014,13 @@ else print ''; } + $discount = new DiscountAbsolute($db); + $result = $discount->fetch(0, 0, $object->id); + // Reopen a standard paid invoice - if (($object->type == FactureFournisseur::TYPE_STANDARD || $object->type == FactureFournisseur::TYPE_REPLACEMENT) && ($object->statut == 2 || $object->statut == 3)) // A paid invoice (partially or completely) + if (($object->type == FactureFournisseur::TYPE_STANDARD || $object->type == FactureFournisseur::TYPE_REPLACEMENT + || ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE && empty($discount->id))) + && ($object->statut == 2 || $object->statut == 3)) // A paid invoice (partially or completely) { if (! $facidnext && $object->close_code != 'replaced' && $user->rights->fournisseur->facture->creer) // Not replaced by another invoice { From 40345ea0f5594890fa01f0d55661c3b9fb9014db Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Fri, 15 Feb 2019 17:38:35 +0100 Subject: [PATCH 027/135] Update paiement_charge.php fixed... --- htdocs/compta/paiement_charge.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php index 94bbc9b87b6..e3c5ee54fe4 100644 --- a/htdocs/compta/paiement_charge.php +++ b/htdocs/compta/paiement_charge.php @@ -282,7 +282,7 @@ if ($action == 'create') if ($objp->date_ech > 0) { - print '."\n"; + print ''."\n"; } else { From bc395b247aa46c5b42410b3aab95ca1bf416c73e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 16 Feb 2019 08:00:16 +0100 Subject: [PATCH 028/135] fix html5 in variant --- htdocs/variants/admin/admin.php | 14 +++++++------- htdocs/variants/card.php | 4 ++-- .../class/ProductCombination2ValuePair.class.php | 12 ++++++------ htdocs/variants/combinations.php | 12 ++++++------ htdocs/variants/create.php | 2 +- htdocs/variants/list.php | 12 ++++++------ 6 files changed, 28 insertions(+), 28 deletions(-) diff --git a/htdocs/variants/admin/admin.php b/htdocs/variants/admin/admin.php index fe28e73fcaa..9a9d67f5ffc 100644 --- a/htdocs/variants/admin/admin.php +++ b/htdocs/variants/admin/admin.php @@ -52,22 +52,22 @@ print load_fiche_titre($title, $linkback, 'title_setup'); dol_fiche_head(array(), 'general', $tab, 0, 'product'); print '
'; -print '
'.$langs->trans("SelectElementAndClick", $langs->transnoentitiesnoconv("Search")).'
'.dol_print_date($objp->date_ech, 'day').''.dol_print_date($objp->date_ech, 'day').'
'; +print '
'; print ''; -print ''."\n"; -print ''."\n"; -print ''."\n"; +print ''."\n"; print ''; print ''; -if(isset($conf->global->PRODUIT_ATTRIBUTES_SEPARATOR)) { +if (isset($conf->global->PRODUIT_ATTRIBUTES_SEPARATOR)) { $separator = $conf->global->PRODUIT_ATTRIBUTES_SEPARATOR; } else { $separator = "_"; } -print ''; +print ''; print '
'.$langs->trans("Parameters").''.$langs->trans("Value").' 
'.$langs->trans("Parameters").''."\n"; +print ''.$langs->trans("Value").''."\n"; +print ' 
'.$langs->trans('HideProductCombinations').''; print $form->selectyesno("PRODUIT_ATTRIBUTES_HIDECHILD", $conf->global->PRODUIT_ATTRIBUTES_HIDECHILD, 1).'
'.$langs->trans('CombinationsSeparator').'
'; -print '
'; +print '
'; print ''; // End of page diff --git a/htdocs/variants/card.php b/htdocs/variants/card.php index fa45b1ad0ef..e7444ed5fb8 100644 --- a/htdocs/variants/card.php +++ b/htdocs/variants/card.php @@ -266,7 +266,7 @@ print $form->formconfirm( id)): ?> - +     @@ -274,7 +274,7 @@ print $form->formconfirm( ref) ?> value) ?> - + diff --git a/htdocs/variants/class/ProductCombination2ValuePair.class.php b/htdocs/variants/class/ProductCombination2ValuePair.class.php index e07ba6077e7..80246cbe1dd 100644 --- a/htdocs/variants/class/ProductCombination2ValuePair.class.php +++ b/htdocs/variants/class/ProductCombination2ValuePair.class.php @@ -111,12 +111,12 @@ class ProductCombination2ValuePair public function fetchByFkCombination($fk_combination) { $sql = "SELECT - c.rowid, - c2v.fk_prod_attr_val, - c2v.fk_prod_attr, - c2v.fk_prod_combination -FROM ".MAIN_DB_PREFIX."product_attribute c LEFT JOIN ".MAIN_DB_PREFIX."product_attribute_combination2val c2v ON c.rowid = c2v.fk_prod_attr -WHERE c2v.fk_prod_combination = ".(int) $fk_combination; + c.rowid, + c2v.fk_prod_attr_val, + c2v.fk_prod_attr, + c2v.fk_prod_combination + FROM ".MAIN_DB_PREFIX."product_attribute c LEFT JOIN ".MAIN_DB_PREFIX."product_attribute_combination2val c2v ON c.rowid = c2v.fk_prod_attr + WHERE c2v.fk_prod_combination = ".(int) $fk_combination; $sql .= $this->db->order('c.rang', 'asc'); diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php index 8c5b80b4cc9..5d8f0fe11ce 100644 --- a/htdocs/variants/combinations.php +++ b/htdocs/variants/combinations.php @@ -502,9 +502,9 @@ if (! empty($id) || ! empty($ref)) print ''; print ''."\n"; print ''."\n"; - if($valueid > 0) { - print ''."\n"; - } + if($valueid > 0) { + print ''."\n"; + } print dol_fiche_head(); @@ -641,7 +641,7 @@ if (! empty($id) || ! empty($ref)) } } elseif ($action === 'copy') { -print $form->formconfirm( + print $form->formconfirm( 'combinations.php?id='.$id, $langs->trans('CloneCombinationsProduct'), $langs->trans('ConfirmCloneProductCombinations'), @@ -795,8 +795,8 @@ print $form->formconfirm( variation_price >= 0 ? '+' : '').price($currcomb->variation_price).($currcomb->variation_price_percentage ? ' %' : '') ?> isProduct()) print ''.($currcomb->variation_weight >= 0 ? '+' : '').price($currcomb->variation_weight).' '.measuring_units_string($prodstatic->weight_units, 'weight').''; ?> - getLibStatut(2, 0) ?> - getLibStatut(2, 1) ?> + getLibStatut(2, 0) ?> + getLibStatut(2, 1) ?> diff --git a/htdocs/variants/create.php b/htdocs/variants/create.php index 4f2d53bb75f..59edd15d8c6 100644 --- a/htdocs/variants/create.php +++ b/htdocs/variants/create.php @@ -77,7 +77,7 @@ print ''; ?> - +
diff --git a/htdocs/variants/list.php b/htdocs/variants/list.php index f230923be7f..481640d0daa 100644 --- a/htdocs/variants/list.php +++ b/htdocs/variants/list.php @@ -116,17 +116,17 @@ $forcereloadpage=empty($conf->global->MAIN_FORCE_RELOAD_PAGE)?0:1; - - + + $attribute): ?> - - - + + @@ -151,4 +151,4 @@ $forcereloadpage=empty($conf->global->MAIN_FORCE_RELOAD_PAGE)?0:1; // End of page llxFooter(); -$db->close(); \ No newline at end of file +$db->close(); From 0255336549b4545f8569f9cc00a8561eb23cc277 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 16 Feb 2019 10:29:15 +0100 Subject: [PATCH 029/135] fix html5 user --- htdocs/core/tpl/admin_extrafields_add.tpl.php | 2 +- .../core/tpl/admin_extrafields_edit.tpl.php | 2 +- .../core/tpl/admin_extrafields_view.tpl.php | 28 +++--- htdocs/core/tpl/advtarget.tpl.php | 46 +++++++--- htdocs/user/agenda_extsites.php | 5 +- htdocs/user/bank.php | 88 +++++++++---------- htdocs/user/card.php | 22 ++--- htdocs/user/clicktodial.php | 6 +- htdocs/user/document.php | 2 +- htdocs/user/group/card.php | 28 +++--- htdocs/user/group/ldap.php | 9 +- htdocs/user/group/list.php | 25 +++--- htdocs/user/group/perms.php | 18 ++-- htdocs/user/hierarchy.php | 11 ++- htdocs/user/home.php | 14 +-- htdocs/user/ldap.php | 4 +- htdocs/user/list.php | 58 ++++++------ htdocs/user/notify/card.php | 8 +- htdocs/user/param_ihm.php | 4 +- htdocs/user/passwordforgotten.php | 6 +- htdocs/user/perms.php | 22 ++--- 21 files changed, 214 insertions(+), 194 deletions(-) diff --git a/htdocs/core/tpl/admin_extrafields_add.tpl.php b/htdocs/core/tpl/admin_extrafields_add.tpl.php index f6f3bcd82b6..45c620db456 100644 --- a/htdocs/core/tpl/admin_extrafields_add.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_add.tpl.php @@ -203,7 +203,7 @@ $langs->load("modulebuilder"); -
">      +
">      ">
diff --git a/htdocs/core/tpl/admin_extrafields_edit.tpl.php b/htdocs/core/tpl/admin_extrafields_edit.tpl.php index 6191a4f92b7..1ba83bc393f 100644 --- a/htdocs/core/tpl/admin_extrafields_edit.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_edit.tpl.php @@ -266,7 +266,7 @@ else -
">      +
">      ">
diff --git a/htdocs/core/tpl/admin_extrafields_view.tpl.php b/htdocs/core/tpl/admin_extrafields_view.tpl.php index 7e05580f77d..ac7ee20139a 100644 --- a/htdocs/core/tpl/admin_extrafields_view.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_view.tpl.php @@ -58,15 +58,15 @@ print '
'; print ''; print ''; print ''; -print ''; +print ''; print ''; -print ''; -print ''; -print ''; -print ''; -print ''; +print ''; +print ''; +print ''; +print ''; +print ''; if ($conf->multicompany->enabled) { - print ''; + print ''; } print ''; print "\n"; @@ -86,15 +86,15 @@ if (is_array($extrafields->attributes[$elementtype]['type']) && count($extrafiel print "\n"; print "\n"; print "\n"; - print '\n"; + print '\n"; print '\n"; - print '\n"; - print '\n"; - print '\n"; - print '\n"; - print '\n"; + print '\n"; + print '\n"; + print '\n"; + print '\n"; + print '\n"; if (! empty($conf->multicompany->enabled)) { - print ''; + print ''; } print '\n"; diff --git a/htdocs/core/tpl/advtarget.tpl.php b/htdocs/core/tpl/advtarget.tpl.php index ea5b6e06e4d..dadfff3e62e 100644 --- a/htdocs/core/tpl/advtarget.tpl.php +++ b/htdocs/core/tpl/advtarget.tpl.php @@ -53,10 +53,10 @@ print ''; - echo $dialog; - if ($parameters['currentcontext'] == 'thirdpartycard' && in_array($object->forme_juridique_code, array(11, 12, 13, 15, 17, 18, 19, 35, 60, 200, 311, 312, 316, 401, 600, 700, 1005)) || $object->typent_id == 8) { - echo ''; - } elseif ($parameters['currentcontext'] == 'membercard') { - echo ''; - } elseif ($parameters['currentcontext'] == 'contactcard') { - echo ''; - } - if (!empty($object->mail) && empty($object->array_options['options_datapolicy_send']) && $parameters['currentcontext'] == 'thirdpartycard' && in_array($object->forme_juridique_code, array(11, 12, 13, 15, 17, 18, 19, 35, 60, 200, 311, 312, 316, 401, 600, 700, 1005)) || $object->typent_id == 8) { - echo ''; - } elseif (!empty($object->mail) && empty($object->array_options['options_datapolicy_send']) && $parameters['currentcontext'] == 'membercard') { - echo ''; - } elseif (!empty($object->mail) && empty($object->array_options['options_datapolicy_send']) && $parameters['currentcontext'] == 'contactcard') { - echo ''; - } + return false; + }); + } ); + '; + echo $dialog; + if ($parameters['currentcontext'] == 'thirdpartycard' && in_array($object->forme_juridique_code, array(11, 12, 13, 15, 17, 18, 19, 35, 60, 200, 311, 312, 316, 401, 600, 700, 1005)) || $object->typent_id == 8) { + echo ''; + } elseif ($parameters['currentcontext'] == 'membercard') { + echo ''; + } elseif ($parameters['currentcontext'] == 'contactcard') { + echo ''; + } + if (!empty($object->mail) && empty($object->array_options['options_datapolicy_send']) && $parameters['currentcontext'] == 'thirdpartycard' && in_array($object->forme_juridique_code, array(11, 12, 13, 15, 17, 18, 19, 35, 60, 200, 311, 312, 316, 401, 600, 700, 1005)) || $object->typent_id == 8) { + echo ''; + } elseif (!empty($object->mail) && empty($object->array_options['options_datapolicy_send']) && $parameters['currentcontext'] == 'membercard') { + echo ''; + } elseif (!empty($object->mail) && empty($object->array_options['options_datapolicy_send']) && $parameters['currentcontext'] == 'contactcard') { + echo ''; + } } } diff --git a/htdocs/datapolicy/class/datapolicy.class.php b/htdocs/datapolicy/class/datapolicy.class.php index 4b89b79e273..b3cb0ce3cd9 100644 --- a/htdocs/datapolicy/class/datapolicy.class.php +++ b/htdocs/datapolicy/class/datapolicy.class.php @@ -30,11 +30,11 @@ include_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php'; */ Class DataPolicy { - /** - * getAllContactNotInformed - * - * @return number - */ + /** + * getAllContactNotInformed + * + * @return number + */ function getAllContactNotInformed() { global $langs, $conf, $db, $user; @@ -144,71 +144,71 @@ Class DataPolicy */ function sendMailDataPolicyContact($contact) { - global $langs, $conf, $db, $user; + global $langs, $conf, $db, $user; - $error = 0; + $error = 0; - $from = $user->getFullName($langs) . ' <' . $user->email . '>'; + $from = $user->getFullName($langs) . ' <' . $user->email . '>'; - $sendto = $contact->email; - $code= md5($contact->email); - if (!empty($contact->default_lang)) { - $l = $contact->default_lang; - } else { - $l = $langs->defaultlang; - } - $s = "DATAPOLICIESSUBJECT_" . $l; - $ma = "DATAPOLICIESCONTENT_" . $l; - $la = 'TXTLINKDATAPOLICIESACCEPT_' . $l; - $lr = 'TXTLINKDATAPOLICIESREFUSE_' . $l; + $sendto = $contact->email; + $code= md5($contact->email); + if (!empty($contact->default_lang)) { + $l = $contact->default_lang; + } else { + $l = $langs->defaultlang; + } + $s = "DATAPOLICIESSUBJECT_" . $l; + $ma = "DATAPOLICIESCONTENT_" . $l; + $la = 'TXTLINKDATAPOLICIESACCEPT_' . $l; + $lr = 'TXTLINKDATAPOLICIESREFUSE_' . $l; - $subject = $conf->global->$s; - $message = $conf->global->$ma; - $linka = $conf->global->$la; - $linkr = $conf->global->$lr; - $sendtocc = $sendtobcc = ''; - $filepath = $mimetype = $filename = array(); - $deliveryreceipt = 0; + $subject = $conf->global->$s; + $message = $conf->global->$ma; + $linka = $conf->global->$la; + $linkr = $conf->global->$lr; + $sendtocc = $sendtobcc = ''; + $filepath = $mimetype = $filename = array(); + $deliveryreceipt = 0; - $substitutionarray = array( - '__LINKACCEPT__' => ''.$linka.'', - '__LINKREFUSED__' => ''.$linkr.'', - '__FIRSTNAME__' => $contact->firstname, - '__NAME__' => $contact->lastname, - '__CIVILITY__' => $contact->civility, - ); - $subject = make_substitutions($subject, $substitutionarray); - $message = make_substitutions($message, $substitutionarray); + $substitutionarray = array( + '__LINKACCEPT__' => ''.$linka.'', + '__LINKREFUSED__' => ''.$linkr.'', + '__FIRSTNAME__' => $contact->firstname, + '__NAME__' => $contact->lastname, + '__CIVILITY__' => $contact->civility, + ); + $subject = make_substitutions($subject, $substitutionarray); + $message = make_substitutions($message, $substitutionarray); - $actiontypecode = 'AC_EMAIL'; - $actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto; - if ($message) { - if ($sendtocc) - $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc); - $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject); - $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":"); - $actionmsg = dol_concatdesc($actionmsg, $message); - } + $actiontypecode = 'AC_EMAIL'; + $actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto; + if ($message) { + if ($sendtocc) + $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc); + $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject); + $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":"); + $actionmsg = dol_concatdesc($actionmsg, $message); + } - // Send mail - require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; - $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, $sendtobcc, $deliveryreceipt, -1); + // Send mail + require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; + $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, $sendtobcc, $deliveryreceipt, -1); - if ($mailfile->error) { - $resultmasssend .= '
' . $mailfile->error . '
'; - } else { - $result4 = $mailfile->sendfile(); - if (!$error) { + if ($mailfile->error) { + $resultmasssend .= '
' . $mailfile->error . '
'; + } else { + $result4 = $mailfile->sendfile(); + if (!$error) { - $resultmasssend .= $langs->trans("MailSent") . ': ' . $sendto . "
"; - $contact->array_options['options_datapolicy_send'] = date('Y-m-d', time()); - $contact->update($contact->id); - } else { - dol_print_error($db); - } - } - setEventMessage($resultmasssend); + $resultmasssend .= $langs->trans("MailSent") . ': ' . $sendto . "
"; + $contact->array_options['options_datapolicy_send'] = date('Y-m-d', time()); + $contact->update($contact->id); + } else { + dol_print_error($db); + } + } + setEventMessage($resultmasssend); } /** @@ -219,44 +219,44 @@ Class DataPolicy */ function sendMailDataPolicyCompany($societe) { - global $langs, $conf, $db, $user; + global $langs, $conf, $db, $user; - $error = 0; + $error = 0; - $from = $user->getFullName($langs) . ' <' . $user->email . '>'; + $from = $user->getFullName($langs) . ' <' . $user->email . '>'; - $sendto = $societe->email; + $sendto = $societe->email; - $code= md5($societe->email); - if (!empty($societe->default_lang)) { - $l = $societe->default_lang; - } else { - $l = $langs->defaultlang; - } - $s = "DATAPOLICIESSUBJECT_" . $l; - $ma = "DATAPOLICIESCONTENT_" . $l; - $la = 'TXTLINKDATAPOLICIESACCEPT_' . $l; - $lr = 'TXTLINKDATAPOLICIESREFUSE_' . $l; + $code= md5($societe->email); + if (!empty($societe->default_lang)) { + $l = $societe->default_lang; + } else { + $l = $langs->defaultlang; + } + $s = "DATAPOLICIESSUBJECT_" . $l; + $ma = "DATAPOLICIESCONTENT_" . $l; + $la = 'TXTLINKDATAPOLICIESACCEPT_' . $l; + $lr = 'TXTLINKDATAPOLICIESREFUSE_' . $l; - $subject = $conf->global->$s; - $message = $conf->global->$ma; - $linka = $conf->global->$la; - $linkr = $conf->global->$lr; - $sendtocc = $sendtobcc = ''; - $filepath = $mimetype = $filename = array(); - $deliveryreceipt = 0; + $subject = $conf->global->$s; + $message = $conf->global->$ma; + $linka = $conf->global->$la; + $linkr = $conf->global->$lr; + $sendtocc = $sendtobcc = ''; + $filepath = $mimetype = $filename = array(); + $deliveryreceipt = 0; - $substitutionarray = array( + $substitutionarray = array( '__LINKACCEPT__' => ''.$linka.'', '__LINKREFUSED__' => ''.$linkr.'', - ); - $subject = make_substitutions($subject, $substitutionarray); - $message = make_substitutions($message, $substitutionarray); + ); + $subject = make_substitutions($subject, $substitutionarray); + $message = make_substitutions($message, $substitutionarray); - $actiontypecode = 'AC_EMAIL'; - $actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto; - if ($message) { - if ($sendtocc) { + $actiontypecode = 'AC_EMAIL'; + $actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto; + if ($message) { + if ($sendtocc) { $actionmsg .= dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc); } $actionmsg .= dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject); @@ -264,23 +264,23 @@ Class DataPolicy $actionmsg .= dol_concatdesc($actionmsg, $message); } - // Send mail - require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; - $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, $sendtobcc, $deliveryreceipt, -1); - if ($mailfile->error) { - $resultmasssend .= '
' . $mailfile->error . '
'; - } else { - $result4 = $mailfile->sendfile(); + // Send mail + require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; + $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, $sendtobcc, $deliveryreceipt, -1); + if ($mailfile->error) { + $resultmasssend .= '
' . $mailfile->error . '
'; + } else { + $result4 = $mailfile->sendfile(); - if (!$error) { - $resultmasssend .= $langs->trans("MailSent") . ': ' . $sendto . "
"; - $societe->array_options['options_datapolicy_send'] = date('Y-m-d', time()); - $societe->update($societe->id); - } else { - dol_print_error($db); - } - } - setEventMessage($resultmasssend); + if (!$error) { + $resultmasssend .= $langs->trans("MailSent") . ': ' . $sendto . "
"; + $societe->array_options['options_datapolicy_send'] = date('Y-m-d', time()); + $societe->update($societe->id); + } else { + dol_print_error($db); + } + } + setEventMessage($resultmasssend); } /** @@ -291,66 +291,66 @@ Class DataPolicy */ function sendMailDataPolicyAdherent($adherent) { - global $langs, $conf, $db, $user; + global $langs, $conf, $db, $user; - $error = 0; + $error = 0; - $from = $user->getFullName($langs) . ' <' . $user->email . '>'; + $from = $user->getFullName($langs) . ' <' . $user->email . '>'; - $sendto = $adherent->email; + $sendto = $adherent->email; - $code= md5($adherent->email); - if (!empty($adherent->default_lang)) { - $l = $adherent->default_lang; - } else { - $l = $langs->defaultlang; - } - $la = 'TXTLINKDATAPOLICIESACCEPT_' . $l; - $lr = 'TXTLINKDATAPOLICIESREFUSE_' . $l; + $code= md5($adherent->email); + if (!empty($adherent->default_lang)) { + $l = $adherent->default_lang; + } else { + $l = $langs->defaultlang; + } + $la = 'TXTLINKDATAPOLICIESACCEPT_' . $l; + $lr = 'TXTLINKDATAPOLICIESREFUSE_' . $l; - $subject = $conf->global->$s; - $message = $conf->global->$ma; - $linka = $conf->global->$la; - $linkr = $conf->global->$lr; - $sendtocc = $sendtobcc = ''; - $filepath = $mimetype = $filename = array(); - $deliveryreceipt = 0; + $subject = $conf->global->$s; + $message = $conf->global->$ma; + $linka = $conf->global->$la; + $linkr = $conf->global->$lr; + $sendtocc = $sendtobcc = ''; + $filepath = $mimetype = $filename = array(); + $deliveryreceipt = 0; - $substitutionarray = array( + $substitutionarray = array( '__LINKACCEPT__' => ''.$linka.'', '__LINKREFUSED__' => ''.$linkr.'', - ); - $subject = make_substitutions($subject, $substitutionarray); - $message = make_substitutions($message, $substitutionarray); + ); + $subject = make_substitutions($subject, $substitutionarray); + $message = make_substitutions($message, $substitutionarray); - $actiontypecode = 'AC_EMAIL'; - $actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto; - if ($message) { - if ($sendtocc) { + $actiontypecode = 'AC_EMAIL'; + $actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto; + if ($message) { + if ($sendtocc) { $actionmsg .= dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc); } $actionmsg .= dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject); $actionmsg .= dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":"); $actionmsg .= dol_concatdesc($actionmsg, $message); - } + } - // Send mail - require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; - $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, $sendtobcc, $deliveryreceipt, -1); - if ($mailfile->error) { - $resultmasssend .= '
' . $mailfile->error . '
'; - } else { - $result4 = $mailfile->sendfile(); + // Send mail + require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; + $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, $sendtobcc, $deliveryreceipt, -1); + if ($mailfile->error) { + $resultmasssend .= '
' . $mailfile->error . '
'; + } else { + $result4 = $mailfile->sendfile(); - if (!$error) { - $resultmasssend .= $langs->trans("MailSent") . ': ' . $sendto . "
"; - $adherent->array_options['options_datapolicy_send'] = date('Y-m-d', time()); - $adherent->update($user); - } else { - dol_print_error($db); - } - } - setEventMessage($resultmasssend); + if (!$error) { + $resultmasssend .= $langs->trans("MailSent") . ': ' . $sendto . "
"; + $adherent->array_options['options_datapolicy_send'] = date('Y-m-d', time()); + $adherent->update($user); + } else { + dol_print_error($db); + } + } + setEventMessage($resultmasssend); } } diff --git a/htdocs/datapolicy/class/datapolicycron.class.php b/htdocs/datapolicy/class/datapolicycron.class.php index 01478580a3a..656831eed2f 100644 --- a/htdocs/datapolicy/class/datapolicycron.class.php +++ b/htdocs/datapolicy/class/datapolicycron.class.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2018 Frédéric France * * This program is free software: you can redistribute it and/or modify @@ -17,7 +17,7 @@ */ /** - * \file datapolicy/class/datapolicycron.class.php + * \file htdocs/datapolicy/class/datapolicycron.class.php * \ingroup datapolicy * \brief Example hook overload. */ @@ -27,11 +27,11 @@ */ class DataPolicyCron { - /** - * Function exec - * - * @return boolean - */ + /** + * Function exec + * + * @return boolean + */ public function exec() { global $conf, $db, $langs, $user; diff --git a/htdocs/datapolicy/lib/datapolicy.lib.php b/htdocs/datapolicy/lib/datapolicy.lib.php index 41c92299989..b72417d7ff9 100644 --- a/htdocs/datapolicy/lib/datapolicy.lib.php +++ b/htdocs/datapolicy/lib/datapolicy.lib.php @@ -1,5 +1,6 @@ + * Copyright (C) 2019 Frédéric France * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +17,7 @@ */ /** - * \file datapolicy/lib/datapolicy.lib.php + * \file htdocs/datapolicy/lib/datapolicy.lib.php * \ingroup datapolicy * \brief Library files with common functions for datapolicy */ @@ -28,27 +29,26 @@ */ function datapolicyAdminPrepareHead() { - global $langs, $conf; + global $langs, $conf; - $langs->load("datapolicy@datapolicy"); + $langs->load("datapolicy@datapolicy"); - $h = 0; - $head = array(); + $h = 0; + $head = array(); - $head[$h][0] = dol_buildpath("/datapolicy/admin/setup.php", 1); - $head[$h][1] = $langs->trans("Deletion"); - $head[$h][2] = 'settings'; - $h++; + $head[$h][0] = DOL_URL_ROOT."/datapolicy/admin/setup.php"; + $head[$h][1] = $langs->trans("Deletion"); + $head[$h][2] = 'settings'; + $h++; - if (! empty($conf->global->DATAPOLICIES_ENABLE_EMAILS)) - { - $head[$h][0] = dol_buildpath("/datapolicy/admin/setupmail.php", 1); - $head[$h][1] = $langs->trans("DATAPOLICIESMail"); - $head[$h][2] = 'settings'; - $h++; - } + if (! empty($conf->global->DATAPOLICIES_ENABLE_EMAILS)) { + $head[$h][0] = DOL_URL_ROOT."/datapolicy/admin/setupmail.php"; + $head[$h][1] = $langs->trans("DATAPOLICIESMail"); + $head[$h][2] = 'settings'; + $h++; + } - complete_head_from_modules($conf, $langs, $object, $head, $h, 'datapolicy'); + complete_head_from_modules($conf, $langs, $object, $head, $h, 'datapolicy'); - return $head; + return $head; } diff --git a/htdocs/datapolicy/mailing.php b/htdocs/datapolicy/mailing.php index e3f38b269be..69da78e00ac 100644 --- a/htdocs/datapolicy/mailing.php +++ b/htdocs/datapolicy/mailing.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2018 Nicolas ZABOURI + * Copyright (C) 2019 Frédéric France * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,22 +17,22 @@ */ /** - * \file datapolicy/mailing.php + * \file htdocs/datapolicy/mailing.php * \ingroup datapolicy * \brief datapolicy mailing page. */ require '../../main.inc.php'; -dol_include_once('/contact/class/contact.class.php'); -dol_include_once('/datapolicy/class/datapolicy.class.php'); +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; +require_once DOL_DOCUMENT_ROOT.'/datapolicy/class/datapolicy.class.php'; $idcontact = GETPOST('idc'); -if(!empty($idcontact)){ +if (!empty($idcontact)) { $contact = new Contact($db); $contact->fetch($idcontact); DataPolicy::sendMailDataPolicyContact($contact); -}else{ +} else { $contacts = new DataPolicy($db); $contacts->getAllContactNotInformed(); diff --git a/htdocs/datapolicy/public/index.php b/htdocs/datapolicy/public/index.php index f819fb079f5..6c78f380b93 100644 --- a/htdocs/datapolicy/public/index.php +++ b/htdocs/datapolicy/public/index.php @@ -17,7 +17,7 @@ */ /** - * \file datapolicy/admin/setup.php + * \file htdocs/datapolicy/admin/setup.php * \ingroup datapolicy * \brief datapolicy setup page. */ @@ -30,11 +30,11 @@ if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); require '../../main.inc.php'; -dol_include_once('/contact/class/contact.class.php'); -dol_include_once('/societe/class/societe.class.php'); -dol_include_once('/adherents/class/adherent.class.php'); -dol_include_once('/user/class/user.class.php'); -dol_include_once('/datapolicy/class/datapolicy.class.php'); +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; +require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; +require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; +require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; +require_once DOL_DOCUMENT_ROOT.'/datapolicy/class/datapolicy.class.php'; $idc = GETPOST('c', 'int'); $ids = GETPOST('s', 'int'); diff --git a/htdocs/don/class/api_donations.class.php b/htdocs/don/class/api_donations.class.php index b326c6f4959..6fae048c3db 100644 --- a/htdocs/don/class/api_donations.class.php +++ b/htdocs/don/class/api_donations.class.php @@ -48,7 +48,7 @@ class Donations extends DolibarrApi { global $db, $conf; $this->db = $db; - $this->don = new Don($this->db); + $this->don = new Don($this->db); } /** diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index 4daa8b6498f..d37271f6480 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -933,7 +933,7 @@ if ($resql) if (! empty($arrayfields['e.ref']['checked'])) { // We are on a specific warehouse card, no filter on other should be possible print_liste_field_titre($arrayfields['e.ref']['label'], $_SERVER["PHP_SELF"], "e.ref", "", $param, "", $sortfield, $sortorder); - + } if (! empty($arrayfields['m.fk_user_author']['checked'])) { print_liste_field_titre($arrayfields['m.fk_user_author']['label'], $_SERVER["PHP_SELF"], "m.fk_user_author", "", $param, "", $sortfield, $sortorder); } diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php index 5d8f0fe11ce..43abb1f9e75 100644 --- a/htdocs/variants/combinations.php +++ b/htdocs/variants/combinations.php @@ -763,7 +763,7 @@ if (! empty($id) || ! empty($ref)) '; + print ''; @@ -802,7 +802,7 @@ if (! empty($id) || ! empty($ref)) '; + print ''."\n"; - } else { //bouton gris + } else { + //bouton gris print ''."\n"; } } diff --git a/htdocs/product/stock/class/api_warehouses.class.php b/htdocs/product/stock/class/api_warehouses.class.php index 9dd34f18569..ba8339f98ed 100644 --- a/htdocs/product/stock/class/api_warehouses.class.php +++ b/htdocs/product/stock/class/api_warehouses.class.php @@ -205,7 +205,7 @@ class Warehouses extends DolibarrApi } if($this->warehouse->update($id, DolibarrApiAccess::$user)) - return $this->get ($id); + return $this->get($id); return false; } diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 4c964f591d0..ba80c61e4ca 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2010,16 +2010,16 @@ class Societe extends CommonObject $name=$this->name?$this->name:$this->nom; - if(!empty($conf->global->SOCIETE_ON_SEARCH_AND_LIST_GO_ON_CUSTOMER_OR_SUPPLIER_CARD)){ - if(empty($option) && $this->client > 0) $option = 'customer'; - if(empty($option) && $this->fournisseur > 0) $option = 'supplier'; + if (!empty($conf->global->SOCIETE_ON_SEARCH_AND_LIST_GO_ON_CUSTOMER_OR_SUPPLIER_CARD)){ + if (empty($option) && $this->client > 0) $option = 'customer'; + if (empty($option) && $this->fournisseur > 0) $option = 'supplier'; } if (! empty($conf->global->SOCIETE_ADD_REF_IN_LIST) && (!empty($withpicto))) { $code = ''; - if (($this->client) && (! empty ($this->code_client)) + if (($this->client) && (! empty($this->code_client)) && ($conf->global->SOCIETE_ADD_REF_IN_LIST == 1 || $conf->global->SOCIETE_ADD_REF_IN_LIST == 2 ) @@ -2028,7 +2028,7 @@ class Societe extends CommonObject $code = $this->code_client . ' - '; } - if (($this->fournisseur) && (! empty ($this->code_fournisseur)) + if (($this->fournisseur) && (! empty($this->code_fournisseur)) && ($conf->global->SOCIETE_ADD_REF_IN_LIST == 1 || $conf->global->SOCIETE_ADD_REF_IN_LIST == 3 ) diff --git a/htdocs/stripe/payment.php b/htdocs/stripe/payment.php index 50d64521621..7a3c089acf3 100644 --- a/htdocs/stripe/payment.php +++ b/htdocs/stripe/payment.php @@ -80,7 +80,7 @@ if ($facid > 0) if (! empty($conf->stripe->enabled)) { - access_forbidden(); + access_forbidden(); } if (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox', 'alpha')) @@ -230,9 +230,9 @@ if (empty($reshook)) $action = 'create'; if (!$source) { setEventMessages($langs->transnoentities('NoSource'), null, 'errors'); - } - $error++; - } + } + $error++; + } // Le reste propre a cette action s'affiche en bas de page. } @@ -995,7 +995,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie // Print total print ''; print ''; - if (!empty($conf->multicurrency->enabled)) { + if (!empty($conf->multicurrency->enabled)) { print ''; print ''; print ''; @@ -1007,7 +1007,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ''; print ''; print ''; - if (!empty($conf->multicurrency->enabled)) { + if (!empty($conf->multicurrency->enabled)) { print ''; } print "\n"; @@ -1018,7 +1018,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie $db->free($resql); } else - { + { dol_print_error($db); } @@ -1051,9 +1051,9 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie if (!empty($totalpayment)) { $text = $langs->trans('ConfirmCustomerPayment', $totalpayment, $langs->trans("Currency".$conf->currency)); } - if (!empty($multicurrency_totalpayment)) { - $text.='
'.$langs->trans('ConfirmCustomerPayment', $multicurrency_totalpayment, $langs->trans("paymentInInvoiceCurrency")); - } + if (!empty($multicurrency_totalpayment)) { + $text.='
'.$langs->trans('ConfirmCustomerPayment', $multicurrency_totalpayment, $langs->trans("paymentInInvoiceCurrency")); + } if (GETPOST('closepaidinvoices')) { $text.='
'.$langs->trans("AllCompletelyPayedInvoiceWillBeClosed"); diff --git a/htdocs/takepos/ajax.php b/htdocs/takepos/ajax.php index 5871d27a618..4b16cc9ec81 100644 --- a/htdocs/takepos/ajax.php +++ b/htdocs/takepos/ajax.php @@ -42,21 +42,21 @@ $term = GETPOST('term', 'alpha'); * View */ -if ($action=="getProducts"){ - $object = new Categorie($db); - $result=$object->fetch($category); - $prods = $object->getObjectsInCateg("product"); - echo json_encode($prods); +if ($action=="getProducts") { + $object = new Categorie($db); + $result=$object->fetch($category); + $prods = $object->getObjectsInCateg("product"); + echo json_encode($prods); } -if ($action=="search"){ - $sql = 'SELECT * FROM '.MAIN_DB_PREFIX.'product'; - $sql.= ' WHERE entity IN ('.getEntity('product').')'; - $sql .= natural_search(array('label','barcode'), $term); - $resql = $db->query($sql); - $rows = array(); - while($row = $db->fetch_array ($resql)){ - $rows[] = $row; - } - echo json_encode($rows); +if ($action=="search") { + $sql = 'SELECT * FROM '.MAIN_DB_PREFIX.'product'; + $sql .= ' WHERE entity IN ('.getEntity('product').')'; + $sql .= natural_search(array('label','barcode'), $term); + $resql = $db->query($sql); + $rows = array(); + while ($row = $db->fetch_array($resql)) { + $rows[] = $row; + } + echo json_encode($rows); } diff --git a/htdocs/takepos/floors.php b/htdocs/takepos/floors.php index 7ca0a40ca74..ceb8c73f211 100644 --- a/htdocs/takepos/floors.php +++ b/htdocs/takepos/floors.php @@ -45,7 +45,7 @@ if ($action=="getTables"){ $sql="SELECT * from ".MAIN_DB_PREFIX."takepos_floor_tables where floor=".$floor; $resql = $db->query($sql); $rows = array(); - while($row = $db->fetch_array ($resql)){ + while($row = $db->fetch_array($resql)){ $rows[] = $row; } echo json_encode($rows); @@ -62,15 +62,15 @@ if ($action=="update") if ($action=="updatename") { - $newname = preg_replace("/[^a-zA-Z0-9\s]/", "", $newname); // Only English chars - if (strlen($newname) > 3) $newname = substr($newname, 0, 3); // Only 3 chars + $newname = preg_replace("/[^a-zA-Z0-9\s]/", "", $newname); // Only English chars + if (strlen($newname) > 3) $newname = substr($newname, 0, 3); // Only 3 chars $db->query("update ".MAIN_DB_PREFIX."takepos_floor_tables set label='$newname' where label='$place'"); } if ($action=="add") { $asdf=$db->query("insert into ".MAIN_DB_PREFIX."takepos_floor_tables values ('', '', '', '45', '45', $floor)"); - $db->query("update ".MAIN_DB_PREFIX."takepos_floor_tables set label=rowid where label=''"); // No empty table names + $db->query("update ".MAIN_DB_PREFIX."takepos_floor_tables set label=rowid where label=''"); // No empty table names } // Title @@ -175,4 +175,4 @@ $( document ).ready(function() { - \ No newline at end of file + diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php index 2f2df5b8085..33524b80a8c 100644 --- a/htdocs/takepos/pay.php +++ b/htdocs/takepos/pay.php @@ -39,7 +39,7 @@ $place = GETPOST('place', 'int'); $sql="SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS-".$place.")'"; $resql = $db->query($sql); -$row = $db->fetch_array ($resql); +$row = $db->fetch_array($resql); $placeid=$row[0]; if (! $placeid) $placeid=0; // Invoice not exist else{ diff --git a/htdocs/takepos/receipt.php b/htdocs/takepos/receipt.php index 456ddcefdb5..d43c3195b92 100644 --- a/htdocs/takepos/receipt.php +++ b/htdocs/takepos/receipt.php @@ -34,7 +34,7 @@ $place=GETPOST('place', 'int'); if ($place>0){ $sql="SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS-".$place.")'"; $resql = $db->query($sql); - $row = $db->fetch_array ($resql); + $row = $db->fetch_array($resql); $facid=$row[0]; } $object=new Facture($db); From 2f300ae63ffa4e7adb3547da9f205db7a676a4b1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 24 Feb 2019 20:26:54 +0100 Subject: [PATCH 127/135] Standardize code with customer invoices --- .../fourn/class/fournisseur.facture.class.php | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index a006b5391b1..5cc47d5201a 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -1646,29 +1646,33 @@ class FactureFournisseur extends CommonInvoice $this->line->fk_facture_fourn=$this->id; //$this->line->label=$label; // deprecated $this->line->desc=$desc; - $this->line->qty= ($this->type==self::TYPE_CREDIT_NOTE?abs($qty):$qty); // For credit note, quantity is always positive and unit price negative $this->line->ref_supplier=$ref_supplier; + $this->line->qty= ($this->type==self::TYPE_CREDIT_NOTE?abs($qty):$qty); // For credit note, quantity is always positive and unit price negative + $this->line->subprice= ($this->type==self::TYPE_CREDIT_NOTE?-abs($pu_ht):$pu_ht); // For credit note, unit price always negative, always positive otherwise + $this->line->vat_src_code=$vat_src_code; $this->line->tva_tx=$txtva; $this->line->localtax1_tx=($total_localtax1?$localtaxes_type[1]:0); $this->line->localtax2_tx=($total_localtax2?$localtaxes_type[3]:0); $this->line->localtax1_type = $localtaxes_type[0]; $this->line->localtax2_type = $localtaxes_type[2]; - $this->line->fk_product=$fk_product; - $this->line->product_type=$type; - $this->line->remise_percent=$remise_percent; - $this->line->subprice= ($this->type==self::TYPE_CREDIT_NOTE?-abs($pu_ht):$pu_ht); // For credit note, unit price always negative, always positive otherwise - $this->line->date_start=$date_start; - $this->line->date_end=$date_end; - $this->line->ventil=$ventil; - $this->line->rang=$rang; - $this->line->info_bits=$info_bits; + $this->line->total_ht= (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_ht):$total_ht); // For credit note and if qty is negative, total is negative $this->line->total_tva= (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_tva):$total_tva); $this->line->total_localtax1=(($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_localtax1):$total_localtax1); $this->line->total_localtax2=(($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_localtax2):$total_localtax2); $this->line->total_ttc= (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_ttc):$total_ttc); + + $this->line->fk_product=$fk_product; + $this->line->product_type=$type; + $this->line->remise_percent=$remise_percent; + $this->line->date_start=$date_start; + $this->line->date_end=$date_end; + $this->line->ventil=$ventil; + $this->line->rang=$rang; + $this->line->info_bits=$info_bits; + $this->line->special_code=$this->special_code; $this->line->fk_parent_line=$this->fk_parent_line; $this->line->origin=$this->origin; From 3f078203b94e86aec886f4864f55bd8e4449e5c0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 24 Feb 2019 20:29:01 +0100 Subject: [PATCH 128/135] Fix phpcs --- htdocs/compta/facture/class/facture.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index fd050297fe5..dda877d0a1f 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1324,7 +1324,7 @@ class Facture extends CommonInvoice $sql.= ', p.code as mode_reglement_code, p.libelle as mode_reglement_libelle'; $sql.= ', c.code as cond_reglement_code, c.libelle as cond_reglement_libelle, c.libelle_facture as cond_reglement_libelle_doc'; $sql.= ', f.fk_incoterms, f.location_incoterms'; - $sql.= ', f.module_source, f.pos_source'; + $sql.= ', f.module_source, f.pos_source'; $sql.= ", i.libelle as libelle_incoterms"; $sql.= ' FROM '.MAIN_DB_PREFIX.'facture as f'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_payment_term as c ON f.fk_cond_reglement = c.rowid'; @@ -1400,9 +1400,9 @@ class Facture extends CommonInvoice $this->fk_incoterms = $obj->fk_incoterms; $this->location_incoterms = $obj->location_incoterms; $this->libelle_incoterms = $obj->libelle_incoterms; - + $this->module_source = $obj->module_source; - $this->pos_source = $obj->pos_source; + $this->pos_source = $obj->pos_source; // Multicurrency $this->fk_multicurrency = $obj->fk_multicurrency; From 58caf2774483d8ba1c0a8702939ac14055bc74b2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 24 Feb 2019 20:30:06 +0100 Subject: [PATCH 129/135] Fix phpcs --- htdocs/stripe/payment.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/stripe/payment.php b/htdocs/stripe/payment.php index 50d64521621..48adfa2b2b3 100644 --- a/htdocs/stripe/payment.php +++ b/htdocs/stripe/payment.php @@ -80,7 +80,7 @@ if ($facid > 0) if (! empty($conf->stripe->enabled)) { - access_forbidden(); + access_forbidden(); } if (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox', 'alpha')) From dde18e803dd692d361002b2ab958ffc6a7c4644c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 Feb 2019 15:09:56 +0100 Subject: [PATCH 130/135] Fix transaction --- .../facture/class/api_invoices.class.php | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index afecfd33b45..9bbb155eb60 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -372,7 +372,7 @@ class Invoices extends DolibarrApi throw new RestException(304, $this->invoice->error); } } - + /** * Add a contact type of given invoice * @@ -939,9 +939,8 @@ class Invoices extends DolibarrApi if(! DolibarrApiAccess::$user->rights->facture->creer) { throw new RestException(401); } - - $this->db->begin(); - + + $result = $this->invoice->fetch($id); if( ! $result ) { throw new RestException(404, 'Invoice not found'); @@ -958,8 +957,12 @@ class Invoices extends DolibarrApi if (! $this->invoice->paye) // protection against multiple submit { + $this->db->begin(); + $this->invoice->fetch_lines(); - + + $amount_ht = $amount_tva = $amount_ttc = array(); + // Loop on each vat rate $i=0; foreach($this->invoice->lines as $line) @@ -1009,14 +1012,14 @@ class Invoices extends DolibarrApi } else { - throw new RestException(500, 'Could not set paid'); - $this->db->rollback(); + $this->db->rollback(); + throw new RestException(500, 'Could not set paid'); } } else { - throw new RestException(500, 'Discount creation error'); - $this->db->rollback(); + $this->db->rollback(); + throw new RestException(500, 'Discount creation error'); } } From 8234c094124be615378169927406e50934bac647 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 Feb 2019 15:15:17 +0100 Subject: [PATCH 131/135] Try some fixes --- htdocs/stripe/class/stripe.class.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index 8cc5b0218b1..646e5c19b12 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -243,13 +243,13 @@ class Stripe extends CommonObject /** * Get the Stripe payment intent * - * @param Societe $object Object tp pay on Stripe - * @param string $customer Stripe customer ref 'cus_xxxxxxxxxxxxx' via customerStripe() - * @param string $key ''=Use common API. If not '', it is the Stripe connect account 'acc_....' to use Stripe connect - * @param int $status Status (0=test, 1=live) - * @param int $usethirdpartyemailforreceiptemail 1=use thirdparty email fpr receipt - * @param int $mode automatic=automatic payment, manual=need confirmation - * @return \Stripe\PaymentIntent|null Stripe PaymentIntent or null if not found + * @param Societe $object Object to pay with Stripe + * @param string $customer Stripe customer ref 'cus_xxxxxxxxxxxxx' via customerStripe() + * @param string $key ''=Use common API. If not '', it is the Stripe connect account 'acc_....' to use Stripe connect + * @param int $status Status (0=test, 1=live) + * @param int $usethirdpartyemailforreceiptemail 1=use thirdparty email for receipt + * @param int $mode automatic=automatic payment, manual=need confirmation + * @return \Stripe\PaymentIntent|null Stripe PaymentIntent or null if not found */ public function getPaymentIntent($object, $customer, $key = null, $status = 0, $usethirdpartyemailforreceiptemail = 0, $mode = 'automatic') { @@ -284,7 +284,7 @@ class Stripe extends CommonObject $obj = $this->db->fetch_object($resql); $intent = $obj->ext_payment_id; - dol_syslog(get_class($this) . "::customerStripe found stripe customer key_account = ".$tiers); + dol_syslog(get_class($this) . "::customerStripe found record"); // Force to use the correct API key global $stripearrayofkeysbyenv; @@ -308,7 +308,7 @@ class Stripe extends CommonObject if (! in_array($object->multicurrency_code, $arrayzerounitcurrency)) $stripeamount=$object->multicurrency_total_ttc * 100; else $stripeamount = $object->multicurrency_total_ttc; - $fee = round(($amount * ($conf->global->STRIPE_APPLICATION_FEE_PERCENT / 100) + $conf->global->STRIPE_APPLICATION_FEE) * 100); + $fee = round(($object->total_ttc * ($conf->global->STRIPE_APPLICATION_FEE_PERCENT / 100) + $conf->global->STRIPE_APPLICATION_FEE) * 100); if ($fee < ($conf->global->STRIPE_APPLICATION_FEE_MINIMAL * 100)) { $fee = round($conf->global->STRIPE_APPLICATION_FEE_MINIMAL * 100); } @@ -328,9 +328,9 @@ class Stripe extends CommonObject { $dataforintent["application_fee"] = $fee; } - if ($societe->email && $usethirdpartyemailforreceiptemail) + if ($usethirdpartyemailforreceiptemail && $object->thirdparty->email) { - $dataforintent["receipt_email"] = $societe->email; + $dataforintent["receipt_email"] = $object->thirdparty->email; } try { From 5ffc1822d92825988192c053ee02bd1b535b3fc0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 Feb 2019 19:01:51 +0100 Subject: [PATCH 132/135] Translation --- htdocs/langs/en_US/accountancy.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index 8b3a5a6600b..a54ba98a7e5 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -150,7 +150,7 @@ ACCOUNTING_EXPENSEREPORT_JOURNAL=Expense report journal ACCOUNTING_SOCIAL_JOURNAL=Social journal ACCOUNTING_HAS_NEW_JOURNAL=Has new Journal -ACCOUNTING_ACCOUNT_TRANSFER_CASH=Accounting account of transfer +ACCOUNTING_ACCOUNT_TRANSFER_CASH=Accounting account of bank transfer ACCOUNTING_ACCOUNT_SUSPENSE=Accounting account of wait DONATION_ACCOUNTINGACCOUNT=Accounting account to register donations ADHERENT_SUBSCRIPTION_ACCOUNTINGACCOUNT=Accounting account to register subscriptions From 25d277acebdab803abbefb88842d578cfc28c112 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 Feb 2019 19:02:41 +0100 Subject: [PATCH 133/135] More complete translation --- htdocs/langs/en_US/accountancy.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index a54ba98a7e5..e613d38ab05 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -150,7 +150,7 @@ ACCOUNTING_EXPENSEREPORT_JOURNAL=Expense report journal ACCOUNTING_SOCIAL_JOURNAL=Social journal ACCOUNTING_HAS_NEW_JOURNAL=Has new Journal -ACCOUNTING_ACCOUNT_TRANSFER_CASH=Accounting account of bank transfer +ACCOUNTING_ACCOUNT_TRANSFER_CASH=Accounting account of transitional bank transfer ACCOUNTING_ACCOUNT_SUSPENSE=Accounting account of wait DONATION_ACCOUNTINGACCOUNT=Accounting account to register donations ADHERENT_SUBSCRIPTION_ACCOUNTINGACCOUNT=Accounting account to register subscriptions From fc1d0b2dd5a13d1982772e4ebeeff5292f5e9343 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 Feb 2019 19:07:29 +0100 Subject: [PATCH 134/135] Add missing translation --- htdocs/langs/en_US/accountancy.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index e613d38ab05..472e2166f6b 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -207,6 +207,7 @@ DescThirdPartyReport=Consult here the list of third-party customers and vendors ListAccounts=List of the accounting accounts UnknownAccountForThirdparty=Unknown third-party account. We will use %s UnknownAccountForThirdpartyBlocking=Unknown third-party account. Blocking error +ThirdpartyAccountNotDefinedOrThirdPartyUnknown=Third-party account not defined or third party unknown. Blocking error. UnknownAccountForThirdpartyAndWaitingAccountNotDefinedBlocking=Unknown third-party account and waiting account not defined. Blocking error PaymentsNotLinkedToProduct=Payment not linked to any product / service From 528bfca690cc6fbf9986a97b1ee411c25cc93bef Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 26 Feb 2019 11:44:16 +0100 Subject: [PATCH 135/135] Fix preselection when key is '0' --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 2fb4e4ca228..0f8969cdace 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6178,7 +6178,7 @@ class Form foreach ($array as $key => $value) { $out.= '
trans('Ref') ?> trans('Label') ?>trans('NbOfDifferentValues') ?>trans('NbProducts') ?>trans('NbOfDifferentValues') ?>trans('NbProducts') ?>
ref) ?> label) ?>countChildValues() ?>countChildProducts() ?> + countChildValues() ?>countChildProducts() ?> '.$langs->trans("LabelOrTranslationKey").''.$langs->trans("TranslationString").''.$langs->trans("AttributeCode").''.$langs->trans("Type").''.$langs->trans("Size").''.$langs->trans("Size").''.$langs->trans("ComputedFormula").''.$langs->trans("Unique").''.$langs->trans("Required").''.$langs->trans("AlwaysEditable").''.$form->textwithpicto($langs->trans("Visible"), $langs->trans("VisibleDesc")).''.$form->textwithpicto($langs->trans("Totalizable"), $langs->trans("TotalizableDesc")).''.$langs->trans("Unique").''.$langs->trans("Required").''.$langs->trans("AlwaysEditable").''.$form->textwithpicto($langs->trans("Visible"), $langs->trans("VisibleDesc")).''.$form->textwithpicto($langs->trans("Totalizable"), $langs->trans("TotalizableDesc")).''.$langs->trans("Entities").''.$langs->trans("Entities").' 
".$langs->trans($extrafields->attributes[$elementtype]['label'][$key])."".$key."".$type2label[$extrafields->attributes[$elementtype]['type'][$key]]."'.$extrafields->attributes[$elementtype]['size'][$key]."'.$extrafields->attributes[$elementtype]['size'][$key]."'.dol_trunc($extrafields->attributes[$elementtype]['computed'][$key], 20)."'.yn($extrafields->attributes[$elementtype]['unique'][$key])."'.yn($extrafields->attributes[$elementtype]['required'][$key])."'.yn($extrafields->attributes[$elementtype]['alwayseditable'][$key])."'.$extrafields->attributes[$elementtype]['list'][$key]."'.yn($extrafields->attributes[$elementtype]['totalizable'][$key])."'.yn($extrafields->attributes[$elementtype]['unique'][$key])."'.yn($extrafields->attributes[$elementtype]['required'][$key])."'.yn($extrafields->attributes[$elementtype]['alwayseditable'][$key])."'.$extrafields->attributes[$elementtype]['list'][$key]."'.yn($extrafields->attributes[$elementtype]['totalizable'][$key])."'.($extrafields->attributes[$elementtype]['entityid'][$key]==0?$langs->trans("All"):$extrafields->attributes[$elementtype]['entitylabel'][$key]).''.($extrafields->attributes[$elementtype]['entityid'][$key]==0?$langs->trans("All"):$extrafields->attributes[$elementtype]['entitylabel'][$key]).''.img_edit().''; print "  ".img_delete()."trans('OnBuy') ?> '; $searchpicto=$form->showCheckAddButtons('checkforselect', 1); print $searchpicto; print ' '; if ($productCombinations || $massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined { $selected=0; From efd27ec1d8e3efe476e10cd096edfcd2334bc928 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sun, 24 Feb 2019 16:11:52 +0100 Subject: [PATCH 124/135] Fix declare functions2.lib.php for donations API --- htdocs/core/lib/functions2.lib.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 7ffc09625a3..5d8ea58ee04 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -2260,6 +2260,9 @@ function getModuleDirForApiClass($module) elseif ($module == 'adherent' || $module == 'members' || $module == 'memberstypes' || $module == 'subscriptions') { $moduledirforclass = 'adherents'; } + elseif ($module == 'don' || $module == 'donations') { + $moduledirforclass = 'don'; + } elseif ($module == 'banque' || $module == 'bankaccounts') { $moduledirforclass = 'compta/bank'; } From c2d05141bf13d65744de2aac616130f948e0a3c2 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sun, 24 Feb 2019 16:36:06 +0100 Subject: [PATCH 125/135] FIX donations API --- htdocs/don/class/api_donations.class.php | 110 ++++++++++------------- 1 file changed, 47 insertions(+), 63 deletions(-) diff --git a/htdocs/don/class/api_donations.class.php b/htdocs/don/class/api_donations.class.php index b326c6f4959..f2ad47f1b2e 100644 --- a/htdocs/don/class/api_donations.class.php +++ b/htdocs/don/class/api_donations.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2016 Laurent Destailleur +/* Copyright (C) 2019 Thibault FOUCART + * Copyright (C) 2019 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -72,13 +72,13 @@ class Donations extends DolibarrApi throw new RestException(404, 'Donation not found'); } - if( ! DolibarrApi::_checkAccessToResource('commande', $this->don->id)) { + if( ! DolibarrApi::_checkAccessToResource('donation', $this->don->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } // Add external contacts ids - //$this->commande->contacts_ids = $this->don->liste_contact(-1,'external',1); - //$this->commande->fetchObjectLinked(); + //$this->don->contacts_ids = $this->don->liste_contact(-1,'external',1); + //$this->don->fetchObjectLinked(); return $this->_cleanObjectDatas($this->don); } @@ -87,14 +87,14 @@ class Donations extends DolibarrApi /** * List donations * - * Get a list of orders + * Get a list of donations * - * @param string $sortfield Sort field - * @param string $sortorder Sort order + * @param string $sortfield Sort field + * @param string $sortorder Sort order * @param int $limit Limit for list * @param int $page Page number - * @param string $thirdparty_ids Thirdparty ids to filter orders of. {@example '1' or '1,2,3'} {@pattern /^[0-9,]*$/i} - * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')" + * @param string $thirdparty_ids Thirdparty ids to filter orders of. {@example '1' or '1,2,3'} {@pattern /^[0-9,]*$/i} + * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')" * @return array Array of order objects * * @throws RestException @@ -108,25 +108,14 @@ class Donations extends DolibarrApi // case of external user, $thirdparty_ids param is ignored and replaced by user's socid $socids = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : $thirdparty_ids; - // If the internal user must only see his customers, force searching by him - $search_sale = 0; - if (! DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) $search_sale = DolibarrApiAccess::$user->id; - $sql = "SELECT t.rowid"; - if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects) + if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) ) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects) $sql.= " FROM ".MAIN_DB_PREFIX."don as t"; - if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale - $sql.= ' WHERE t.entity IN ('.getEntity('don').')'; - if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql.= " AND t.fk_soc = sc.fk_soc"; - if ($socids) $sql.= " AND t.fk_soc IN (".$socids.")"; - if ($search_sale > 0) $sql.= " AND t.rowid = sc.fk_soc"; // Join for the needed table to filter by sale - // Insert sale filter - if ($search_sale > 0) - { - $sql .= " AND sc.fk_user = ".$search_sale; - } + if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) ) $sql.= " AND t.fk_soc = sc.fk_soc"; + if ($thirdparty_ids) $sql.= " AND t.fk_soc = ".$thirdparty_ids." "; + // Add sql filters if ($sqlfilters) { @@ -151,7 +140,7 @@ class Donations extends DolibarrApi dol_syslog("API Rest request"); $result = $db->query($sql); - + if ($result) { $num = $db->num_rows($result); @@ -160,21 +149,22 @@ class Donations extends DolibarrApi while ($i < $min) { $obj = $db->fetch_object($result); - $commande_static = new Commande($db); - if($commande_static->fetch($obj->rowid)) { + $don_static = new Don($db); + if($don_static->fetch($obj->rowid)) { // Add external contacts ids - $commande_static->contacts_ids = $commande_static->liste_contact(-1, 'external', 1); - $obj_ret[] = $this->_cleanObjectDatas($commande_static); + //$don_static->contacts_ids = $don_static->liste_contact(-1, 'external', 1); + $obj_ret[] = $this->_cleanObjectDatas($don_static); } $i++; } } else { - throw new RestException(503, 'Error when retrieve commande list : '.$db->lasterror()); + throw new RestException(503, 'Error when retrieve donation list : '.$db->lasterror()); } if( ! count($obj_ret)) { - throw new RestException(404, 'No order found'); + throw new RestException(404, 'No donation found'); } + return $obj_ret; } @@ -186,28 +176,28 @@ class Donations extends DolibarrApi */ function post($request_data = null) { - if(! DolibarrApiAccess::$user->rights->commande->creer) { + if(! DolibarrApiAccess::$user->rights->don->creer) { throw new RestException(401, "Insuffisant rights"); } // Check mandatory fields $result = $this->_validate($request_data); foreach($request_data as $field => $value) { - $this->commande->$field = $value; + $this->don->$field = $value; } /*if (isset($request_data["lines"])) { $lines = array(); foreach ($request_data["lines"] as $line) { array_push($lines, (object) $line); } - $this->commande->lines = $lines; + $this->don->lines = $lines; }*/ - if ($this->commande->create(DolibarrApiAccess::$user) < 0) { - throw new RestException(500, "Error creating order", array_merge(array($this->commande->error), $this->commande->errors)); + if ($this->don->create(DolibarrApiAccess::$user) < 0) { + throw new RestException(500, "Error creating order", array_merge(array($this->don->error), $this->don->errors)); } - return $this->commande->id; + return $this->don->id; } /** @@ -220,36 +210,30 @@ class Donations extends DolibarrApi */ function put($id, $request_data = null) { - if (! DolibarrApiAccess::$user->rights->commande->creer) { + if (! DolibarrApiAccess::$user->rights->don->creer) { throw new RestException(401); } - $result = $this->commande->fetch($id); + $result = $this->don->fetch($id); if (! $result) { - throw new RestException(404, 'Order not found'); + throw new RestException(404, 'Donation not found'); } - if (! DolibarrApi::_checkAccessToResource('commande', $this->commande->id)) { + if (! DolibarrApi::_checkAccessToResource('donation', $this->don->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } foreach($request_data as $field => $value) { if ($field == 'id') continue; - $this->commande->$field = $value; + $this->don->$field = $value; } - // Update availability - if (!empty($this->commande->availability_id)) { - if ($this->commande->availability($this->commande->availability_id) < 0) - throw new RestException(400, 'Error while updating availability'); - } - - if ($this->commande->update(DolibarrApiAccess::$user) > 0) + if ($this->don->update(DolibarrApiAccess::$user) > 0) { return $this->get($id); } else { - throw new RestException(500, $this->commande->error); + throw new RestException(500, $this->don->error); } } @@ -269,7 +253,7 @@ class Donations extends DolibarrApi throw new RestException(404, 'Donation not found'); } - if( ! DolibarrApi::_checkAccessToResource('don', $this->don->id)) { + if( ! DolibarrApi::_checkAccessToResource('donation', $this->don->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } @@ -309,10 +293,10 @@ class Donations extends DolibarrApi */ function validate($id, $idwarehouse = 0, $notrigger = 0) { - if(! DolibarrApiAccess::$user->rights->commande->creer) { + if(! DolibarrApiAccess::$user->rights->don->creer) { throw new RestException(401); } - $result = $this->commande->fetch($id); + $result = $this->don->fetch($id); if( ! $result ) { throw new RestException(404, 'Donation not found'); } @@ -321,25 +305,25 @@ class Donations extends DolibarrApi throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } - $result = $this->commande->valid(DolibarrApiAccess::$user, $idwarehouse, $notrigger); + $result = $this->don->valid(DolibarrApiAccess::$user, $idwarehouse, $notrigger); if ($result == 0) { throw new RestException(304, 'Error nothing done. May be object is already validated'); } if ($result < 0) { - throw new RestException(500, 'Error when validating Order: '.$this->commande->error); + throw new RestException(500, 'Error when validating Order: '.$this->don->error); } - $result = $this->commande->fetch($id); + $result = $this->don->fetch($id); if( ! $result ) { throw new RestException(404, 'Order not found'); } - if( ! DolibarrApi::_checkAccessToResource('commande', $this->commande->id)) { + if( ! DolibarrApi::_checkAccessToResource('don', $this->don->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } - $this->commande->fetchObjectLinked(); + $this->don->fetchObjectLinked(); - return $this->_cleanObjectDatas($this->commande); + return $this->_cleanObjectDatas($this->don); } /** @@ -372,12 +356,12 @@ class Donations extends DolibarrApi */ function _validate($data) { - $commande = array(); + $don = array(); foreach (Orders::$FIELDS as $field) { if (!isset($data[$field])) throw new RestException(400, $field ." field missing"); - $commande[$field] = $data[$field]; + $don[$field] = $data[$field]; } - return $commande; + return $don; } } From 894123fb06bab62986d4941f1d52ff7417e50e52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 24 Feb 2019 20:06:55 +0100 Subject: [PATCH 126/135] PSR2.Methods.FunctionCallSignature.SpaceBeforeOpenBracket --- dev/initdemo/sftpget_and_loaddump.php | 2 +- dev/initdemo/updatedemo.php | 2 +- dev/setup/codesniffer/ruleset.xml | 3 +- .../thirdparty_lettering_supplier.php | 7 +- .../accountancy/journal/purchasesjournal.php | 16 ++--- htdocs/cashdesk/facturation_verif.php | 2 +- htdocs/cashdesk/validation_verif.php | 2 +- .../categories/class/api_categories.class.php | 2 +- htdocs/categories/class/categorie.class.php | 3 +- .../mailing/class/advtargetemailing.class.php | 29 ++++---- .../html.formadvtargetemailing.class.php | 71 ++++++++++--------- .../core/class/commondocgenerator.class.php | 22 +++--- htdocs/core/class/html.formmail.class.php | 6 +- htdocs/core/class/smtps.class.php | 6 +- htdocs/core/lib/functions.lib.php | 12 ++-- htdocs/core/lib/functionsnumtoword.lib.php | 14 ++-- htdocs/expedition/card.php | 8 +-- .../class/api_supplier_invoices.class.php | 20 +++--- .../fourn/class/api_supplier_orders.class.php | 23 +++--- htdocs/opensurvey/wizard/choix_date.php | 9 +-- .../stock/class/api_warehouses.class.php | 2 +- htdocs/societe/class/societe.class.php | 10 +-- htdocs/stripe/payment.php | 20 +++--- htdocs/takepos/ajax.php | 30 ++++---- htdocs/takepos/floors.php | 10 +-- htdocs/takepos/pay.php | 2 +- htdocs/takepos/receipt.php | 2 +- 27 files changed, 169 insertions(+), 166 deletions(-) diff --git a/dev/initdemo/sftpget_and_loaddump.php b/dev/initdemo/sftpget_and_loaddump.php index e9641ac6816..e261895b617 100755 --- a/dev/initdemo/sftpget_and_loaddump.php +++ b/dev/initdemo/sftpget_and_loaddump.php @@ -48,7 +48,7 @@ if (! $res && file_exists("../../master.inc.php")) $res=@include "../../master.i if (! $res && file_exists("../../../master.inc.php")) $res=@include "../../../master.inc.php"; if (! $res && preg_match('/\/nltechno([^\/]*)\//', $_SERVER["PHP_SELF"], $reg)) $res=@include $path."../../../dolibarr".$reg[1]."/htdocs/master.inc.php"; // Used on dev env only if (! $res && preg_match('/\/nltechno([^\/]*)\//', $_SERVER["PHP_SELF"], $reg)) $res=@include "../../../dolibarr".$reg[1]."/htdocs/master.inc.php"; // Used on dev env only -if (! $res) die ("Failed to include master.inc.php file\n"); +if (! $res) die("Failed to include master.inc.php file\n"); include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; diff --git a/dev/initdemo/updatedemo.php b/dev/initdemo/updatedemo.php index 606bdbe6f56..53ae2251f35 100755 --- a/dev/initdemo/updatedemo.php +++ b/dev/initdemo/updatedemo.php @@ -43,7 +43,7 @@ if (! $res && file_exists("../../master.inc.php")) $res=@include "../../master.i if (! $res && file_exists("../../../master.inc.php")) $res=@include "../../../master.inc.php"; if (! $res && preg_match('/\/nltechno([^\/]*)\//', $_SERVER["PHP_SELF"], $reg)) $res=@include $path."../../../dolibarr".$reg[1]."/htdocs/master.inc.php"; // Used on dev env only if (! $res && preg_match('/\/nltechno([^\/]*)\//', $_SERVER["PHP_SELF"], $reg)) $res=@include "../../../dolibarr".$reg[1]."/htdocs/master.inc.php"; // Used on dev env only -if (! $res) die ("Failed to include master.inc.php file\n"); +if (! $res) die("Failed to include master.inc.php file\n"); include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; diff --git a/dev/setup/codesniffer/ruleset.xml b/dev/setup/codesniffer/ruleset.xml index 6098a0e0139..296c6cb9b6f 100644 --- a/dev/setup/codesniffer/ruleset.xml +++ b/dev/setup/codesniffer/ruleset.xml @@ -428,5 +428,6 @@ - + + diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php b/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php index 67ae907d9a4..bf2b8d4f948 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php @@ -173,17 +173,16 @@ while ($obj = $db->fetch_object($resql)) { $sql.= $db->plimit($limit+1, $offset); -dol_syslog ("/accountancy/bookkeeping/thirdparty_lettrage_supplier.php", LOG_DEBUG); +dol_syslog("/accountancy/bookkeeping/thirdparty_lettrage_supplier.php", LOG_DEBUG); $resql = $db->query($sql); -if (! $resql) -{ +if (! $resql) { dol_print_error($db); exit; } $num = $db->num_rows($resql); -dol_syslog ("/accountancy/bookkeeping/thirdparty_lettrage_supplier.php", LOG_DEBUG); +dol_syslog("/accountancy/bookkeeping/thirdparty_lettrage_supplier.php", LOG_DEBUG); $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index c6434da6388..6bbc4ad9c62 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -633,12 +633,12 @@ if ($action == 'exportcsv') { // ISO and not UTF8 ! print '"' . $key . '"' . $sep; print '"' . $date . '"' . $sep; print '"' . $val["refsologest"] . '"' . $sep; - print '"' . utf8_decode (dol_trunc($companystatic->name, 32)). '"' . $sep; + print '"' . utf8_decode(dol_trunc($companystatic->name, 32)). '"' . $sep; print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep; print '"' . $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER . '"' . $sep; print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep; print '"' . $langs->trans("Thirdparty") . '"' . $sep; - print '"' . utf8_decode (dol_trunc($companystatic->name, 16)) . ' - ' . $val["refsuppliersologest"] . ' - ' . $langs->trans("Thirdparty") . '"' . $sep; + print '"' . utf8_decode(dol_trunc($companystatic->name, 16)) . ' - ' . $val["refsuppliersologest"] . ' - ' . $langs->trans("Thirdparty") . '"' . $sep; print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep; print '"' . ($mt >= 0 ? price($mt) : '') . '"'. $sep; print '"' . $journal . '"' ; @@ -654,12 +654,12 @@ if ($action == 'exportcsv') { // ISO and not UTF8 ! print '"' . $key . '"' . $sep; print '"' . $date . '"' . $sep; print '"' . $val["refsologest"] . '"' . $sep; - print '"' . utf8_decode (dol_trunc($companystatic->name, 32)) . '"' . $sep; + print '"' . utf8_decode(dol_trunc($companystatic->name, 32)) . '"' . $sep; print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep; print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep; print '""' . $sep; - print '"' . utf8_decode (dol_trunc($accountingaccount->label, 32)) . '"' . $sep; - print '"' . utf8_decode (dol_trunc($companystatic->name, 16)) . ' - ' . $val["refsuppliersologest"] . ' - ' . dol_trunc($accountingaccount->label, 32) . '"' . $sep; + print '"' . utf8_decode(dol_trunc($accountingaccount->label, 32)) . '"' . $sep; + print '"' . utf8_decode(dol_trunc($companystatic->name, 16)) . ' - ' . $val["refsuppliersologest"] . ' - ' . dol_trunc($accountingaccount->label, 32) . '"' . $sep; print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep; print '"' . ($mt < 0 ? price(- $mt) : '') . '"'. $sep; print '"' . $journal . '"' ; @@ -679,7 +679,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 ! print '"' . $key . '"' . $sep; print '"' . $date . '"' . $sep; print '"' . $val["refsologest"] . '"' . $sep; - print '"' . utf8_decode (dol_trunc($companystatic->name, 32)) . '"' . $sep; + print '"' . utf8_decode(dol_trunc($companystatic->name, 32)) . '"' . $sep; print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep; print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep; print '""' . $sep; @@ -700,12 +700,12 @@ if ($action == 'exportcsv') { // ISO and not UTF8 ! print '"' . $key . '"' . $sep; print '"' . $date . '"' . $sep; print '"' . $val["refsologest"] . '"' . $sep; - print '"' . utf8_decode (dol_trunc($companystatic->name, 32)). '"' . $sep; + print '"' . utf8_decode(dol_trunc($companystatic->name, 32)). '"' . $sep; print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep; print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep; print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep; print '"' . $langs->trans("Thirdparty") . '"' . $sep; - print '"' . utf8_decode (dol_trunc($companystatic->name, 16)) . ' - ' . $val["refsuppliersologest"] . ' - ' . $langs->trans("VAT") . ' NPR"' . $sep; + print '"' . utf8_decode(dol_trunc($companystatic->name, 16)) . ' - ' . $val["refsuppliersologest"] . ' - ' . $langs->trans("VAT") . ' NPR"' . $sep; print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep; print '"' . ($mt >= 0 ? price($mt) : '') . '"'. $sep; print '"' . $journal . '"' ; diff --git a/htdocs/cashdesk/facturation_verif.php b/htdocs/cashdesk/facturation_verif.php index 3c455f102f9..a7aab12b2ef 100644 --- a/htdocs/cashdesk/facturation_verif.php +++ b/htdocs/cashdesk/facturation_verif.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; $action = GETPOST('action', 'alpha'); $obj_facturation = unserialize($_SESSION['serObjFacturation']); -unset ($_SESSION['serObjFacturation']); +unset($_SESSION['serObjFacturation']); switch($action) diff --git a/htdocs/cashdesk/validation_verif.php b/htdocs/cashdesk/validation_verif.php index b75878b11bd..9d47c63a75a 100644 --- a/htdocs/cashdesk/validation_verif.php +++ b/htdocs/cashdesk/validation_verif.php @@ -359,7 +359,7 @@ switch ($action) // End of case: valide_facture } -unset ($_SESSION['serObjFacturation']); +unset($_SESSION['serObjFacturation']); $_SESSION['serObjFacturation'] = serialize($obj_facturation); diff --git a/htdocs/categories/class/api_categories.class.php b/htdocs/categories/class/api_categories.class.php index f5b13437ba9..2b670ae5286 100644 --- a/htdocs/categories/class/api_categories.class.php +++ b/htdocs/categories/class/api_categories.class.php @@ -220,7 +220,7 @@ class Categories extends DolibarrApi if ($this->category->update(DolibarrApiAccess::$user) > 0) { - return $this->get ($id); + return $this->get($id); } else { diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 20d9a862f33..99433a9b8f0 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -1472,8 +1472,7 @@ class Categorie extends CommonObject // We want to reverse lookup $map_type = array_flip($this->MAP_ID); $type = $map_type[$type]; -dol_syslog( get_class($this) . "::rechercher(): numeric types are deprecated, please use string instead", - LOG_WARNING ); + dol_syslog(get_class($this) . "::rechercher(): numeric types are deprecated, please use string instead", LOG_WARNING); } // Generation requete recherche diff --git a/htdocs/comm/mailing/class/advtargetemailing.class.php b/htdocs/comm/mailing/class/advtargetemailing.class.php index 00aae3a8b08..567f968e3d2 100644 --- a/htdocs/comm/mailing/class/advtargetemailing.class.php +++ b/htdocs/comm/mailing/class/advtargetemailing.class.php @@ -423,12 +423,15 @@ class AdvanceTargetingMailing extends CommonObject $this->db->begin(); dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG); $resql = $this->db->query($sql); - if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } + if (! $resql) { + $error++; + $this->errors[]="Error ".$this->db->lasterror(); + } - if (! $error) - { - if (! $notrigger) - { + //if (! $error) + //{ + // if (! $notrigger) + // { // Uncomment this and change MYOBJECT to your own tag if you // want this action calls a trigger. @@ -438,8 +441,8 @@ class AdvanceTargetingMailing extends CommonObject //$result=$interface->run_triggers('MYOBJECT_MODIFY',$this,$user,$langs,$conf); //if ($result < 0) { $error++; $this->errors=$interface->errors; } //// End call triggers - } - } + // } + //} // Commit or rollback if ($error) @@ -790,15 +793,15 @@ class AdvanceTargetingMailing extends CommonObject if (!empty($arrayquery['options_'.$key.'_end_dt'.'_cnct'])){ $sqlwhere[]= " (te.".$key." >= '".$this->db->idate($arrayquery['options_'.$key.'_st_dt'.'_cnct'])."' AND te.".$key." <= '".$this->db->idate($arrayquery['options_'.$key.'_end_dt'.'_cnct'])."')"; } - }elseif ($extrafields->attribute_type[$key] == 'boolean') { + } elseif ($extrafields->attribute_type[$key] == 'boolean') { if ($arrayquery['options_'.$key.'_cnct']!=''){ if ($arrayquery['options_'.$key.'_cnct']==0) { $sqlwhere[]= " (te.".$key." = ".$arrayquery['options_'.$key.'_cnct']." OR ((te.".$key." IS NULL) AND (te.fk_object IS NOT NULL)))"; - }else { + } else { $sqlwhere[]= " (te.".$key." = ".$arrayquery['options_'.$key.'_cnct'].")"; } } - }else{ + } else { if (is_array($arrayquery['options_'.$key.'_cnct'])) { $sqlwhere[]= " (te.".$key." IN ('".implode("','", $arrayquery['options_'.$key.'_cnct'])."'))"; } elseif (!empty($arrayquery['options_'.$key.'_cnct'])) { @@ -965,12 +968,12 @@ class AdvanceTargetingMailing extends CommonObject } if (count($return_sql_like)>0) { - $return_sql_criteria .= '(' . implode (' OR ', $return_sql_like) .')'; + $return_sql_criteria .= '(' . implode(' OR ', $return_sql_like) .')'; } if (count($return_sql_not_like)>0) { - $return_sql_criteria .= ' AND (' . implode (' AND ', $return_sql_not_like).')'; + $return_sql_criteria .= ' AND (' . implode(' AND ', $return_sql_not_like).')'; } - }else { + } else { $return_sql_criteria .= $column_to_test . ' LIKE \''.$this->db->escape($criteria).'\''; } diff --git a/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php b/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php index 26b16e50d68..66303647dbc 100644 --- a/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php +++ b/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2014 Florian Henry + * Copyright (C) 2019 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -43,10 +44,10 @@ class FormAdvTargetEmailing extends Form */ function __construct($db) { - global $langs; + global $langs; - $this->db = $db; - } + $this->db = $db; + } /** * Affiche un champs select contenant une liste @@ -64,7 +65,7 @@ class FormAdvTargetEmailing extends Form $sql .= " FROM " . MAIN_DB_PREFIX . "c_prospectlevel"; $sql .= " WHERE active > 0"; $sql .= " ORDER BY sortorder"; - dol_syslog (get_class($this) . '::multiselectProspectionStatus sql=' . $sql, LOG_DEBUG); + dol_syslog(get_class($this) . '::multiselectProspectionStatus sql=' . $sql, LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { $num = $this->db->num_rows($resql); @@ -83,7 +84,7 @@ class FormAdvTargetEmailing extends Form dol_print_error($this->db); } return $this->advMultiselectarray($htmlname, $options_array, $selected_array); - } + } /** * Return combo list of activated countries, into language of user @@ -120,10 +121,10 @@ class FormAdvTargetEmailing extends Form $foundselected = false; while ($i < $num) { - $obj = $this->db->fetch_object ($resql); + $obj = $this->db->fetch_object($resql); $countryArray [$i] ['rowid'] = $obj->rowid; $countryArray [$i] ['code_iso'] = $obj->code_iso; - $countryArray [$i] ['label'] = ($obj->code_iso && $langs->transnoentitiesnoconv("Country" . $obj->code_iso) != "Country" . $obj->code_iso ? $langs->transnoentitiesnoconv ("Country" . $obj->code_iso) : ($obj->label != '-' ? $obj->label : '')); + $countryArray [$i] ['label'] = ($obj->code_iso && $langs->transnoentitiesnoconv("Country" . $obj->code_iso) != "Country" . $obj->code_iso ? $langs->transnoentitiesnoconv("Country" . $obj->code_iso) : ($obj->label != '-' ? $obj->label : '')); $label[$i] = $countryArray[$i]['label']; $i ++; } @@ -143,7 +144,7 @@ class FormAdvTargetEmailing extends Form } return $this->advMultiselectarray($htmlname, $options_array, $selected_array); - } + } /** * Return select list for categories (to use in form search selectors) @@ -166,26 +167,26 @@ class FormAdvTargetEmailing extends Form $sql_usr .= " WHERE u2.entity IN (0," . $conf->entity . ")"; $sql_usr .= " AND u2.rowid = sc.fk_user "; - if (! empty ($conf->global->USER_HIDE_INACTIVE_IN_COMBOBOX)) + if (! empty($conf->global->USER_HIDE_INACTIVE_IN_COMBOBOX)) $sql_usr .= " AND u2.statut<>0 "; $sql_usr .= " ORDER BY name ASC"; // print $sql_usr;exit; - $resql_usr = $this->db->query ($sql_usr); + $resql_usr = $this->db->query($sql_usr); if ($resql_usr) { - while ( $obj_usr = $this->db->fetch_object ($resql_usr) ) { + while ( $obj_usr = $this->db->fetch_object($resql_usr) ) { $label = $obj_usr->firstname . " " . $obj_usr->name . " (" . $obj_usr->login . ')'; $options_array [$obj_usr->rowid] = $label; } - $this->db->free ($resql_usr); + $this->db->free($resql_usr); } else { - dol_print_error ($this->db); + dol_print_error($this->db); } - return $this->advMultiselectarray ($htmlname, $options_array, $selected_array); - } + return $this->advMultiselectarray($htmlname, $options_array, $selected_array); + } /** * Return select list for categories (to use in form search selectors) @@ -210,7 +211,7 @@ class FormAdvTargetEmailing extends Form } asort($options_array); return $this->advMultiselectarray($htmlname, $options_array, $selected_array); - } + } /** * Return multiselect list of entities for extrafeild type sellist @@ -227,8 +228,8 @@ class FormAdvTargetEmailing extends Form if (is_array($sqlqueryparam)) { - $param_list = array_keys ($sqlqueryparam); - $InfoFieldList = explode (":", $param_list [0]); + $param_list = array_keys($sqlqueryparam); + $InfoFieldList = explode(":", $param_list [0]); // 0 1 : tableName // 1 2 : label field name Nom du champ contenant le libelle @@ -237,8 +238,8 @@ class FormAdvTargetEmailing extends Form $keyList = 'rowid'; - if (count ($InfoFieldList) >= 3) { - if (strpos ($InfoFieldList [3], 'extra.') !== false) { + if (count($InfoFieldList) >= 3) { + if (strpos($InfoFieldList [3], 'extra.') !== false) { $keyList = 'main.' . $InfoFieldList [2] . ' as rowid'; } else { $keyList = $InfoFieldList [2] . ' as rowid'; @@ -247,10 +248,10 @@ class FormAdvTargetEmailing extends Form $sql = 'SELECT ' . $keyList . ', ' . $InfoFieldList [1]; $sql .= ' FROM ' . MAIN_DB_PREFIX . $InfoFieldList [0]; - if (! empty ($InfoFieldList [3])) { + if (! empty($InfoFieldList [3])) { // We have to join on extrafield table - if (strpos ($InfoFieldList [3], 'extra') !== false) { + if (strpos($InfoFieldList [3], 'extra') !== false) { $sql .= ' as main, ' . MAIN_DB_PREFIX . $InfoFieldList [0] . '_extrafields as extra'; $sql .= ' WHERE extra.fk_object=main.' . $InfoFieldList [2] . ' AND ' . $InfoFieldList [3]; } else { @@ -270,13 +271,13 @@ class FormAdvTargetEmailing extends Form $i = 0; if ($num) { while ( $i < $num ) { - $obj = $this->db->fetch_object ($resql); - $labeltoshow = dol_trunc ($obj->$InfoFieldList [1], 90); + $obj = $this->db->fetch_object($resql); + $labeltoshow = dol_trunc($obj->$InfoFieldList [1], 90); $options_array[$obj->rowid]=$labeltoshow; $i ++; } } - $this->db->free ($resql); + $this->db->free($resql); } } @@ -328,7 +329,7 @@ class FormAdvTargetEmailing extends Form dol_print_error($this->db); } - return $this->advMultiselectarray ($htmlname, $options_array, $selected_array); + return $this->advMultiselectarray($htmlname, $options_array, $selected_array); } /** @@ -347,7 +348,7 @@ class FormAdvTargetEmailing extends Form $form=new Form($this->db); $return = $form->multiselectarray($htmlname, $options_array, $selected_array, 0, 0, '', 0, 295); return $return; - } + } /** * Return combo list with customer categories @@ -438,19 +439,19 @@ class FormAdvTargetEmailing extends Form $sql .= " WHERE type_element='$type_element'"; $sql .= " ORDER BY c.name"; - dol_syslog (get_class ($this) . "::".__METHOD__, LOG_DEBUG); - $resql = $this->db->query ($sql); + dol_syslog(get_class($this) . "::".__METHOD__, LOG_DEBUG); + $resql = $this->db->query($sql); if ($resql) { $out .= ''; } else { - dol_print_error ($this->db); + dol_print_error($this->db); } - $this->db->free ($resql); + $this->db->free($resql); return $out; - } + } } diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 98d7e720628..c1b483efe8c 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -570,7 +570,7 @@ abstract class CommonDocGenerator 'line_multicurrency_total_ttc_locale' => price($line->multicurrency_total_ttc, 0, $outputlangs), ); - // Units + // Units if ($conf->global->PRODUCT_USE_UNITS) { $resarray['line_unit']=$outputlangs->trans($line->getLabelOfUnit('long')); @@ -882,7 +882,7 @@ abstract class CommonDocGenerator // Sorting - uasort ($this->cols, array( $this, 'columnSort' )); + uasort($this->cols, array($this, 'columnSort')); // Positionning $curX = $this->page_largeur-$this->marge_droite; // start from right @@ -945,10 +945,10 @@ abstract class CommonDocGenerator } /** - * get column content width from column key + * get column content width from column key * - * @param string $colKey the column key - * @return float width in mm + * @param string $colKey the column key + * @return float width in mm */ function getColumnContentWidth($colKey) { @@ -1025,13 +1025,13 @@ abstract class CommonDocGenerator /** - * print standard column content + * print standard column content * - * @param PDF $pdf pdf object - * @param float $curY curent Y position - * @param string $colKey the column key - * @param string $columnText column text - * @return int new rank on success and -1 on error + * @param PDF $pdf pdf object + * @param float $curY curent Y position + * @param string $colKey the column key + * @param string $columnText column text + * @return int new rank on success and -1 on error */ function printStdColumnContent($pdf, &$curY, $colKey, $columnText = '') { diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 6ea2e01fbfc..1159c74dc8d 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -228,9 +228,9 @@ class FormMail extends Form if (! empty($_SESSION["listofmimes".$keytoavoidconflict])) $listofmimes=explode(';', $_SESSION["listofmimes".$keytoavoidconflict]); if ($keytodelete >= 0) { - unset ($listofpaths[$keytodelete]); - unset ($listofnames[$keytodelete]); - unset ($listofmimes[$keytodelete]); + unset($listofpaths[$keytodelete]); + unset($listofnames[$keytodelete]); + unset($listofmimes[$keytodelete]); $_SESSION["listofpaths".$keytoavoidconflict]=join(';', $listofpaths); $_SESSION["listofnames".$keytoavoidconflict]=join(';', $listofnames); $_SESSION["listofmimes".$keytoavoidconflict]=join(';', $listofmimes); diff --git a/htdocs/core/class/smtps.class.php b/htdocs/core/class/smtps.class.php index f59ad79c430..695464f536f 100644 --- a/htdocs/core/class/smtps.class.php +++ b/htdocs/core/class/smtps.class.php @@ -655,7 +655,7 @@ class SMTPs $_retVal = true; // if we have a path... - if ( ! empty ($_strConfigPath) ) + if ( ! empty($_strConfigPath) ) { // If the path is not valid, this will NOT generate an error, // it will simply return false. @@ -989,7 +989,7 @@ class SMTPs $aryHost = $this->_msgRecipients; // Only run this if we have something - if ( !empty ($_addrList)) + if ( !empty($_addrList)) { // $_addrList can be a STRING or an array if ( is_string($_addrList) ) @@ -1409,7 +1409,7 @@ class SMTPs // If we have ZERO, we have a problem if( $keyCount === 0 ) - die ("Sorry, no content"); + die("Sorry, no content"); // If we have ONE, we can use the simple format elseif( $keyCount === 1 && empty($conf->global->MAIN_MAIL_USE_MULTI_PART)) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 45a8d5bd5c6..c541808399d 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -6610,12 +6610,12 @@ function dol_sort_array(&$array, $index, $order = 'asc', $natsort = 0, $case_sen $temp = array(); foreach(array_keys($array) as $key) $temp[$key]=$array[$key][$index]; - if (!$natsort) ($order=='asc') ? asort($temp) : arsort($temp); - else - { - ($case_sensitive) ? natsort($temp) : natcasesort($temp); - if($order!='asc') $temp=array_reverse($temp, true); - } + if (! $natsort) { + ($order=='asc') ? asort($temp) : arsort($temp); + } else { + ($case_sensitive) ? natsort($temp) : natcasesort($temp); + if($order!='asc') $temp=array_reverse($temp, true); + } $sorted = array(); diff --git a/htdocs/core/lib/functionsnumtoword.lib.php b/htdocs/core/lib/functionsnumtoword.lib.php index 7f4d44f73f6..6481604ff64 100644 --- a/htdocs/core/lib/functionsnumtoword.lib.php +++ b/htdocs/core/lib/functionsnumtoword.lib.php @@ -38,10 +38,10 @@ function dol_convertToWord($num, $langs, $currency = false, $centimes = false) global $conf; $num = str_replace(array(',', ' '), '', trim($num)); - if(! $num) { + if (! $num) { return false; } - if($centimes && strlen($num) == 1) { + if ($centimes && strlen($num) == 1) { $num = $num*10; } $TNum = explode('.', $num); @@ -151,7 +151,7 @@ function dolNumberToWord($numero, $langs, $numorcurrency = 'number') if ($numero >= 1000000000001) return -1; // Get 2 decimals to cents, another functions round or truncate - $strnumber = number_format ($numero, 10); + $strnumber = number_format($numero, 10); $len=strlen($strnumber); for ($i=0; $i<$len; $i++) { @@ -187,7 +187,7 @@ function dolNumberToWord($numero, $langs, $numorcurrency = 'number') $numero = $numero - $DdMMillon * 10000000000; $UdMMillon = (int) ($numero / 1000000000); $numero = $numero - $UdMMillon * 1000000000; - $entexto .= hundreds2text ($CdMMillon, $DdMMillon, $UdMMillon); + $entexto .= hundreds2text($CdMMillon, $DdMMillon, $UdMMillon); $entexto .= " MIL "; } if ($number >= 1000000){ @@ -197,7 +197,7 @@ function dolNumberToWord($numero, $langs, $numorcurrency = 'number') $numero = $numero - $DdMILLON * 10000000; $udMILLON = (int) ($numero / 1000000); $numero = $numero - $udMILLON * 1000000; - $entexto .= hundreds2text ($CdMILLON, $DdMILLON, $udMILLON); + $entexto .= hundreds2text($CdMILLON, $DdMILLON, $udMILLON); if (!$CdMMillon && !$DdMMillon && !$UdMMillon && !$CdMILLON && !$DdMILLON && $udMILLON==1) $entexto .= " MILLÓN "; else @@ -210,7 +210,7 @@ function dolNumberToWord($numero, $langs, $numorcurrency = 'number') $numero = $numero - $ddm * 10000; $udm = (int) ($numero / 1000); $numero = $numero - $udm * 1000; - $entexto .= hundreds2text ($cdm, $ddm, $udm); + $entexto .= hundreds2text($cdm, $ddm, $udm); if ($cdm || $ddm || $udm) $entexto .= " MIL "; } @@ -218,7 +218,7 @@ function dolNumberToWord($numero, $langs, $numorcurrency = 'number') $numero = $numero - $c * 100; $d = (int) ($numero / 10); $u = (int) $numero - $d * 10; - $entexto .= hundreds2text ($c, $d, $u); + $entexto .= hundreds2text($c, $d, $u); if (!$cdm && !$ddm && !$udm && !$c && !$d && !$u && $number>1000000) $entexto .= " DE"; $entexto .= " PESOS ".$parte_decimal." / 100 M.N."; diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 5a7b7ff2e42..4886d5c5086 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -121,7 +121,7 @@ if (empty($reshook)) { $action = ''; $object->fetch($id); // show shipment also after canceling modification - } + } include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once @@ -784,8 +784,7 @@ if (empty($reshook)) $stockLocation="entl".$detail_entrepot->line_id; $qty = "qtyl".$detail_entrepot->line_id; $warehouse = GETPOST($stockLocation, 'int'); - if (!empty ($warehouse)) - { + if (!empty($warehouse)) { $line->id = $detail_entrepot->line_id; $line->entrepot_id = $warehouse; $line->qty = GETPOST($qty, 'int'); @@ -800,8 +799,9 @@ if (empty($reshook)) } } } - else // Product no predefined + else { + // Product no predefined $qty = "qtyl".$line_id; $line->id = $line_id; $line->qty = GETPOST($qty, 'int'); diff --git a/htdocs/fourn/class/api_supplier_invoices.class.php b/htdocs/fourn/class/api_supplier_invoices.class.php index 69e6ff160dc..4391d14ea3c 100644 --- a/htdocs/fourn/class/api_supplier_invoices.class.php +++ b/htdocs/fourn/class/api_supplier_invoices.class.php @@ -185,8 +185,8 @@ class SupplierInvoices extends DolibarrApi function post($request_data = null) { if(! DolibarrApiAccess::$user->rights->fournisseur->facture->creer) { - throw new RestException(401, "Insuffisant rights"); - } + throw new RestException(401, "Insuffisant rights"); + } // Check mandatory fields $result = $this->_validate($request_data); @@ -221,8 +221,8 @@ class SupplierInvoices extends DolibarrApi function put($id, $request_data = null) { if(! DolibarrApiAccess::$user->rights->fournisseur->facture->creer) { - throw new RestException(401); - } + throw new RestException(401); + } $result = $this->invoice->fetch($id); if( ! $result ) { @@ -239,7 +239,7 @@ class SupplierInvoices extends DolibarrApi } if($this->invoice->update($id, DolibarrApiAccess::$user)) - return $this->get ($id); + return $this->get($id); return false; } @@ -253,8 +253,8 @@ class SupplierInvoices extends DolibarrApi function delete($id) { if(! DolibarrApiAccess::$user->rights->fournisseur->facture->supprimer) { - throw new RestException(401); - } + throw new RestException(401); + } $result = $this->invoice->fetch($id); if( ! $result ) { throw new RestException(404, 'Supplier invoice not found'); @@ -306,9 +306,9 @@ class SupplierInvoices extends DolibarrApi throw new RestException(404, 'Invoice not found'); } - if( ! DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) { - throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); - } + if( ! DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) { + throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + } $result = $this->invoice->validate(DolibarrApiAccess::$user, '', $idwarehouse, $notrigger); if ($result == 0) { diff --git a/htdocs/fourn/class/api_supplier_orders.class.php b/htdocs/fourn/class/api_supplier_orders.class.php index b48635d3fd1..38c9ab9e200 100644 --- a/htdocs/fourn/class/api_supplier_orders.class.php +++ b/htdocs/fourn/class/api_supplier_orders.class.php @@ -190,8 +190,8 @@ class SupplierOrders extends DolibarrApi function post($request_data = null) { if(! DolibarrApiAccess::$user->rights->fournisseur->commande->creer) { - throw new RestException(401, "Insuffisant rights"); - } + throw new RestException(401, "Insuffisant rights"); + } // Check mandatory fields $result = $this->_validate($request_data); @@ -226,8 +226,8 @@ class SupplierOrders extends DolibarrApi function put($id, $request_data = null) { if(! DolibarrApiAccess::$user->rights->fournisseur->commande->creer) { - throw new RestException(401); - } + throw new RestException(401); + } $result = $this->order->fetch($id); if( ! $result ) { @@ -244,7 +244,7 @@ class SupplierOrders extends DolibarrApi } if($this->order->update($id, DolibarrApiAccess::$user)) - return $this->get ($id); + return $this->get($id); return false; } @@ -257,20 +257,19 @@ class SupplierOrders extends DolibarrApi */ function delete($id) { - if(! DolibarrApiAccess::$user->rights->fournisseur->commande->supprimer) { - throw new RestException(401); - } + if (! DolibarrApiAccess::$user->rights->fournisseur->commande->supprimer) { + throw new RestException(401); + } $result = $this->order->fetch($id); - if( ! $result ) { + if ( ! $result) { throw new RestException(404, 'Supplier order not found'); } - if( ! DolibarrApi::_checkAccessToResource('fournisseur', $this->order->id, '', 'commande')) { + if ( ! DolibarrApi::_checkAccessToResource('fournisseur', $this->order->id, '', 'commande')) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } - if( $this->order->delete(DolibarrApiAccess::$user) < 0) - { + if ( $this->order->delete(DolibarrApiAccess::$user) < 0) { throw new RestException(500); } diff --git a/htdocs/opensurvey/wizard/choix_date.php b/htdocs/opensurvey/wizard/choix_date.php index 93e3d1128e2..8840da3f3e7 100644 --- a/htdocs/opensurvey/wizard/choix_date.php +++ b/htdocs/opensurvey/wizard/choix_date.php @@ -1,6 +1,6 @@ - * Copyright (C) 2014 Marcos García +/* Copyright (C) 2013 Laurent Destailleur + * Copyright (C) 2014 Marcos García * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -448,7 +448,7 @@ if (issetAndNoEmpty('reporterhoraires')) { if (issetAndNoEmpty('resethoraires')) { $nbofchoice=count($_SESSION["totalchoixjour"]); for ($i = 0; $i < $nbofchoice; $i++) { - unset ($_SESSION["horaires$i"]); + unset($_SESSION["horaires$i"]); } } @@ -484,7 +484,8 @@ for ($i = 0; $i < $nbrejourmois + $premierjourmois; $i++) { //bouton vert if (($numerojour >= $jourAJ && $_SESSION["mois"] == $moisAJ && $_SESSION["annee"] == $anneeAJ) || ($_SESSION["mois"] > $moisAJ && $_SESSION["annee"] == $anneeAJ) || $_SESSION["annee"] > $anneeAJ) { print ''.$numerojour.'
'.$langs->trans('TotalTTC').''.price($sign * price2num($total_ttc - $totalrecu - $totalrecucreditnote - $totalrecudeposits, 'MT')).'