X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=purchasing%2Fsupplier_invoice.php;h=b1bd2ece237921d589dd3402bdb57646c2a927c8;hb=f47d9d014a202852918520b35927ad65bb421bf6;hp=b2ea26a39e24aed0b343ac310fec8b14da19a30e;hpb=14402932d3256d0f89072d6d72516f6462830ce6;p=fa-stable.git diff --git a/purchasing/supplier_invoice.php b/purchasing/supplier_invoice.php index b2ea26a3..b1bd2ece 100644 --- a/purchasing/supplier_invoice.php +++ b/purchasing/supplier_invoice.php @@ -130,6 +130,12 @@ if (isset($_POST['AddGLCodeToTrans'])){ } } + if (!is_tax_gl_unique(get_post('gl_code'))) { + display_error(_("Cannot post to GL account used by more than one tax type.")); + set_focus('gl_code'); + $input_error = true; + } + if ($input_error == false) { $_SESSION['supp_trans']->add_gl_codes_to_trans($_POST['gl_code'], $gl_act_name, @@ -189,7 +195,11 @@ function check_data() return false; } - $sql = "SELECT Count(*) FROM ".TB_PREF."supp_trans WHERE supplier_id='" . $_SESSION['supp_trans']->supplier_id . "' AND supp_reference='" . $_POST['supp_reference'] . "'"; + $sql = "SELECT Count(*) FROM ".TB_PREF."supp_trans WHERE supplier_id='" + . $_SESSION['supp_trans']->supplier_id . "' AND supp_reference='" + . $_POST['supp_reference'] + . "' AND ov_amount!=0"; // ignore voided invoice references + $result=db_query($sql,"The sql to check for the previous entry of the same invoice failed"); $myrow = db_fetch_row($result);