Customer Allocation Inquiry, Supplier Allocation Inquiry: fixed payment forms initial...
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Sun, 13 Oct 2013 19:11:40 +0000 (21:11 +0200)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Sun, 13 Oct 2013 19:21:42 +0000 (21:21 +0200)
config.default.php
includes/types.inc
purchasing/allocations/supplier_allocation_main.php
purchasing/inquiry/supplier_allocation_inquiry.php
purchasing/supplier_payment.php
sales/allocations/customer_allocation_main.php
sales/customer_payments.php
sales/inquiry/customer_allocation_inquiry.php
themes/aqua/images/alloc.png [new file with mode: 0644]
themes/cool/images/alloc.png [new file with mode: 0644]
themes/default/images/alloc.png [new file with mode: 0644]

index 7067ae786a7d83cbca5ceee37245da6749503657..9bef6d927bdb56cc21c3dcb5e2cc42cc6ceea888 100644 (file)
@@ -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
index 79ef8be71c01699d87a8daf242fee733ad718fe3..37ec321cf4d2352aeed1938e8f6072da4b657665 100644 (file)
@@ -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
index 3487767544f025f0dea620d3b5fdd2e1c012c49a..039db9a5094c41d775a3c2e6b47cbd1fac786a65 100644 (file)
@@ -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)
index 1d339306e18f3f90cd3ce547f30700422c69f9d3..98b630833725db76db536ffd6e543971087fb34c 100644 (file)
@@ -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 );
index b5757cf64e65a232d0be0f37751bbfaf45076b90..b3fe7ceeaefc241a3a35141d238e500edd2c969a 100644 (file)
@@ -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;
                                }
                        }
index 2bd169ef7dfa3c5f62e27e630a60bd7550411c98..5908ee5770354320253b5203a8dd99a5d65d49b2 100644 (file)
@@ -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)
index 1f60e058068e745caccce1e6099f48a0690e033f..bf15289a690f68d6c739666555a6c1b26de30192 100644 (file)
@@ -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;
                                }
                        }
index b49bb1231a7ba078ca54b2919610fe5906ff06ee..2d08467fc142b53e58a6dfefb6d8c341b408848c 100644 (file)
@@ -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 (file)
index 0000000..2f734ca
Binary files /dev/null and b/themes/aqua/images/alloc.png differ
diff --git a/themes/cool/images/alloc.png b/themes/cool/images/alloc.png
new file mode 100644 (file)
index 0000000..2f734ca
Binary files /dev/null and b/themes/cool/images/alloc.png differ
diff --git a/themes/default/images/alloc.png b/themes/default/images/alloc.png
new file mode 100644 (file)
index 0000000..2f734ca
Binary files /dev/null and b/themes/default/images/alloc.png differ