Merge remote-tracking branch 'upstream/develop' into product_code_syntax

This commit is contained in:
Frédéric FRANCE 2021-02-26 16:11:34 +01:00
commit 8029a3317f
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
13 changed files with 69 additions and 63 deletions

View File

@ -21,6 +21,8 @@ Following changes may create regressions for some external modules, but were nec
* API /setup/shipment_methods has been replaced with API /setup/shipping_methods
* Field "tva" renamed into "total_tva" in llx_propal, llx_supplier_proposal, llx_commande, llx_commande_fournisseur for better field name consistency
* Field "total" renamed into "total_ttc" in llx_propal, llx_supplier_proposal for better field name consistency
* If your database is PostgreSql, you must use version 9.1.0 or more (Dolibarr need the SQL function CONCAT)
* If your database is MySql or MariaDB, you need at least version 5.1
***** ChangeLog for 13.0.1 compared to 13.0.0 *****

View File

@ -559,7 +559,7 @@ print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
/*
* Paid
* VAT Paid
*/
print load_fiche_titre($langs->trans("VATPaid"), '', '');
@ -586,47 +586,6 @@ $sql .= " ORDER BY dm ASC, mode ASC";
pt($db, $sql, $langs->trans("Month"));
if (!empty($conf->global->MAIN_FEATURES_LEVEL)) {
print '<br>';
/*
* Recap
*/
print load_fiche_titre($langs->trans("VATBalance"), '', ''); // need to add translation
$sql1 = "SELECT SUM(amount) as mm";
$sql1 .= " FROM ".MAIN_DB_PREFIX."tva as f";
$sql1 .= " WHERE f.entity = ".$conf->entity;
$sql1 .= " AND f.datev >= '".$db->idate($date_start)."'";
$sql1 .= " AND f.datev <= '".$db->idate($date_end)."'";
$result = $db->query($sql1);
if ($result) {
$obj = $db->fetch_object($result);
print '<table class="noborder centpercent">';
print "<tr>";
print '<td class="right">'.$langs->trans("VATDue").'</td>';
print '<td class="nowrap right">'.price(price2num($total, 'MT')).'</td>';
print "</tr>\n";
print "<tr>";
print '<td class="right">'.$langs->trans("VATPaid").'</td>';
print '<td class="nowrap right">'.price(price2num($obj->mm, 'MT'))."</td>\n";
print "</tr>\n";
$restopay = $total - $obj->mm;
print "<tr>";
print '<td class="right">'.$langs->trans("RemainToPay").'</td>';
print '<td class="nowrap right">'.price(price2num($restopay, 'MT')).'</td>';
print "</tr>\n";
print '</table>';
}
}
print '</div></div>';
llxFooter();

View File

@ -1433,7 +1433,8 @@ class pdf_einstein extends ModelePDFCommandes
$carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs);
$carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, 'target', $object);
$mode = 'target';
$carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, $mode, $object);
// Show recipient
$widthrecbox = !empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 92 : 100;

View File

@ -1618,7 +1618,8 @@ class pdf_eratosthene extends ModelePDFCommandes
$carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs);
$carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, 'target', $object);
$mode = 'target';
$carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, $mode, $object);
// Show recipient
$widthrecbox = !empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 92 : 100;

View File

@ -1850,7 +1850,8 @@ class pdf_crabe extends ModelePDFFactures
$carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs);
$carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, 'target', $object);
$mode = 'target';
$carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, $mode, $object);
// Show recipient
$widthrecbox = !empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 92 : 100;

View File

@ -2116,7 +2116,8 @@ class pdf_sponge extends ModelePDFFactures
$carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs);
$carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, 'target', $object);
$mode = 'target';
$carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, $mode, $object);
// Show recipient
$widthrecbox = !empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 92 : 100;

View File

@ -1602,7 +1602,8 @@ class pdf_azur extends ModelePDFPropales
$carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs);
$carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, 'target', $object);
$mode = 'target';
$carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, $mode, $object);
// Show recipient
$widthrecbox = 100;

View File

@ -1718,7 +1718,8 @@ class pdf_cyan extends ModelePDFPropales
$carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs);
$carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, 'target', $object);
$mode = 'target';
$carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact,$mode, $object);
// Show recipient
$widthrecbox = !empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 92 : 100;

View File

@ -1,8 +1,10 @@
# ProductBATCH language file - en_US - ProductBATCH
ManageLotSerial=Use lot/serial number
ProductStatusOnBatch=Yes (lot/serial required)
ProductStatusOnBatch=Lot (required)
ProductStatusOnSerial=Unique Serial Number (required)
ProductStatusNotOnBatch=No (lot/serial not used)
ProductStatusOnBatchShort=Yes
ProductStatusOnBatchShort=Lot
ProductStatusOnSerialShort=Serial
ProductStatusNotOnBatchShort=No
Batch=Lot/Serial
atleast1batchfield=Eat-by date or Sell-by date or Lot/Serial number

View File

@ -1,8 +1,10 @@
# ProductBATCH language file - en_US - ProductBATCH
ManageLotSerial=Utiliser les numéros de lots/série
ProductStatusOnBatch=Oui (Lot/Série requis)
ProductStatusOnBatch=Lot (requis)
ProductStatusOnSerial=Numéro de série (doit être unique pour chaque équipement)
ProductStatusNotOnBatch=Non (Lot/Série non utilisé)
ProductStatusOnBatchShort=Oui
ProductStatusOnBatchShort=Lot
ProductStatusOnSerialShort=N°série
ProductStatusNotOnBatchShort=Non
Batch=Lot/Série
atleast1batchfield=Date limite utilisation optimale, de consommation ou numéro de lot/série

View File

@ -1084,7 +1084,13 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Batch number management
if (!empty($conf->productbatch->enabled)) {
print '<tr><td>'.$langs->trans("ManageLotSerial").'</td><td colspan="3">';
$statutarray = array('0' => $langs->trans("ProductStatusNotOnBatch"), '1' => $langs->trans("ProductStatusOnBatch"));
if ( empty($conf->global ->MAIN_ADVANCE_NUMLOT) )
{
$statutarray = array('0' => $langs->trans("ProductStatusNotOnBatch"), '1' => $langs->trans("ProductStatusOnBatch"));
}
else {
$statutarray = array('0' => $langs->trans("ProductStatusNotOnBatch"), '1' => $langs->trans("ProductStatusOnBatch"), '2' => $langs->trans("ProductStatusOnSerial"));
}
print $form->selectarray('status_batch', $statutarray, GETPOST('status_batch'));
print '</td></tr>';
}
@ -1544,7 +1550,13 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
if ($conf->productbatch->enabled) {
if ($object->isProduct() || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
print '<tr><td>'.$langs->trans("ManageLotSerial").'</td><td colspan="3">';
$statutarray = array('0' => $langs->trans("ProductStatusNotOnBatch"), '1' => $langs->trans("ProductStatusOnBatch"));
if ( empty($conf->global ->MAIN_ADVANCE_NUMLOT) )
{
$statutarray = array('0' => $langs->trans("ProductStatusNotOnBatch"), '1' => $langs->trans("ProductStatusOnBatch"));
}
else {
$statutarray = array('0' => $langs->trans("ProductStatusNotOnBatch"), '1' => $langs->trans("ProductStatusOnBatch"), '2' => $langs->trans("ProductStatusOnSerial"));
}
print $form->selectarray('status_batch', $statutarray, $object->status_batch);
print '</td></tr>';
}
@ -2031,7 +2043,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
if (!empty($conf->productbatch->enabled)) {
if ($object->isProduct() || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
print '<tr><td>'.$langs->trans("ManageLotSerial").'</td><td colspan="2">';
if (!empty($conf->use_javascript_ajax) && $usercancreate && !empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
if (!empty($conf->use_javascript_ajax) && $usercancreate && !empty($conf->global->MAIN_DIRECT_STATUS_UPDATE) && empty($conf->global->MAIN_ADVANCE_NUMLOT)) {
print ajax_object_onoff($object, 'status_batch', 'tobatch', 'ProductStatusOnBatch', 'ProductStatusNotOnBatch');
} else {
print $object->getLibStatut(0, 2);

View File

@ -4735,10 +4735,10 @@ class Product extends CommonObject
if ($type == 2) {
switch ($mode) {
case 0:
$label = ($status == 0 ? $langs->trans('ProductStatusNotOnBatch') : $langs->trans('ProductStatusOnBatch'));
$label = ($status == 0 ? $langs->trans('ProductStatusNotOnBatch') : ($status == 1 || empty($conf->global->MAIN_ADVANCE_NUMLOT) ? $langs->trans('ProductStatusOnBatch') : $langs->trans('ProductStatusOnSerial')));
return dolGetStatus($label);
case 1:
$label = ($status == 0 ? $langs->trans('ProductStatusNotOnBatchShort') : $langs->trans('ProductStatusOnBatchShort'));
$label = ($status == 0 ? $langs->trans('ProductStatusNotOnBatchShort') : ($status == 1 || empty($conf->global->MAIN_ADVANCE_NUMLOT) ? $langs->trans('ProductStatusOnBatchShort') : $langs->trans('ProductStatusOnSerialShort')));
return dolGetStatus($label);
case 2:
return $this->LibStatut($status, 3, 2).' '.$this->LibStatut($status, 1, 2);
@ -4776,11 +4776,15 @@ class Product extends CommonObject
$labelStatus = $langs->trans('ProductStatusOnBuyShort');
$labelStatusShort = $langs->trans('ProductStatusOnBuy');
} elseif ($type == 2) {
$labelStatus = $langs->trans('ProductStatusOnBatch');
$labelStatusShort = $langs->trans('ProductStatusOnBatchShort');
$labelStatus = ($status == 1 || empty($conf->global->MAIN_ADVANCE_NUMLOT) ? $langs->trans('ProductStatusOnBatch') : $langs->trans('ProductStatusOnSerial'));
$labelStatusShort = ($status == 1 || empty($conf->global->MAIN_ADVANCE_NUMLOT) ? $langs->trans('ProductStatusOnBatchShort') : $langs->trans('ProductStatusOnSerialShort'));
}
}
elseif ( ! empty($conf->global->MAIN_ADVANCE_NUMLOT) && $type == 2 && $status == 2)
{
$labelStatus = $langs->trans('ProductStatusOnSerial');
$labelStatusShort = $langs->trans('ProductStatusOnSerialShort');
}
if ($mode > 6) {
return dolGetStatus($langs->trans('Unknown'), '', '', 'status0', 0);
@ -5518,7 +5522,7 @@ class Product extends CommonObject
*/
public function hasbatch()
{
return ($this->status_batch == 1 ? true : false);
return ($this->status_batch > 0 ? true : false);
}

View File

@ -970,7 +970,20 @@ if ($resql) {
}
// To batch
if (!empty($arrayfields['p.tobatch']['checked'])) {
print '<td class="liste_titre center">'.$form->selectyesno('search_tobatch', $search_tobatch, 1, false, 1).'</td>';
print '<td class="liste_titre center">';
if (empty($conf->global ->MAIN_ADVANCE_NUMLOT)) {
print $form->selectyesno('search_tobatch', $search_tobatch, 1, false, 1);
} else {
$statutarray = array(
'-1' => '',
'0' => $langs->trans("ProductStatusNotOnBatchShort"),
'1' => $langs->trans("ProductStatusOnBatchShort"),
'2' => $langs->trans("ProductStatusOnSerialShort")
);
print $form->selectarray('search_tobatch', $statutarray, $search_tobatch);
}
print '</td>';
}
// Country
if (!empty($arrayfields['p.fk_country']['checked'])) {
@ -1659,7 +1672,13 @@ if ($resql) {
// Lot/Serial
if (!empty($arrayfields['p.tobatch']['checked'])) {
print '<td class="center">';
print yn($obj->tobatch);
if ( empty($conf->global->MAIN_ADVANCE_NUMLOT) )
{
print yn($obj->tobatch);
}
else {
print $product_static->getLibStatut(1, 2);
}
print '</td>';
if (!$i) {
$totalarray['nbfield']++;