blob: 8ae66e49bcbd1e77ca7c039bf8b9af034d9e1c5e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
<?php
/**
* @package stock
*/
namespace Bitweaver\Stock;
require_once '../kernel/includes/setup_inc.php';
global $gBitSystem, $gBitSmarty, $gBitDb;
$gBitSystem->verifyPermission( 'p_stock_view' );
$componentContentId = isset( $_REQUEST['component_content_id'] ) && is_numeric( $_REQUEST['component_content_id'] )
? (int)$_REQUEST['component_content_id'] : null;
$movement = new StockMovement();
$listHash = $_REQUEST;
$movementList = $movement->getList( $listHash );
$componentTitle = '';
$packSize = null;
if( $componentContentId ) {
$componentTitle = $gBitDb->getOne(
"SELECT `title` FROM `".BIT_DB_PREFIX."liberty_content` WHERE `content_id` = ?",
[ $componentContentId ]
) ?: '';
$ps = $gBitDb->getOne(
"SELECT CAST(x.`xkey` AS DOUBLE PRECISION) FROM `".BIT_DB_PREFIX."liberty_xref` x
WHERE x.`content_id` = ? AND x.`item` = 'PCK'",
[ $componentContentId ]
);
$packSize = $ps ? (float)$ps : null;
}
$gBitSmarty->assign( 'listInfo', $listHash['listInfo'] );
$gBitSmarty->assign( 'movementList', $movementList );
$gBitSmarty->assign( 'filterType', $_REQUEST['ref_type'] ?? '' );
$gBitSmarty->assign( 'assemblyContentId', isset( $_REQUEST['assembly_content_id'] ) && is_numeric( $_REQUEST['assembly_content_id'] ) ? (int)$_REQUEST['assembly_content_id'] : null );
$gBitSmarty->assign( 'componentContentId', $componentContentId );
$gBitSmarty->assign( 'componentTitle', $componentTitle );
$gBitSmarty->assign( 'packSize', $packSize );
$gBitSystem->display( 'bitpackage:stock/list_movements.tpl', 'Movements', [ 'display_mode' => 'list' ] );
|