diff --git a/htdocs/bom/tpl/linkedobjectblock.tpl.php b/htdocs/bom/tpl/linkedobjectblock.tpl.php new file mode 100644 index 00000000000..913f96dce92 --- /dev/null +++ b/htdocs/bom/tpl/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"; 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/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index cc59d0198c0..34034abb280 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 { @@ -3169,7 +3171,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', 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/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'])) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 6251b5b57b0..2ac1a57ef0b 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); @@ -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); } @@ -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 }