global $Refs;
$id = get_next_trans_no(ST_JOURNAL);
- $ref = $Refs->get_next(ST_JOURNAL);
-
+ $ref = $Refs->get_next(ST_JOURNAL, null, $date_);
+
$stock_gl_code = get_stock_gl_code($stock_id);
add_journal(ST_JOURNAL, $id, $costs, $date_, get_company_currency(), $ref);
$memo = "WO Overhead cost settlement JV for zero/negative respository of ".$stock_id;
global $Refs;
$id = get_next_trans_no(ST_JOURNAL);
- $ref = $Refs->get_next(ST_JOURNAL);
+ $ref = $Refs->get_next(ST_JOURNAL, null, $date_);
add_journal(ST_JOURNAL, $id, $costs, $date_, get_company_currency(), $ref);
$stock_gl_code = get_stock_gl_code($stock_id);
global $Refs;
$id = get_next_trans_no(ST_JOURNAL);
- $ref = $Refs->get_next(ST_JOURNAL);
+ $ref = $Refs->get_next(ST_JOURNAL, null, $date_);
add_journal(ST_JOURNAL, $id, $costs, $date_, get_company_currency(), $ref);
$stock_gl_code = get_stock_gl_code($stock_id);
begin_transaction();
$journal_id = get_next_trans_no(ST_JOURNAL);
- if (!$ref) $ref = $Refs->get_next(ST_JOURNAL);
+ if (!$ref) $ref = $Refs->get_next(ST_JOURNAL, null, $date);
add_gl_trans_std_cost(ST_JOURNAL, $journal_id, $date, $cr_acc,
0, 0, $wo_cost_types[$cost_type], -$amount);