From 08a35bbcff49db0d0d1780f5453774657ae5a3d3 Mon Sep 17 00:00:00 2001 From: John BOTELLA <68917336+thersane-john@users.noreply.github.com> Date: Tue, 15 Apr 2025 18:17:36 +0200 Subject: [PATCH] NEW : Toggle Display of Supplier Invoices and Credit Notes on Payment Page (#33856) * New supplier paiments display all invoices mode * fix param * fix php stan * add display mode dinstinction for css selector --- htdocs/fourn/facture/paiement.php | 167 ++++++++++++++++++++++-------- htdocs/langs/en_US/bills.lang | 5 + 2 files changed, 129 insertions(+), 43 deletions(-) diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 9b44a560d9f..9d476fa8912 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -76,6 +76,11 @@ $search_amount = GETPOST('search_amount', 'alpha'); // alpha because we must be $search_company = GETPOST('search_company', 'alpha'); $search_payment_num = GETPOST('search_payment_num', 'alpha'); +$displayAllInvoices = getDolGlobalInt('MAIN_PAIMENTS_SHOW_ALL_INVOICE_TYPES', 0); +if (GETPOSTISSET('display-all-invoices')) { + $displayAllInvoices = GETPOSTINT('display-all-invoices'); +} + $limit = GETPOSTINT('limit') ? GETPOST('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); @@ -413,7 +418,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie } $resql = $db->query($sql); if ($resql) { - $num = $db->num_rows($resql); + $totalnboflines = $num = $db->num_rows($resql); if ($num) { $obj = $db->fetch_object($resql); $total = $obj->total; @@ -487,7 +492,8 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie //Add js for AutoFill print ' $(document).ready(function () {'; - print ' $(".AutoFillAmount").on(\'click touchstart\', function(){ + print ' $(".AutoFillAmount").on(\'click touchstart\', function(e){ + e.preventDefault(); $("input[name="+$(this).data(\'rowname\')+"]").val($(this).data("value")).trigger("change"); });'; print ' });'."\n"; @@ -498,6 +504,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print '