Fixed dashboard page in Setup tab. Mixing customers in the Supplier diagram.
[fa-stable.git] / sales / sales_order_entry.php
index 485776933d56ea779482ab0dbe43bd036516b05c..618030a450d3a3855a42d386ef9e3778228232ef 100644 (file)
@@ -385,7 +385,7 @@ function can_process() {
                return false;
        }
        if ($_SESSION['Items']->payment_terms['cash_sale'] == 0) {
-               if (!$_SESSION['Items']->is_started() && ($_SESSION['Items']->payment_terms['days_before_due'] < 0) && ((input_num('prep_amount')<=0) ||
+               if (!$_SESSION['Items']->is_started() && ($_SESSION['Items']->payment_terms['days_before_due'] == -1) && ((input_num('prep_amount')<=0) ||
                        input_num('prep_amount')>$_SESSION['Items']->get_trans_total())) {
                        display_error(_("Pre-payment required have to be positive and less than total amount."));
                        set_focus('prep_amount');
@@ -531,7 +531,7 @@ function check_item_data()
                return false;
        }
 
-       $cost_home = get_standard_cost(get_post('stock_id')); // Added 2011-03-27 Joe Hunt
+       $cost_home = get_unit_cost(get_post('stock_id')); // Added 2011-03-27 Joe Hunt
        $cost = $cost_home / get_exchange_rate_from_home_currency($_SESSION['Items']->customer_currency, $_SESSION['Items']->document_date);
        if (input_num('price') < $cost)
        {