}
$cart->memo_ = get_comments_string($type, $trans_no);
$cart->reference = $header['reference'];
-
// update net_amounts from tax register
// retrieve tax details
$cart->tax_info = false;
$trans_no = write_journal_entries($cart);
+ // retain the reconciled status if desired by user
+ if (isset($_POST['reconciled'])
+ && $_POST['reconciled'] == 1) {
+ $sql = "UPDATE ".TB_PREF."bank_trans SET reconciled=".db_escape($_POST['reconciled_date'])
+ ." WHERE type=" . ST_JOURNAL . " AND trans_no=".db_escape($trans_no);
+
+ db_query($sql, "Can't change reconciliation status");
+ }
+
$cart->clear_items();
new_doc_date($_POST['date_']);
unset($_SESSION['journal_items']);
LEFT JOIN ".TB_PREF."suppliers supplier ON supplier.supplier_id = st.supplier_id,
".TB_PREF."bank_accounts act
WHERE act.id=bt.bank_act ";
- if ($type != null)
+ if (isset($type))
$sql .= " AND bt.type=".db_escape($type);
- if ($trans_no != null)
+ if (isset($trans_no))
$sql .= " AND bt.trans_no = ".db_escape($trans_no);
- if ($person_type_id != null)
+ if (isset($person_type_id))
$sql .= " AND bt.person_type_id = ".db_escape($person_type_id);
- if ($person_id != null)
+ if (isset($person_id))
$sql .= " AND bt.person_id = ".db_escape($person_id);
$sql .= " ORDER BY trans_date, bt.id";
}
check_row(_('Include in tax register:'), 'taxable_trans', null, true);
+ // Query the user to retain the reconciled status
+ if (!$new) {
+ $result = get_bank_trans(ST_JOURNAL, $Order->order_id);
+ $row = db_fetch($result);
+ if ($row
+ && $row['reconciled']) {
+ check_row(_('Reconciled:'), 'reconciled', 1, true);
+ hidden('reconciled_date', $row['reconciled']);
+ }
+ }
end_outer_table(1);
}