From 7a7444a97abd4105eb1b55f6204e3556f472e0c6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 24 Sep 2024 10:47:42 +0200 Subject: [PATCH 1/8] Typo --- htdocs/langs/en_US/accountancy.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index 48724731d84..b799215f95d 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -270,7 +270,7 @@ DescVentilCustomer=Consult here the list of customer invoice lines bound (or not DescVentilMore=In most cases, if you use predefined products or services and you set the account (from chart of account) on the product/service card, the application will be able to make all the binding between your invoice lines and the accounting account of your chart of accounts, just in one click with the button "%s". If account was not set on product/service cards or if you still have some lines not bound to an account, you will have to make a manual binding from the menu "%s". DescVentilDoneCustomer=Consult here the list of the lines of invoices customers and their product account from chart of account DescVentilTodoCustomer=Bind invoice lines not already bound with a product account from chart of account -ChangeAccount=Change the product/service account (from chart of account) for the selected lines with the following account: +ChangeAccount=Change the product/service account (from chart of account) for the selected lines with: Vide=- DescVentilSupplier=Consult here the list of vendor invoice lines bound or not yet bound to a product account from chart of account (only record not already transferred in accountancy are visible) DescVentilDoneSupplier=Consult here the list of the lines of vendor invoices and their accounting account From ceee0a98857f1ae13508c1017ad08ed9e734b700 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 24 Sep 2024 10:54:12 +0200 Subject: [PATCH 2/8] Fix look and feel --- htdocs/accountancy/customer/lines.php | 2 +- htdocs/accountancy/expensereport/lines.php | 2 +- htdocs/accountancy/supplier/lines.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index 6d8dd13951f..cb14e29cce5 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -390,7 +390,7 @@ if ($result) { print_barre_liste($langs->trans("InvoiceLinesDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit); print ''.$langs->trans("DescVentilDoneCustomer").'
'; - print '
'.$langs->trans("ChangeAccount").' '; + print '
'.$langs->trans("ChangeAccount").'
'; print $formaccounting->select_account($account_parent, 'account_parent', 2, array(), 0, 0, 'maxwidth300 maxwidthonsmartphone valignmiddle'); print '
'; diff --git a/htdocs/accountancy/expensereport/lines.php b/htdocs/accountancy/expensereport/lines.php index c6519533a33..a07a24cf7ad 100644 --- a/htdocs/accountancy/expensereport/lines.php +++ b/htdocs/accountancy/expensereport/lines.php @@ -318,7 +318,7 @@ if ($result) { print_barre_liste($langs->trans("ExpenseReportLinesDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit); print ''.$langs->trans("DescVentilDoneExpenseReport").'
'; - print '
'.$langs->trans("ChangeAccount").' '; + print '
'.$langs->trans("ChangeAccount").'
'; print $formaccounting->select_account($account_parent, 'account_parent', 2, array(), 0, 0, 'maxwidth300 maxwidthonsmartphone valignmiddle'); print '
'; diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php index 5245c67d683..44ba2ce010f 100644 --- a/htdocs/accountancy/supplier/lines.php +++ b/htdocs/accountancy/supplier/lines.php @@ -398,7 +398,7 @@ if ($result) { print_barre_liste($langs->trans("InvoiceLinesDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit); print ''.$langs->trans("DescVentilDoneSupplier").'
'; - print '
'.$langs->trans("ChangeAccount").' '; + print '
'.$langs->trans("ChangeAccount").'
'; print $formaccounting->select_account($account_parent, 'account_parent', 2, array(), 0, 0, 'maxwidth300 maxwidthonsmartphone valignmiddle'); print '
'; From 7ff3d7356d682d2f142e7f064f4282b9715b2a72 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 24 Sep 2024 11:43:31 +0200 Subject: [PATCH 3/8] FIX accounting transfer when nb of lines is not zero but amount is zero --- htdocs/accountancy/customer/card.php | 18 ++++++--- htdocs/accountancy/customer/index.php | 34 ++++++---------- htdocs/accountancy/expensereport/index.php | 29 +++++++------ htdocs/accountancy/supplier/card.php | 15 ++++--- htdocs/accountancy/supplier/index.php | 47 +++++++++++----------- 5 files changed, 72 insertions(+), 71 deletions(-) diff --git a/htdocs/accountancy/customer/card.php b/htdocs/accountancy/customer/card.php index f606cc48868..a7e20f22b74 100644 --- a/htdocs/accountancy/customer/card.php +++ b/htdocs/accountancy/customer/card.php @@ -101,13 +101,14 @@ $formaccounting = new FormAccounting($db); if (!empty($id)) { $sql = "SELECT f.ref, f.rowid as facid, l.fk_product, l.description, l.price,"; - $sql .= " l.qty, l.rowid, l.tva_tx, l.remise_percent, l.subprice,"; + $sql .= " l.qty, l.rowid, l.tva_tx, l.remise_percent, l.subprice, l.fk_code_ventilation,"; + $sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label,"; if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) { $sql .= " ppe.accountancy_code_sell as code_sell,"; } else { $sql .= " p.accountancy_code_sell as code_sell,"; } - $sql .= " l.fk_code_ventilation, aa.account_number, aa.label"; + $sql .= " aa.account_number, aa.label"; $sql .= " FROM ".MAIN_DB_PREFIX."facturedet as l"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = l.fk_product"; if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) { @@ -139,18 +140,23 @@ if (!empty($id)) { print ''; - // Ref facture + // Ref invoice print ''; $facture_static->ref = $objp->ref; $facture_static->id = $objp->facid; print ''; print ''; - print ''; - print ''; - print ''; + print ''; + + print ''; + print ''; + + print ''; + print '
'.$langs->trans("Invoice").''.$facture_static->getNomUrl(1).'
'.$langs->trans("Line").''.nl2br($objp->description).'
'.$langs->trans("Account").''; + print '
'.$langs->trans("Description").''.dolPrintHTML($objp->description).'
'.$langs->trans("ProductLabel").''.dol_trunc($objp->product_label, 24).'
'.$langs->trans("Account").''; print $formaccounting->select_account($objp->fk_code_ventilation, 'codeventil', 1); print '
'; print dol_get_fiche_end(); diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index b1b82d35735..9594f4aa722 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -17,7 +17,6 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * */ /** @@ -40,17 +39,6 @@ $langs->loadLangs(array("compta", "bills", "other", "accountancy")); $validatemonth = GETPOSTINT('validatemonth'); $validateyear = GETPOSTINT('validateyear'); -// Security check -if (!isModEnabled('accounting')) { - accessforbidden(); -} -if ($user->socid > 0) { - accessforbidden(); -} -if (!$user->hasRight('accounting', 'bind', 'write')) { - accessforbidden(); -} - $accountingAccount = new AccountingAccount($db); $month_start = getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1); @@ -84,7 +72,7 @@ if (!isModEnabled('accounting')) { if ($user->socid > 0) { accessforbidden(); } -if (!$user->hasRight('accounting', 'mouvements', 'lire')) { +if (!$user->hasRight('accounting', 'bind', 'write')) { accessforbidden(); } @@ -259,7 +247,7 @@ if ($action == 'validatehistory' && $user->hasRight('accounting', 'bind', 'write } if ($suggestedid > 0) { - $sqlupdate = "UPDATE ".MAIN_DB_PREFIX."facturedet"; + $sqlupdate = "UPDATE ".$db->prefix()."facturedet"; $sqlupdate .= " SET fk_code_ventilation = ".((int) $suggestedid); $sqlupdate .= " WHERE fk_code_ventilation <= 0 AND product_type <= 2 AND rowid = ".((int) $facture_static_det->id); @@ -320,7 +308,7 @@ if (getDolGlobalInt('INVOICE_USE_SITUATION') == 1) { $y = $year_current; -$buttonbind = ''.img_picto($langs->trans("ValidateHistory"), 'link', 'class="pictofixedwidth fa-color-unset"').$langs->trans("ValidateHistory").''; +$buttonbind = ''.img_picto($langs->trans("ValidateHistory"), 'link', 'class="pictofixedwidth fa-color-unset"').$langs->trans("ValidateHistory").''; print_barre_liste(img_picto('', 'unlink', 'class="paddingright fa-color-unset"').$langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1, 0, $buttonbind); //print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, ''); @@ -362,8 +350,9 @@ for ($i = 1; $i <= 12; $i++) { $j -= 12; } $sql .= " SUM(".$db->ifsql("MONTH(f.datef) = ".((string) $j), "fd.total_ht", "0").") AS month".str_pad((string) $j, 2, "0", STR_PAD_LEFT).","; + $sql .= " SUM(".$db->ifsql("MONTH(f.datef) = ".((string) $j), "1", "0").") AS nbmonth".str_pad((string) $j, 2, "0", STR_PAD_LEFT).","; } -$sql .= " SUM(fd.total_ht) as total"; +$sql .= " SUM(fd.total_ht) as total, COUNT(fd.rowid) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."facturedet as fd"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON f.rowid = fd.fk_facture"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON aa.rowid = fd.fk_code_ventilation"; @@ -420,6 +409,7 @@ if ($resql) { print $row[1]; } print ''; + for ($i = 2; $i <= 13; $i++) { $cursormonth = (getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) + $i - 2); if ($cursormonth > 12) { @@ -428,17 +418,19 @@ if ($resql) { $cursoryear = ($cursormonth < getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1)) ? $y + 1 : $y; $tmp = dol_getdate(dol_get_last_day($cursoryear, $cursormonth, 'gmt'), false, 'gmt'); - print ''; - print price($row[$i]); + print ''; + print price($row[2*$i - 2]); // Add link to make binding - if (!empty(price2num($row[$i]))) { + if (!empty(price2num($row[2*$i - 2])) || !empty($row[2*$i - 1])) { print ''; print img_picto($langs->trans("ValidateHistory").' ('.$langs->trans('Month'.str_pad((string) $cursormonth, 2, '0', STR_PAD_LEFT)).' '.$cursoryear.')', 'link', 'class="marginleft2"'); print ''; } print ''; } - print ''.price($row[14]).''; + + print ''.price($row[26]).''; + print ''; } $db->free($resql); @@ -584,7 +576,7 @@ if (getDolGlobalString('SHOW_TOTAL_OF_PREVIOUS_LISTS_IN_LIN_PAGE')) { // This pa print '
'; print ''; - print ''; + print ''; for ($i = 1; $i <= 12; $i++) { $j = $i + getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) - 1; if ($j > 12) { diff --git a/htdocs/accountancy/expensereport/index.php b/htdocs/accountancy/expensereport/index.php index f3dbc54f78a..174ff4039da 100644 --- a/htdocs/accountancy/expensereport/index.php +++ b/htdocs/accountancy/expensereport/index.php @@ -77,17 +77,17 @@ if (!$user->hasRight('accounting', 'bind', 'write')) { */ if (($action == 'clean' || $action == 'validatehistory') && $user->hasRight('accounting', 'bind', 'write')) { - // Clean database + // Clean database by removing binding done on non existing or no more existing accounts $db->begin(); - $sql1 = "UPDATE ".MAIN_DB_PREFIX."expensereport_det as erd"; + $sql1 = "UPDATE ".$db->prefix()."expensereport_det as erd"; $sql1 .= " SET fk_code_ventilation = 0"; $sql1 .= ' WHERE erd.fk_code_ventilation NOT IN'; $sql1 .= ' (SELECT accnt.rowid '; - $sql1 .= ' FROM '.MAIN_DB_PREFIX.'accounting_account as accnt'; - $sql1 .= ' INNER JOIN '.MAIN_DB_PREFIX.'accounting_system as syst'; + $sql1 .= ' FROM '.$db->prefix().'accounting_account as accnt'; + $sql1 .= ' INNER JOIN '.$db->prefix().'accounting_system as syst'; $sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid='.((int) getDolGlobalInt('CHARTOFACCOUNTS')).' AND accnt.entity = '.((int) $conf->entity).')'; - $sql1 .= ' AND erd.fk_expensereport IN (SELECT rowid FROM '.MAIN_DB_PREFIX.'expensereport WHERE entity = '.((int) $conf->entity).')'; - $sql1 .= ' AND fk_code_ventilation <> 0'; + $sql1 .= ' AND erd.fk_expensereport IN (SELECT rowid FROM '.$db->prefix().'expensereport WHERE entity = '.((int) $conf->entity).')'; + $sql1 .= " AND fk_code_ventilation <> 0"; dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG); $resql1 = $db->query($sql1); if (!$resql1) { @@ -194,7 +194,7 @@ print '
'; $y = $year_current; -$buttonbind = ''.img_picto('', 'link', 'class="paddingright fa-color-unset"').$langs->trans("ValidateHistory").''; +$buttonbind = ''.img_picto($langs->trans("ValidateHistory"), 'link', 'class="pictofixedwidth fa-color-unset"').$langs->trans("ValidateHistory").''; print_barre_liste(img_picto('', 'unlink', 'class="paddingright fa-color-unset"').$langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1, 0, $buttonbind); @@ -238,8 +238,9 @@ for ($i = 1; $i <= 12; $i++) { $j -= 12; } $sql .= " SUM(".$db->ifsql("MONTH(er.date_debut) = ".((int) $j), "erd.total_ht", "0").") AS month".str_pad((string) $j, 2, "0", STR_PAD_LEFT).","; + $sql .= " SUM(".$db->ifsql("MONTH(er.date_debut) = ".((string) $j), "1", "0").") AS nbmonth".str_pad((string) $j, 2, "0", STR_PAD_LEFT).","; } -$sql .= " SUM(erd.total_ht) as total"; +$sql .= " SUM(erd.total_ht) as total, COUNT(erd.rowid) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."expensereport_det as erd"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."expensereport as er ON er.rowid = erd.fk_expensereport"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON aa.rowid = erd.fk_code_ventilation"; @@ -294,17 +295,17 @@ if ($resql) { $cursoryear = ($cursormonth < getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1)) ? $y + 1 : $y; $tmp = dol_getdate(dol_get_last_day($cursoryear, $cursormonth, 'gmt'), false, 'gmt'); - print ''; } - print ''; + print ''; print ''; } $db->free($resql); @@ -371,14 +372,12 @@ if ($resql) { while ($row = $db->fetch_row($resql)) { print ''; - print ''; - //print ''; } - print ''; + print ''; print ''; } $db->free($resql); From 2cde0c47a4c1a7baff46dd39bbb30a87b69819c8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 24 Sep 2024 12:08:05 +0200 Subject: [PATCH 4/8] Fix CSS --- htdocs/compta/facture/invoicetemplate_list.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index 54102500e9e..7b5fe471e7f 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -859,8 +859,7 @@ while ($i < $imaxinloop) { print $langs->trans("MaxNumberOfGenerationReached"); } elseif (empty($objp->frequency) || $db->jdate($objp->date_when) <= $today) { print ''; - print img_picto($langs->trans("CreateBill"), 'add', 'class="paddingrightonly"'); - //print $langs->trans("CreateBill"); + print img_picto($langs->trans("CreateBill"), 'add', 'class="none"'); print ''; } else { print $form->textwithpicto('', $langs->trans("DateIsNotEnough")); From fe193baaedc434b9181f2682580f799e3fed44be Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 24 Sep 2024 13:11:52 +0200 Subject: [PATCH 5/8] FIX Warning visible when it should not --- htdocs/compta/prelevement/factures.php | 15 +++++++++------ htdocs/langs/en_US/errors.lang | 1 + htdocs/modulebuilder/template/myobject_card.php | 1 + 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/htdocs/compta/prelevement/factures.php b/htdocs/compta/prelevement/factures.php index 534051f96f3..72267892a10 100644 --- a/htdocs/compta/prelevement/factures.php +++ b/htdocs/compta/prelevement/factures.php @@ -37,6 +37,9 @@ require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php'; // Load translation files required by the page $langs->loadLangs(array('banks', 'categories', 'bills', 'companies', 'withdrawals', 'salaries', 'suppliers')); +$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)).basename(__FILE__, '.php')); // To manage different context of search +$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') + // Get supervariables $id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); @@ -94,7 +97,6 @@ $thirdpartytmp = new Societe($db); llxHeader('', $langs->trans("WithdrawalsReceipts")); if ($id > 0 || $ref) { - $object->fetch($id, $ref); if (empty($object->id)) { $langs->load('errors'); echo '
'.$langs->trans("ErrorRecordNotFound").'
'; @@ -311,9 +313,9 @@ if ($resql) { print_liste_field_titre("RefSupplierShort", $_SERVER["PHP_SELF"], "f.ref_supplier", '', $param, '', $sortfield, $sortorder); } print_liste_field_titre(($salaryBonPl ? "Employee" : "ThirdParty"), $_SERVER["PHP_SELF"], "s.nom", '', $param, '', $sortfield, $sortorder); - print_liste_field_titre(($salaryBonPl ? "AmountSalary" : "AmountInvoice"), $_SERVER["PHP_SELF"], "f.total_ttc", "", $param, 'class="right"', $sortfield, $sortorder); - print_liste_field_titre("AmountRequested", $_SERVER["PHP_SELF"], "pl.amount", "", $param, 'class="right"', $sortfield, $sortorder); - print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "", "", $param, 'align="center"', $sortfield, $sortorder); + print_liste_field_titre(($salaryBonPl ? "AmountSalary" : "AmountInvoice"), $_SERVER["PHP_SELF"], "f.total_ttc", "", $param, '', $sortfield, $sortorder, 'right '); + print_liste_field_titre("AmountRequested", $_SERVER["PHP_SELF"], "pl.amount", "", $param, '', $sortfield, $sortorder, 'right '); + print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "", "", $param, '"', $sortfield, $sortorder, 'center '); print "\n"; $totalinvoices = 0; @@ -413,8 +415,9 @@ if ($resql) { print "\n"; print '
\n"; diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index b0947e8291d..849120fd0c6 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -388,6 +388,7 @@ WarningParentIDDoesNotExistAnymore=This parent ID does not exists anymore WarningReadBankAlsoAllowedIfUserHasPermission=Warning, reading bank account is also allowed with the permission to Manage chart of account WarningNoDataTransferedInAccountancyYet=Please note, there is no data in the accounting table. Please transfer your data recorded in the application to the accounting section or change the calculation mode to analyze the data recorded outside of accounting. WarningChangingThisMayBreakStopTaskScheduler=Warning, changing this value may disable the scheduler +WarningAmountOfFileDiffersFromSumOfLines=Warning, amount of file (%s) differs from the sum of lines (%s) SwissQrOnlyVIR = SwissQR invoice can only be added on invoices set to be paid with credit transfer payments. SwissQrCreditorAddressInvalid = Creditor address is invalid (are ZIP and city set? (%s) SwissQrCreditorInformationInvalid = Creditor information is invalid for IBAN (%s): %s diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index 1cca16368ea..ee78e549082 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -98,6 +98,7 @@ $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str $backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used $backtopagejsfields = GETPOST('backtopagejsfields', 'alpha'); +$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') $dol_openinpopup = GETPOST('dol_openinpopup', 'aZ09'); if (!empty($backtopagejsfields)) { From 6d19f1636769d3f0749c606dbef6e27b35e2c04d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 24 Sep 2024 13:14:07 +0200 Subject: [PATCH 6/8] FIX Missing picto on user link --- htdocs/compta/prelevement/factures.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/prelevement/factures.php b/htdocs/compta/prelevement/factures.php index 72267892a10..45bd1adb550 100644 --- a/htdocs/compta/prelevement/factures.php +++ b/htdocs/compta/prelevement/factures.php @@ -339,7 +339,7 @@ if ($resql) { $salarytmp->fetch($obj->salaryid); $usertmp->fetch($obj->userid); $itemurl = $salarytmp->getNomUrl(1); - $partyurl = $usertmp->getNomUrl(1); + $partyurl = $usertmp->getNomUrl(-1); } elseif ($invoicetmpcustomer instanceof Facture && $invoicetmpsupplier instanceof FactureFournisseur) { if ($obj->type == 'bank-transfer') { $invoicetmp = $invoicetmpsupplier; From 397ccc576f05b6d0b567796ac6ef3b0f27e5802e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 24 Sep 2024 13:23:37 +0200 Subject: [PATCH 7/8] FIX Remove wrong button --- htdocs/compta/bank/bankentries_list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index ecf9744402c..1875025ef82 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -1916,9 +1916,9 @@ if ($resql) { print ''; } elseif ($i == $posconciliatecol) { print ''; } else { print ''; From 72d2d716a1611be772f7397636789959011bc705 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 24 Sep 2024 14:28:59 +0200 Subject: [PATCH 8/8] CSS --- htdocs/user/card.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 32fbeac19cd..607f8e1695c 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1746,7 +1746,7 @@ if ($action == 'create' || $action == 'adduserldap') { // Color user if (isModEnabled('agenda')) { - print ''; + print ''; print ''; @@ -1755,8 +1755,8 @@ if ($action == 'create' || $action == 'adduserldap') { // Categories if (isModEnabled('category') && $user->hasRight("categorie", "read")) { - print ''; - print ''; + print ''; } @@ -1765,7 +1765,7 @@ if ($action == 'create' || $action == 'adduserldap') { if (getDolGlobalInt('MAIN_MULTILANGS')) { $langs->load("languages"); require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - print '
'.$langs->trans("TotalVente").'
'.$langs->trans("TotalVente").''; - print price($row[$i]); + print ''; + print price($row[2*$i - 2]); // Add link to make binding - if (!empty(price2num($row[$i]))) { + if (!empty(price2num($row[2*$i - 2])) || !empty($row[2*$i - 1])) { print ''; print img_picto($langs->trans("ValidateHistory").' ('.$langs->trans('Month'.str_pad((string) $cursormonth, 2, '0', STR_PAD_LEFT)).' '.$cursoryear.')', 'link', 'class="marginleft2"'); print ''; } print ''.price($row[14]).''.price($row[26]).'
'; + print ''; if ($row[0] == 'tobind') { //print ''.$langs->trans("Unknown").''; } else { print length_accountg($row[0]).' - '; } - //print ''; if ($row[0] == 'tobind') { print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/expensereport/list.php?search_year='.((int) $y), $langs->transnoentitiesnoconv("ToBind")); } else { diff --git a/htdocs/accountancy/supplier/card.php b/htdocs/accountancy/supplier/card.php index 153c86b7c6c..03332e9a862 100644 --- a/htdocs/accountancy/supplier/card.php +++ b/htdocs/accountancy/supplier/card.php @@ -141,20 +141,23 @@ if (!empty($id)) { print ''; - // ref invoice + // Ref invoice print ''; $facturefournisseur_static->ref = $objp->ref; $facturefournisseur_static->id = $objp->facid; print ''; print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + + print ''; + print ''; + + print ''; + print '
'.$langs->trans("BillsSuppliers").''.$facturefournisseur_static->getNomUrl(1).'
'.$langs->trans("Line").''.stripslashes(nl2br($objp->description)).'
'.$langs->trans("ProductLabel").''.dol_trunc($objp->product_label, 24).'
'.$langs->trans("Account").''; + print '
'.$langs->trans("Description").''.dolPrintHTML($objp->description).'
'.$langs->trans("ProductLabel").''.dol_trunc($objp->product_label, 24).'
'.$langs->trans("Account").''; print $formaccounting->select_account($objp->fk_code_ventilation, 'codeventil', 1); print '
'; print dol_get_fiche_end(); diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php index bb9572bc879..19064b24d6d 100644 --- a/htdocs/accountancy/supplier/index.php +++ b/htdocs/accountancy/supplier/index.php @@ -81,7 +81,7 @@ if (!$user->hasRight('accounting', 'bind', 'write')) { */ if (($action == 'clean' || $action == 'validatehistory') && $user->hasRight('accounting', 'bind', 'write')) { - // Clean database + // Clean database by removing binding done on non existing or no more existing accounts $db->begin(); $sql1 = "UPDATE ".$db->prefix()."facture_fourn_det as fd"; $sql1 .= " SET fk_code_ventilation = 0"; @@ -178,31 +178,31 @@ if ($action == 'validatehistory' && $user->hasRight('accounting', 'bind', 'write while ($i < min($num_lines, 10000)) { // No more than 10000 at once $objp = $db->fetch_object($result); - $thirdpartystatic->id = $objp->socid; - $thirdpartystatic->name = $objp->name; - $thirdpartystatic->client = $objp->client; - $thirdpartystatic->fournisseur = $objp->fournisseur; - $thirdpartystatic->code_client = $objp->code_client; - $thirdpartystatic->code_compta_client = $objp->code_compta_client; - $thirdpartystatic->code_fournisseur = $objp->code_fournisseur; - $thirdpartystatic->code_compta_fournisseur = $objp->code_compta_fournisseur; - $thirdpartystatic->email = $objp->email; - $thirdpartystatic->country_code = $objp->country_code; - $thirdpartystatic->tva_intra = $objp->tva_intra; + $thirdpartystatic->id = !empty($objp->socid) ? $objp->socid : 0; + $thirdpartystatic->name = !empty($objp->name) ? $objp->name : ""; + $thirdpartystatic->client = !empty($objp->client) ? $objp->client : ""; + $thirdpartystatic->fournisseur = !empty($objp->fournisseur) ? $objp->fournisseur : ""; + $thirdpartystatic->code_client = !empty($objp->code_client) ? $objp->code_client : ""; + $thirdpartystatic->code_compta_client = !empty($objp->code_compta_client) ? $objp->code_compta_client : ""; + $thirdpartystatic->code_fournisseur = !empty($objp->code_fournisseur) ? $objp->code_fournisseur : ""; + $thirdpartystatic->code_compta_fournisseur = !empty($objp->code_compta_fournisseur) ? $objp->code_compta_fournisseur : ""; + $thirdpartystatic->email = !empty($objp->email) ? $objp->email : ""; + $thirdpartystatic->country_code = !empty($objp->country_code) ? $objp->country_code : ""; + $thirdpartystatic->tva_intra = !empty($objp->tva_intra) ? $objp->tva_intra : ""; $thirdpartystatic->code_compta_product = $objp->company_code_buy; // The accounting account for product stored on thirdparty object (for level3 suggestion) $product_static->ref = $objp->product_ref; $product_static->id = $objp->product_id; $product_static->type = $objp->type; $product_static->label = $objp->product_label; - $product_static->status = $objp->status; - $product_static->status_buy = $objp->status_buy; + $product_static->status = !empty($objp->status) ? $objp->status : 0; + $product_static->status_buy = !empty($objp->status_buy) ? $objp->status_buy : 0; $product_static->accountancy_code_sell = $objp->code_sell; $product_static->accountancy_code_sell_intra = $objp->code_sell_intra; $product_static->accountancy_code_sell_export = $objp->code_sell_export; - $product_static->accountancy_code_buy = $objp->code_buy; - $product_static->accountancy_code_buy_intra = $objp->code_buy_intra; - $product_static->accountancy_code_buy_export = $objp->code_buy_export; + $product_static->accountancy_code_buy = !empty($objp->code_buy) ? $objp->code_buy : ""; + $product_static->accountancy_code_buy_intra = !empty($objp->code_buy_intra) ? $objp->code_buy_intra : ""; + $product_static->accountancy_code_buy_export = !empty($objp->code_buy_export) ? $objp->code_buy_export : ""; $product_static->tva_tx = $objp->tva_tx_prod; $facture_static->ref = $objp->ref; @@ -301,7 +301,7 @@ print '
'; $y = $year_current; -$buttonbind = ''.img_picto('', 'link', 'class="paddingright fa-color-unset smallpaddingimp"').$langs->trans("ValidateHistory").''; +$buttonbind = ''.img_picto($langs->trans("ValidateHistory"), 'link', 'class="pictofixedwidth fa-color-unset"').$langs->trans("ValidateHistory").''; print_barre_liste(img_picto('', 'unlink', 'class="paddingright fa-color-unset"').$langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1, 0, $buttonbind); @@ -344,8 +344,9 @@ for ($i = 1; $i <= 12; $i++) { $j -= 12; } $sql .= " SUM(".$db->ifsql("MONTH(ff.datef) = ".((int) $j), "ffd.total_ht", "0").") AS month".str_pad((string) $j, 2, "0", STR_PAD_LEFT).","; + $sql .= " SUM(".$db->ifsql("MONTH(ff.datef) = ".((string) $j), "1", "0").") AS nbmonth".str_pad((string) $j, 2, "0", STR_PAD_LEFT).","; } -$sql .= " SUM(ffd.total_ht) as total"; +$sql .= " SUM(ffd.total_ht) as total, COUNT(ffd.rowid) as nb"; $sql .= " FROM ".$db->prefix()."facture_fourn_det as ffd"; $sql .= " LEFT JOIN ".$db->prefix()."facture_fourn as ff ON ff.rowid = ffd.fk_facture_fourn"; $sql .= " LEFT JOIN ".$db->prefix()."accounting_account as aa ON aa.rowid = ffd.fk_code_ventilation"; @@ -405,17 +406,17 @@ if ($resql) { $cursoryear = ($cursormonth < getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1)) ? $y + 1 : $y; $tmp = dol_getdate(dol_get_last_day($cursoryear, $cursormonth, 'gmt'), false, 'gmt'); - print '
'; - print price($row[$i]); + print ''; + print price($row[2*$i - 2]); // Add link to make binding - if (!empty(price2num($row[$i]))) { + if (!empty(price2num($row[2*$i - 2])) || !empty($row[2*$i - 1])) { print ''; print img_picto($langs->trans("ValidateHistory").' ('.$langs->trans('Month'.str_pad((string) $cursormonth, 2, '0', STR_PAD_LEFT)).' '.$cursoryear.')', 'link', 'class="marginleft2"'); print ''; } print ''.price($row[14]).''.price($row[26]).'
'; // If the page show all record (no pagination) and total does not match total of file, we show a warning. Should not happen. - if (($nbtotalofrecords <= $num) && $totalamount_requested != $object->amount) { - print img_warning("AmountOfFileDiffersFromSumOfInvoices"); + if (($nbtotalofrecords <= $num) && $totalamount_requested != (float) $object->amount) { + $langs->load("errors"); + print img_warning("WarningAmountOfFileDiffersFromSumOfLines", (float) $object->amount, $totalamount_requested); } print price($totalamount_requested); print "'.price($totalarray['totalcred']).''; - if ($user->hasRight('banque', 'consolidate') && $action == 'reconcile') { + /*if ($user->hasRight('banque', 'consolidate') && $action == 'reconcile') { print ''; - } + }*/ print '
'.$langs->trans("ColorUser").'
'.$langs->trans("ColorUser").''; print $formother->showColor($object->color, ''); print '
'.$langs->trans("Categories").''; + print '
'.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_USER, 1); print '
'; + print '
'; print $form->textwithpicto($langs->trans("DefaultLang"), $langs->trans("WarningNotLangOfInterface", $langs->transnoentitiesnoconv("UserGUISetup"))); print ''; //$s=picto_from_langcode($object->default_lang); @@ -1862,16 +1862,16 @@ if ($action == 'create' || $action == 'adduserldap') { print '
'; print '
'; - print ''; + print '
'; - print ''; - print ''; + print ''; + print ''; print ''; // Date login validity - print ''; + print ''; print ''; + print ''; print ''; @@ -1941,7 +1941,7 @@ if ($action == 'create' || $action == 'adduserldap') { } if (dol_string_nohtmltag($valuetoshow)) { // If there is a real visible content to show - print ''; + print ''; print '";
'; - print img_picto('', 'security', 'class="paddingleft pictofixedwidth"').$langs->trans("Credentials"); - print '
'; + print img_picto('', 'security', 'class="paddingleft pictofixedwidth"').$langs->trans("Security"); + print '
'.$langs->trans("RangeOfLoginValidity").'
'.$langs->trans("RangeOfLoginValidity").''; if ($object->datestartvalidity) { print ''.$langs->trans("FromDate").' '; @@ -1886,7 +1886,7 @@ if ($action == 'create' || $action == 'adduserldap') { // Alternative email for OAUth2 login if (!empty($object->email_oauth2) && preg_match('/googleoauth/', $dolibarr_main_authentication)) { - print '
'.$langs->trans("AlternativeEmailForOAuth2").'
'.$langs->trans("AlternativeEmailForOAuth2").''; print dol_print_email($object->email_oauth2); print '
'.$langs->trans("Password").'
'.$langs->trans("Password").''; print $valuetoshow; print "