Topic: Deleting Fiscal Year - I
Lines 308 to 315 of the function delete_this_fiscalyear($selected_id) in admin/db/fiscal_years_db.inc:
while ($row2 = db_fetch_row($res))
{
$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(ST_MANUISSUE, $row['id']);
$sql = "DELETE FROM ".TB_PREF."wo_issues WHERE workorder_id = {$row['id']}";
db_query($sql, "Could not delete wo issues");
should actually be corrected (translation string) and optimised like the rest to be:
while ($row2 = db_fetch_row($res))
{
$sql = "DELETE FROM ".TB_PREF."wo_issue_items WHERE issue_id = {$row2[0]}";
db_query($sql, "Could not delete wo issue items");
$sql = "DELETE FROM ".TB_PREF."wo_issues WHERE workorder_id = {$row2[0]}";
db_query($sql, "Could not delete wo issues");
delete_attachments_and_comments(ST_MANUISSUE, {$row2[0]});
}
Line 303 in the same file:
$result = db_query($sql, "Could not retrieve supp trans");
should be:
$result = db_query($sql, "Could not retrieve workorders");
Line 326 in the same file:
$result = db_query($sql, "Could not retrieve supp trans");
should be:
$result = db_query($sql, "Could not retrieve stock moves");
Line 344 in the same file:
db_query($sql, "Could not delete exchange rates");
should be:
db_query($sql, "Could not delete budget transactions");
@joe: please verify and commit.