From 574560928e6d43007858a8655d71c9055739f986 Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Sun, 13 Oct 2013 21:11:40 +0200 Subject: [PATCH] Customer Allocation Inquiry, Supplier Allocation Inquiry: fixed payment forms initialization, different icons for playment and allocation links. --- config.default.php | 23 ----------------- includes/types.inc | 24 ++++++++++++++++++ .../allocations/supplier_allocation_main.php | 2 +- .../inquiry/supplier_allocation_inquiry.php | 2 +- purchasing/supplier_payment.php | 9 ++++--- .../allocations/customer_allocation_main.php | 2 +- sales/customer_payments.php | 15 ++++++----- sales/inquiry/customer_allocation_inquiry.php | 2 +- themes/aqua/images/alloc.png | Bin 0 -> 518 bytes themes/cool/images/alloc.png | Bin 0 -> 518 bytes themes/default/images/alloc.png | Bin 0 -> 518 bytes 11 files changed, 42 insertions(+), 37 deletions(-) create mode 100644 themes/aqua/images/alloc.png create mode 100644 themes/cool/images/alloc.png create mode 100644 themes/default/images/alloc.png diff --git a/config.default.php b/config.default.php index 7067ae78..9bef6d92 100644 --- a/config.default.php +++ b/config.default.php @@ -230,29 +230,6 @@ if(isset($_SESSION["wa_current_user"])) { // additional js source included in header $js_lib = $js_userlib = array(); -if (!defined('ICON_EDIT')) -{ - define("ICON_EDIT", "edit.gif"); - define("ICON_DELETE", "delete.gif"); - define("ICON_ADD", "ok.gif"); - define("ICON_UPDATE", "ok.gif"); - define("ICON_OK", "ok.gif"); - define("ICON_CANCEL", "cancel.png"); - define("ICON_GL", "gl.png"); - define("ICON_PRINT", "print.png"); - define("ICON_PDF", "pdf.gif"); - define("ICON_DOC", "invoice.gif"); - define("ICON_CREDIT", "credit.gif"); - define("ICON_RECEIVE", "receive.gif"); - define("ICON_DOWN", "download.gif"); - define("ICON_MONEY", "money.png"); - define("ICON_REMOVE", "remove.png"); - define("ICON_REPORT", "report.png"); - define("ICON_VIEW", "view.gif"); - define("ICON_SUBMIT", "ok.gif"); - define("ICON_ESCAPE", "escape.png"); -} - /* Display a dropdown select box for choosing Company to login if false. Show a blank editbox only if true where the Company NickName diff --git a/includes/types.inc b/includes/types.inc index 79ef8be7..37ec321c 100644 --- a/includes/types.inc +++ b/includes/types.inc @@ -228,4 +228,28 @@ define('PTT_FOLLOWING', 4); include_once($path_to_root . '/includes/sysnames.inc'); +//--------------------------------------------------------------------------------- +// Constants optionally redefined locally +// +defined('ICON_EDIT') || define('ICON_EDIT', 'edit.gif'); +defined('ICON_DELETE') || define('ICON_DELETE', 'delete.gif'); +defined('ICON_ADD') || define('ICON_ADD', 'ok.gif'); +defined('ICON_UPDATE') || define('ICON_UPDATE', 'ok.gif'); +defined('ICON_OK') || define('ICON_OK', 'ok.gif'); +defined('ICON_CANCEL') || define('ICON_CANCEL', 'cancel.png'); +defined('ICON_GL') || define('ICON_GL', 'gl.png'); +defined('ICON_PRINT') || define('ICON_PRINT', 'print.png'); +defined('ICON_PDF') || define('ICON_PDF', 'pdf.gif'); +defined('ICON_DOC') || define('ICON_DOC', 'invoice.gif'); +defined('ICON_CREDIT') || define('ICON_CREDIT', 'credit.gif'); +defined('ICON_RECEIVE') || define('ICON_RECEIVE', 'receive.gif'); +defined('ICON_DOWN') || define('ICON_DOWN', 'download.gif'); +defined('ICON_MONEY') || define('ICON_MONEY', 'money.png'); +defined('ICON_REMOVE') || define('ICON_REMOVE', 'remove.png'); +defined('ICON_REPORT') || define('ICON_REPORT', 'report.png'); +defined('ICON_VIEW') || define('ICON_VIEW', 'view.gif'); +defined('ICON_SUBMIT') || define('ICON_SUBMIT', 'ok.gif'); +defined('ICON_ESCAPE') || define('ICON_ESCAPE', 'escape.png'); +defined('ICON_ALLOC') || define('ICON_ALLOC', 'alloc.png'); + ?> \ No newline at end of file diff --git a/purchasing/allocations/supplier_allocation_main.php b/purchasing/allocations/supplier_allocation_main.php index 34877675..039db9a5 100644 --- a/purchasing/allocations/supplier_allocation_main.php +++ b/purchasing/allocations/supplier_allocation_main.php @@ -69,7 +69,7 @@ function alloc_link($row) { return pager_link(_("Allocate"), "/purchasing/allocations/supplier_allocate.php?trans_no=" - .$row["trans_no"] . "&trans_type=" . $row["type"], ICON_MONEY ); + .$row["trans_no"] . "&trans_type=" . $row["type"], ICON_ALLOC); } function amount_left($row) diff --git a/purchasing/inquiry/supplier_allocation_inquiry.php b/purchasing/inquiry/supplier_allocation_inquiry.php index 1d339306..98b63083 100644 --- a/purchasing/inquiry/supplier_allocation_inquiry.php +++ b/purchasing/inquiry/supplier_allocation_inquiry.php @@ -98,7 +98,7 @@ function alloc_link($row) if (($row["type"] == ST_BANKPAYMENT || $row["type"] == ST_SUPPCREDIT || $row["type"] == ST_SUPPAYMENT) && (-$row["TotalAmount"] - $row["Allocated"]) >= 0) return pager_link(_("Allocations"), "/purchasing/allocations/supplier_allocate.php?trans_no=" . - $row["trans_no"]. "&trans_type=" . $row["type"]. "&supplier_id=" . $row["supplier_id"], ICON_MONEY ); + $row["trans_no"]. "&trans_type=" . $row["type"]. "&supplier_id=" . $row["supplier_id"], ICON_ALLOC); elseif ($row["type"] == ST_SUPPINVOICE && ($row["TotalAmount"] - $row["Allocated"]) > 0) return pager_link(_("Pay"), "/purchasing/supplier_payment.php?supplier_id=".$row["supplier_id"] ."&PInvoice=".$row["trans_no"], ICON_MONEY ); diff --git a/purchasing/supplier_payment.php b/purchasing/supplier_payment.php index b5757cf6..b3fe7cee 100644 --- a/purchasing/supplier_payment.php +++ b/purchasing/supplier_payment.php @@ -72,15 +72,18 @@ if (!isset($_POST['bank_account'])) { // first page call if (isset($_GET['PInvoice'])) { // get date and supplier $inv = get_supp_trans($_GET['PInvoice'], ST_SUPPINVOICE); + $dflt_act = get_default_bank_account($inv['curr_code']); + $_POST['bank_account'] = $dflt_act['id']; if($inv) { - $_POST['supplier_id'] = $inv['supplier_id']; + $_SESSION['alloc']->person_id = $_POST['supplier_id'] = $inv['supplier_id']; + $_SESSION['alloc']->read(); $_POST['DatePaid'] = sql2date($inv['tran_date']); $_POST['memo_'] = $inv['supp_reference']; foreach($_SESSION['alloc']->allocs as $line => $trans) { if ($trans->type == ST_SUPPINVOICE && $trans->type_no == $_GET['PInvoice']) { $un_allocated = abs($trans->amount) - $trans->amount_allocated; - $_POST['amount'] = $_SESSION['alloc']->amount = - $_SESSION['alloc']->allocs[$line]->current_allocated = price_format($un_allocated); + $_SESSION['alloc']->amount = $_SESSION['alloc']->allocs[$line]->current_allocated = $un_allocated; + $_POST['amount'] = $_POST['amount'.$line] = price_format($un_allocated); break; } } diff --git a/sales/allocations/customer_allocation_main.php b/sales/allocations/customer_allocation_main.php index 2bd169ef..5908ee57 100644 --- a/sales/allocations/customer_allocation_main.php +++ b/sales/allocations/customer_allocation_main.php @@ -73,7 +73,7 @@ function alloc_link($row) { return pager_link(_("Allocate"), "/sales/allocations/customer_allocate.php?trans_no=" - .$row["trans_no"] . "&trans_type=" . $row["type"]. "&debtor_no=" . $row["debtor_no"], ICON_MONEY); + .$row["trans_no"] . "&trans_type=" . $row["type"]. "&debtor_no=" . $row["debtor_no"], ICON_ALLOC); } function amount_left($row) diff --git a/sales/customer_payments.php b/sales/customer_payments.php index 1f60e058..bf15289a 100644 --- a/sales/customer_payments.php +++ b/sales/customer_payments.php @@ -49,18 +49,19 @@ if (!isset($_POST['bank_account'])) { // first page call if (isset($_GET['SInvoice'])) { // get date and supplier $inv = get_customer_trans($_GET['SInvoice'], ST_SALESINVOICE); + $dflt_act = get_default_bank_account($inv['curr_code']); + $_POST['bank_account'] = $dflt_act['id']; if($inv) { - $_POST['customer_id'] = $inv['debtor_no']; + $_SESSION['alloc']->person_id = $_POST['customer_id'] = $inv['debtor_no']; + $_SESSION['alloc']->read(); $_POST['DateBanked'] = sql2date($inv['tran_date']); foreach($_SESSION['alloc']->allocs as $line => $trans) { if ($trans->type == ST_SALESINVOICE && $trans->type_no == $_GET['SInvoice']) { $un_allocated = $trans->amount - $trans->amount_allocated; - if($un_allocated){ - $_POST['amount'] = $_SESSION['alloc']->amount = -// price_format($trans->amount); - $_SESSION['alloc']->allocs[$line]->current_allocated = -// $trans->amount; - price_format($un_allocated);} + if ($un_allocated){ + $_SESSION['alloc']->allocs[$line]->current_allocated = $un_allocated; + $_POST['amount'] = $_POST['amount'.$line] = price_format($un_allocated); + } break; } } diff --git a/sales/inquiry/customer_allocation_inquiry.php b/sales/inquiry/customer_allocation_inquiry.php index b49bb123..2d08467f 100644 --- a/sales/inquiry/customer_allocation_inquiry.php +++ b/sales/inquiry/customer_allocation_inquiry.php @@ -95,7 +95,7 @@ function alloc_link($row) $link = pager_link(_("Allocation"), "/sales/allocations/customer_allocate.php?trans_no=" . $row["trans_no"] - ."&trans_type=" . $row["type"]."&debtor_no=" . $row["debtor_no"], ICON_MONEY); + ."&trans_type=" . $row["type"]."&debtor_no=" . $row["debtor_no"], ICON_ALLOC); if ($row["type"] == ST_CUSTCREDIT && $row['TotalAmount'] > 0) { diff --git a/themes/aqua/images/alloc.png b/themes/aqua/images/alloc.png new file mode 100644 index 0000000000000000000000000000000000000000..2f734caab217938cf96f1b8b63b5eae1ffeb4c1b GIT binary patch literal 518 zcmV+h0{Q)kP)Px#24YJ`L;(H({s8{#7}SCQ000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2i*z{ z5d$r$xTD+v00D+cL_t(2&xMjbO9Md=hM&9aUMviPXb}WE|A0kug$6+rNT-FZjsAsn zn-obU`3qLTPOODQL1J^)*x4v3_?3W%A}A3}_AJ~xqoA2`XJ_7L<{e8Z6*3~K)v5!0 z05%W;Axf$6uZVI=se7&UnASR}wU%0I?5OMc#RZpFSKQp*(CKywf*@9`)oSTVrP2f5 zjWQxiI*vpLiIfs41VSVLD3{B_)FEI2VO*GW99CD?06084LL?I8^ZB@<)oKBZ1Fx82 zjbajj#$CY5@-k9N78VxC<#NM{uSV6jGMUVetv2ogrfr*IdJ^CF0mx>v0C=9~m~TP= zl&(8WU@@DB$vNme#syoAV|F%{h!z9%#V8L;dnY{g1^~FO8`J%ZTG~4S;HfuY|LlS5 z=Qp}9@67FPViyVpeBY1f0Vt*?M}d6%*lxE0*qE83Uax;)t}lM8Zm*L9QW5IVt)2q& zzdJXZ&3HMU=UL`CWofMi&<7lIQUKEU)d!NU>%JK~BrpK1PZ`9oM>Zi2+5i9m07*qo IM6N<$f+bVZvj6}9 literal 0 HcmV?d00001 diff --git a/themes/cool/images/alloc.png b/themes/cool/images/alloc.png new file mode 100644 index 0000000000000000000000000000000000000000..2f734caab217938cf96f1b8b63b5eae1ffeb4c1b GIT binary patch literal 518 zcmV+h0{Q)kP)Px#24YJ`L;(H({s8{#7}SCQ000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2i*z{ z5d$r$xTD+v00D+cL_t(2&xMjbO9Md=hM&9aUMviPXb}WE|A0kug$6+rNT-FZjsAsn zn-obU`3qLTPOODQL1J^)*x4v3_?3W%A}A3}_AJ~xqoA2`XJ_7L<{e8Z6*3~K)v5!0 z05%W;Axf$6uZVI=se7&UnASR}wU%0I?5OMc#RZpFSKQp*(CKywf*@9`)oSTVrP2f5 zjWQxiI*vpLiIfs41VSVLD3{B_)FEI2VO*GW99CD?06084LL?I8^ZB@<)oKBZ1Fx82 zjbajj#$CY5@-k9N78VxC<#NM{uSV6jGMUVetv2ogrfr*IdJ^CF0mx>v0C=9~m~TP= zl&(8WU@@DB$vNme#syoAV|F%{h!z9%#V8L;dnY{g1^~FO8`J%ZTG~4S;HfuY|LlS5 z=Qp}9@67FPViyVpeBY1f0Vt*?M}d6%*lxE0*qE83Uax;)t}lM8Zm*L9QW5IVt)2q& zzdJXZ&3HMU=UL`CWofMi&<7lIQUKEU)d!NU>%JK~BrpK1PZ`9oM>Zi2+5i9m07*qo IM6N<$f+bVZvj6}9 literal 0 HcmV?d00001 diff --git a/themes/default/images/alloc.png b/themes/default/images/alloc.png new file mode 100644 index 0000000000000000000000000000000000000000..2f734caab217938cf96f1b8b63b5eae1ffeb4c1b GIT binary patch literal 518 zcmV+h0{Q)kP)Px#24YJ`L;(H({s8{#7}SCQ000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2i*z{ z5d$r$xTD+v00D+cL_t(2&xMjbO9Md=hM&9aUMviPXb}WE|A0kug$6+rNT-FZjsAsn zn-obU`3qLTPOODQL1J^)*x4v3_?3W%A}A3}_AJ~xqoA2`XJ_7L<{e8Z6*3~K)v5!0 z05%W;Axf$6uZVI=se7&UnASR}wU%0I?5OMc#RZpFSKQp*(CKywf*@9`)oSTVrP2f5 zjWQxiI*vpLiIfs41VSVLD3{B_)FEI2VO*GW99CD?06084LL?I8^ZB@<)oKBZ1Fx82 zjbajj#$CY5@-k9N78VxC<#NM{uSV6jGMUVetv2ogrfr*IdJ^CF0mx>v0C=9~m~TP= zl&(8WU@@DB$vNme#syoAV|F%{h!z9%#V8L;dnY{g1^~FO8`J%ZTG~4S;HfuY|LlS5 z=Qp}9@67FPViyVpeBY1f0Vt*?M}d6%*lxE0*qE83Uax;)t}lM8Zm*L9QW5IVt)2q& zzdJXZ&3HMU=UL`CWofMi&<7lIQUKEU)d!NU>%JK~BrpK1PZ`9oM>Zi2+5i9m07*qo IM6N<$f+bVZvj6}9 literal 0 HcmV?d00001 -- 2.30.2