From 9aca86d16a3c9f7348c2f76ce8be391777b354ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 22 Nov 2024 00:39:22 +0100 Subject: [PATCH 01/11] fix phpstan (#32049) * fix phpstan * refix --- htdocs/adherents/stats/geo.php | 2 ++ htdocs/core/class/commonpeople.class.php | 30 ++++++++++++++---------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/htdocs/adherents/stats/geo.php b/htdocs/adherents/stats/geo.php index 3f0ebd040f2..8e5362fdeec 100644 --- a/htdocs/adherents/stats/geo.php +++ b/htdocs/adherents/stats/geo.php @@ -95,6 +95,7 @@ print load_fiche_titre($title, '', $memberstatic->picto); //dol_mkdir($dir); $data = array(); $tab = null; +$label = ''; if ($mode) { // Define sql @@ -263,6 +264,7 @@ if ($mode && !count($data)) { // Show graphics if (count($arrayjs) && $mode == 'memberbycountry') { + global $theme_bordercolor, $theme_datacolor, $theme_bgcolor, $theme_bgcoloronglet; $color_file = DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php'; if (is_readable($color_file)) { include $color_file; diff --git a/htdocs/core/class/commonpeople.class.php b/htdocs/core/class/commonpeople.class.php index b71925e0b9a..9d80dbdd518 100644 --- a/htdocs/core/class/commonpeople.class.php +++ b/htdocs/core/class/commonpeople.class.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2023-2024 Frédéric France * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -152,9 +152,9 @@ trait CommonPeople /** * Return full address for banner * - * @param string $htmlkey HTML id to make banner content unique - * @param Object $object Object (thirdparty, thirdparty of contact for contact, null for a member) - * @return string Full address string + * @param string $htmlkey HTML id to make banner content unique + * @param CommonObject $object Object (thirdparty, thirdparty of contact for contact, null for a member) + * @return string Full address string */ public function getBannerAddress($htmlkey, $object) { @@ -165,20 +165,24 @@ trait CommonPeople $contactid = 0; $thirdpartyid = 0; $elementforaltlanguage = $this->element; - if ($this instanceOf Societe && $this->element === 'societe') { - /** @var Societe $this */ + if ($this->element === 'societe' && $this instanceof Societe) { $thirdpartyid = $this->id; } - if ($this instanceOf Contact && $this->element === 'contact') { - /** @var Contact $this */ + if ($this->element === 'contact' && $this instanceof Contact) { $contactid = $this->id; $thirdpartyid = empty($this->fk_soc) ? 0 : $this->fk_soc; } - if ($this instanceOf User && $this->element === 'user') { - /** @var User $this */ + if ($this->element == 'member' && $this instanceof Adherent) { + $contactid = $this->id; + $thirdpartyid = empty($this->socid) ? 0 : $this->socid; + } + if ($this->element === 'user' && $this instanceof User) { $contactid = $this->contact_id; $thirdpartyid = empty($object->fk_soc) ? 0 : $object->fk_soc; } + if ($this->element == 'recruitmentcandidature' && $this instanceof RecruitmentCandidature) { + $thirdpartyid = 0; + } $out = ''; @@ -210,7 +214,7 @@ trait CommonPeople $arrayoflangcode[] = getDolGlobalString('PDF_USE_ALSO_LANGUAGE_CODE'); } - if (is_array($arrayoflangcode) && count($arrayoflangcode)) { + if (/* is_array($arrayoflangcode) && */count($arrayoflangcode)) { if (!is_object($extralanguages)) { include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php'; $extralanguages = new ExtraLanguages($this->db); @@ -258,7 +262,7 @@ trait CommonPeople // Phones $outphonedone = 0; if (!empty($this->phone) && empty($this->phone_pro)) { // For objects that store pro phone into ->phone - $out .= ($outphonedone ? ' ' : ''); + // $out .= ($outphonedone ? ' ' : ''); $out .= dol_print_phone($this->phone, $this->country_code, $contactid, $thirdpartyid, 'AC_TEL', ' ', 'phone', $langs->trans("PhonePro")); $outdone++; $outphonedone++; @@ -387,7 +391,7 @@ trait CommonPeople $this->address = dol_strtoupper($this->address); $this->town = dol_strtoupper($this->town); } - if (isset($this->email)) { + if (!empty($this->email)) { $this->email = dol_strtolower($this->email); } if (isset($this->personal_email)) { From e12fdfb55039440502ed3128402a97c722760c86 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 22 Nov 2024 02:56:17 +0100 Subject: [PATCH 02/11] Add language file for tunisia --- htdocs/langs/en_US/sendings.lang | 2 +- htdocs/langs/fr_TN/main.lang | 31 +++++++++++++++++++++++++++++++ htdocs/langs/fr_TN/sendings.lang | 2 ++ 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 htdocs/langs/fr_TN/main.lang create mode 100644 htdocs/langs/fr_TN/sendings.lang diff --git a/htdocs/langs/en_US/sendings.lang b/htdocs/langs/en_US/sendings.lang index eb9c16239cc..a9bb15faf5f 100644 --- a/htdocs/langs/en_US/sendings.lang +++ b/htdocs/langs/en_US/sendings.lang @@ -14,7 +14,7 @@ LastSendings=Latest %s shipments StatisticsOfSendings=Statistics for shipments NbOfSendings=Number of shipments NumberOfShipmentsByMonth=Number of shipments by month -SendingCard=Shipment card +SendingCard=Shipment NewSending=New shipment CreateShipment=Create shipment QtyShipped=Qty shipped diff --git a/htdocs/langs/fr_TN/main.lang b/htdocs/langs/fr_TN/main.lang new file mode 100644 index 00000000000..ae3db1eeb17 --- /dev/null +++ b/htdocs/langs/fr_TN/main.lang @@ -0,0 +1,31 @@ +# Dolibarr language file - Source file is en_US - main +DIRECTION=ltr +# Default for FONTFORPDF=helvetica +# Note for Chinese: +# msungstdlight or cid0ct are for traditional Chinese zh_TW (traditional does not render with Ubuntu pdf reader) +# stsongstdlight or cid0cs are for simplified Chinese zh_CN +# To read Chinese pdf with Linux: sudo apt-get install poppler-data +# cid0jp is for Japanish +# cid0kr is for Korean +# DejaVuSans is for some Eastern languages, some Asian languages and some Arabic languages +# freemono is for ru_RU or uk_UA, uz_UZ +# freeserif is for Tamil or Ethiopian +FONTFORPDF=helvetica +FONTSIZEFORPDF=10 +SeparatorDecimal=, +SeparatorThousand=Space +FormatDateShort=%d/%m/%Y +FormatDateShortInput=%d/%m/%Y +FormatDateShortJava=dd/MM/yyyy +FormatDateShortJavaInput=dd/MM/yyyy +FormatDateShortJQuery=dd/mm/yy +FormatDateShortJQueryInput=dd/mm/yy +FormatHourShortJQuery=HH:MI +FormatHourShort=%H:%M +FormatHourShortDuration=%H:%M +FormatDateTextShort=%d %b %Y +FormatDateText=%d %B %Y +FormatDateHourShort=%d/%m/%Y %H:%M +FormatDateHourSecShort=%d/%m/%Y %H:%M:%S +FormatDateHourTextShort=%d %b %Y %H:%M +FormatDateHourText=%d %B %Y %H:%M diff --git a/htdocs/langs/fr_TN/sendings.lang b/htdocs/langs/fr_TN/sendings.lang new file mode 100644 index 00000000000..776063f7602 --- /dev/null +++ b/htdocs/langs/fr_TN/sendings.lang @@ -0,0 +1,2 @@ +# Dolibarr language file - Source file is en_US - sendings +SendingCard=Bon livraison From 6d6335ccf35984853c60900641b6b6b5405d9095 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 22 Nov 2024 02:57:40 +0100 Subject: [PATCH 03/11] Add french tunisia language --- htdocs/langs/en_US/languages.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/languages.lang b/htdocs/langs/en_US/languages.lang index 6afa486d033..4ea49a160fa 100644 --- a/htdocs/langs/en_US/languages.lang +++ b/htdocs/langs/en_US/languages.lang @@ -72,6 +72,7 @@ Language_fr_FR=French Language_fr_GA=French (Gabon) Language_fr_NC=French (New Caledonia) Language_fr_SN=French (Senegal) +Language_fr_TN=French (Tunisia) Language_fy_NL=Frisian Language_gl_ES=Galician Language_he_IL=Hebrew From c4b34dd8f74973b0ecc2d1fc6ddb820c2130626d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 22 Nov 2024 09:00:28 +0100 Subject: [PATCH 04/11] Clean code --- htdocs/expedition/list.php | 8 +++----- htdocs/langs/en_US/receptions.lang | 1 - htdocs/langs/en_US/sendings.lang | 1 - htdocs/reception/list.php | 8 ++++---- 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index e2cbfed00c5..b45450396bc 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -669,7 +669,7 @@ $companystatic = new Societe($db); $formcompany = new FormCompany($db); $shipment = new Expedition($db); -$title = $langs->trans('ListOfSendings'); +$title = $langs->trans('Shipments'); $help_url = 'EN:Module_Shipments|FR:Module_Expéditions|ES:Módulo_Expediciones'; llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'bodyforlist mod-expedition page-list'); @@ -934,8 +934,6 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $ exit; } -$expedition = new Expedition($db); - if ($socid > 0) { $soc = new Societe($db); $soc->fetch($socid); @@ -1074,7 +1072,7 @@ print ''; print ''; // @phan-suppress-next-line PhanPluginSuspiciousParamOrder -print_barre_liste($langs->trans('ListOfSendings'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'dolly', 0, $newcardbutton, '', $limit, 0, 0, 1); +print_barre_liste($langs->trans('Shipments'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'dolly', 0, $newcardbutton, '', $limit, 0, 0, 1); $topicmail = "SendShippingRef"; $modelmail = "shipping_send"; @@ -1085,7 +1083,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; if ($massaction == 'createbills') { print ''; - print ''; + print '
'; print ''; print '
'; print $langs->trans('DateInvoice'); diff --git a/htdocs/langs/en_US/receptions.lang b/htdocs/langs/en_US/receptions.lang index 80e9724b3b4..34b2276fca7 100644 --- a/htdocs/langs/en_US/receptions.lang +++ b/htdocs/langs/en_US/receptions.lang @@ -7,7 +7,6 @@ Receptions=Receptions AllReceptions=All Receptions ShowReception=Show Receptions ReceptionsArea=Receptions area -ListOfReceptions=List of receptions ReceptionMethod=Reception method LastReceptions=Latest %s receptions StatisticsOfReceptions=Statistics for receptions diff --git a/htdocs/langs/en_US/sendings.lang b/htdocs/langs/en_US/sendings.lang index a9bb15faf5f..95406dcc87e 100644 --- a/htdocs/langs/en_US/sendings.lang +++ b/htdocs/langs/en_US/sendings.lang @@ -8,7 +8,6 @@ Shipments=Shipments ShowSending=Show Shipments Receivings=Delivery Receipts SendingsArea=Shipments area -ListOfSendings=List of shipments SendingMethod=Shipping method LastSendings=Latest %s shipments StatisticsOfSendings=Statistics for shipments diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php index b8801e6a26d..e50ffb1e687 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -608,9 +608,9 @@ $reception = new Reception($db); $formcompany = new FormCompany($db); $formfile = new FormFile($db); - +$title = $langs->trans('Receptions'); $helpurl = 'EN:Module_Receptions|FR:Module_Receptions|ES:Módulo_Receptiones'; -llxHeader('', $langs->trans('ListOfReceptions'), $helpurl, '', 0, 0, '', '', '', 'bodyforlist mod-reception page-list'); +llxHeader('', $title, $helpurl, '', 0, 0, '', '', '', 'bodyforlist mod-reception page-list'); $sql = "SELECT e.rowid, e.ref, e.ref_supplier, e.date_reception as date_reception, e.date_delivery as delivery_date, l.date_delivery as date_reception2, e.fk_statut as status, e.billed,"; $sql .= " s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client,"; @@ -906,13 +906,13 @@ print ''; print ''; // @phan-suppress-next-line PhanPluginSuspiciousParamOrder -print_barre_liste($langs->trans('ListOfReceptions'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'dollyrevert', 0, $newcardbutton, '', $limit, 0, 0, 1); +print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'dollyrevert', 0, $newcardbutton, '', $limit, 0, 0, 1); if ($massaction == 'createbills') { //var_dump($_REQUEST); print ''; - print ''; + print '
'; print ''; print ' Date: Fri, 22 Nov 2024 10:53:08 +0100 Subject: [PATCH 06/11] Debug v21 --- htdocs/core/class/html.form.class.php | 4 ++-- htdocs/langs/en_US/products.lang | 1 - htdocs/langs/en_US/stocks.lang | 3 --- htdocs/product/admin/product.php | 3 +++ htdocs/product/stats/card.php | 2 +- htdocs/product/stock/movement_card.php | 2 +- htdocs/product/stock/movement_list.php | 8 ++++---- 7 files changed, 11 insertions(+), 12 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index e61568e6209..d27e941d1e6 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2767,9 +2767,9 @@ class Form } if (empty($hidelabel)) { - $out .= $langs->trans("RefOrLabel") . ' : '; + $placeholder = ' placeholder="' . dolPrintHTMLForAttribute($langs->trans("RefOrLabel")) . '"'; } elseif ($hidelabel > 1) { - $placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"'; + $placeholder = ' placeholder="' . dolPrintHTMLForAttribute($langs->trans("RefOrLabel")) . '"'; if ($hidelabel == 2) { $out .= img_picto($langs->trans("Search"), 'search'); } diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index c3b29b9751b..2d8d05e9761 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -97,7 +97,6 @@ ShowService=Show service ProductsAndServicesArea=Product and Services area ProductsArea=Product area ServicesArea=Services area -ListOfStockMovements=List of stock movements BuyingPrice=Buying price PriceForEachProduct=Products with specific prices SupplierCard=Vendor card diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index 0648dde54b4..9b651192a6b 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -27,9 +27,6 @@ LotSerialList=List of lot/serials SubjectToLotSerialOnly=Products subject to lot/serial only Movements=Movements ErrorWarehouseRefRequired=Warehouse reference name is required -ListOfWarehouses=List of warehouses -ListOfStockMovements=List of stock movements -ListOfInventories=List of inventories MovementId=Movement ID StockMovementForId=Movement ID %d ListMouvementStockProject=List of stock movements associated to project diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php index ea093c7885a..3d7e56c8de8 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -650,6 +650,9 @@ print ''; +print '
'; + + print load_fiche_titre($langs->trans("UserInterface"), '', ''); diff --git a/htdocs/product/stats/card.php b/htdocs/product/stats/card.php index a0d2cf1a04a..f2708e0df27 100644 --- a/htdocs/product/stats/card.php +++ b/htdocs/product/stats/card.php @@ -217,7 +217,7 @@ if ($result || !($id > 0)) { // Product print ''; // Tag diff --git a/htdocs/product/stock/movement_card.php b/htdocs/product/stock/movement_card.php index f76a30f674a..9c81e707e3d 100644 --- a/htdocs/product/stock/movement_card.php +++ b/htdocs/product/stock/movement_card.php @@ -560,7 +560,7 @@ if ($resql) { if ($msid) { $texte = $langs->trans('StockMovementForId', $msid); } else { - $texte = $langs->trans("ListOfStockMovements"); + $texte = $langs->trans("StockMovements"); if ($id) { $texte .= ' ('.$langs->trans("ForThisWarehouse").')'; } diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index a8ecbeacf72..86986da7ed4 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -832,7 +832,7 @@ $help_url = 'EN:Module_Stocks_En|FR:Module_Stock|ES:Módulo_Stocks'; if ($msid) { $title = $langs->trans('StockMovementForId', $msid); } else { - $title = $langs->trans("ListOfStockMovements"); + $title = $langs->trans("StockMovements"); if ($id) { if (!empty($warehouse->ref)) { $title .= ' ('.$warehouse->ref.')'; @@ -1236,7 +1236,7 @@ if (!empty($arrayfields['pl.sellby']['checked'])) { if (!empty($arrayfields['e.ref']['checked'])) { print ''; } if (!empty($arrayfields['m.fk_user_author']['checked'])) { @@ -1564,7 +1564,7 @@ while ($i < $imaxinloop) { } // Warehouse if (!empty($arrayfields['e.ref']['checked'])) { - print '\n"; } @@ -1591,7 +1591,7 @@ while ($i < $imaxinloop) { if (!empty($arrayfields['origin']['checked'])) { print ''; } - // fk_project + // Project if (!empty($arrayfields['m.fk_projet']['checked'])) { print ''; - print '\n"; } diff --git a/htdocs/takepos/admin/setup.php b/htdocs/takepos/admin/setup.php index f17607e7e74..a1e33ab79a0 100644 --- a/htdocs/takepos/admin/setup.php +++ b/htdocs/takepos/admin/setup.php @@ -278,7 +278,7 @@ print "\n"; print '\n"; // Services diff --git a/htdocs/takepos/floors.php b/htdocs/takepos/floors.php index 43a1cab18a6..540244d87d6 100644 --- a/htdocs/takepos/floors.php +++ b/htdocs/takepos/floors.php @@ -59,7 +59,7 @@ $action = GETPOST('action', 'aZ09'); $left = GETPOST('left', 'alpha'); $top = GETPOST('top', 'alpha'); -$place = (GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : 0); // $place is id of table for Ba or Restaurant +$place = (GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : 0); // $place is id of table for Bar or Restaurant $newname = GETPOST('newname', 'alpha'); $mode = GETPOST('mode', 'alpha'); @@ -74,15 +74,22 @@ if (!$user->hasRight('takepos', 'run')) { */ if ($action == "getTables" && $user->hasRight('takepos', 'run')) { - $sql = "SELECT rowid, entity, label, leftpos, toppos, floor FROM ".MAIN_DB_PREFIX."takepos_floor_tables WHERE floor = ".((int) $floor)." AND entity IN (".getEntity('takepos').")"; - $resql = $db->query($sql); $rows = array(); + + $sql = "SELECT rowid, entity, label, leftpos, toppos, floor"; + $sql .= " FROM ".MAIN_DB_PREFIX."takepos_floor_tables"; + $sql .= " WHERE floor = ".((int) $floor)." AND entity IN (".getEntity('takepos').")"; + + $resql = $db->query($sql); while ($row = $db->fetch_array($resql)) { + $tmpplace = (int) $row['rowid']; + $invoice = new Facture($db); - $result = $invoice->fetch('', '(PROV-POS'.$_SESSION['takeposterminal'].'-'.$row['rowid'].')'); + $result = $invoice->fetch('', '(PROV-POS'.$_SESSION['takeposterminal'].'-'.$tmpplace.')'); if ($result > 0) { $row['occupied'] = "red"; } + $rows[] = $row; } diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 8f3259b46c0..4a7f4eebfe4 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -624,7 +624,9 @@ if (empty($reshook)) { if ($placeid < 0) { dol_htmloutput_errors($invoice->error, $invoice->errors, 1); } - $sql = "UPDATE ".MAIN_DB_PREFIX."facture set ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")' where rowid = ".((int) $placeid); + $sql = "UPDATE ".MAIN_DB_PREFIX."facture"; + $sql .= " SET ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")'"; + $sql .= " WHERE rowid = ".((int) $placeid); $resql = $db->query($sql); if (!$resql) { $error++; @@ -898,7 +900,7 @@ if (empty($reshook)) { if ($invoice->status == $invoice::STATUS_DRAFT && $invoice->pos_source && $invoice->module_source == 'takepos') { $permissiontoupdateline = true; // TODO Add also a test on $_SESSION('publicobjectid'] defined at creation of object - // TODO Check also that invoice->ref is (PROV-POS1-2) with 1 = terminal and 2, the invoice ID + // TODO Check also that invoice->ref is (PROV-POS1-2) with 1 = terminal and 2, the table ID } }*/ @@ -928,11 +930,12 @@ if (empty($reshook)) { // Action to delete or discard an invoice if ($action == "delete" && ($user->hasRight('takepos', 'run') || defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE'))) { - // $placeid is the invoice id (it differs from place) and is defined if the place is set and the ref of invoice is '(PROV-POS'.$_SESSION["takeposterminal"].'-'.$place.')', so the fetch at beginning of page works. + // $placeid is the invoice id (it differs from place) and is defined if the place is set and + // the ref of invoice is '(PROV-POS'.$_SESSION["takeposterminal"].'-'.$place.')', so the fetch at beginning of page works. if ($placeid > 0) { $result = $invoice->fetch($placeid); - if ($result > 0 && $invoice->statut == Facture::STATUS_DRAFT) { + if ($result > 0 && $invoice->status == Facture::STATUS_DRAFT) { $db->begin(); // We delete the lines @@ -973,7 +976,7 @@ if (empty($reshook)) { if ($invoice->status == $invoice::STATUS_DRAFT && $invoice->pos_source && $invoice->module_source == 'takepos') { $permissiontoupdateline = true; // TODO Add also a test on $_SESSION('publicobjectid'] defined at creation of object - // TODO Check also that invoice->ref is (PROV-POS1-2) with 1 = terminal and 2, the invoice ID + // TODO Check also that invoice->ref is (PROV-POS1-2) with 1 = terminal and 2, the table ID } } if (!$permissiontoupdateline) { @@ -1023,7 +1026,7 @@ if (empty($reshook)) { if ($invoice->status == $invoice::STATUS_DRAFT && $invoice->pos_source && $invoice->module_source == 'takepos') { $permissiontoupdateline = true; // TODO Add also a test on $_SESSION('publicobjectid'] defined at creation of object - // TODO Check also that invoice->ref is (PROV-POS1-2) with 1 = terminal and 2, the invoice ID + // TODO Check also that invoice->ref is (PROV-POS1-2) with 1 = terminal and 2, the table ID } } @@ -1074,7 +1077,7 @@ if (empty($reshook)) { if ($invoice->status == $invoice::STATUS_DRAFT && $invoice->pos_source && $invoice->module_source == 'takepos') { $permissiontoupdateline = true; // TODO Add also a test on $_SESSION('publicobjectid'] defined at creation of object - // TODO Check also that invoice->ref is (PROV-POS1-2) with 1 = terminal and 2, the invoice ID + // TODO Check also that invoice->ref is (PROV-POS1-2) with 1 = terminal and 2, the table ID } } if (!$permissiontoupdateline) { diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php index be9db4bb922..f60e08dd546 100644 --- a/htdocs/takepos/pay.php +++ b/htdocs/takepos/pay.php @@ -187,7 +187,7 @@ if ($usestripeterminals && $invoice->type != $invoice::TYPE_CREDIT_NOTE) { if (!getDolGlobalString($keyforstripeterminalbank)) { ?> const config = { simulated: true false - , location: 'global->STRIPE_LOCATION; ?>' + , location: '' } terminal.discoverReaders(config).then(function(discoverResult) { if (discoverResult.error) { @@ -233,8 +233,8 @@ if ($usestripeterminals && $invoice->type != $invoice::TYPE_CREDIT_NOTE) { total_ttc; ?>); - if (alreadypaydplusreceived > total_ttc; ?>) + //console.log("total_ttc = "+total_ttc; ?>); + if (alreadypaydplusreceived > total_ttc; ?>) { - var change=parseFloat(alreadypayed + parseFloat(received) - total_ttc; ?>); + var change=parseFloat(alreadypayed + parseFloat(received) - total_ttc; ?>); $('.change2').html(pricejs(change, 'MT')); $('.change2').val(change); $('.change1').removeClass('colorred'); @@ -439,7 +439,7 @@ if (!getDolGlobalInt("TAKEPOS_NUMPAD")) { fetchPaymentIntentClientSecret(amountpayed, invoiceid).then(function(client_secret) { - terminal.setSimulatorConfiguration({testCardNumber: 'global->STRIPE_TERMINAL_SIMULATED; ?>'}); + terminal.setSimulatorConfiguration({testCardNumber: ''}); document.getElementById("card-present-alert").innerHTML = '
trans('PaymentSendToStripeTerminal'); ?>
'; terminal.collectPaymentMethod(client_secret).then(function(result) { diff --git a/htdocs/takepos/receipt.php b/htdocs/takepos/receipt.php index 881c8bd16e5..8427e5b7b6c 100644 --- a/htdocs/takepos/receipt.php +++ b/htdocs/takepos/receipt.php @@ -78,8 +78,11 @@ if (!$user->hasRight('takepos', 'run')) { top_htmlhead('', '', 1); -if ($place > 0) { - $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS".$db->escape($_SESSION["takeposterminal"]."-".$place).")'"; +if ((string) $place != '') { + $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture"; + $sql .= " WHERE ref = '(PROV-POS".$db->escape($_SESSION["takeposterminal"]."-".$place).")'"; + $sql .= " AND entity IN (".getEntity('invoice').")"; + $resql = $db->query($sql); $obj = $db->fetch_object($resql); if ($obj) { diff --git a/htdocs/takepos/reduction.php b/htdocs/takepos/reduction.php index 047fb89610c..b6eab6d8343 100644 --- a/htdocs/takepos/reduction.php +++ b/htdocs/takepos/reduction.php @@ -69,7 +69,10 @@ $invoice = new Facture($db); if ($invoiceid > 0) { $invoice->fetch($invoiceid); } else { - $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")'"; + $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture"; + $sql .= " WHERE ref = '(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")'"; + $sql .= " AND entity IN (".getEntity('invoice').")"; + $resql = $db->query($sql); $obj = $db->fetch_object($resql); if ($obj) { diff --git a/htdocs/takepos/split.php b/htdocs/takepos/split.php index 7f6796db0b0..8fadea69c95 100644 --- a/htdocs/takepos/split.php +++ b/htdocs/takepos/split.php @@ -62,7 +62,7 @@ if (!$user->hasRight('takepos', 'run')) { * Actions */ -if ($action=="split" && $user->hasRight('takepos', 'run')) { +if ($action == "split" && $user->hasRight('takepos', 'run')) { $line = GETPOSTINT('line'); $split = GETPOSTINT('split'); if ($split==1) { // Split line @@ -85,16 +85,17 @@ if ($action=="split" && $user->hasRight('takepos', 'run')) { if ($placeid < 0) { dol_htmloutput_errors($invoice->error, $invoice->errors, 1); } - $sql = "UPDATE ".MAIN_DB_PREFIX."facture set ref='(PROV-POS".$_SESSION["takeposterminal"]."-SPLIT)' where rowid=".$placeid; + $sql = "UPDATE ".MAIN_DB_PREFIX."facture SET ref='(PROV-POS".$_SESSION["takeposterminal"]."-SPLIT)'"; + $sql .= " WHERE rowid = ".((int) $placeid); $db->query($sql); } } - $sql = "UPDATE ".MAIN_DB_PREFIX."facturedet set fk_facture=".$placeid." where rowid=".$line; + $sql = "UPDATE ".MAIN_DB_PREFIX."facturedet SET fk_facture = ".((int) $placeid)." WHERE rowid = ".((int) $line); $db->query($sql); } elseif ($split==0) { // Unsplit line $invoice = new Facture($db); - if ($place=="SPLIT") { - $place="0"; + if ($place == "SPLIT") { + $place = "0"; } // Avoid move line to the same place (from SPLIT to SPLIT place) $ret = $invoice->fetch('', '(PROV-POS'.$_SESSION["takeposterminal"].'-'.$place.')'); if ($ret > 0) { @@ -114,7 +115,9 @@ if ($action=="split" && $user->hasRight('takepos', 'run')) { if ($placeid < 0) { dol_htmloutput_errors($invoice->error, $invoice->errors, 1); } - $sql = "UPDATE ".MAIN_DB_PREFIX."facture set ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")' where rowid=".$placeid; + + $sql = "UPDATE ".MAIN_DB_PREFIX."facture SET ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")'"; + $sql .= " WHERE rowid = ".((int) $placeid); $db->query($sql); } } @@ -123,6 +126,7 @@ if ($action=="split" && $user->hasRight('takepos', 'run')) { } $invoice->fetch('', '(PROV-POS'.$_SESSION["takeposterminal"].'-SPLIT)'); $invoice->update_price(); + $invoice->fetch('', '(PROV-POS'.$_SESSION["takeposterminal"].'-'.$place.')'); $invoice->update_price(); } diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 374537924e1..774f134dc0a 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -5363,7 +5363,7 @@ img.boxhandle, img.boxclose { .add-filter-btn { margin: 0 !important; } -.search-component-assistance .operand, .operator, .value { +.search-component-assistance .operand, .search-component-assistance .operator, .search-component-assistance .value { display: contents; } .search-component-assistance .btn-div{ diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 1327a739682..4a2ee8d9890 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -5352,7 +5352,7 @@ img.boxhandle, img.boxclose { .add-filter-btn { margin: 0 !important; } -.search-component-assistance .operand, .operator, .value { +.search-component-assistance .operand, .search-component-assistance .operator, .search-component-assistance .value { display: contents; } .search-component-assistance .btn-div{ From ef714b23c0247b26cf0b164d776b880978d4dac2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 22 Nov 2024 12:29:00 +0100 Subject: [PATCH 08/11] Debug v21 --- htdocs/takepos/invoice.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 4a7f4eebfe4..e05f6f1d4d3 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -265,7 +265,7 @@ if (empty($reshook)) { $conf->global->STOCK_CALCULATE_ON_BILL = 1; // To force the change of stock during invoice validation - $constantforkey = 'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"]; + $constantforkey = 'CASHDESK_ID_WAREHOUSE'.(isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : ''); dol_syslog("Validate invoice with stock change. Warehouse defined into constant ".$constantforkey." = ".getDolGlobalString($constantforkey)); // Validate invoice with stock change into warehouse getDolGlobalInt($constantforkey) @@ -799,7 +799,7 @@ if (empty($reshook)) { $line = array('description' => $prod->description, 'price' => $price, 'tva_tx' => $tva_tx, 'localtax1_tx' => $localtax1_tx, 'localtax2_tx' => $localtax2_tx, 'remise_percent' => $customer->remise_percent, 'price_ttc' => $price_ttc, 'array_options' => $array_options); /* setup of margin calculation */ - if (isset($conf->global->MARGIN_TYPE)) { + if (getDolGlobalString('MARGIN_TYPE')) { if (getDolGlobalString('MARGIN_TYPE') == 'pmp' && !empty($prod->pmp)) { $line['fk_fournprice'] = null; $line['pa_ht'] = $prod->pmp; @@ -1259,7 +1259,7 @@ if (empty($reshook)) { if (getDolGlobalInt('TAKEPOS_PRINT_INVOICE_DOC_INSTEAD_OF_RECEIPT')) { $sectionwithinvoicelink .= ' Invoice'; } elseif (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector") { - if (getDolGlobalString('TAKEPOS_PRINT_SERVER') && filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) { + if (getDolGlobalString('TAKEPOS_PRINT_SERVER') && filter_var(getDolGlobalString('TAKEPOS_PRINT_SERVER'), FILTER_VALIDATE_URL) == true) { $sectionwithinvoicelink .= ' '; } else { $sectionwithinvoicelink .= ' '; @@ -1357,11 +1357,11 @@ $(document).ready(function() { global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) { + if (filter_var(getDolGlobalString('TAKEPOS_PRINT_SERVER'), FILTER_VALIDATE_URL) == true) { ?> $.ajax({ type: "POST", - url: 'global->TAKEPOS_PRINT_SERVER; ?>/printer/index.php', + url: '/printer/index.php', data: 'invoice='+orderprinter1esc }); $.ajax({ type: "POST", - url: 'http://global->TAKEPOS_PRINT_SERVER; ?>:8111/print', + url: 'http://:8111/print', data: '' }); @@ -1378,11 +1378,11 @@ if ($action == "order" && !empty($order_receipt_printer1)) { } if ($action == "order" && !empty($order_receipt_printer2)) { - if (filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) { + if (filter_var(getDolGlobalString('TAKEPOS_PRINT_SERVER'), FILTER_VALIDATE_URL) == true) { ?> $.ajax({ type: "POST", - url: 'global->TAKEPOS_PRINT_SERVER; ?>/printer/index.php?printer=2', + url: '/printer/index.php?printer=2', data: 'invoice='+orderprinter2esc }); $.ajax({ type: "POST", - url: 'http://global->TAKEPOS_PRINT_SERVER; ?>:8111/print2', + url: 'http://:8111/print2', data: '' }); @@ -1399,11 +1399,11 @@ if ($action == "order" && !empty($order_receipt_printer2)) { } if ($action == "order" && !empty($order_receipt_printer3)) { - if (filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) { + if (filter_var(getDolGlobalString('TAKEPOS_PRINT_SERVER'), FILTER_VALIDATE_URL) == true) { ?> $.ajax({ type: "POST", - url: 'global->TAKEPOS_PRINT_SERVER; ?>/printer/index.php?printer=3', + url: '/printer/index.php?printer=3', data: 'invoice='+orderprinter3esc }); $.ajax({ type: "POST", - url: 'http://global->TAKEPOS_PRINT_SERVER; ?>:8111/print', + url: 'http://:8111/print', data: '' }); @@ -1984,7 +1984,7 @@ if ($placeid > 0) { if ($line->product_label && $line->desc) { $htmlforlines .= '
'; } - $firstline = dolGetFirstLineOfText($line->desc, $conf->global->TAKEPOS_SHOW_N_FIRST_LINES); + $firstline = dolGetFirstLineOfText($line->desc, getDolGlobalString('TAKEPOS_SHOW_N_FIRST_LINES')); if ($firstline != $line->desc) { $htmlforlines .= $form->textwithpicto(dolGetFirstLineOfText($line->desc), $line->desc); } else { From 65aadd446a62d2908addf582d3d3a24c11eb4911 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 22 Nov 2024 12:33:53 +0100 Subject: [PATCH 09/11] Debug v21 --- htdocs/takepos/admin/bar.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/takepos/admin/bar.php b/htdocs/takepos/admin/bar.php index beb3089cebd..9459557f18c 100644 --- a/htdocs/takepos/admin/bar.php +++ b/htdocs/takepos/admin/bar.php @@ -137,10 +137,13 @@ if (getDolGlobalInt('TAKEPOS_BAR_RESTAURANT')) { print "\n"; print '
'; print ''; if (getDolGlobalString('TAKEPOS_ORDER_PRINTERS')) { From 1f386fb8086607a670221ed0781d48ed1aba5820 Mon Sep 17 00:00:00 2001 From: HENRY Florian Date: Fri, 22 Nov 2024 13:21:18 +0100 Subject: [PATCH 10/11] fix #32060 (#32061) * fix #32060 * fix #32060 --- htdocs/compta/facture/class/facture-rec.class.php | 2 +- htdocs/fourn/class/fournisseur.facture-rec.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 3a5fe7166ab..f9cd158244f 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -1311,7 +1311,7 @@ class FactureRec extends CommonInvoice if (empty($this->date_when)) { return false; } - return dol_time_plus_duree($this->date_when, $this->frequency, $this->unit_frequency); + return dol_time_plus_duree($this->date_when, $this->frequency, $this->unit_frequency, 1); } /** diff --git a/htdocs/fourn/class/fournisseur.facture-rec.class.php b/htdocs/fourn/class/fournisseur.facture-rec.class.php index f57cfab72fb..7d2ea231dfc 100644 --- a/htdocs/fourn/class/fournisseur.facture-rec.class.php +++ b/htdocs/fourn/class/fournisseur.facture-rec.class.php @@ -1307,7 +1307,7 @@ class FactureFournisseurRec extends CommonInvoice if (empty($this->date_when)) { return false; } - return dol_time_plus_duree((int) $this->date_when, $this->frequency, $this->unit_frequency); + return dol_time_plus_duree((int) $this->date_when, $this->frequency, $this->unit_frequency, 1); } /** From 2b264ae5d07bb27ea407ec3390ddba7096693c76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 22 Nov 2024 15:24:11 +0100 Subject: [PATCH 11/11] fix phpstan (#32063) --- htdocs/takepos/invoice.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index e05f6f1d4d3..e557d95de02 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -1984,7 +1984,7 @@ if ($placeid > 0) { if ($line->product_label && $line->desc) { $htmlforlines .= '
'; } - $firstline = dolGetFirstLineOfText($line->desc, getDolGlobalString('TAKEPOS_SHOW_N_FIRST_LINES')); + $firstline = dolGetFirstLineOfText($line->desc, getDolGlobalInt('TAKEPOS_SHOW_N_FIRST_LINES')); if ($firstline != $line->desc) { $htmlforlines .= $form->textwithpicto(dolGetFirstLineOfText($line->desc), $line->desc); } else {
'; print $langs->trans('DateInvoice'); From dbba584dfbdcccd35870fbd378ef7c076ac5e61e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 22 Nov 2024 09:19:12 +0100 Subject: [PATCH 05/11] Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop --- htdocs/adherents/class/adherent.class.php | 2 +- htdocs/contact/class/contact.class.php | 2 +- htdocs/contact/list.php | 5 ----- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index e2353b82af6..7ad5ee54ee7 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -3300,7 +3300,7 @@ class Adherent extends CommonObject $return .= '
'; $return .= ''; if (property_exists($this, 'photo') || !empty($this->photo)) { - $return .= Form::showphoto('memberphoto', $this, 0, 60, 0, 'photokanban photoref photowithmargin photologintooltip', 'small', 0, 1); + $return .= Form::showphoto('memberphoto', $this, 0, 60, 0, 'photokanban photowithmargin photologintooltip', 'small', 0, 1); } else { $return .= img_picto('', 'user'); } diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 9af01fe74ce..5fc553e9994 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -1531,7 +1531,7 @@ class Contact extends CommonObject * @param string $morecss Add more css on link * @return string String with URL */ - public function getNomUrl($withpicto = 0, $option = '', $maxlen = 0, $moreparam = '', $save_lastsearch_value = -1, $notooltip = 0, $morecss = '') + public function getNomUrl($withpicto = 0, $option = '', $maxlen = 0, $moreparam = '', $save_lastsearch_value = -1, $notooltip = 0, $morecss = 'valignmiddle') { global $conf, $langs, $hookmanager; diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 0d971f01723..ae6fd816681 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -166,26 +166,22 @@ if ($type == "p") { $contextpage = 'contactprospectlist'; } $title .= ' ('.$langs->trans("ThirdPartyProspects").')'; - $urlfiche = "card.php"; } if ($type == "c") { if (empty($contextpage) || $contextpage == 'contactlist') { $contextpage = 'contactcustomerlist'; } $title .= ' ('.$langs->trans("ThirdPartyCustomers").')'; - $urlfiche = "card.php"; } elseif ($type == "f") { if (empty($contextpage) || $contextpage == 'contactlist') { $contextpage = 'contactsupplierlist'; } $title .= ' ('.$langs->trans("ThirdPartySuppliers").')'; - $urlfiche = "card.php"; } elseif ($type == "o") { if (empty($contextpage) || $contextpage == 'contactlist') { $contextpage = 'contactotherlist'; } $title .= ' ('.$langs->trans("OthersNotLinkedToThirdParty").')'; - $urlfiche = ""; } // Initialize a technical object @@ -1453,7 +1449,6 @@ while ($i < $imaxinloop) { } } else { // Show here line of result - $j = 0; print '
'.$langs->trans("ProductOrService").''; print img_picto('', 'product', 'class="pictofixedwidth"'); - print $form->select_produits($id, 'id', '', 0, 0, 1, 2, '', ($conf->dol_optimize_smallscreen ? 1 : 0), array(), 0, '1', 0, 'widthcentpercentminusx maxwidth400'); + print $form->select_produits($id, 'id', '', 0, 0, 1, 2, '', 0, array(), 0, $langs->trans("RefOrLabel"), 0, 'widthcentpercentminusx maxwidth400'); print '
'; //print ''; - print $formproduct->selectWarehouses($search_warehouse, 'search_warehouse', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, array(), 'maxwidth200'); + print $formproduct->selectWarehouses($search_warehouse, 'search_warehouse', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, array(), 'maxwidth150'); print ''; + print ''; print $warehousestatic->getNomUrl(1); print "'.$origin.''; if ($obj->fk_project != 0) { From 999754c1842b3c786ae046d11fc40c21c7c6864e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 22 Nov 2024 12:07:48 +0100 Subject: [PATCH 07/11] Debug v21 --- htdocs/langs/en_US/cashdesk.lang | 2 +- htdocs/langs/fr_FR/cashdesk.lang | 2 +- htdocs/takepos/admin/bar.php | 4 ++-- htdocs/takepos/admin/setup.php | 2 +- htdocs/takepos/floors.php | 15 +++++++++++---- htdocs/takepos/invoice.php | 17 ++++++++++------- htdocs/takepos/pay.php | 14 +++++++------- htdocs/takepos/receipt.php | 7 +++++-- htdocs/takepos/reduction.php | 5 ++++- htdocs/takepos/split.php | 16 ++++++++++------ htdocs/theme/eldy/global.inc.php | 2 +- htdocs/theme/md/style.css.php | 2 +- 12 files changed, 54 insertions(+), 34 deletions(-) diff --git a/htdocs/langs/en_US/cashdesk.lang b/htdocs/langs/en_US/cashdesk.lang index afe22259f17..5155d532f7c 100644 --- a/htdocs/langs/en_US/cashdesk.lang +++ b/htdocs/langs/en_US/cashdesk.lang @@ -60,7 +60,7 @@ Numberspad=Numbers Pad BillsCoinsPad=Coins and banknotes Pad DolistorePosCategory=TakePOS modules and other POS solutions for Dolibarr TakeposNeedsCategories=TakePOS needs at least one product category to work -TakeposNeedsAtLeastOnSubCategoryIntoParentCategory=TakePOS needs at least 1 product category under the category %s to work +TakeposNeedsAtLeastOnSubCategoryIntoParentCategory=TakePOS needs at least 1 sub-category under the product category %s to work OrderNotes=Can add some notes to each ordered items CashDeskBankAccountFor=Default account to use for payments in NoPaimementModesDefined=No paiment mode defined in TakePOS configuration diff --git a/htdocs/langs/fr_FR/cashdesk.lang b/htdocs/langs/fr_FR/cashdesk.lang index 2f7a1a59aa8..ecbb052ad0b 100644 --- a/htdocs/langs/fr_FR/cashdesk.lang +++ b/htdocs/langs/fr_FR/cashdesk.lang @@ -60,7 +60,7 @@ Numberspad=Pavé numérique BillsCoinsPad=Pavé avec montant des Pièces et Billets DolistorePosCategory=Modules TakePOS et autres solutions de PDV pour Dolibarr TakeposNeedsCategories=TakePOS a besoin d'au moins une catégorie de produits pour fonctionner -TakeposNeedsAtLeastOnSubCategoryIntoParentCategory=TakePOS a besoin d'au moins 1 catégorie de produits dans la catégorie %s pour fonctionner +TakeposNeedsAtLeastOnSubCategoryIntoParentCategory=TakePOS a besoin d'au moins 1 sous-catégorie dans la catégorie de produit %s pour fonctionner OrderNotes=Il est possible d'ajouter des notes sur chacun des produits commandés CashDeskBankAccountFor=Compte par défaut à utiliser pour les paiements en NoPaimementModesDefined=Aucun mode de paiement défini dans la configuration de TakePOS diff --git a/htdocs/takepos/admin/bar.php b/htdocs/takepos/admin/bar.php index 362942bc16d..beb3089cebd 100644 --- a/htdocs/takepos/admin/bar.php +++ b/htdocs/takepos/admin/bar.php @@ -179,9 +179,9 @@ if (getDolGlobalInt('TAKEPOS_BAR_RESTAURANT')) { print '
'; print $langs->trans("SupplementCategory"); print ''; + print ''; print img_picto('', 'category', 'class="pictofixedwidth"'); - print $form->select_all_categories(Categorie::TYPE_PRODUCT, getDolGlobalString('TAKEPOS_SUPPLEMENTS_CATEGORY'), 'TAKEPOS_SUPPLEMENTS_CATEGORY', 64, 0, 0); + print $form->select_all_categories(Categorie::TYPE_PRODUCT, getDolGlobalString('TAKEPOS_SUPPLEMENTS_CATEGORY'), 'TAKEPOS_SUPPLEMENTS_CATEGORY', 64, 0, 0, 0, 'minwidth 200 maxwidth500 widthcentpercentminusx'); print ajax_combobox('TAKEPOS_SUPPLEMENTS_CATEGORY'); print "
'; print $langs->trans("NumberOfTerminals"); print ''; -print ''; +print ''; print "
'; - print $langs->trans("OrderPrinters").' ('.$langs->trans("Setup").')'; + print $langs->trans("OrderPrinters"); print ''; print ajax_constantonoff("TAKEPOS_ORDER_PRINTERS", array(), $conf->entity, 0, 0, 1, 0); + if (getDolGlobalString('TAKEPOS_ORDER_PRINTERS')) { + print'   '.$langs->trans("Setup").''; + } print '