From a2d42ebb0808e18ed5ae92a19bf186db4d37b65d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 3 Jul 2025 00:08:51 +0200 Subject: [PATCH] Debug v22 --- htdocs/compta/prelevement/card.php | 7 +++--- htdocs/compta/prelevement/fiche-rejet.php | 27 +++++++++++++---------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/htdocs/compta/prelevement/card.php b/htdocs/compta/prelevement/card.php index 2bc0c95932c..9f24558a6dd 100644 --- a/htdocs/compta/prelevement/card.php +++ b/htdocs/compta/prelevement/card.php @@ -80,8 +80,11 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'inclu $hookmanager->initHooks(array('directdebitprevcard', 'globalcard', 'directdebitprevlist')); $type = $object->type; -// check if salary pl + +// Check if salary or invoice $salaryBonPl = $object->checkIfSalaryBonPrelevement(); + +// Security check if ($type == 'bank-transfer') { $result = restrictedArea($user, 'paymentbybanktransfer', '', '', ''); @@ -99,7 +102,6 @@ if ($type == 'bank-transfer') { } - /* * Actions */ @@ -197,7 +199,6 @@ if (empty($reshook)) { } - /* * View */ diff --git a/htdocs/compta/prelevement/fiche-rejet.php b/htdocs/compta/prelevement/fiche-rejet.php index e7ba1a6d487..6261052b93c 100644 --- a/htdocs/compta/prelevement/fiche-rejet.php +++ b/htdocs/compta/prelevement/fiche-rejet.php @@ -1,9 +1,9 @@ - * Copyright (C) 2005 Laurent Destailleur + * Copyright (C) 2005-2025 Laurent Destailleur * Copyright (C) 2005-2010 Regis Houssin * Copyright (C) 2010-2012 Juanjo Menent - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 Frédéric France * * 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 @@ -46,7 +46,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; */ // Load translation files required by the page -$langs->loadLangs(array("banks", "categories", 'withdrawals', 'bills')); +$langs->loadLangs(array("banks", "categories", "companies", 'withdrawals', 'bills')); // Security check if ($user->socid > 0) { @@ -76,6 +76,9 @@ $object = new BonPrelevement($db); // Load object include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals +// Check if salary or invoice +$salaryBonPl = $object->checkIfSalaryBonPrelevement(); + // Security check if ($user->socid > 0) { accessforbidden(); @@ -89,7 +92,6 @@ if ($type == 'bank-transfer') { } - /* * View */ @@ -225,11 +227,8 @@ $sql .= " WHERE p.rowid=".((int) $object->id); $sql .= " AND pl.fk_prelevement_bons = p.rowid"; $sql .= " AND p.entity IN (".getEntity('facture').")"; $sql .= " AND pl.fk_soc = s.rowid"; -$sql .= " AND pl.statut = 3 "; +$sql .= " AND pl.statut = 3"; $sql .= " AND pr.fk_prelevement_lignes = pl.rowid"; -/*if ($socid) { - $sql .= " AND s.rowid = ".((int) $socid); -}*/ $sql .= " ORDER BY pl.amount DESC"; // Count total nb of records @@ -252,16 +251,20 @@ if ($resql) { // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("Rejects"), $page, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', $num, $nbtotalofrecords, ''); + $param = '&id='.((int) $object->id); + print"\n\n"; print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table print ''; print ''; - print ''; - print ''; - print ''; print ''; $total = 0;
'.$langs->trans("Line").''.$langs->trans("ThirdParty").''.$langs->trans("Amount").''.$langs->trans("Reason").''.$langs->trans("ToBill").''; + print_liste_field_titre("Line", $_SERVER["PHP_SELF"], "pl.rowid", '', $param, '', $sortfield, $sortorder); + print_liste_field_titre((!$salaryBonPl ? "ThirdParty" : "Employee"), $_SERVER["PHP_SELF"], "s.nom", '', $param, '', $sortfield, $sortorder); + print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "pl.amount", '', $param, '', $sortfield, $sortorder, 'right '); + print_liste_field_titre("Reason", $_SERVER["PHP_SELF"], "pr.motif", '', $param, '', $sortfield, $sortorder); + print_liste_field_titre("ToBill", $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder, 'center '); + print_liste_field_titre(""); // Invoice to charge the error. No yet implemented. //print $langs->trans("Invoice"); - print '