本文整理匯總了PHP中is_new_reference函數的典型用法代碼示例。如果您正苦於以下問題:PHP is_new_reference函數的具體用法?PHP is_new_reference怎麽用?PHP is_new_reference使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了is_new_reference函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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) {
示例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;
}
示例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;
}
}
示例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;
}