projects
/
fa-stable.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rerun of items attachments. Including fixed assets.
[fa-stable.git]
/
inventory
/
manage
/
items.php
diff --git
a/inventory/manage/items.php
b/inventory/manage/items.php
index d4904041b2e0c3752f2d5fdf1c1a9e7bc5345ab2..ae2686cdc89498a4ff99b71a8bed7aabbe2f7039 100644
(file)
--- a/
inventory/manage/items.php
+++ b/
inventory/manage/items.php
@@
-38,6
+38,7
@@
page($_SESSION['page_title'], @$_REQUEST['popup'], false, "", $js);
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 . "/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 . "/includes/ui/attachment.inc");
include_once($path_to_root . "/inventory/includes/inventory_db.inc");
include_once($path_to_root . "/fixed_assets/includes/fixed_assets_db.inc");
include_once($path_to_root . "/inventory/includes/inventory_db.inc");
include_once($path_to_root . "/fixed_assets/includes/fixed_assets_db.inc");
@@
-56,7
+57,7
@@
function set_edit($stock_id)
$_POST['del_image'] = 0;
}
$_POST['del_image'] = 0;
}
-function del
ete
_image($stock_id)
+function del_image($stock_id)
{
foreach (array('jpg', 'png', 'gif') as $ext) {
$filename = company_path().'/images/'.item_img_name($stock_id).".".$ext;
{
foreach (array('jpg', 'png', 'gif') as $ext) {
$filename = company_path().'/images/'.item_img_name($stock_id).".".$ext;
@@
-335,7
+336,7
@@
if (isset($_POST['delete']) && strlen($_POST['delete']) > 1)
$stock_id = $_POST['NewStockID'];
delete_item($stock_id);
$stock_id = $_POST['NewStockID'];
delete_item($stock_id);
- del
ete
_image($stock_id);
+ del_image($stock_id);
display_notification(_("Selected item has been deleted."));
$_POST['stock_id'] = '';
clear_data();
display_notification(_("Selected item has been deleted."));
$_POST['stock_id'] = '';
clear_data();
@@
-585,7
+586,8
@@
if (!$stock_id)
$tabs = (get_post('fixed_asset'))
? array(
'settings' => array(_('&General settings'), $stock_id),
$tabs = (get_post('fixed_asset'))
? array(
'settings' => array(_('&General settings'), $stock_id),
- 'movement' => array(_('&Transactions'), $stock_id) )
+ 'movement' => array(_('&Transactions'), $stock_id),
+ 'attachments' => array(_('Attachments'), (user_check_access('SA_ATTACHDOCUMENT') ? get_item_code_id($stock_id) : null)))
: array(
'settings' => array(_('&General settings'), $stock_id),
'sales_pricing' => array(_('S&ales Pricing'), (user_check_access('SA_SALESPRICE') ? $stock_id : null)),
: array(
'settings' => array(_('&General settings'), $stock_id),
'sales_pricing' => array(_('S&ales Pricing'), (user_check_access('SA_SALESPRICE') ? $stock_id : null)),
@@
-596,6
+598,7
@@
$tabs = (get_post('fixed_asset'))
'movement' => array(_('&Transactions'), (user_check_access('SA_ITEMSTRANSVIEW') && is_inventory_item($stock_id) ?
$stock_id : null)),
'status' => array(_('&Status'), (user_check_access('SA_ITEMSSTATVIEW') ? $stock_id : null)),
'movement' => array(_('&Transactions'), (user_check_access('SA_ITEMSTRANSVIEW') && is_inventory_item($stock_id) ?
$stock_id : null)),
'status' => array(_('&Status'), (user_check_access('SA_ITEMSSTATVIEW') ? $stock_id : null)),
+ 'attachments' => array(_('Attachments'), (user_check_access('SA_ATTACHDOCUMENT') ? get_item_code_id($stock_id) : null)),
);
tabbed_content_start('tabs', $tabs);
);
tabbed_content_start('tabs', $tabs);
@@
-637,6
+640,12
@@
tabbed_content_start('tabs', $tabs);
$_GET['stock_id'] = $stock_id;
include_once($path_to_root."/inventory/inquiry/stock_status.php");
break;
$_GET['stock_id'] = $stock_id;
include_once($path_to_root."/inventory/inquiry/stock_status.php");
break;
+ case 'attachments':
+ $id = get_item_code_id($stock_id);
+ $_GET['trans_no'] = $id;
+ $_GET['type_no']= get_post('fixed_asset') ? ST_FIXEDASSET : ST_ITEM;
+ $attachments = new attachments('attachment', $id, 'items');
+ $attachments->show();
};
br();
};
br();
@@
-686,9
+695,10
@@
function generateBarcode() {
$query = "SELECT stock_id FROM ".TB_PREF."stock_master WHERE stock_id='" . $tmpBarcodeID . "'";
$arr_stock = db_fetch(db_query($query));
$query = "SELECT stock_id FROM ".TB_PREF."stock_master WHERE stock_id='" . $tmpBarcodeID . "'";
$arr_stock = db_fetch(db_query($query));
- if ( !$arr_stock['stock_id'] ) {
+ if ( !$arr_stock
|| !$arr_stock
['stock_id'] ) {
return $tmpBarcodeID;
}
$tmpBarcodeID = "";
}
}
return $tmpBarcodeID;
}
$tmpBarcodeID = "";
}
}
+