From b1ad30cbb4c99405adcdea17179d58d3dfc3cdcf Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Wed, 8 Apr 2020 14:51:28 +0200 Subject: [PATCH 1/8] Update list.php --- htdocs/societe/list.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 088d1b20b7a..ca29efbfad8 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -139,8 +139,6 @@ $fieldstosearchall = array( 's.code_fournisseur'=>"SupplierCode", 's.code_compta'=>"CustomerAccountancyCodeShort", 's.code_compta_fournisseur'=>"SupplierAccountancyCodeShort", - 's.zip'=>"zip", - 's.town'=>"town", 's.email'=>"EMail", 's.url'=>"URL", 's.tva_intra'=>"VATIntra", @@ -1150,7 +1148,7 @@ while ($i < min($num, $limit)) } if (!empty($arrayfields['s.email']['checked'])) { - print "".$obj->email."\n"; + print "".dol_print_email($obj->email, $obj->rowid, $obj->socid, 'AC_EMAIL', 18)."\n"; if (!$i) $totalarray['nbfield']++; } if (!empty($arrayfields['s.phone']['checked'])) From 97153fd57d9c7d4aa1f87d95274d4f4ae1f3a68b Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Wed, 8 Apr 2020 15:13:19 +0200 Subject: [PATCH 2/8] Update functions.lib.php --- htdocs/core/lib/functions.lib.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 57e7b2817bb..247c492b930 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2378,6 +2378,7 @@ function dol_print_phone($phone, $countrycode = '', $cid = 0, $socid = 0, $addli // Clean phone parameter $phone = preg_replace("/[\s.-]/", "", trim($phone)); if (empty($phone)) { return ''; } + if ($conf->global->MAIN_PHONE_SEPAR) $separ = $conf->global->MAIN_PHONE_SEPAR; if (empty($countrycode)) $countrycode = $mysoc->country_code; // Short format for small screens @@ -2679,8 +2680,9 @@ function dol_print_phone($phone, $countrycode = '', $cid = 0, $socid = 0, $addli { if ($conf->browser->layout == 'phone' || (!empty($conf->clicktodial->enabled) && !empty($conf->global->CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS))) // If phone or option for, we use link of phone { + $newphoneform = $newphone; $newphone = ''; + $newphone .= '>'.$newphoneform.''; } elseif (!empty($conf->clicktodial->enabled) && $addlink == 'AC_TEL') // If click to dial, we use click to dial url { From 732a103ba84774928d906aa24f6a88c2292cc054 Mon Sep 17 00:00:00 2001 From: BENKE Charlene <1179011+defrance@users.noreply.github.com> Date: Wed, 8 Apr 2020 15:30:48 +0200 Subject: [PATCH 3/8] add linked object block --- htdocs/bom/linkedobjectblock.tpl.php | 74 ++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 htdocs/bom/linkedobjectblock.tpl.php diff --git a/htdocs/bom/linkedobjectblock.tpl.php b/htdocs/bom/linkedobjectblock.tpl.php new file mode 100644 index 00000000000..913f96dce92 --- /dev/null +++ b/htdocs/bom/linkedobjectblock.tpl.php @@ -0,0 +1,74 @@ + + * Copyright (C) 2013 Juanjo Menent + * Copyright (C) 2014 Marcos GarcĂ­a + * Copyright (C) 2013-2020 Charlene BENKE + * + * 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Protection to avoid direct call of template +if (empty($conf) || !is_object($conf)) { + print "Error, template page can't be called as URL"; + exit; +} + +print "\n"; + +global $user, $db; +global $noMoreLinkedObjectBlockAfter; + +$langs = $GLOBALS['langs']; +$linkedObjectBlock = $GLOBALS['linkedObjectBlock']; + +// Load translation files required by the page +$langs->load("bom"); + +$linkedObjectBlock = dol_sort_array($linkedObjectBlock, 'date', 'desc', 0, 0, 1); + +$total = 0; +$ilink = 0; +foreach ($linkedObjectBlock as $key => $objectlink) +{ + $ilink++; + $product_static= new Product($db); + $trclass = 'oddeven'; + if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass .= ' liste_sub_total'; + echo ''; + echo ''.$langs->trans("Bom"); + if (!empty($showImportButton) && $conf->global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES) { + print ' '; + echo ''.$objectlink->getNomUrl(1).''; + $product_static->fetch($objectlink->fk_product); + echo ''.$product_static->getNomUrl(1).''; + echo ''.dol_print_date($objectlink->date_creation, 'day').''; + echo ''; + if ($user->rights->commande->lire) { + $total = $total + $objectlink->total_ht; + echo price($objectlink->total_ht); + } + echo ''; + echo ''.$objectlink->getLibStatut(3).''; + echo ''; + // For now, shipments must stay linked to order, so link is not deletable + if ($object->element != 'shipping') { + echo ''.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').''; + } + echo ''; + echo "\n"; +} + +echo "\n"; From 728bfd1c904c768e318c333d5c4dc825072db32b Mon Sep 17 00:00:00 2001 From: BENKE Charlene <1179011+defrance@users.noreply.github.com> Date: Wed, 8 Apr 2020 19:46:29 +0200 Subject: [PATCH 4/8] oups ssooory everything fine thank's --- htdocs/bom/{ => tpl}/linkedobjectblock.tpl.php | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename htdocs/bom/{ => tpl}/linkedobjectblock.tpl.php (100%) diff --git a/htdocs/bom/linkedobjectblock.tpl.php b/htdocs/bom/tpl/linkedobjectblock.tpl.php similarity index 100% rename from htdocs/bom/linkedobjectblock.tpl.php rename to htdocs/bom/tpl/linkedobjectblock.tpl.php From ea79c914823e790e55afabc9313ad70ee24e86f6 Mon Sep 17 00:00:00 2001 From: "jove@bisquerra.com" Date: Wed, 8 Apr 2020 20:02:54 +0200 Subject: [PATCH 5/8] Add langs and print only no printed order lines --- htdocs/core/class/dolreceiptprinter.class.php | 18 +++++------ htdocs/langs/en_US/receiptprinter.lang | 30 +++++++++++++++++++ htdocs/takepos/invoice.php | 5 ++-- 3 files changed, 42 insertions(+), 11 deletions(-) diff --git a/htdocs/core/class/dolreceiptprinter.class.php b/htdocs/core/class/dolreceiptprinter.class.php index e089a89190a..39adc7ace60 100644 --- a/htdocs/core/class/dolreceiptprinter.class.php +++ b/htdocs/core/class/dolreceiptprinter.class.php @@ -181,7 +181,7 @@ class dolReceiptPrinter extends Printer 'dol_value_month', 'dol_value_day', 'dol_value_day_letters', - 'dol_print_payment', + //'dol_print_payment', 'dol_print_logo', 'dol_print_logo_old', 'dol_value_object_id', @@ -219,14 +219,14 @@ class dolReceiptPrinter extends Printer 'dol_value_vendor_mail', 'dol_value_customer_points', 'dol_value_object_points', - 'dol_print_if_customer', - 'dol_print_if_vendor', - 'dol_print_if_happy_hour', - 'dol_print_if_num_object_unique', - 'dol_print_if_customer_points', - 'dol_print_if_object_points', - 'dol_print_if_customer_tax_number', - 'dol_print_if_customer_account_balance_positive', + //'dol_print_if_customer', + //'dol_print_if_vendor', + //'dol_print_if_happy_hour', + //'dol_print_if_num_object_unique', + //'dol_print_if_customer_points', + //'dol_print_if_object_points', + //'dol_print_if_customer_tax_number', + //'dol_print_if_customer_account_balance_positive', ); } diff --git a/htdocs/langs/en_US/receiptprinter.lang b/htdocs/langs/en_US/receiptprinter.lang index b0b60c60840..5533de0c320 100644 --- a/htdocs/langs/en_US/receiptprinter.lang +++ b/htdocs/langs/en_US/receiptprinter.lang @@ -63,3 +63,33 @@ DOL_VALUE_MONTH_LETTERS=Invoice month in letters DOL_VALUE_MONTH=Invoice month DOL_VALUE_DAY=Invoice day DOL_VALUE_DAY_LETTERS=Inovice day in letters +DOL_LINE_FEED_REVERSE=Line feed reverse +DOL_VALUE_OBJECT_ID=Invoice ID +DOL_VALUE_OBJECT_REF=Invoice ref +DOL_PRINT_OBJECT_LINES=Invoice lines +DOL_VALUE_CUSTOMER_FIRSTNAME=Customer first name +DOL_VALUE_CUSTOMER_LASTNAME=Customer last name +DOL_VALUE_CUSTOMER_MAIL=Customer mail +DOL_VALUE_CUSTOMER_PHONE=Customer phone +DOL_VALUE_CUSTOMER_MOBILE=Customer mobile +DOL_VALUE_CUSTOMER_SKYPE=Customer Skype +DOL_VALUE_CUSTOMER_TAX_NUMBER=Customer tax number +DOL_VALUE_CUSTOMER_ACCOUNT_BALANCE=Customer account balance +DOL_VALUE_MYSOC_NAME=Your company name +DOL_VALUE_MYSOC_ADDRESS=Your company address +DOL_VALUE_MYSOC_ZIP=Your zip code +DOL_VALUE_MYSOC_TOWN=Your town +DOL_VALUE_MYSOC_COUNTRY=Your country +DOL_VALUE_MYSOC_IDPROF1=Your IDPROF1 +DOL_VALUE_MYSOC_IDPROF2=Your IDPROF2 +DOL_VALUE_MYSOC_IDPROF3=Your IDPROF3 +DOL_VALUE_MYSOC_IDPROF4=Your IDPROF4 +DOL_VALUE_MYSOC_IDPROF5=Your IDPROF5 +DOL_VALUE_MYSOC_IDPROF6=Your IDPROF6 +DOL_VALUE_MYSOC_TVA_INTRA=Intra-Community VAT ID +DOL_VALUE_MYSOC_CAPITAL=Capital +DOL_VALUE_VENDOR_LASTNAME=Vendor last name +DOL_VALUE_VENDOR_FIRSTNAME=Vendor first name +DOL_VALUE_VENDOR_MAIL=Vendor mail +DOL_VALUE_CUSTOMER_POINTS=Customer points +DOL_VALUE_OBJECT_POINTS=Object points \ No newline at end of file diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 6251b5b57b0..e79191393b7 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -533,7 +533,7 @@ if ($action == "order" and $placeid != 0) $order_receipt_printer1 .= ''; } } - if ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter") { + if ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter" && $count > 0) { $invoice->fetch($placeid); //Reload object before send to printer $ret = $printer->sendToPrinter($invoice, $conf->global->{'TAKEPOS_TEMPLATE_TO_USE_FOR_ORDERS'.$_SESSION["takeposterminal"]}, $conf->global->{'TAKEPOS_PRINTER_TO_USE'.$_SESSION["takeposterminal"]}); // PRINT TO PRINTER 1 } @@ -543,6 +543,7 @@ if ($action == "order" and $placeid != 0) foreach ($invoice->lines as $line) { + $count=0; if ($line->special_code == "4") { continue; } @@ -558,7 +559,7 @@ if ($action == "order" and $placeid != 0) $order_receipt_printer2 .= ''; } } - if ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter") { + if ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter" && $count > 0) { $invoice->fetch($placeid); //Reload object before send to printer $ret = $printer->sendToPrinter($invoice, $conf->global->{'TAKEPOS_TEMPLATE_TO_USE_FOR_ORDERS'.$_SESSION["takeposterminal"]}, $conf->global->{'TAKEPOS_PRINTER_TO_USE'.$_SESSION["takeposterminal"]}); // PRINT TO PRINTER 2 } From 7d11a36bebb81e41631df8776abb0c82d486e988 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Thu, 9 Apr 2020 14:42:42 +0200 Subject: [PATCH 6/8] FIX TakePOS buying price --- 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 6251b5b57b0..378ac7efd8c 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -341,7 +341,7 @@ if ($action == "addline") } } if ($idoflineadded <= 0) { - $idoflineadded = $invoice->addline($prod->description, $price, 1, $tva_tx, $localtax1_tx, $localtax2_tx, $idproduct, $customer->remise_percent, '', 0, 0, 0, '', $price_base_type, $price_ttc, $prod->type, -1, 0, '', 0, $parent_line, null, 0, '', 0, 100, '', null, 0); + $idoflineadded = $invoice->addline($prod->description, $price, 1, $tva_tx, $localtax1_tx, $localtax2_tx, $idproduct, $customer->remise_percent, '', 0, 0, 0, '', $price_base_type, $price_ttc, $prod->type, -1, 0, '', 0, $parent_line, null, '', '', 0, 100, '', null, 0); } $invoice->fetch($placeid); From e43e9a0daa446ccf1f59b4f276c8b22487bf9bb1 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Thu, 9 Apr 2020 14:56:50 +0200 Subject: [PATCH 7/8] FIX TakePOS buying price --- 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 378ac7efd8c..d7cc4e5ee55 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -362,7 +362,7 @@ if ($action == "freezone") { $localtax1_tx = get_localtax($tva_tx, 1, $customer, $mysoc, $tva_npr); $localtax2_tx = get_localtax($tva_tx, 2, $customer, $mysoc, $tva_npr); - $invoice->addline($desc, $number, 1, $tva_tx, $localtax1_tx, $localtax2_tx, 0, 0, '', 0, 0, 0, '', 'TTC', $number, 0, -1, 0, '', 0, 0, null, 0, '', 0, 100, '', null, 0); + $invoice->addline($desc, $number, 1, $tva_tx, $localtax1_tx, $localtax2_tx, 0, 0, '', 0, 0, 0, '', 'TTC', $number, 0, -1, 0, '', 0, 0, null, '', '', 0, 100, '', null, 0); $invoice->fetch($placeid); } From 5bba22aeebc7bb4d1062ebe1cf18a26771a92cb7 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Thu, 9 Apr 2020 14:58:42 +0200 Subject: [PATCH 8/8] FIX pencil with font awesome 5.13 --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index b8513c54865..c75d891cfb7 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3168,7 +3168,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'generic'=>'file', 'holiday'=>'umbrella-beach', 'member'=>'users', 'trip'=>'wallet', 'group'=>'users', 'sign-out'=>'sign-out-alt', 'switch_off'=>'toggle-off', 'switch_on'=>'toggle-on', 'check'=>'check', 'bookmark'=>'star', 'bookmark'=>'star', 'stats' => 'chart-bar', - 'bank'=>'university', 'close_title'=>'window-close', 'delete'=>'trash', 'edit'=>'pencil', 'filter'=>'filter', 'split'=>'code-branch', + 'bank'=>'university', 'close_title'=>'window-close', 'delete'=>'trash', 'edit'=>'pencil-alt', 'filter'=>'filter', 'split'=>'code-branch', 'list-alt'=>'list-alt', 'calendar'=>'calendar-alt', 'calendarweek'=>'calendar-week', 'calendarmonth'=>'calendar-alt', 'calendarday'=>'calendar-day', 'calendarperuser'=>'table', 'multicurrency'=>'dollar-sign', 'other'=>'square', 'resource'=>'laptop-house', 'error'=>'exclamation-triangle', 'warning'=>'exclamation-triangle',