X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fdata_checks.inc;fp=includes%2Fdata_checks.inc;h=8449b5dd63bce2ea47ddf8062aee0a031ea87a9c;hb=f4e4bc5a2ff9f97a20b3a62265926a4c677163f9;hp=7243e43fe937be460c3650d47028ade5939d7a33;hpb=2068065e70294c46cb5244723d9dc44d3a72b66c;p=fa-stable.git diff --git a/includes/data_checks.inc b/includes/data_checks.inc index 7243e43f..8449b5dd 100644 --- a/includes/data_checks.inc +++ b/includes/data_checks.inc @@ -495,6 +495,22 @@ function check_is_closed($type, $type_no, $msg=null) } } +function check_db_has_template_orders($msg) +{ + $sql = "SELECT sorder.order_no + FROM ".TB_PREF."sales_orders as sorder," + .TB_PREF."sales_order_details as line + WHERE sorder.order_no = line.order_no AND sorder.type = 1 + GROUP BY line.order_no"; + + if (!check_empty_result($sql)) + { + display_error($msg, true); + end_page(); + exit; + } +} + function check_deferred_income_act($msg) { global $path_to_root;