From 51b2901d4531d4b4ffe3d7ffc58c0c906e6a57e1 Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Tue, 2 Nov 2021 13:25:36 +0100 Subject: [PATCH] Allowing multiple jounal entries on one trans_no. Ex. trans_no, Joulnal Entry, customer_id. --- purchasing/supplier_payment.php | 3 ++- sales/customer_payments.php | 3 ++- sales/includes/db/cust_trans_db.inc | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/purchasing/supplier_payment.php b/purchasing/supplier_payment.php index d516070a..ab98b662 100644 --- a/purchasing/supplier_payment.php +++ b/purchasing/supplier_payment.php @@ -63,8 +63,9 @@ if (!isset($_POST['bank_account'])) { // first page call $_SESSION['alloc'] = new allocation(ST_SUPPAYMENT, 0, get_post('supplier_id')); if (isset($_GET['PInvoice'])) { + $supp = isset($_POST['supplier_id']) ? $_POST['supplier_id'] : null; // get date and supplier - $inv = get_supp_trans($_GET['PInvoice'], $_GET['trans_type']); + $inv = get_supp_trans($_GET['PInvoice'], $_GET['trans_type'], $supp); if ($inv) { $_SESSION['alloc']->person_id = $_POST['supplier_id'] = $inv['supplier_id']; $_SESSION['alloc']->read(); diff --git a/sales/customer_payments.php b/sales/customer_payments.php index 7612a2b4..78561a91 100644 --- a/sales/customer_payments.php +++ b/sales/customer_payments.php @@ -49,7 +49,8 @@ if (!isset($_POST['bank_account'])) { // first page call if (isset($_GET['SInvoice'])) { // get date and supplier $type = !isset($_GET['Type']) ? ST_SALESINVOICE : $_GET['Type']; - $inv = get_customer_trans($_GET['SInvoice'], $type); + $cust = !isset($_GET['customer_id']) ? null : $_GET['customer_id']; + $inv = get_customer_trans($_GET['SInvoice'], $type, $cust); $dflt_act = get_default_bank_account($inv['curr_code']); $_POST['bank_account'] = $dflt_act['id']; if ($inv) { diff --git a/sales/includes/db/cust_trans_db.inc b/sales/includes/db/cust_trans_db.inc index 710be16f..602c4127 100644 --- a/sales/includes/db/cust_trans_db.inc +++ b/sales/includes/db/cust_trans_db.inc @@ -396,7 +396,7 @@ function get_sql_for_customer_inquiry($from, $to, $cust_id = ALL_TEXT, $filter = } } - $sql .= " GROUP BY trans.trans_no, trans.type"; + $sql .= " GROUP BY trans.trans_no, trans.type, trans.debtor_no"; return $sql; } -- 2.30.2