From 44012f6736c91bc0811d64544fd90b6181433a5f Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Wed, 1 Jul 2009 12:27:16 +0000 Subject: [PATCH] Small adjustment in /inventory/prices.php to see the calculated prices if they are set. --- CHANGELOG.txt | 3 +++ inventory/prices.php | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index eb34b8d3..ca541bb6 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -19,6 +19,9 @@ Legend: ! -> Note $ -> Affected files +! Small adjustment in /inventory/prices.php to see the calculated prices if they are set. +$ /inventory/prices.php + 30-Jun-2009 Joe Hunt # Small annoying bug-fixes in items.php and items_trans_db.inc $ /inventory/manage/items.php diff --git a/inventory/prices.php b/inventory/prices.php index 4121553c..6268d2bf 100644 --- a/inventory/prices.php +++ b/inventory/prices.php @@ -115,7 +115,7 @@ if (list_updated('stock_id')) { $Ajax->activate('price_table'); $Ajax->activate('price_details'); } -if (list_updated('stock_id') || isset($_POST['_curr_abrev_update']) ) { +if (list_updated('stock_id') || isset($_POST['_curr_abrev_update']) || isset($_POST['_sales_type_id_update'])) { // after change of stock, currency or salestype selector // display default calculated price for new settings. // If we have this price already in db it is overwritten later. @@ -133,7 +133,7 @@ start_table("$table_style width=30%"); $th = array(_("Currency"), _("Sales Type"), _("Price"), "", ""); table_header($th); $k = 0; //row colour counter - +$calculated = false; while ($myrow = db_fetch($prices_list)) { @@ -150,6 +150,7 @@ while ($myrow = db_fetch($prices_list)) end_table(); if (db_num_rows($prices_list) == 0) { + $calculated = true; display_note(_("There are no prices set up for this part."), 1); } div_end(); @@ -172,6 +173,7 @@ start_table($table_style2); currencies_list_row(_("Currency:"), 'curr_abrev', null, true); sales_types_list_row(_("Sales Type:"), 'sales_type_id', null, true); + if (!isset($_POST['price'])) { $_POST['price'] = price_format(get_kit_price(get_post('stock_id'), get_post('curr_abrev'), get_post('sales_type_id'))); @@ -181,6 +183,8 @@ $kit = get_item_code_dflts($_POST['stock_id']); small_amount_row(_("Price:"), 'price', null, '', _('per') .' '.$kit["units"]); end_table(1); +if ($calculated) + display_note(_("The price is calculated."), 0, 1); submit_add_or_update_center($selected_id == -1, '', 'both'); div_end(); -- 2.30.2