See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
$page_security = 'SA_STANDARDCOST';
-$path_to_root = "..";
-include_once($path_to_root . "/includes/session.inc");
+if (!@$_GET['popup'])
+ $path_to_root = "..";
+else
+ $path_to_root = "../..";
+include_once($path_to_root . "/includes/session.inc");
include_once($path_to_root . "/includes/date_functions.inc");
include_once($path_to_root . "/includes/ui.inc");
include_once($path_to_root . "/includes/banking.inc");
include_once($path_to_root . "/includes/manufacturing.inc");
include_once($path_to_root . "/includes/data_checks.inc");
-
include_once($path_to_root . "/inventory/includes/inventory_db.inc");
-$js = "";
-if ($use_popup_windows)
- $js .= get_js_open_window(900, 500);
-page(_($help_context = "Inventory Item Cost Update"), false, false, "", $js);
+
+if (!@$_GET['popup'])
+{
+ $js = "";
+ if ($use_popup_windows)
+ $js .= get_js_open_window(900, 500);
+ page(_($help_context = "Inventory Item Cost Update"), false, false, "", $js);
+}
//--------------------------------------------------------------------------------------
if ($update_no > 0)
{
- display_note(get_gl_view_str(ST_COSTUPDATE, $update_no, _("View the GL Journal Entries for this Cost Update")), 0, 1);
+ display_notification(get_gl_view_str(ST_COSTUPDATE, $update_no, _("View the GL Journal Entries for this Cost Update")), 0, 1);
}
+
}
}
$Ajax->activate('cost_table');
//-----------------------------------------------------------------------------------------
-start_form();
+$action = $_SERVER['PHP_SELF'];
+if (@$_GET['popup'])
+ $action .= "?stock_id=".get_post('stock_id');
+start_form(false, false, $action);
if (!isset($_POST['stock_id']))
$_POST['stock_id'] = get_global_stock_item();
-echo "<center>" . _("Item:"). " ";
-//echo stock_costable_items_list('stock_id', $_POST['stock_id'], false, true);
-echo stock_items_list('stock_id', $_POST['stock_id'], false, true);
+if (!@$_GET['popup'])
+{
+ echo "<center>" . _("Item:"). " ";
+ //echo stock_costable_items_list('stock_id', $_POST['stock_id'], false, true);
+ echo stock_items_list('stock_id', $_POST['stock_id'], false, true);
+
+ echo "</center><hr>";
+}
+else
+ br(2);
-echo "</center><hr>";
set_global_stock_item($_POST['stock_id']);
$myrow = get_item($_POST['stock_id']);
$_POST['overhead_cost'] = price_decimal_format($myrow["overhead_cost"], $dec3);
amount_row(_("Standard Material Cost Per Unit"), "material_cost", null, "class='tableheader2'", null, $dec1);
+
+if (@$_GET['popup'])
+ hidden('_tabs_sel', get_post('_tabs_sel'));
if ($myrow["mb_flag"]=='M')
{
amount_row(_("Standard Labour Cost Per Unit"), "labour_cost", null, "class='tableheader2'", null, $dec2);
submit_center('UpdateData', _("Update"), true, false, 'default');
end_form();
-end_page();
+if (!@$_GET['popup'])
+ end_page(@$_GET['popup'], false, false);
?>
return db_fetch($result);
}
+function get_stock_price_type_currency($stock_id, $type, $currency)
+{
+ $sql = "SELECT * FROM ".TB_PREF."prices WHERE stock_id=".db_escape($stock_id)."
+ AND sales_type_id=".db_escape($type)."
+ AND curr_abrev=".db_escape($currency);
+
+ $result = db_query($sql,"price could not be retreived");
+
+ return db_fetch($result);
+}
?>
\ No newline at end of file
$stock_gl_code = get_stock_gl_code($stock_id);
$update_no = get_next_trans_no(ST_COSTUPDATE);
$memo_ = sprintf(_("Cost was %s changed to %s x quantity on hand for item '%s'"),
- number_format2($last_cost, 2), number_format2($new_cost, 2), $$stock_id);
+ number_format2($last_cost, 2), number_format2($new_cost, 2), $stock_id);
add_gl_trans_std_cost(ST_COSTUPDATE, $update_no, $date_, $stock_gl_code["adjustment_account"],
$stock_gl_code["dimension_id"], $stock_gl_code["dimension2_id"], $memo_, (-$value_of_change));
tabbed_content_start('tabs', array(
'settings' => array(_('&General settings'), $stock_id),
+ 'sales_pricing' => array(_('S&ales Pricing'), $stock_id),
+ 'purchase_pricing' => array(_('&Purchasing Pricing'), $stock_id),
+ 'standard_cost' => array(_('Standard &Costs'), $stock_id),
+ 'reorder_level' => array(_('&Reorder Levels'), (is_inventory_item($stock_id) ? $stock_id : null)),
'movement' => array(_('&Transactions'), $stock_id),
'status' => array(_('&Status'), $stock_id),
));
case 'settings':
item_settings($stock_id);
break;
+ case 'sales_pricing':
+ $_GET['stock_id'] = $stock_id;
+ $_GET['popup'] = 1;
+ include_once($path_to_root."/inventory/prices.php");
+ break;
+ case 'purchase_pricing':
+ $_GET['stock_id'] = $stock_id;
+ $_GET['popup'] = 1;
+ include_once($path_to_root."/inventory/purchasing_data.php");
+ break;
+ case 'standard_cost':
+ $_GET['stock_id'] = $stock_id;
+ $_GET['popup'] = 1;
+ include_once($path_to_root."/inventory/cost_update.php");
+ break;
+ case 'reorder_level':
+ if (!is_inventory_item($stock_id))
+ {
+ break;
+ }
+ $_GET['stock_id'] = $stock_id;
+ $_GET['popup'] = 1;
+ include_once($path_to_root."/inventory/reorder_level.php");
+ break;
case 'movement':
$_GET['stock_id'] = $stock_id;
$_GET['popup'] = 1;
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
$page_security = 'SA_SALESPRICE';
-$path_to_root = "..";
-include_once($path_to_root . "/includes/session.inc");
-
-page(_($help_context = "Inventory Item Sales prices"));
+if (!@$_GET['popup'])
+ $path_to_root = "..";
+else
+ $path_to_root = "../..";
+include_once($path_to_root . "/includes/session.inc");
include_once($path_to_root . "/sales/includes/sales_db.inc");
include_once($path_to_root . "/sales/includes/db/sales_types_db.inc");
include_once($path_to_root . "/includes/ui.inc");
include_once($path_to_root . "/includes/data_checks.inc");
-
include_once($path_to_root . "/inventory/includes/inventory_db.inc");
+if (!@$_GET['popup'])
+ page(_($help_context = "Inventory Item Sales prices"));
+
//---------------------------------------------------------------------------------------------------
check_db_has_stock_items(_("There are no items defined in the system."));
//---------------------------------------------------------------------------------------------------
-start_form();
+$action = $_SERVER['PHP_SELF'];
+if (@$_GET['popup'])
+ $action .= "?stock_id=".get_post('stock_id');
+start_form(false, false, $action);
if (!isset($_POST['stock_id']))
$_POST['stock_id'] = get_global_stock_item();
-echo "<center>" . _("Item:"). " ";
-echo sales_items_list('stock_id', $_POST['stock_id'], false, true, '', array('editable' => false));
-echo "<hr></center>";
-
+if (!@$_GET['popup'])
+{
+ echo "<center>" . _("Item:"). " ";
+ echo sales_items_list('stock_id', $_POST['stock_id'], false, true, '', array('editable' => false));
+ echo "<hr></center>";
+}
+else
+ br(2);
set_global_stock_item($_POST['stock_id']);
//----------------------------------------------------------------------------------------------------
display_error( _("The price entered must be numeric."));
set_focus('price');
}
+ elseif ($Mode == 'ADD_ITEM' && get_stock_price_type_currency($_POST['stock_id'], $_POST['sales_type_id'], $_POST['curr_abrev']))
+ {
+ $input_error = 1;
+ display_error( _("The sales pricing for this item, sales type and currency has already been added."));
+ set_focus('supplier_id');
+ }
if ($input_error != 1)
{
}
hidden('selected_id', $selected_id);
+if (@$_GET['popup'])
+ hidden('_tabs_sel', get_post('_tabs_sel'));
+
div_start('price_details');
start_table(TABLESTYLE2);
div_end();
end_form();
-end_page();
+if (!@$_GET['popup'])
+ end_page(@$_GET['popup'], false, false);
?>
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
$page_security = 'SA_PURCHASEPRICING';
-$path_to_root = "..";
-include_once($path_to_root . "/includes/session.inc");
-
-page(_($help_context = "Supplier Purchasing Data"));
+if (!@$_GET['popup'])
+ $path_to_root = "..";
+else
+ $path_to_root = "../..";
+include_once($path_to_root . "/includes/session.inc");
include_once($path_to_root . "/includes/date_functions.inc");
include_once($path_to_root . "/includes/ui.inc");
include_once($path_to_root . "/includes/manufacturing.inc");
include_once($path_to_root . "/includes/data_checks.inc");
+if (!@$_GET['popup'])
+ page(_($help_context = "Supplier Purchasing Data"));
+
check_db_has_purchasable_items(_("There are no purchasable inventory items defined in the system."));
check_db_has_suppliers(_("There are no suppliers defined in the system."));
//----------------------------------------------------------------------------------------
simple_page_mode(true);
+if (isset($_GET['stock_id']))
+{
+ $_POST['stock_id'] = $_GET['stock_id'];
+}
//--------------------------------------------------------------------------------------------------
{
$input_error = 1;
display_error( _("There is no item selected."));
- set_focus('stock_id');
+ set_focus('stock_id');
}
elseif (!check_num('price', 0))
{
display_error( _("The conversion factor entered was not numeric. The conversion factor is the number by which the price must be divided by to get the unit price in our unit of measure."));
set_focus('conversion_factor');
}
-
+ elseif ($Mode == 'ADD_ITEM' && get_item_purchasing_data($_POST['supplier_id'], $_POST['stock_id']))
+ {
+ $input_error = 1;
+ display_error( _("The purchasing data for this supplier has already been added."));
+ set_focus('supplier_id');
+ }
if ($input_error == 0)
{
if ($Mode == 'ADD_ITEM')
$Ajax->activate('price_table');
//--------------------------------------------------------------------------------------------------
-start_form();
+$action = $_SERVER['PHP_SELF'];
+if (@$_GET['popup'])
+ $action .= "?stock_id=".get_post('stock_id');
+start_form(false, false, $action);
if (!isset($_POST['stock_id']))
$_POST['stock_id'] = get_global_stock_item();
-echo "<center>" . _("Item:"). " ";
-//Chaitanya : All items can be purchased
-echo stock_items_list('stock_id', $_POST['stock_id'], false, true);
-//echo stock_purchasable_items_list('stock_id', $_POST['stock_id'], false, true);
-
-echo "<hr></center>";
+if (!@$_GET['popup'])
+{
+ echo "<center>" . _("Item:"). " ";
+ //Chaitanya : All items can be purchased
+ echo stock_items_list('stock_id', $_POST['stock_id'], false, true);
+ //echo stock_purchasable_items_list('stock_id', $_POST['stock_id'], false, true);
+ echo "<hr></center>";
+}
+else
+ br(2);
set_global_stock_item($_POST['stock_id']);
br();
hidden('selected_id', $selected_id);
+if (@$_GET['popup'])
+ hidden('_tabs_sel', get_post('_tabs_sel'));
+
start_table(TABLESTYLE2);
if ($Mode == 'Edit')
submit_add_or_update_center($selected_id == -1, '', 'both');
end_form();
-end_page();
+if (!@$_GET['popup'])
+ end_page(@$_GET['popup'], false, false);
?>
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
$page_security = 'SA_REORDER';
-$path_to_root = "..";
-include_once($path_to_root . "/includes/session.inc");
-
-page(_($help_context = "Reorder Levels"));
+if (!@$_GET['popup'])
+ $path_to_root = "..";
+else
+ $path_to_root = "../..";
+include_once($path_to_root . "/includes/session.inc");
include_once($path_to_root . "/includes/date_functions.inc");
include_once($path_to_root . "/includes/ui.inc");
include_once($path_to_root . "/includes/data_checks.inc");
-
include_once($path_to_root . "/inventory/includes/inventory_db.inc");
+if (!@$_GET['popup'])
+ page(_($help_context = "Reorder Levels"));
+
check_db_has_costable_items(_("There are no inventory items defined in the system (Purchased or manufactured items)."));
//------------------------------------------------------------------------------------
}
//------------------------------------------------------------------------------------
-start_form();
+$action = $_SERVER['PHP_SELF'];
+if (@$_GET['popup'])
+ $action .= "?stock_id=".get_post('stock_id');
+start_form(false, false, $action);
if (!isset($_POST['stock_id']))
$_POST['stock_id'] = get_global_stock_item();
-echo "<center>" . _("Item:"). " ";
-echo stock_costable_items_list('stock_id', $_POST['stock_id'], false, true);
-
-echo "<hr></center>";
+if (!@$_GET['popup'])
+{
+ echo "<center>" . _("Item:"). " ";
+ echo stock_costable_items_list('stock_id', $_POST['stock_id'], false, true);
+ echo "<hr></center>";
+}
+else
+ br(2);
div_start('show_heading');
stock_item_heading($_POST['stock_id']);
br();
div_end();
+
set_global_stock_item($_POST['stock_id']);
div_start('reorders');
$result = get_loc_details($_POST['stock_id']);
+if (@$_GET['popup'])
+ hidden('_tabs_sel', get_post('_tabs_sel'));
+
while ($myrow = db_fetch($result))
{
submit_center('UpdateData', _("Update"), true, false, 'default');
end_form();
-end_page();
+if (!@$_GET['popup'])
+ end_page(@$_GET['popup'], false, false);
?>