Files
OMS/app/siso/lib/receipt/iostock/defaultstore.php
2026-01-04 19:08:31 +08:00

69 lines
2.5 KiB
PHP

<?php
/**
* Copyright 2012-2026 ShopeX (https://www.shopex.cn)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
class siso_receipt_iostock_defaultstore extends siso_receipt_iostock_abstract implements siso_receipt_iostock_interface{
/**
*
* 出入库类型id
* @var int
*/
protected $_typeId = 500;
/**
*
* 出库/入库动作
* @var int
*/
protected $_io_type = 1;
/**
*
* 期初出入库单明细内容
* @param int $data 是数据内容
*/
function get_io_data($data){
$oInventory = app::get('console')->model('inventory');
#$inventory = $oInventory->dump(array('inventory_id'=>$data['inventory_id']),'inventory_bn,branch_bn,inventory_id');
$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' => time(),
'operator' => $operator,
'memo' => $data['memo'],
'is_use_expire' => $item['is_use_expire'],
'inventory_item_id' => $item['inventory_item_id'],
);
}
return $iostock_data;
}
}