0) { switch($freq) { case 1: $date = add_days($date_, $i*7); break; case 2: $date = add_days($date_, $i*14); break; case 3: $date = add_months($date_, $i*1); break; case 4: $date = add_months($date_, $i*3); break; } $am0 = $am; } if (isset($_POST['go'])) { $id = get_next_trans_no(ST_JOURNAL); $ref = $Refs->get_next(ST_JOURNAL); add_gl_trans(ST_JOURNAL, $id, $date, get_post('acc_act'), 0, 0, $ref, $am0 * -1); add_gl_trans(ST_JOURNAL, $id, $date, get_post('res_act'), get_post('dimension_id'), get_post('dimension2_id'), $ref, $am0); add_audit_trail(ST_JOURNAL, $id, $date); add_comments(ST_JOURNAL, $id, $date, $memo); $Refs->save(ST_JOURNAL, $id, $ref); } else { alt_table_row_color($k); label_cell($date); label_cell($_POST['acc_act'] . " " . get_gl_account_name($_POST['acc_act'])); if ($dim > 0) label_cell(""); if ($dim > 1) label_cell(""); display_debit_or_credit_cells($am0 * -1); label_cell($memo); alt_table_row_color($k); label_cell($date); label_cell($_POST['res_act'] . " " . get_gl_account_name($_POST['res_act'])); if ($dim > 0) label_cell(get_dimension_string($_POST['dimension_id'], true)); if ($dim > 1) label_cell(get_dimension_string($_POST['dimension2_id'], true)); display_debit_or_credit_cells($am0); label_cell($memo); } } if (isset($_POST['go'])) { commit_transaction(); display_notification_centered(_("Revenue / Cost Accruals have been processed.")); $_POST['date_'] = $_POST['amount'] = $_POST['periods'] = ""; } else { end_table(1); display_notification_centered(_("Showing GL Transactions.")); } } } } function frequency_list_row($label, $name, $selected=null) { echo "