Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2020-04-10 00:25:41 +02:00
commit 401b8b2dcc
6 changed files with 123 additions and 18 deletions

View File

@ -0,0 +1,74 @@
<?php
/* Copyright (C) 2010-2011 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2013-2020 Charlene BENKE <charlie@patas-monkey.com>
*
* 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 <https://www.gnu.org/licenses/>.
*/
// 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 "<!-- BEGIN PHP TEMPLATE -->\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 '<tr class="'.$trclass.'" >';
echo '<td class="linkedcol-element" >'.$langs->trans("Bom");
if (!empty($showImportButton) && $conf->global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES) {
print '<a class="objectlinked_importbtn" href="'.$objectlink->getNomUrl(0, '', 0, 1).'&amp;action=selectlines" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" > <i class="fa fa-indent"></i> </a';
}
echo '</td>';
echo '<td class="linkedcol-name nowraponall" >'.$objectlink->getNomUrl(1).'</td>';
$product_static->fetch($objectlink->fk_product);
echo '<td class="linkedcol-ref" align="center">'.$product_static->getNomUrl(1).'</td>';
echo '<td class="linkedcol-date" align="center">'.dol_print_date($objectlink->date_creation, 'day').'</td>';
echo '<td class="linkedcol-amount right">';
if ($user->rights->commande->lire) {
$total = $total + $objectlink->total_ht;
echo price($objectlink->total_ht);
}
echo '</td>';
echo '<td class="linkedcol-statut right">'.$objectlink->getLibStatut(3).'</td>';
echo '<td class="linkedcol-action right">';
// For now, shipments must stay linked to order, so link is not deletable
if ($object->element != 'shipping') {
echo '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key.'">'.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').'</a>';
}
echo '</td>';
echo "</tr>\n";
}
echo "<!-- END PHP TEMPLATE -->\n";

View File

@ -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',
);
}

View File

@ -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 = '<a href="tel:'.$phone.'"';
$newphone .= '>'.$phone.'</a>';
$newphone .= '>'.$newphoneform.'</a>';
}
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',

View File

@ -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

View File

@ -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 "<td>".$obj->email."</td>\n";
print "<td>".dol_print_email($obj->email, $obj->rowid, $obj->socid, 'AC_EMAIL', 18)."</td>\n";
if (!$i) $totalarray['nbfield']++;
}
if (!empty($arrayfields['s.phone']['checked']))

View File

@ -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 .= '</td></tr>';
}
}
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 .= '</td></tr>';
}
}
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
}