Files
OMS/app/siso/lib/receipt/iostock/overage.php
2025-12-28 23:13:25 +08:00

58 lines
2.1 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
/**
* Copyright © ShopeX http://www.shopex.cn. All rights reserved.
* See LICENSE file for license details.
*/
class siso_receipt_iostock_overage extends siso_receipt_iostock_abstract implements siso_receipt_iostock_interface{
/**
*
* 出入库类型id
* @var int
*/
protected $_typeId = 60;
/**
*
* 出库/入库动作
* @var int
*/
protected $_io_type = 1;
/**
*
* 根据盘盈组织出入库单明细内容
* @param int $data 是数据内容
*/
function get_io_data($data){
$oInventory = app::get('console')->model('inventory');
#$inventory = $oInventory->getlist('inventory_bn,branch_bn,inventory_id',array('inventory_id'=>$data['inventory_id']),0,1);
#$inventory = $inventory[0];
$branchObj = kernel::single('console_iostockdata');
$branch= $branchObj->getBranchBybn($data['branch_bn']);
$create_time = $data['operate_time'] == '' ? time(): $data['operate_time'];
$items = $data['items'];
$operator = kernel::single('desktop_user')->get_name();
$operator = $operator=='' ? 'system' : $operator;
foreach ($items as $k=>$item){
$iostock_data[] = array(
'branch_id' => $branch['branch_id'],
'original_bn' => $data['inventory_bn'],
'original_id' => $data['inventory_id'],
'original_item_id' => $item['item_id'],
'supplier_id' => 0,
'bn' => $item['bn'],
'iostock_price' => $item['price']!='' ? $item['price']: '0',
'nums' => $item['normal_num'],
'oper' => $operator,
'create_time' => $create_time,
'operator' => $operator,
'memo' => $data['memo'],
'is_use_expire' => $item['is_use_expire'],
'inventory_item_id' => $item['inventory_item_id'],
);
}
return $iostock_data;
}
}