• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP is_new_reference函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中is_new_reference函数的典型用法代码示例。如果您正苦于以下问题:PHP is_new_reference函数的具体用法?PHP is_new_reference怎么用?PHP is_new_reference使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了is_new_reference函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: can_process

function can_process()
{
    global $Refs;
    if (!is_date($_POST['date_'])) {
        display_error(_("The entered date for the issue is invalid."));
        set_focus('date_');
        return false;
    } elseif (!is_date_in_fiscalyear($_POST['date_'])) {
        display_error(_("The entered date is not in fiscal year."));
        set_focus('date_');
        return false;
    }
    if (!$Refs->is_valid($_POST['ref'])) {
        display_error(_("You must enter a reference."));
        set_focus('ref');
        return false;
    }
    if (!is_new_reference($_POST['ref'], ST_MANUISSUE)) {
        display_error(_("The entered reference is already in use."));
        set_focus('ref');
        return false;
    }
    $failed_item = $_SESSION['issue_items']->check_qoh($_POST['Location'], $_POST['date_'], !$_POST['IssueType']);
    if ($failed_item != -1) {
        display_error(_("The issue cannot be processed because it would cause negative inventory balance for marked items as of document date or later."));
        return false;
    }
    return true;
}
开发者ID:knjy24,项目名称:FrontAccounting,代码行数:29,代码来源:work_order_issue.php


示例2: can_process

function can_process()
{
    if (!is_date($_POST['date_'])) {
        display_error(tr("The entered date for the issue is invalid."));
        set_focus('date_');
        return false;
    } elseif (!is_date_in_fiscalyear($_POST['date_'])) {
        display_error(tr("The entered date is not in fiscal year."));
        set_focus('date_');
        return false;
    }
    if (!references::is_valid($_POST['ref'])) {
        display_error(tr("You must enter a reference."));
        set_focus('ref');
        return false;
    }
    if (!is_new_reference($_POST['ref'], 28)) {
        display_error(tr("The entered reference is already in use."));
        set_focus('ref');
        return false;
    }
    $failed_item = $_SESSION['issue_items']->check_qoh($_POST['Location'], $_POST['date_'], !$_POST['IssueType']);
    if ($failed_item != null) {
        display_error(tr("The issue cannot be processed because an entered item would cause a negative inventory balance :") . " " . $failed_item->stock_id . " - " . $failed_item->item_description);
        return false;
    }
    return true;
}
开发者ID:ravenii,项目名称:guardocs,代码行数:28,代码来源:work_order_issue.php


示例3: can_process

function can_process()
{
    if (!is_date($_POST['CreditDate'])) {
        display_error(tr("The entered date is invalid."));
        set_focus('CreditDate');
        return false;
    } elseif (!is_date_in_fiscalyear($_POST['CreditDate'])) {
        display_error(tr("The entered date is not in fiscal year."));
        set_focus('CreditDate');
        return false;
    }
    if ($_SESSION['Items']->trans_no == 0) {
        if (!references::is_valid($_POST['ref'])) {
            display_error(tr("You must enter a reference."));
            set_focus('ref');
            return false;
        }
        if (!is_new_reference($_POST['ref'], 11)) {
            display_error(tr("The entered reference is already in use."));
            set_focus('ref');
            return false;
        }
    }
    if (!check_num('ChargeFreightCost', 0)) {
        display_error(tr("The entered shipping cost is invalid or less than zero."));
        set_focus('ChargeFreightCost');
        return false;
    }
    return true;
}
开发者ID:ravenii,项目名称:guardocs,代码行数:30,代码来源:customer_credit_invoice.php


示例4: can_process

function can_process()
{
    global $selected_id, $Refs;
    if ($selected_id == -1) {
        if (!$Refs->is_valid($_POST['ref'])) {
            display_error(_("The dimension reference must be entered."));
            set_focus('ref');
            return false;
        }
        if (!is_new_reference($_POST['ref'], ST_DIMENSION)) {
            display_error(_("The entered reference is already in use."));
            set_focus('ref');
            return false;
        }
    }
    if (strlen($_POST['name']) == 0) {
        display_error(_("The dimension name must be entered."));
        set_focus('name');
        return false;
    }
    if (!is_date($_POST['date_'])) {
        display_error(_("The date entered is in an invalid format."));
        set_focus('date_');
        return false;
    }
    if (!is_date($_POST['due_date'])) {
        display_error(_("The required by date entered is in an invalid format."));
        set_focus('due_date');
        return false;
    }
    return true;
}
开发者ID:pthdnq,项目名称:ivalley-svn,代码行数:32,代码来源:dimension_entry.php


示例5: check_data

function check_data()
{
    global $Refs;
    if (!is_date($_POST['date'])) {
        display_error(_("The entered date is invalid."));
        set_focus('date');
        return false;
    }
    if (!is_date_in_fiscalyear($_POST['date'])) {
        display_error(_("The entered date is not in fiscal year."));
        set_focus('date');
        return false;
    }
    if (!$Refs->is_valid($_POST['ref'])) {
        display_error(_("You must enter a reference."));
        set_focus('ref');
        return false;
    }
    if (!is_new_reference($_POST['ref'], ST_JOURNAL)) {
        display_error(_("The entered reference is already in use."));
        set_focus('ref');
        return false;
    }
    return true;
}
开发者ID:knjy24,项目名称:FrontAccounting,代码行数:25,代码来源:revaluate_currencies.php


示例6: check_data

function check_data()
{
    if (!$_SESSION['supp_trans']->is_valid_trans_to_post()) {
        display_error(tr("The invoice cannot be processed because the there are no items or values on the invoice.  Invoices are expected to have a charge."));
        return false;
    }
    if (!references::is_valid($_SESSION['supp_trans']->reference)) {
        display_error(tr("You must enter an invoice reference."));
        set_focus('reference');
        return false;
    }
    if (!is_new_reference($_SESSION['supp_trans']->reference, 20)) {
        display_error(tr("The entered reference is already in use."));
        set_focus('reference');
        return false;
    }
    if (!references::is_valid($_SESSION['supp_trans']->supp_reference)) {
        display_error(tr("You must enter a supplier's invoice reference."));
        set_focus('supp_reference');
        return false;
    }
    if (!is_date($_SESSION['supp_trans']->tran_date)) {
        display_error(tr("The invoice as entered cannot be processed because the invoice date is in an incorrect format."));
        set_focus('trans_date');
        return false;
    } elseif (!is_date_in_fiscalyear($_SESSION['supp_trans']->tran_date)) {
        display_error(tr("The entered date is not in fiscal year."));
        set_focus('trans_date');
        return false;
    }
    if (!is_date($_SESSION['supp_trans']->due_date)) {
        display_error(tr("The invoice as entered cannot be processed because the due date is in an incorrect format."));
        set_focus('due_date');
        return false;
    }
    $sql = "SELECT Count(*) FROM supp_trans WHERE supplier_id='" . $_SESSION['supp_trans']->supplier_id . "' AND supp_reference='" . $_POST['supp_reference'] . "'";
    $result = db_query($sql, "The sql to check for the previous entry of the same invoice failed");
    $myrow = db_fetch_row($result);
    if ($myrow[0] == 1) {
        /*Transaction reference already entered */
        display_error(tr("This invoice number has already been entered. It cannot be entered again." . " (" . $_POST['supp_reference'] . ")"));
        return false;
    }
    return true;
}
开发者ID:ravenii,项目名称:guardocs,代码行数:45,代码来源:supplier_invoice.php


示例7: can_process

function can_process()
{
    global $wo_details;
    if (!references::is_valid($_POST['ref'])) {
        display_error(tr("You must enter a reference."));
        set_focus('ref');
        return false;
    }
    if (!is_new_reference($_POST['ref'], 29)) {
        display_error(tr("The entered reference is already in use."));
        set_focus('ref');
        return false;
    }
    if (!check_num('quantity', 0)) {
        display_error(tr("The quantity entered is not a valid number or less then zero."));
        set_focus('quantity');
        return false;
    }
    if (!is_date($_POST['date_'])) {
        display_error(tr("The entered date is invalid."));
        set_focus('date_');
        return false;
    } elseif (!is_date_in_fiscalyear($_POST['date_'])) {
        display_error(tr("The entered date is not in fiscal year."));
        set_focus('date_');
        return false;
    }
    if (date_diff(sql2date($wo_details["released_date"]), $_POST['date_'], "d") > 0) {
        display_error(tr("The production date cannot be before the release date of the work order."));
        set_focus('date_');
        return false;
    }
    // if unassembling we need to check the qoh
    if ($_POST['ProductionType'] == 0 && !sys_prefs::allow_negative_stock()) {
        $wo_details = get_work_order($_POST['selected_id']);
        $qoh = get_qoh_on_date($wo_details["stock_id"], $wo_details["loc_code"], $date_);
        if (-$_POST['quantity'] + $qoh < 0) {
            display_error(tr("The unassembling cannot be processed because there is insufficient stock."));
            set_focus('quantity');
            return false;
        }
    }
    return true;
}
开发者ID:ravenii,项目名称:guardocs,代码行数:44,代码来源:work_order_add_finished.php


示例8: check_data

function check_data()
{
    global $total_grn_value, $total_gl_value;
    if (!$_SESSION['supp_trans']->is_valid_trans_to_post()) {
        display_error(tr("The credit note cannot be processed because the there are no items or values on the invoice.  Credit notes are expected to have a charge."));
        set_focus('');
        return false;
    }
    if (!references::is_valid($_SESSION['supp_trans']->reference)) {
        display_error(tr("You must enter an credit note reference."));
        set_focus('reference');
        return false;
    }
    if (!is_new_reference($_SESSION['supp_trans']->reference, 21)) {
        display_error(tr("The entered reference is already in use."));
        set_focus('reference');
        return false;
    }
    if (!references::is_valid($_SESSION['supp_trans']->supp_reference)) {
        display_error(tr("You must enter a supplier's credit note reference."));
        set_focus('supp_reference');
        return false;
    }
    if (!is_date($_SESSION['supp_trans']->tran_date)) {
        display_error(tr("The credit note as entered cannot be processed because the date entered is not valid."));
        set_focus('tran_date');
        return false;
    } elseif (!is_date_in_fiscalyear($_SESSION['supp_trans']->tran_date)) {
        display_error(tr("The entered date is not in fiscal year."));
        set_focus('tran_date');
        return false;
    }
    if (!is_date($_SESSION['supp_trans']->due_date)) {
        display_error(tr("The invoice as entered cannot be processed because the due date is in an incorrect format."));
        set_focus('due_date');
        return false;
    }
    if ($_SESSION['supp_trans']->ov_amount < $total_gl_value + $total_grn_value) {
        display_error(tr("The credit note total as entered is less than the sum of the the general ledger entires (if any) and the charges for goods received. There must be a mistake somewhere, the credit note as entered will not be processed."));
        return false;
    }
    return true;
}
开发者ID:ravenii,项目名称:guardocs,代码行数:43,代码来源:supplier_credit.php


示例9: can_process

function can_process()
{
    global $Refs;
    $adj =& $_SESSION['adj_items'];
    if (count($adj->line_items) == 0) {
        display_error(_("You must enter at least one non empty item line."));
        set_focus('stock_id');
        return false;
    }
    if (!$Refs->is_valid($_POST['ref'])) {
        display_error(_("You must enter a reference."));
        set_focus('ref');
        return false;
    }
    if (!is_new_reference($_POST['ref'], ST_INVADJUST)) {
        display_error(_("The entered reference is already in use."));
        set_focus('ref');
        return false;
    }
    if (!is_date($_POST['AdjDate'])) {
        display_error(_("The entered date for the adjustment is invalid."));
        set_focus('AdjDate');
        return false;
    } elseif (!is_date_in_fiscalyear($_POST['AdjDate'])) {
        display_error(_("The entered date is not in fiscal year."));
        set_focus('AdjDate');
        return false;
    } else {
        $failed_item = $adj->check_qoh($_POST['StockLocation'], $_POST['AdjDate'], !$_POST['Increase']);
        if ($failed_item >= 0) {
            $line = $adj->line_items[$failed_item];
            display_error(_("The adjustment cannot be processed because an adjustment item would cause a negative inventory balance :") . " " . $line->stock_id . " - " . $line->item_description);
            $_POST['Edit' . $failed_item] = 1;
            // enter edit mode
            unset($_POST['Process']);
            return false;
        }
    }
    return true;
}
开发者ID:pthdnq,项目名称:ivalley-svn,代码行数:40,代码来源:adjustments.php


示例10: can_process

function can_process()
{
    if (!isset($_POST['DateBanked']) || !is_date($_POST['DateBanked'])) {
        display_error(tr("The entered date is invalid. Please enter a valid date for the payment."));
        set_focus('DateBanked');
        return false;
    } elseif (!is_date_in_fiscalyear($_POST['DateBanked'])) {
        display_error(tr("The entered date is not in fiscal year."));
        set_focus('DateBanked');
        return false;
    }
    if (!references::is_valid($_POST['ref'])) {
        display_error(tr("You must enter a reference."));
        set_focus('ref');
        return false;
    }
    if (!is_new_reference($_POST['ref'], 12)) {
        display_error(tr("The entered reference is already in use."));
        set_focus('ref');
        return false;
    }
    if (!check_num('amount', 0)) {
        display_error(tr("The entered amount is invalid or negative and cannot be processed."));
        set_focus('amount');
        return false;
    }
    if (!check_num('discount')) {
        display_error(tr("The entered discount is not a valid number."));
        set_focus('discount');
        return false;
    }
    if (input_num('amount') - input_num('discount') <= 0) {
        display_error(tr("The balance of the amount and discout is zero or negative. Please enter valid amounts."));
        set_focus('discount');
        return false;
    }
    return true;
}
开发者ID:ravenii,项目名称:guardocs,代码行数:38,代码来源:customer_payments.php


示例11: can_process

function can_process()
{
    global $Refs, $SysPrefs;
    $adj =& $_SESSION['adj_items'];
    if (count($adj->line_items) == 0) {
        display_error(_("You must enter at least one non empty item line."));
        set_focus('stock_id');
        return false;
    }
    if (!$Refs->is_valid($_POST['ref'])) {
        display_error(_("You must enter a reference."));
        set_focus('ref');
        return false;
    }
    if (!is_new_reference($_POST['ref'], ST_INVADJUST)) {
        display_error(_("The entered reference is already in use."));
        set_focus('ref');
        return false;
    }
    if (!is_date($_POST['AdjDate'])) {
        display_error(_("The entered date for the adjustment is invalid."));
        set_focus('AdjDate');
        return false;
    } elseif (!is_date_in_fiscalyear($_POST['AdjDate'])) {
        display_error(_("The entered date is not in fiscal year."));
        set_focus('AdjDate');
        return false;
    } elseif (!$SysPrefs->allow_negative_stock()) {
        $low_stock = $adj->check_qoh($_POST['StockLocation'], $_POST['AdjDate'], !$_POST['Increase']);
        if ($low_stock) {
            display_error(_("The adjustment cannot be processed because it would cause negative inventory balance for marked items as of document date or later."));
            unset($_POST['Process']);
            return false;
        }
    }
    return true;
}
开发者ID:blestab,项目名称:frontaccounting,代码行数:37,代码来源:adjustments.php


示例12: session_register

    session_register("deposit_items");
    $_SESSION['deposit_items'] = new items_cart();
    $_POST['date_'] = Today();
    if (!is_date_in_fiscalyear($_POST['date_'])) {
        $_POST['date_'] = end_fiscalyear();
    }
    $_SESSION['deposit_items']->tran_date = $_POST['date_'];
}
//-----------------------------------------------------------------------------------------------
if (isset($_POST['Process'])) {
    $input_error = 0;
    if (!references::is_valid($_POST['ref'])) {
        display_error(tr("You must enter a reference."));
        set_focus('ref');
        $input_error = 1;
    } elseif (!is_new_reference($_POST['ref'], systypes::bank_deposit())) {
        display_error(tr("The entered reference is already in use."));
        set_focus('ref');
        $input_error = 1;
    }
    if (!is_date($_POST['date_'])) {
        display_error(tr("The entered date for the deposit is invalid."));
        set_focus('date_');
        $input_error = 1;
    }
    if (!is_date_in_fiscalyear($_POST['date_'])) {
        display_error(tr("The entered date is not in fiscal year."));
        set_focus('date_');
        $input_error = 1;
    }
    if ($input_error == 1) {
开发者ID:ravenii,项目名称:guardocs,代码行数:31,代码来源:gl_deposit.php


示例13: check_valid_entries

function check_valid_entries()
{
    global $Refs;
    if (!is_date($_POST['DatePaid'])) {
        display_error(_("The entered date is invalid."));
        set_focus('DatePaid');
        return false;
    }
    if (!is_date_in_fiscalyear($_POST['DatePaid'])) {
        display_error(_("The entered date is not in fiscal year."));
        set_focus('DatePaid');
        return false;
    }
    if (!check_num('amount', 0)) {
        display_error(_("The entered amount is invalid or less than zero."));
        set_focus('amount');
        return false;
    }
    if (input_num('amount') == 0) {
        display_error(_("The total bank amount cannot be 0."));
        set_focus('amount');
        return false;
    }
    $limit = get_bank_account_limit($_POST['FromBankAccount'], $_POST['DatePaid']);
    $amnt_tr = input_num('charge') + input_num('amount');
    if ($limit !== null && floatcmp($limit, $amnt_tr) < 0) {
        display_error(sprintf(_("The total bank amount exceeds allowed limit (%s) for source account."), price_format($limit)));
        set_focus('amount');
        return false;
    }
    if ($trans = check_bank_account_history(-$amnt_tr, $_POST['FromBankAccount'], $_POST['DatePaid'])) {
        display_error(sprintf(_("The bank transaction would result in exceed of authorized overdraft limit for transaction: %s #%s on %s."), $systypes_array[$trans['type']], $trans['trans_no'], sql2date($trans['trans_date'])));
        set_focus('amount');
        $input_error = 1;
    }
    if (isset($_POST['charge']) && !check_num('charge', 0)) {
        display_error(_("The entered amount is invalid or less than zero."));
        set_focus('charge');
        return false;
    }
    if (isset($_POST['charge']) && input_num('charge') > 0 && get_company_pref('bank_charge_act') == '') {
        display_error(_("The Bank Charge Account has not been set in System and General GL Setup."));
        set_focus('charge');
        return false;
    }
    if (!$Refs->is_valid($_POST['ref'])) {
        display_error(_("You must enter a reference."));
        set_focus('ref');
        return false;
    }
    if (!is_new_reference($_POST['ref'], ST_BANKTRANSFER)) {
        display_error(_("The entered reference is already in use."));
        set_focus('ref');
        return false;
    }
    if ($_POST['FromBankAccount'] == $_POST['ToBankAccount']) {
        display_error(_("The source and destination bank accouts cannot be the same."));
        set_focus('ToBankAccount');
        return false;
    }
    if (isset($_POST['target_amount']) && !check_num('target_amount', 0)) {
        display_error(_("The entered amount is invalid or less than zero."));
        set_focus('target_amount');
        return false;
    }
    if (isset($_POST['target_amount']) && input_num('target_amount') == 0) {
        display_error(_("The incomming bank amount cannot be 0."));
        set_focus('target_amount');
        return false;
    }
    if (!db_has_currency_rates(get_bank_account_currency($_POST['FromBankAccount']), $_POST['DatePaid'])) {
        return false;
    }
    if (!db_has_currency_rates(get_bank_account_currency($_POST['ToBankAccount']), $_POST['DatePaid'])) {
        return false;
    }
    return true;
}
开发者ID:knjy24,项目名称:FrontAccounting,代码行数:78,代码来源:bank_transfer.php


示例14: check_inputs

function check_inputs()
{
    global $Refs;
    if (!get_post('supplier_id')) {
        display_error(_("There is no supplier selected."));
        set_focus('supplier_id');
        return false;
    }
    if (@$_POST['amount'] == "") {
        $_POST['amount'] = price_format(0);
    }
    if (!check_num('amount', 0)) {
        display_error(_("The entered amount is invalid or less than zero."));
        set_focus('amount');
        return false;
    }
    if (isset($_POST['charge']) && !check_num('charge', 0)) {
        display_error(_("The entered amount is invalid or less than zero."));
        set_focus('charge');
        return false;
    }
    if (isset($_POST['charge']) && input_num('charge') > 0) {
        $charge_acct = get_company_pref('bank_charge_act');
        if (get_gl_account($charge_acct) == false) {
            display_error(_("The Bank Charge Account has not been set in System and General GL Setup."));
            set_focus('charge');
            return false;
        }
    }
    if (@$_POST['discount'] == "") {
        $_POST['discount'] = 0;
    }
    if (!check_num('discount', 0)) {
        display_error(_("The entered discount is invalid or less than zero."));
        set_focus('amount');
        return false;
    }
    //if (input_num('amount') - input_num('discount') <= 0)
    if (input_num('amount') <= 0) {
        display_error(_("The total of the amount and the discount is zero or negative. Please enter positive values."));
        set_focus('amount');
        return false;
    }
    if (isset($_POST['bank_amount']) && input_num('bank_amount') <= 0) {
        display_error(_("The entered bank amount is zero or negative."));
        set_focus('bank_amount');
        return false;
    }
    if (!is_date($_POST['DatePaid'])) {
        display_error(_("The entered date is invalid."));
        set_focus('DatePaid');
        return false;
    } elseif (!is_date_in_fiscalyear($_POST['DatePaid'])) {
        display_error(_("The entered date is out of fiscal year or is closed for further data entry."));
        set_focus('DatePaid');
        return false;
    }
    $limit = get_bank_account_limit($_POST['bank_account'], $_POST['DatePaid']);
    if ($limit !== null && floatcmp($limit, input_num('amount')) < 0) {
        display_error(sprintf(_("The total bank amount exceeds allowed limit (%s)."), price_format($limit)));
        set_focus('amount');
        return false;
    }
    if (!$Refs->is_valid($_POST['ref'])) {
        display_error(_("You must enter a reference."));
        set_focus('ref');
        return false;
    }
    if (!is_new_reference($_POST['ref'], ST_SUPPAYMENT)) {
        display_error(_("The entered reference is already in use."));
        set_focus('ref');
        return false;
    }
    if (!db_has_currency_rates(get_supplier_currency($_POST['supplier_id']), $_POST['DatePaid'], true)) {
        return false;
    }
    $_SESSION['alloc']->amount = -input_num('amount');
    if (isset($_POST["TotalNumberOfAllocs"])) {
        return check_allocations();
    } else {
        return true;
    }
}
开发者ID:M-Shahbaz,项目名称:FA,代码行数:83,代码来源:supplier_payment.php


示例15: can_process

function can_process()
{
    if (count($_SESSION['PO']->line_items) <= 0) {
        display_error(tr("There is nothing to process. Please enter valid quantities greater than zero."));
        return false;
    }
    if (!is_date($_POST['DefaultReceivedDate'])) {
        display_error(tr("The entered date is invalid."));
        set_focus('DefaultReceivedDate');
        return false;
    }
    if (!references::is_valid($_POST['ref'])) {
        display_error(tr("You must enter a reference."));
        set_focus('ref');
        return false;
    }
    if (!is_new_reference($_POST['ref'], 25)) {
        display_error(tr("The entered reference is already in use."));
        set_focus('ref');
        return false;
    }
    $something_received = 0;
    foreach ($_SESSION['PO']->line_items as $order_line) {
        if ($order_line->receive_qty > 0) {
            $something_received = 1;
            break;
        }
    }
    // Check whether trying to deliver more items than are recorded on the actual purchase order (+ overreceive allowance)
    $delivery_qty_too_large = 0;
    foreach ($_SESSION['PO']->line_items as $order_line) {
        if ($order_line->receive_qty + $order_line->qty_received > $order_line->quantity * (1 + sys_prefs::over_receive_allowance() / 100)) {
            $delivery_qty_too_large = 1;
            break;
        }
    }
    if ($something_received == 0) {
        /*Then dont bother proceeding cos nothing to do ! */
        display_error(tr("There is nothing to process. Please enter valid quantities greater than zero."));
        return false;
    } elseif ($delivery_qty_too_large == 1) {
        display_error(tr("Entered quantities cannot be greater than the quantity entered on the purchase order including the allowed over-receive percentage") . " (" . sys_prefs::over_receive_allowance() . "%)." . "<br>" . tr("Modify the ordered items on the purchase order if you wish to increase the quantities."));
        return false;
    }
    return true;
}
开发者ID:ravenii,项目名称:guardocs,代码行数:46,代码来源:po_receive_items.php


示例16: can_process

function can_process()
{
    global $wo_details, $SysPrefs, $Refs;
    if (!$Refs->is_valid($_POST['ref'])) {
        display_error(_("You must enter a reference."));
        set_focus('ref');
        return false;
    }
    if (!is_new_reference($_POST['ref'], 29)) {
        display_error(_("The entered reference is already in use."));
        set_focus('ref');
        return false;
    }
    if (!check_num('quantity', 0)) {
        display_error(_("The quantity entered is not a valid number or less then zero."));
        set_focus('quantity');
        return false;
    }
    if (!is_date($_POST['date_'])) {
        display_error(_("The entered date is invalid."));
        set_focus('date_');
        return false;
    } elseif (!is_date_in_fiscalyear($_POST['date_'])) {
        display_error(_("The entered date is not in fiscal year."));
        set_focus('date_');
        return false;
    }
    if (date_diff2(sql2date($wo_details["released_date"]), $_POST['date_'], "d") > 0) {
        display_error(_("The production date cannot be before the release date of the work order."));
        set_focus('date_');
        return false;
    }
    // don't produce more that required. Otherwise change the Work Order.
    if (input_num('quantity') > $wo_details["units_reqd"] - $wo_details["units_issued"]) {
        display_error(_("The production exceeds the quantity needed. Please change the Work Order."));
        set_focus('quantity');
        return false;
    }
    // if unassembling we need to check the qoh
    if ($_POST['ProductionType'] == 0 && !$SysPrefs->allow_negative_stock()) {
        $wo_details = get_work_order($_POST['selected_id']);
        $qoh = get_qoh_on_date($wo_details["stock_id"], $wo_details["loc_code"], $_POST['date_']);
        if (-input_num('quantity') + $qoh < 0) {
            display_error(_("The unassembling cannot be processed because there is insufficient stock."));
            set_focus('quantity');
            return false;
        }
    }
    // if production we need to check the qoh of the wo requirements
    if ($_POST['ProductionType'] == 1 && !$SysPrefs->allow_negative_stock()) {
        $err = false;
        $result = get_wo_requirements($_POST['selected_id']);
        while ($row = db_fetch($result)) {
            if ($row['mb_flag'] == 'D') {
                // service, non stock
                continue;
            }
            $qoh = get_qoh_on_date($row["stock_id"], $row["loc_code"], $_POST['date_']);
            if ($qoh - $row['units_req'] * input_num('quantity') < 0) {
                display_error(_("The production cannot be processed because a required item would cause a negative inventory balance :") . " " . $row['stock_id'] . " - " . $row['description']);
                $err = true;
            }
        }
        if ($err) {
            set_focus('quantity');
            return false;
        }
    }
    return true;
}
开发者ID:pthdnq,项目名称:ivalley-svn,代码行数:70,代码来源:work_order_add_finished.php


示例17: check_data

function check_data()
{
    global $total_grn_value, $total_gl_value, $Refs, $SysPrefs;
    if (!$_SESSION['supp_trans']->is_valid_trans_to_post()) {
        display_error(_("The credit note cannot be processed because the there are no items or values on the invoice.  Credit notes are expected to have a charge."));
        set_focus('');
        return false;
    }
    if (!$Refs->is_valid($_SESSION['supp_trans']->reference)) {
        display_error(_("You must enter an credit note reference."));
        set_focus('reference');
        return false;
    }
    if (!is_new_reference($_SESSION['supp_trans']->reference, ST_SUPPCREDIT)) {
        display_error(_("The entered reference is already in use."));
        set_focus('reference');
        return false;
    }
    if (!$Refs->is_valid($_SESSION['supp_trans']->supp_reference)) {
        display_error(_("You must enter a supplier's credit note reference."));
        set_focus('supp_reference');
        return false;
    }
    if (!is_date($_SESSION['supp_trans']->tran_date)) {
        display_error(_("The credit note as entered cannot be processed because the date entered is not valid."));
        set_focus('tran_date');
        return false;
    } elseif (!is_date_in_fiscalyear($_SESSION['supp_trans']->tran_date)) {
        display_error(_("The entered date is not in fiscal year."));
        set_focus('tran_date');
        return false;
    }
    if (!is_date($_SESSION['supp_trans']->due_date)) {
        display_error(_("The invoice as entered cannot be processed because the due date is in an incorrect format."));
        set_focus('due_date');
        return false;
    }
    if ($_SESSION['supp_trans']->ov_amount < $total_gl_value + $total_grn_value) {
        display_error(_("The credit note total as entered is less than the sum of the the general ledger entires (if any) and the charges for goods received. There must be a mistake somewhere, the credit note as entered will not be processed."));
        return false;
    }
    if (!$SysPrefs->allow_negative_stock()) {
        foreach ($_SESSION['supp_trans']->grn_items as $n => $item) {
            if (is_inventory_item($item->item_code)) {
                if (check_negative_stock($item->item_code, -$item->this_quantity_inv, null, $_SESSION['supp_trans']->tran_date)) {
                    $stock = get_item($item->item_code);
                    display_error(_("The return cannot be processed because there is an insufficient quantity for item:") . " " . $stock['stock_id'] . " - " . $stock['description'] . " - " . _("Quantity On Hand") . " = " . number_format2($qoh, get_qty_dec($stock['stock_id'])));
                    return false;
                }
            }
        }
    }
    return true;
}
开发者ID:scoutman57,项目名称:front_accounting,代码行数:54,代码来源:supplier_credit.php


示例18: check_trans

function check_trans()
{
    global $Refs;
    $input_error = 0;
    if ($_SESSION['pay_items']->count_gl_items() < 1) {
        display_error(_("You must enter at least one payment line."));
        set_focus('code_id');
        $input_error = 1;
    }
    if ($_SESSION['pay_items']->gl_items_total() == 0.0) {
        display_error(_("The total bank amount cannot be 0."));
        set_focus('code_id');
        $input_error = 1;
    }
    $limit = get_bank_account_limit($_POST['bank_account'], $_POST['date_']);
    $amnt_chg = -$_SESSION['pay_items']->gl_items_total() - $_SESSION['pay_items']->original_amount;
    if ($limit !== null && floatcmp($limit, -$amnt_chg) < 0) {
        display_error(sprintf(_("The total bank amount exceeds allowed limit (%s)."), price_format($limit - $_SESSION['pay_items']->original_amount)));
        set_focus('code_id');
        $input_error = 1;
    }
    if ($trans = check_bank_account_history($amnt_chg, $_POST['bank_account'], $_POST['date_'])) {
        display_error(sprintf(_("The bank transaction would result in exceed of authorized overdraft limit for transaction: %s #%s on %s."), $systypes_array[$trans['type']], $trans['trans_no'], sql2date($trans['trans_date'])));
        set_focus('amount');
        $input_error = 1;
    }
    if (!$Refs->is_valid($_POST['ref'])) {
        display_error(_("You must enter a reference."));
        set_focus('ref');
        $input_error = 1;
    } elseif ($_POST['ref'] != $_SESSION['pay_items']->reference && !is_new_reference($_POST['ref'], $_SESSION['pay_items']->trans_type)) {
        display_error(_("The entered reference is already in use."));
        set_focus('ref');
        $input_error = 1;
    }
    if (!is_date($_POST['date_'])) {
        display_error(_("The entered date for the payment is invalid."));
        set_focus('date_');
        $input_error = 1;
    } elseif (!is_date_in_fiscalyear($_POST['date_'])) {
        display_error(_("The entered date is not in fiscal year."));
        set_focus('date_');
        $input_error = 1;
    }
    if (get_post('PayType') == PT_CUSTOMER && (!get_post('person_id') || !get_post('PersonDetailID'))) {
        display_error(_("You have to select customer and customer branch."));
        set_focus('person_id');
        $input_error = 1;
    } elseif (get_post('PayType') == PT_SUPPLIER && !get_post('person_id')) {
        display_error(_("You have to select supplier."));
        set_focus('person_id');
        $input_error = 1;
    }
    if (!db_has_currency_rates(get_bank_account_currency($_POST['bank_account']), $_POST['date_'], true)) {
        $input_error = 1;
    }
    if (isset($_POST['settled_amount']) && in_array(get_post('PayType'), array(PT_SUPPLIER, PT_CUSTOMER)) && input_num('settled_amount') <= 0) {
        display_error(_("Settled amount have to be positive number."));
        set_focus('person_id');
        $input_error = 1;
    }
    return $input_error;
}
开发者ID:nativebandung,项目名称:frontaccounting,代码行数:63,代码来源:gl_bank.php


示例19: session_register

    session_register("pay_items");
    $_SESSION['pay_items'] = new items_cart();
    $_POST['date_'] = Today();
    if (!is_date_in_fiscalyear($_POST['date_'])) {
        $_POST['date_'] = end_fiscalyear();
    }
    $_SESSION['pay_items']->tran_date = $_POST['date_'];
}
//-----------------------------------------------------------------------------------------------
if (isset($_POST['Process'])) {
    $input_error = 0;
    if (!references::is_valid($_POST['ref'])) {
        display_error(tr("You must enter a reference."));
        set_focus('ref');
        $input_error = 1;
    } elseif (!is_new_reference($_POST['ref'], systypes::bank_payment())) {
        display_error(tr("The entered reference is already in use."));
        set_focus('ref');
        $input_error = 1;
    } elseif (!is_date($_POST['date_'])) {
        display_error(tr("The entered date for the payment is invalid."));
        set_focus('date_');
        $input_error = 1;
    } elseif (!is_date_in_fiscalyear($_POST['date_'])) {
        display_error(tr("The entered date is not in fiscal year."));
        set_focus('date_');
        $input_error = 1;
    }
    if ($input_error == 1) {
        unset($_POST['Process']);
    }
开发者ID:ravenii,项目名称:guardocs,代码行数:31,代码来源:gl_payment.php


示例20: can_commit

function can_commit()
{
    if (!is_date($_POST['OrderDate'])) {
        display_error(tr("The entered order date is invalid."));
        set_focus('OrderDate');
        return false;
    }
    if (!$_SESSION['PO']->order_no) {
        if (!references::is_valid($_SESSIO 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP is_newer_version函数代码示例发布时间:2022-05-15
下一篇:
PHP is_new_day函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap