From ed89e387e00a3382ab3a38e6d015ec463c1c3398 Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Sat, 9 Jan 2010 23:23:51 +0000 Subject: [PATCH] Rerun --- admin/fiscalyears.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/admin/fiscalyears.php b/admin/fiscalyears.php index 15f7ff4..4d3f87f 100644 --- a/admin/fiscalyears.php +++ b/admin/fiscalyears.php @@ -271,6 +271,7 @@ function delete_this_fiscalyear($selected_id) db_query($sql, "Could not delete debtor trans details"); $sql = "DELETE FROM ".TB_PREF."debtor_trans WHERE trans_no = $delivery AND type = ".ST_CUSTDELIVERY; db_query($sql, "Could not delete debtor trans"); + delete_attachments_and_comments(ST_CUSTDELIVERY, $delivery); } } $sql = "DELETE FROM ".TB_PREF."cust_allocations WHERE trans_no_from = {$row['trans_no']} AND trans_type_from = {$row['type']}"; @@ -305,7 +306,7 @@ function delete_this_fiscalyear($selected_id) $sql = "DELETE FROM ".TB_PREF."wo_issue_items WHERE issue_id = {$row2[0]}"; db_query($sql, "Could not delete wo issue items"); } - delete_attachments_and_comments(28, $row['id']); + delete_attachments_and_comments(ST_MANUISSUE, $row['id']); $sql = "DELETE FROM ".TB_PREF."wo_issues WHERE workorder_id = {$row['id']}"; db_query($sql, "Could not delete wo issues"); $sql = "DELETE FROM ".TB_PREF."wo_manufacture WHERE workorder_id = {$row['id']}"; @@ -314,7 +315,7 @@ function delete_this_fiscalyear($selected_id) db_query($sql, "Could not delete wo requirements"); $sql = "DELETE FROM ".TB_PREF."workorders WHERE id = {$row['id']}"; db_query($sql, "Could not delete workorders"); - delete_attachments_and_comments(26, $row['id']); + delete_attachments_and_comments(ST_WORKORDER, $row['id']); } $sql = "SELECT loc_code, stock_id, SUM(qty) AS qty, SUM(qty*standard_cost) AS std_cost FROM ".TB_PREF."stock_moves WHERE tran_date <= '$to' GROUP by loc_code, stock_id"; @@ -348,7 +349,7 @@ function delete_this_fiscalyear($selected_id) { $trans_no = get_next_trans_no(ST_JOURNAL); $sql = "INSERT INTO ".TB_PREF."gl_trans (type, type_no, tran_date, account, memo_, amount) VALUES - (ST_JOURNAL, $trans_no, '$to', '{$row['account']}', '$ref', {$row['amount']})"; + (".ST_JOURNAL.", $trans_no, '$to', '{$row['account']}', '$ref', {$row['amount']})"; db_query($sql, "Could not insert gl trans"); } } -- 2.30.2