Don't delete templates
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Tue, 2 Jun 2009 11:28:32 +0000 (11:28 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Tue, 2 Jun 2009 11:28:32 +0000 (11:28 +0000)
admin/fiscalyears.php

index f3968458f1e0f2cf4bf2e28f89195522c9d05c9d..29d6d306d131c5b7c9e599705aef899220dff7bc 100644 (file)
@@ -204,7 +204,7 @@ function delete_this_fiscalyear($selected_id)
        $ref = _("Open Balance");
        $myrow = get_fiscalyear($selected_id);
        $to = $myrow['end'];
-       $sql = "SELECT order_no FROM ".TB_PREF."sales_orders WHERE ord_date <= '$to'";
+       $sql = "SELECT order_no FROM ".TB_PREF."sales_orders WHERE ord_date <= '$to' AND type <> 1"; // don't take the templates
        $result = db_query($sql, "Could not retrieve sales orders");
        while ($row = db_fetch($result))
        {