- $_POST['code_id'] = $item->code_id;
- $_POST['dimension_id'] = $item->dimension_id;
- $_POST['dimension2_id'] = $item->dimension2_id;
- $_POST['AmountDebit'] = price_format($item->amount);
- $_POST['AmountCredit'] = price_format(abs($item->amount));
- $_POST['description'] = $item->description;
- $_POST['LineMemo'] = $item->reference;
-
- hidden('Index', $item->index);
- hidden('code_id', $item->code_id);
- label_cell($_POST['code_id']);
- label_cell($item->description);
+ if (!isset($continue))
+ {
+ $_POST['code_id'] = $item->code_id;
+ $_POST['dimension_id'] = $item->dimension_id;
+ $_POST['dimension2_id'] = $item->dimension2_id;
+ $_POST['person_id'] = $item->person_id;
+ if ($item->amount > 0)
+ {
+ $_POST['AmountDebit'] = price_format($item->amount);
+ $_POST['AmountCredit'] = "";
+ }
+ else
+ {
+ $_POST['AmountDebit'] = "";
+ $_POST['AmountCredit'] = price_format(abs($item->amount));
+ }
+ $_POST['description'] = $item->description;
+ $_POST['LineMemo'] = $item->reference;
+ }
+ hidden('Index', $id);
+ $skip_bank = !$_SESSION["wa_current_user"]->can_access('SA_BANKJOURNAL');
+ echo gl_all_accounts_list('code_id', null, $skip_bank, true, _('[Select account]'), true, false, false);
+
+ if (is_subledger_account(get_post('code_id')))
+ { // for home currency postings show all customers
+ $sel_cur = get_post('currency', $order->currency);
+ subledger_list_cells(null, 'person_id', get_post('code_id'), null, false, false,
+ get_company_currency() == $sel_cur ? null : $sel_cur);
+ } elseif ($order->has_sub_accounts())
+ label_cell('');