本文整理汇总了PHP中input_num函数的典型用法代码示例。如果您正苦于以下问题:PHP input_num函数的具体用法?PHP input_num怎么用?PHP input_num使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了input_num函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: handle_submit
function handle_submit(&$selected_id)
{
global $path_to_root, $Ajax, $auto_create_branch;
if (!can_process()) {
return;
}
if ($selected_id) {
update_customer($_POST['customer_id'], $_POST['CustName'], $_POST['cust_ref'], $_POST['address'], $_POST['tax_id'], $_POST['curr_code'], $_POST['dimension_id'], $_POST['dimension2_id'], $_POST['credit_status'], $_POST['payment_terms'], input_num('discount') / 100, input_num('pymt_discount') / 100, input_num('credit_limit'), $_POST['sales_type'], $_POST['notes']);
update_record_status($_POST['customer_id'], $_POST['inactive'], 'debtors_master', 'debtor_no');
$Ajax->activate('customer_id');
// in case of status change
display_notification(_("Customer has been updated."));
} else {
//it is a new customer
begin_transaction();
add_customer($_POST['CustName'], $_POST['cust_ref'], $_POST['address'], $_POST['tax_id'], $_POST['curr_code'], $_POST['dimension_id'], $_POST['dimension2_id'], $_POST['credit_status'], $_POST['payment_terms'], input_num('discount') / 100, input_num('pymt_discount') / 100, input_num('credit_limit'), $_POST['sales_type'], $_POST['notes']);
$selected_id = $_POST['customer_id'] = db_insert_id();
if (isset($auto_create_branch) && $auto_create_branch == 1) {
add_branch($selected_id, $_POST['CustName'], $_POST['cust_ref'], $_POST['address'], $_POST['salesman'], $_POST['area'], $_POST['tax_group_id'], '', get_company_pref('default_sales_discount_act'), get_company_pref('debtors_act'), get_company_pref('default_prompt_payment_act'), $_POST['location'], $_POST['address'], 0, 0, $_POST['ship_via'], $_POST['notes']);
$selected_branch = db_insert_id();
add_crm_person($_POST['CustName'], $_POST['cust_ref'], '', $_POST['address'], $_POST['phone'], $_POST['phone2'], $_POST['fax'], $_POST['email'], '', '');
add_crm_contact('cust_branch', 'general', $selected_branch, db_insert_id());
}
commit_transaction();
display_notification(_("A new customer has been added."));
if (isset($auto_create_branch) && $auto_create_branch == 1) {
display_notification(_("A default Branch has been automatically created, please check default Branch values by using link below."));
}
$Ajax->activate('_page_body');
}
}
开发者ID:pthdnq,项目名称:ivalley-svn,代码行数:31,代码来源:customers.php
示例2: on_submit
function on_submit($selected_parent, $selected_id = -1)
{
if (!check_num('quantity', 0)) {
display_error(_("The quantity entered must be numeric and greater than zero."));
set_focus('quantity');
return;
}
if ($selected_id != -1) {
update_bom($selected_parent, $selected_id, $_POST['workcentre_added'], $_POST['loc_code'], input_num('quantity'));
display_notification(_('Selected component has been updated'));
$Mode = 'RESET';
} else {
/*Selected component is null cos no item selected on first time round
so must be adding a record must be Submitting new entries in the new
component form */
//need to check not recursive bom component of itself!
if (!check_for_recursive_bom($selected_parent, $_POST['component'])) {
/*Now check to see that the component is not already on the bom */
if (!is_component_already_on_bom($_POST['component'], $_POST['workcentre_added'], $_POST['loc_code'], $selected_parent)) {
add_bom($selected_parent, $_POST['component'], $_POST['workcentre_added'], $_POST['loc_code'], input_num('quantity'));
display_notification(_("A new component part has been added to the bill of material for this item."));
$Mode = 'RESET';
} else {
/*The component must already be on the bom */
display_error(_("The selected component is already on this bom. You can modify it's quantity but it cannot appear more than once on the same bom."));
}
} else {
display_error(_("The selected component is a parent of the current item. Recursive BOMs are not allowed."));
}
}
}
开发者ID:blestab,项目名称:frontaccounting,代码行数:31,代码来源:bom_edit.php
示例3: check_data
function check_data()
{
global $check_price_charged_vs_order_price, $check_qty_charged_vs_del_qty;
if (!check_num('this_quantity_inv', 0) || input_num('this_quantity_inv') == 0) {
display_error(tr("The quantity to invoice must be numeric and greater than zero."));
set_focus('this_quantity_inv');
return false;
}
if (!check_num('ChgPrice')) {
display_error(tr("The price is not numeric."));
set_focus('ChgPrice');
return false;
}
if ($check_price_charged_vs_order_price == True) {
if ($_POST['order_price'] != input_num('ChgPrice')) {
if ($_POST['order_price'] == 0 || input_num('ChgPrice') / $_POST['order_price'] > 1 + sys_prefs::over_charge_allowance() / 100) {
display_error(tr("The price being invoiced is more than the purchase order price by more than the allowed over-charge percentage. The system is set up to prohibit this. See the system administrator to modify the set up parameters if necessary.") . tr("The over-charge percentage allowance is :") . sys_prefs::over_charge_allowance() . "%");
set_focus('ChgPrice');
return false;
}
}
}
if ($check_qty_charged_vs_del_qty == True) {
if (input_num('this_quantity_inv') / ($_POST['qty_recd'] - $_POST['prev_quantity_inv']) > 1 + sys_prefs::over_charge_allowance() / 100) {
display_error(tr("The quantity being invoiced is more than the outstanding quantity by more than the allowed over-charge percentage. The system is set up to prohibit this. See the system administrator to modify the set up parameters if necessary.") . tr("The over-charge percentage allowance is :") . sys_prefs::over_charge_allowance() . "%");
set_focus('this_quantity_inv');
return false;
}
}
return true;
}
开发者ID:ravenii,项目名称:guardocs,代码行数:31,代码来源:supplier_invoice_grns.php
示例4: handle_submit
function handle_submit()
{
global $selected_id;
if (!check_data()) {
return false;
}
if ($selected_id != "") {
update_exchange_rate($_POST['curr_abrev'], $_POST['date_'], input_num('BuyRate'), input_num('BuyRate'));
} else {
add_exchange_rate($_POST['curr_abrev'], $_POST['date_'], input_num('BuyRate'), input_num('BuyRate'));
}
return true;
}
开发者ID:ravenii,项目名称:guardocs,代码行数:13,代码来源:exchange_rates.php
示例5: 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
示例6: handle_submit
function handle_submit()
{
global $path_to_root;
if (!can_process()) {
return;
}
if (!isset($_POST['New'])) {
$sql = "UPDATE debtors_master SET name=" . db_escape($_POST['CustName']) . ", \n\t\t\taddress=" . db_escape($_POST['address']) . ", \n\t\t\ttax_id=" . db_escape($_POST['tax_id']) . ", \n\t\t\tcurr_code=" . db_escape($_POST['curr_code']) . ", \n\t\t\temail=" . db_escape($_POST['email']) . ", \n\t\t\tdimension_id=" . db_escape($_POST['dimension_id']) . ", \n\t\t\tdimension2_id=" . db_escape($_POST['dimension2_id']) . ", \n credit_status=" . db_escape($_POST['credit_status']) . ", \n payment_terms=" . db_escape($_POST['payment_terms']) . ", \n discount=" . input_num('discount') / 100 . ", \n pymt_discount=" . input_num('pymt_discount') / 100 . ", \n credit_limit=" . input_num('credit_limit') . ", \n sales_type = " . db_escape($_POST['sales_type']) . " \n WHERE debtor_no = '" . $_POST['customer_id'] . "'";
db_query($sql, "The customer could not be updated");
display_notification(tr("Customer has been updated."));
clear_fields();
} else {
//it is a new customer
begin_transaction();
$sql = "INSERT INTO debtors_master (name, address, tax_id, email, dimension_id, dimension2_id, \n\t\t\tcurr_code, credit_status, payment_terms, discount, pymt_discount,credit_limit, \n\t\t\tsales_type) VALUES (" . db_escape($_POST['CustName']) . ", " . db_escape($_POST['address']) . ", " . db_escape($_POST['tax_id']) . "," . db_escape($_POST['email']) . ", " . db_escape($_POST['dimension_id']) . ", " . db_escape($_POST['dimension2_id']) . ", " . db_escape($_POST['curr_code']) . ", \n\t\t\t" . db_escape($_POST['credit_status']) . ", " . db_escape($_POST['payment_terms']) . ", " . input_num('discount') / 100 . ", \n\t\t\t" . input_num('pymt_discount') / 100 . ", " . input_num('credit_limit') . ", " . db_escape($_POST['sales_type']) . ")";
db_query($sql, "The customer could not be added");
$new_customer_id = db_insert_id();
commit_transaction();
display_notification(tr("A new customer has been added."));
hyperlink_params($path_to_root . "/sales/manage/customer_branches.php", tr("Add branches for this customer"), "debtor_no={$new_customer_id}");
clear_fields();
}
}
开发者ID:ravenii,项目名称:guardocs,代码行数:23,代码来源:customers.php
示例7: display_error
if (strlen($_POST['item_code']) == 0) {
$input_error = 1;
display_error(_("The item of use cannot be empty."));
set_focus('name');
}
if (strlen($_POST['estimate_price']) == 0) {
$input_error = 1;
display_error(_("The estimated price be empty."));
set_focus('rate');
}
if ($input_error != 1) {
if ($selected_id != -1) {
update_requisition_detail($selected_id, $_POST['item_code'], $_POST['purpose'], $_POST['order_quantity'], input_num('estimate_price'));
display_notification(_('Selected requisition details has been updated.'));
} else {
add_requisition_detail($_POST['requisitionid'], $_POST['item_code'], $_POST['purpose'], $_POST['order_quantity'], input_num('estimate_price'));
display_notification(_('New requisition details has been added'));
}
$Mode = 'RESET';
}
}
//-----------------------------------------------------------------------------------
if ($Mode == 'Delete') {
delete_requisition_detail($selected_id);
display_notification(_('Selected requisition detail has been deleted'));
$Mode = 'RESET';
}
if ($Mode == 'RESET') {
$selected_id = -1;
$sav = get_post('show_inactive');
$requisitionid = $_POST['requisitionid'];
开发者ID:blestab,项目名称:frontaccounting,代码行数:31,代码来源:requisition_details.php
示例8: handle_new_item
function handle_new_item()
{
if (!check_item_data()) {
return;
}
if (!isset($_POST['std_cost'])) {
$_POST['std_cost'] = 0;
}
add_to_order($_SESSION['transfer_items'], $_POST['stock_id'], input_num('qty'), $_POST['std_cost']);
line_start_focus();
}
开发者ID:blestab,项目名称:frontaccounting,代码行数:11,代码来源:transfers.php
示例9: can_process
function can_process()
{
global $Refs;
if (!get_post('customer_id')) {
display_error(_("There is no customer selected."));
set_focus('customer_id');
return false;
}
if (!get_post('BranchID')) {
display_error(_("This customer has no branch defined."));
set_focus('BranchID');
return false;
}
if (!isset($_POST['DateBanked']) || !is_date($_POST['DateBanked'])) {
display_error(_("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(_("The entered date is not in fiscal year."));
set_focus('DateBanked');
return false;
}
if (!$Refs->is_valid($_POST['ref'])) {
display_error(_("You must enter a reference."));
set_focus('ref');
return false;
}
//Chaitanya : 13-OCT-2011 - To support Edit feature
if (isset($_POST['trans_no']) && $_POST['trans_no'] == 0 && !is_new_reference($_POST['ref'], ST_CUSTPAYMENT)) {
display_error(_("The entered reference is already in use."));
set_focus('ref');
return false;
} elseif ($_POST['ref'] != $_POST['old_ref'] && !is_new_reference($_POST['ref'], ST_CUSTPAYMENT)) {
display_error(_("The entered reference is already in use."));
set_focus('ref');
return false;
}
if (!check_num('amount', 0)) {
display_error(_("The entered amount is invalid or negative and cannot be processed."));
set_focus('amount');
return false;
}
if (isset($_POST['charge']) && !check_num('charge', 0)) {
display_error(_("The entered amount is invalid or negative and cannot be processed."));
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 (isset($_POST['_ex_rate']) && !check_num('_ex_rate', 1.0E-6)) {
display_error(_("The exchange rate must be numeric and greater than zero."));
set_focus('_ex_rate');
return false;
}
if ($_POST['discount'] == "") {
$_POST['discount'] = 0;
}
if (!check_num('discount')) {
display_error(_("The entered discount is not a valid number."));
set_focus('discount');
return false;
}
//if ((input_num('amount') - input_num('discount') <= 0)) {
if (input_num('amount') <= 0) {
display_error(_("The balance of the amount and discout is zero or negative. Please enter valid amounts."));
set_focus('discount');
return false;
}
if (!db_has_currency_rates(get_customer_currency($_POST['customer_id']), $_POST['DateBanked'], true)) {
return false;
}
$_SESSION['alloc']->amount = input_num('amount');
if (isset($_POST["TotalNumberOfAllocs"])) {
return check_allocations();
} else {
return true;
}
}
开发者ID:pthdnq,项目名称:ivalley-svn,代码行数:84,代码来源:customer_payments.php
示例10: handle_add_new_item
function handle_add_new_item()
{
$allow_update = check_data();
if ($allow_update == true) {
if (count($_SESSION['PO']->line_items) > 0) {
foreach ($_SESSION['PO']->line_items as $order_item) {
/* do a loop round the items on the order to see that the item
is not already on this order */
if ($order_item->stock_id == $_POST['stock_id'] && $order_item->Deleted == False) {
$allow_update = False;
display_error(tr("The selected item is already on this order."));
}
}
/* end of the foreach loop to look for pre-existing items of the same code */
}
if ($allow_update == true) {
$sql = "SELECT description, units, mb_flag\n\t\t\t\tFROM stock_master WHERE stock_id = '" . $_POST['stock_id'] . "'";
$result = db_query($sql, "The stock details for " . $_POST['stock_id'] . " could not be retrieved");
if (db_num_rows($result) == 0) {
$allow_update = False;
}
if ($allow_update) {
$myrow = db_fetch($result);
$_SESSION['PO']->add_to_order($_POST['line_no'], $_POST['stock_id'], input_num('qty'), $myrow["description"], input_num('price'), $myrow["units"], $_POST['req_del_date'], 0, 0);
unset_form_variables();
$_POST['StockID2'] = $_POST['stock_id'] = "";
} else {
display_error(tr("The selected item does not exist or it is a kit part and therefore cannot be purchased."));
}
}
/* end of if not already on the order and allow input was true*/
}
}
开发者ID:ravenii,项目名称:guardocs,代码行数:33,代码来源:po_entry_items.php
示例11: handle_new_item
function handle_new_item()
{
if (!check_item_data()) {
return;
}
add_to_order($_SESSION['adj_items'], $_POST['stock_id'], input_num('qty'), input_num('std_cost'));
line_start_focus();
}
开发者ID:blestab,项目名称:frontaccounting,代码行数:8,代码来源:adjustments.php
示例12: start_row
$total = $btotal = $ltotal = 0;
for ($i = 0, $date_ = $begin; date1_greater_date2($end, $date_); $i++) {
start_row();
$_POST['amount' . $i] = number_format2(get_only_budget_trans_from_to($date_, $date_, $_POST['account'], $_POST['dim1'], $_POST['dim2']), 0);
label_cell($date_);
if (!isset($_POST['amount' . $i])) {
$_POST['amount' . $i] = '0';
}
amount_cells(null, 'amount' . $i, null, 15, null, 0);
if ($showdims) {
$d = get_budget_trans_from_to($date_, $date_, $_POST['account'], $_POST['dim1'], $_POST['dim2']);
label_cell(number_format2($d, 0), "nowrap align=right");
$btotal += $d;
}
$lamount = get_gl_trans_from_to(add_years($date_, -1), add_years(end_month($date_), -1), $_POST['account'], $_POST['dim1'], $_POST['dim2']);
$total += input_num('amount' . $i);
$ltotal += $lamount;
label_cell(number_format2($lamount, 0), "nowrap align=right");
$date_ = add_months($date_, 1);
end_row();
}
start_row();
label_cell("<b>" . tr("Total") . "</b>");
label_cell("<b>" . number_format2($total, 0) . "</b>", 'align=right');
if ($showdims) {
label_cell("<b>" . number_format2($btotal, 0) . "</b>", "nowrap align=right");
}
label_cell("<b>" . number_format2($ltotal, 0) . "</b>", "nowrap align=right");
end_row();
end_table(1);
submit_center_first('add', tr("Save"));
开发者ID:ravenii,项目名称:guardocs,代码行数:31,代码来源:gl_budget.php
示例13: display_error
$input_error = 1;
display_error(tr("Salesman provision cannot be less than 0 or more than 100%."));
set_focus(!$pr1 ? 'provision' : 'provision2');
}
if (!check_num('break_pt', 0)) {
$input_error = 1;
display_error(tr("Salesman provision breakpoint must be numeric and not less than 0."));
set_focus('break_pt');
}
if ($input_error != 1) {
if (isset($selected_id)) {
/*selected_id could also exist if submit had not been clicked this code would not run in this case cos submit is false of course see the delete code below*/
$sql = "UPDATE salesman SET salesman_name=" . db_escape($_POST['salesman_name']) . ",\n \t\t\tsalesman_phone=" . db_escape($_POST['salesman_phone']) . ",\n \t\t\tsalesman_fax=" . db_escape($_POST['salesman_fax']) . ",\n \t\t\tsalesman_email=" . db_escape($_POST['salesman_email']) . ",\n \t\t\tprovision=" . input_num('provision') . ",\n \t\t\tbreak_pt=" . input_num('break_pt') . ",\n \t\t\tprovision2=" . input_num('provision2') . "\n \t\t\tWHERE salesman_code = '{$selected_id}'";
} else {
/*Selected group is null cos no item selected on first time round so must be adding a record must be submitting new entries in the new Sales-person form */
$sql = "INSERT INTO salesman (salesman_name, salesman_phone, salesman_fax, salesman_email,\n \t\t\tprovision, break_pt, provision2)\n \t\t\tVALUES (" . db_escape($_POST['salesman_name']) . ", " . db_escape($_POST['salesman_phone']) . ", " . db_escape($_POST['salesman_fax']) . ", " . db_escape($_POST['salesman_email']) . ", " . input_num('provision') . ", " . input_num('break_pt') . ", " . input_num('provision2') . ")";
}
//run the sql from either of the above possibilites
db_query($sql, "The insert or update of the salesperson failed");
meta_forward($_SERVER['PHP_SELF']);
}
}
if (isset($_GET['delete'])) {
//the link to delete a selected record was clicked instead of the submit button
// PREVENT DELETES IF DEPENDENT RECORDS IN 'debtors_master'
$sql = "SELECT COUNT(*) FROM cust_branch WHERE salesman='{$selected_id}'";
$result = db_query($sql, "check failed");
$myrow = db_fetch_row($result);
if ($myrow[0] > 0) {
display_error("Cannot delete this sales-person because branches are set up referring to this sales-person - first alter the branches concerned.");
} else {
开发者ID:ravenii,项目名称:guardocs,代码行数:31,代码来源:sales_people.php
示例14: handle_add_payment
function handle_add_payment()
{
$payment_id = write_supp_payment(0, $_POST['supplier_id'], $_POST['bank_account'], $_POST['DatePaid'], $_POST['ref'], input_num('amount'), input_num('discount'), $_POST['memo_'], input_num('charge'), input_num('bank_amount', input_num('amount')));
new_doc_date($_POST['DatePaid']);
$_SESSION['alloc']->trans_no = $payment_id;
$_SESSION['alloc']->date_ = $_POST['DatePaid'];
$_SESSION['alloc']->write();
unset($_POST['bank_account']);
unset($_POST['DatePaid']);
unset($_POST['currency']);
unset($_POST['memo_']);
unset($_POST['amount']);
unset($_POST['discount']);
unset($_POST['ProcessSuppPayment']);
meta_forward($_SERVER['PHP_SELF'], "AddedID={$payment_id}&supplier_id=" . $_POST['supplier_id']);
}
开发者ID:M-Shahbaz,项目名称:FA,代码行数:16,代码来源:supplier_payment.php
示例15: change_tpl_flag
function change_tpl_flag($reconcile_id)
{
global $Ajax;
if (!check_date() && check_value("rec_" . $reconcile_id)) {
// temporary fix
return false;
}
if (get_post('bank_date') == '') {
// new reconciliation
$Ajax->activate('bank_date');
}
$_POST['bank_date'] = date2sql(get_post('reconcile_date'));
$reconcile_value = check_value("rec_" . $reconcile_id) ? "'" . $_POST['bank_date'] . "'" : 'NULL';
update_reconciled_values($reconcile_id, $reconcile_value, $_POST['reconcile_date'], input_num('end_balance'), $_POST['bank_account']);
$Ajax->activate('reconciled');
$Ajax->activate('difference');
return true;
}
开发者ID:knjy24,项目名称:FrontAccounting,代码行数:18,代码来源:bank_account_reconcile.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: read_po
/*read in all the selected order into the Items cart */
read_po($_GET['PONumber'], $_SESSION['PO']);
}
//--------------------------------------------------------------------------------------------------
if (isset($_POST['Update']) || isset($_POST['ProcessGoodsReceived'])) {
/* if update quantities button is hit page has been called and ${$line->line_no} would have be
set from the post to the quantity to be received in this receival*/
foreach ($_SESSION['PO']->line_items as $line) {
$_POST[$line->line_no] = max($_POST[$line->line_no], 0);
if (!check_num($line->line_no)) {
$_POST[$line->line_no] = qty_format(0);
}
if (!isset($_POST['DefaultReceivedDate']) || $_POST['DefaultReceivedDate'] == "") {
$_POST['DefaultReceivedDate'] = Today();
}
$_SESSION['PO']->line_items[$line->line_no]->receive_qty = input_num($line->line_no);
if (isset($_POST[$line->stock_id . "Desc"]) && strlen($_POST[$line->stock_id . "Desc"]) > 0) {
$_SESSION['PO']->line_items[$line->line_no]->item_description = $_POST[$line->stock_id . "Desc"];
}
}
}
//--------------------------------------------------------------------------------------------------
if (isset($_POST['ProcessGoodsReceived'])) {
process_receive_po();
}
//--------------------------------------------------------------------------------------------------
start_form(false, true);
display_grn_summary($_SESSION['PO'], true);
display_heading(tr("Items to Receive"));
display_po_receive_items();
echo "<br><center>";
开发者ID:ravenii,项目名称:guardocs,代码行数:31,代码来源:po_receive_items.php
示例18: handle_add_new_item
function handle_add_new_item()
{
$allow_update = check_data();
if ($allow_update == true) {
if (count($_SESSION['PO']->line_items) > 0) {
foreach ($_SESSION['PO']->line_items as $order_item) {
/* do a loop round the items on the order to see that the item
is not already on this order */
if ($order_item->stock_id == $_POST['stock_id']) {
display_warning(_("The selected item is already on this order."));
}
}
/* end of the foreach loop to look for pre-existing items of the same code */
}
if ($allow_update == true) {
$result = get_short_info($_POST['stock_id']);
if (db_num_rows($result) == 0) {
$allow_update = false;
}
if ($allow_update) {
$myrow = db_fetch($result);
$_SESSION['PO']->add_to_order(count($_SESSION['PO']->line_items), $_POST['stock_id'], input_num('qty'), get_post('stock_id_text'), input_num('price'), '', $_SESSION['PO']->trans_type == ST_PURCHORDER ? $_POST['req_del_date'] : '', 0, 0);
unset_form_variables();
$_POST['stock_id'] = "";
} else {
display_error(_("The selected item does not exist or it is a kit part and therefore cannot be purchased."));
}
}
/* end of if not already on the order and allow input was true*/
}
line_start_focus();
}
开发者ID:knjy24,项目名称:FrontAccounting,代码行数:32,代码来源:po_entry_items.php
示例19: start_table
start_table(TABLESTYLE, "width=30%");
$th = array(_("Location"), _("Quantity On Hand"), _("Re-Order Level"));
table_header($th);
$j = 1;
$k = 0;
//row colour counter
$result = get_loc_details($_POST['stock_id']);
if (@$_GET['popup']) {
hidden('_tabs_sel', get_post('_tabs_sel'));
hidden('popup', @$_GET['popup']);
}
while ($myrow = db_fetch($result)) {
alt_table_row_color($k);
if (isset($_POST['UpdateData']) && check_num($myrow["loc_code"])) {
$myrow["reorder_level"] = input_num($myrow["loc_code"]);
set_reorder_level($_POST['stock_id'], $myrow["loc_code"], input_num($myrow["loc_code"]));
display_notification(_("Reorder levels has been updated."));
}
$qoh = get_qoh_on_date($_POST['stock_id'], $myrow["loc_code"]);
label_cell($myrow["location_name"]);
$_POST[$myrow["loc_code"]] = qty_format($myrow["reorder_level"], $_POST['stock_id'], $dec);
qty_cell($qoh, false, $dec);
qty_cells(null, $myrow["loc_code"], null, null, null, $dec);
end_row();
$j++;
if ($j == 12) {
$j = 1;
table_header($th);
}
}
end_table(1);
开发者ID:nativebandung,项目名称:frontaccounting,代码行数:31,代码来源:reorder_level.php
示例20: can_process
function can_process()
{
global $selected_id, $SysPrefs, $Refs;
if (!isset($selected_id)) {
if (!$Refs->is_valid($_POST['wo_ref'])) {
display_error(_("You must enter a reference."));
set_focus('wo_ref');
return false;
}
if (!is_new_reference($_POST['wo_ref'], ST_WORKORDER)) {
display_error(_("The entered reference is already in use."));
set_focus('wo_ref');
return false;
}
}
if (!check_num('quantity', 0)) {
display_error(_("The quantity entered is invalid or less than zero."));
set_focus('quantity');
return false;
}
if (!is_date($_POST['date_'])) {
display_error(_("The date entered is in an invalid format."));
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;
}
// only check bom and quantites if quick assembly
if (!($_POST['type'] == WO_ADVANCED)) {
if (!has_bom($_POST['stock_id'])) {
display_error(_("The selected item to manufacture does not have a bom."));
set_focus('stock_id');
return false;
}
if ($_POST['Labour'] == "") {
$_POST['Labour'] = price_format(0);
}
if (!check_num('Labour', 0)) {
display_error(_("The labour cost entered is invalid or less than zero."));
set_focus('Labour');
return false;
}
if ($_POST['Costs'] == "") {
$_POST['Costs'] = price_format(0);
}
if (!check_num('Costs', 0)) {
display_error(_("The cost entered is invalid or less than zero."));
set_focus('Costs');
return false;
}
if (!$SysPrefs->allow_negative_stock()) {
if ($_POST['type'] == WO_ASSEMBLY) {
// check bom if assembling
$result = get_bom($_POST['stock_id']);
while ($bom_item = db_fetch($result)) {
if (has_stock_holding($bom_item["ResourceType"])) {
$quantity = $bom_item["quantity"] * input_num('quantity');
if (check_negative_stock($bom_item["component"], -$quantity, $bom_item["loc_code"], $_POST['date_'])) {
display_error(_("The work order cannot be processed because there is an insufficient quantity for component:") . " " . $bom_item["component"] . " - " . $bom_item["description"] . ". " . _("Location:") . " " . $bom_item["location_name"]);
set_focus('quantity');
return false;
}
}
}
} elseif ($_POST['type'] == WO_UNASSEMBLY) {
// if unassembling, check item to unassemble
if (check_negative_stock($_POST['stock_id'], -input_num('quantity'), $_POST['StockLocation'], $_POST['date_'])) {
display_error(_("The selected item cannot be unassembled because there is insufficient stock."));
return false;
}
}
}
} else {
if (!is_date($_POST['RequDate'])) {
set_focus('RequDate');
display_error(_("The date entered is in an invalid format."));
return false;
}
//elseif (!is_date_in_fiscalyear($_POST['RequDate']))
//{
// display_error(_("The entered date is not in fiscal year."));
// return false;
//}
if (isset($selected_id)) {
$myrow = get_work_order($selected_id, true);
if ($_POST['units_issued'] > input_num('quantity')) {
set_focus('quantity');
display_error(_("The quantity cannot be changed to be less than the quantity already manufactured for this order."));
return false;
}
}
}
return true;
}
开发者ID:M-Shahbaz,项目名称:FA,代码行数:96,代码来源:work_order_entry.php
注:本文中的input_num函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论