Fiscal Year delete . now removes all transactions and convert into relevant open...
[fa-stable.git] / sales / customer_payments.php
index f4fdf794b5d3fab02dd0031157a7617c7de54c7a..cd7d7dc3e0bba54de307af84327a0e9a52c0ec36 100644 (file)
@@ -1,13 +1,13 @@
 <?php
 /**********************************************************************
     Copyright (C) FrontAccounting, LLC.
-       Released under the terms of the GNU Affero General Public License,
-       AGPL, as published by the Free Software Foundation, either version 
-       of the License, or (at your option) any later version.
+       Released under the terms of the GNU General Public License, GPL, 
+       as published by the Free Software Foundation, either version 3 
+       of the License, or (at your option) any later version.
     This program is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
-    See the License here <http://www.gnu.org/licenses/agpl-3.0.html>.
+    See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
 ***********************************************************************/
 $path_to_root="..";
 $page_security = 3;
@@ -148,6 +148,8 @@ if (isset($_POST['AddPaymentItem'])) {
        else
                $rate = input_num('_ex_rate');
 
+       new_doc_date($_POST['DateBanked']);
+
        $payment_no = write_customer_payment(0, $_POST['customer_id'], $_POST['BranchID'],
                $_POST['bank_account'], $_POST['DateBanked'], $_POST['ref'],
                input_num('amount'), input_num('discount'), $_POST['memo_'], $rate);
@@ -185,7 +187,7 @@ function display_item_form()
        if (!isset($_POST['customer_id']))
                $_POST['customer_id'] = get_global_customer(false);
        if (!isset($_POST['DateBanked'])) {
-               $_POST['DateBanked'] = Today();
+               $_POST['DateBanked'] = new_doc_date();
                if (!is_date_in_fiscalyear($_POST['DateBanked'])) {
                        $_POST['DateBanked'] = end_fiscalyear();
                }
@@ -212,7 +214,7 @@ function display_item_form()
 
                label_row(_("Customer prompt payment discount :"), $display_discount_percent);
 
-               date_row(_("Date of Deposit:"), 'DateBanked','',null, 0, 0, 0, null, true);
+               date_row(_("Date of Deposit:"), 'DateBanked', '', true, 0, 0, 0, null, true);
 
                table_section(2);
 
@@ -236,7 +238,7 @@ function display_item_form()
 
                echo"<br>";
 
-               submit_center('AddPaymentItem', _("Add Payment"), true, '', true);
+               submit_center('AddPaymentItem', _("Add Payment"), true, '', 'default');
        }
 
        echo "<br>";