X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=sales%2Fcredit_note_entry.php;h=4b20b7474bcbf2448a7a3d391a547bd8743b7079;hb=f58466eea31b624deacaf5e5cd4b9de7995e0373;hp=63c5ea2ff8541054ba58c6adee7781d097200cc1;hpb=e8ae3516539a520338117f25d401c0fc234973a4;p=fa-stable.git
diff --git a/sales/credit_note_entry.php b/sales/credit_note_entry.php
index 63c5ea2f..4b20b747 100644
--- a/sales/credit_note_entry.php
+++ b/sales/credit_note_entry.php
@@ -51,17 +51,12 @@ check_db_has_stock_items(_("There are no items defined in the system."));
check_db_has_customer_branches(_("There are no customers, or there are no customers with branches. Please define customers and customer branches."));
//-----------------------------------------------------------------------------
-if ($ret = context_restore()) {
- // return from new customer add
- copy_from_cn();
- if(isset($ret['customer_id']))
- $_POST['customer_id'] = $ret['customer_id'];
- if(isset($ret['branch_id']))
- $_POST['branch_id'] = $ret['branch_id'];
-}
-if (isset($_POST['_customer_id_editor'])) {
- copy_to_cn(); //store context
- context_call($path_to_root.'/sales/manage/customers.php?debtor_no='.$_POST['customer_id'], 'Items');
+
+if (list_updated('branch_id')) {
+ // when branch is selected via external editor also customer can change
+ $br = get_branch(get_post('branch_id'));
+ $_POST['customer_id'] = $br['debtor_no'];
+ $Ajax->activate('customer_id');
}
if (isset($_GET['AddedID'])) {
@@ -180,6 +175,7 @@ if (isset($_POST['ProcessCredit']) && can_process()) {
}
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");
@@ -278,7 +274,7 @@ if ($customer_error == "") {
echo "