Merged changes from main branch up to 2.1.3.
[fa-stable.git] / sales / credit_note_entry.php
index cab8c3dc810a6a7edbf64284187fdf9878c76bcd..f27bf8f0ad8617c4c9f9f81bbb6b58179253c707 100644 (file)
@@ -1,4 +1,14 @@
 <?php
+/**********************************************************************
+    Copyright (C) FrontAccounting, LLC.
+       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/gpl-3.0.html>.
+***********************************************************************/
 //---------------------------------------------------------------------------
 //
 //     Entry/Modify free hand Credit Note
@@ -168,7 +178,9 @@ if (isset($_POST['ProcessCredit']) && can_process()) {
        if (!isset($_POST['WriteOffGLCode'])) {
                $_POST['WriteOffGLCode'] = 0;
        }
+       copy_to_cn();
        $credit_no = $_SESSION['Items']->write($_POST['WriteOffGLCode']);
+       new_doc_date($_SESSION['Items']->document_date);
        processing_end();
        meta_forward($_SERVER['PHP_SELF'], "AddedID=$credit_no");
 
@@ -249,7 +261,7 @@ if (!processing_active()) {
 
 //-----------------------------------------------------------------------------
 
-start_form(false, true);
+start_form();
 hidden('cart_id');
 
 $customer_error = display_credit_header($_SESSION['Items']);
@@ -267,7 +279,7 @@ if ($customer_error == "") {
 
 echo "<br><center><table><tr>";
 submit_cells('Update', _("Update"));
-submit_cells('ProcessCredit', _("Process Credit Note"));
+submit_cells('ProcessCredit', _("Process Credit Note"), '', false, 'default');
 echo "</tr></table></center>";
 
 end_form();