2
0
forked from Wavyzz/dolibarr

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

This commit is contained in:
Laurent Destailleur
2024-03-17 13:10:44 +01:00
4 changed files with 35 additions and 24 deletions

View File

@@ -6,6 +6,7 @@
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* 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
@@ -239,7 +240,7 @@ foreach ($list_account_main as $key) {
// Value
print '<td class="right">'; // Do not force class=right, or it align also the content of the select box
$key_value = getDolGlobalString($key);
print $formaccounting->select_account($key_value, $key, 1, '', 1, 1, 'minwidth100 maxwidth300 maxwidthonsmartphone', 'accountsmain');
print $formaccounting->select_account($key_value, $key, 1, [], 1, 1, 'minwidth100 maxwidth300 maxwidthonsmartphone', 'accountsmain');
print '</td>';
print '</tr>';
}
@@ -285,7 +286,7 @@ foreach ($list_account as $key) {
print '</td>';
// Value
print '<td class="right">'; // Do not force class=right, or it align also the content of the select box
print $formaccounting->select_account(getDolGlobalString($key), $key, 1, '', 1, 1, 'minwidth100 maxwidth300 maxwidthonsmartphone', 'accounts');
print $formaccounting->select_account(getDolGlobalString($key), $key, 1, [], 1, 1, 'minwidth100 maxwidth300 maxwidthonsmartphone', 'accounts');
print '</td>';
print '</tr>';
}
@@ -300,7 +301,7 @@ print img_picto('', 'bill', 'class="pictofixedwidth"') . $langs->trans('ACCOUNTI
print '</td>';
// Value
print '<td class="right">'; // Do not force class=right, or it align also the content of the select box
print $formaccounting->select_account(getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT'), 'ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT', 1, '', 1, 1, 'minwidth100 maxwidth300 maxwidthonsmartphone', 'accounts');
print $formaccounting->select_account(getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT'), 'ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT', 1, [], 1, 1, 'minwidth100 maxwidth300 maxwidthonsmartphone', 'accounts');
print '</td>';
print '</tr>';
@@ -327,7 +328,7 @@ print img_picto('', 'supplier_invoice', 'class="pictofixedwidth"') . $langs->tra
print '</td>';
// Value
print '<td class="right">'; // Do not force class=right, or it align also the content of the select box
print $formaccounting->select_account(getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER_DEPOSIT'), 'ACCOUNTING_ACCOUNT_SUPPLIER_DEPOSIT', 1, '', 1, 1, 'minwidth100 maxwidth300 maxwidthonsmartphone', 'accounts');
print $formaccounting->select_account(getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER_DEPOSIT'), 'ACCOUNTING_ACCOUNT_SUPPLIER_DEPOSIT', 1, [], 1, 1, 'minwidth100 maxwidth300 maxwidthonsmartphone', 'accounts');
print '</td>';
print '</tr>';

View File

@@ -6,6 +6,7 @@
* Copyright (C) 2015 Ari Elbaz (elarifr) <github@accedinfo.com>
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* 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
@@ -81,6 +82,12 @@ $search_onpurchase = GETPOST('search_onpurchase', 'alpha');
$accounting_product_mode = GETPOST('accounting_product_mode', 'alpha');
$btn_changetype = GETPOST('changetype', 'alpha');
// Show/hide child product variants
$show_childproducts = 0;
if (isModEnabled('variants')) {
$show_childproducts = GETPOST('search_show_childproducts');
}
if (empty($accounting_product_mode)) {
$accounting_product_mode = 'ACCOUNTANCY_SELL';
}
@@ -179,6 +186,10 @@ if ($action == 'update') {
if (!empty($chk_prod) && $massaction === 'changeaccount') {
//$msg = '<div><span class="accountingprocessing">' . $langs->trans("Processing") . '...</span></div>';
$ok = 0;
$ko = 0;
$msg = '';
$sql = '';
if (!empty($chk_prod) && in_array($accounting_product_mode, $accounting_product_modes)) {
$accounting = new AccountingAccount($db);
@@ -186,8 +197,6 @@ if ($action == 'update') {
$arrayofdifferentselectedvalues = array();
$cpt = 0;
$ok = 0;
$ko = 0;
foreach ($chk_prod as $productid) {
$accounting_account_id = GETPOST('codeventil_'.$productid);
@@ -201,7 +210,6 @@ if ($action == 'update') {
$msg .= '<div><span class="error">'.$langs->trans("ErrorDB").' : '.$langs->trans("Product").' '.$productid.' '.$langs->trans("NotVentilatedinAccount").' : id='.$accounting_account_id.'<br> <pre>'.$sql.'</pre></span></div>';
$ko++;
} else {
$sql = '';
if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
$sql_exists = "SELECT rowid FROM " . MAIN_DB_PREFIX . "product_perentity";
$sql_exists .= " WHERE fk_product = " . ((int) $productid) . " AND entity = " . ((int) $conf->entity);

View File

@@ -209,11 +209,11 @@ class PaymentSocialContribution extends CommonObject
$totalamount = 0;
foreach ($this->amounts as $key => $value) { // How payment is dispatch
$newvalue = price2num($value, 'MT');
$newvalue = (float) price2num($value, 'MT');
$this->amounts[$key] = $newvalue;
$totalamount += $newvalue;
}
$totalamount = price2num($totalamount);
$totalamount = (float) price2num($totalamount);
// Check parameters
if ($totalamount == 0) {
@@ -240,7 +240,7 @@ class PaymentSocialContribution extends CommonObject
foreach ($this->amounts as $key => $amount) {
$contribid = $key;
if (is_numeric($amount) && $amount != 0) {
$amount = price2num($amount);
$amount = (float) price2num($amount);
// If we want to closed paid invoices
if ($closepaidcontrib) {
@@ -251,8 +251,8 @@ class PaymentSocialContribution extends CommonObject
$creditnotes = 0;
//$deposits=$contrib->getSumDepositsUsed();
$deposits = 0;
$alreadypayed = price2num($paiement + $creditnotes + $deposits, 'MT');
$remaintopay = price2num($contrib->amount - $paiement - $creditnotes - $deposits, 'MT');
$alreadypayed = (float) price2num($paiement + $creditnotes + $deposits, 'MT');
$remaintopay = (float) price2num($contrib->amount - $paiement - $creditnotes - $deposits, 'MT');
if ($remaintopay == 0) {
$result = $contrib->setPaid($user);
} else {
@@ -369,7 +369,7 @@ class PaymentSocialContribution extends CommonObject
$this->fk_charge = (int) $this->fk_charge;
}
if (isset($this->amount)) {
$this->amount = trim($this->amount);
$this->amount = (float) $this->amount;
}
if (isset($this->fk_typepaiement)) {
$this->fk_typepaiement = (int) $this->fk_typepaiement;

View File

@@ -477,11 +477,22 @@ class pdf_cornas extends ModelePDFSuppliersOrders
// Use new auto column system
$this->prepareArrayColumnField($object, $outputlangs, $hidedetails, $hidedesc, $hideref);
$pageposbeforeprintlines = $pdf->getPage();
$pagenb = $pageposbeforeprintlines;
// Show square
if ($pagenb == $pageposbeforeprintlines) {
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, $hidetop, 0, $object->multicurrency_code);
$bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
} else {
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0, $object->multicurrency_code);
$bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
}
$nexY = $tab_top + $this->tabTitleHeight;
// Loop on each lines
$pageposbeforeprintlines = $pdf->getPage();
$pagenb = $pageposbeforeprintlines;
for ($i = 0; $i < $nblines; $i++) {
$curY = $nexY;
$pdf->SetFont('', '', $default_font_size - 1); // Into loop to work with multipage
@@ -765,15 +776,6 @@ class pdf_cornas extends ModelePDFSuppliersOrders
}
}
// Show square
if ($pagenb == $pageposbeforeprintlines) {
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, $hidetop, 0, $object->multicurrency_code);
$bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
} else {
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0, $object->multicurrency_code);
$bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
}
// Affiche zone infos
$posy = $this->_tableau_info($pdf, $object, $bottomlasttab, $outputlangs);