X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=includes%2Fui%2Fui_lists.inc;h=15cfe2e93dc8632c2001361be63e28223fd79a5e;hb=0e9e4cf4f01431531dfed299bb501955bb0818ed;hp=b803ac3215b40c4f9231d2ab5742c5e96983b142;hpb=5a7ef37131354aabdcf04c639a903e5876b743e4;p=fa-stable.git diff --git a/includes/ui/ui_lists.inc b/includes/ui/ui_lists.inc index b803ac32..15cfe2e9 100644 --- a/includes/ui/ui_lists.inc +++ b/includes/ui/ui_lists.inc @@ -1473,8 +1473,8 @@ function workorders_list_row($label, $name, $selected_id=null) function payment_terms_list($name, $selected_id=null) { - $sql = "SELECT terms_indicator, terms, inactive FROM ".TB_PREF."payment_terms"; - return combo_input($name, $selected_id, $sql, 'terms_indicator', 'terms', array()); + $sql = "SELECT id, terms, inactive FROM ".TB_PREF."payment_terms"; + return combo_input($name, $selected_id, $sql, 'id', 'terms', array()); } function payment_terms_list_cells($label, $name, $selected_id=null) @@ -1697,16 +1697,16 @@ function pos_list_row($label, $name, $selected_id=null, $spec_option=false, $sub // function sale_payment_list($name, $category, $selected_id=null, $submit_on_change=true, $prepayments=true) { - $sql = "SELECT terms_indicator, terms, inactive FROM ".TB_PREF."payment_terms"; + $sql = "SELECT id, terms, inactive FROM ".TB_PREF."payment_terms"; if ($category == PM_CASH) // only cash - $sql .= " WHERE days_before_due=0 AND day_in_following_month=0"; + $sql .= " WHERE type=".PTT_CASH; elseif ($category == PM_CREDIT) // only delayed payments - $sql .= " WHERE days_before_due".($prepayments ? '!=': '>')."0 OR day_in_following_month!=0"; + $sql .= " WHERE type IN(".PTT_FOLLOWING.",".PTT_DAYS.")"; elseif (!$prepayments) - $sql .= " WHERE days_before_due>=0"; + $sql .= " WHERE type<>".PTT_PREPAY; - return combo_input($name, $selected_id, $sql, 'terms_indicator', 'terms', + return combo_input($name, $selected_id, $sql, 'id', 'terms', array( 'select_submit'=> $submit_on_change, 'async' => true