Files
SGF/scripts/sgf-stock-completion-binding.php
T
2026-11-11 09:00:17 +02:00

9 lines
975 B
PHP

<?php
$book=$argv[1]??'regression';require __DIR__.'/sgf-single-bootstrap.php';
$input=json_decode(file_get_contents($s['root'].'/single-stock-disposition-input.json'),true,32,JSON_THROW_ON_ERROR);
$line=$native->table('goods_receipt_items')->where('goods_receipt_id',$input['receipt'])->where('stock_item_id',$input['stock_item'])->firstOrFail();
$p=['composition'=>$tag,'scope'=>$f['scope'],'dispatcher_host_id'=>$f['validator'],'reviewer_host_id'=>12,'dispatcher_native_id'=>6,'reviewer_native_id'=>3,'warehouse_id'=>$input['warehouse'],'stock_item_id'=>$input['stock_item'],'receipt_item_id'=>$line->id];
$file=$s['root'].'/stock-completion-binding.json';if(is_file($file)&&json_decode(file_get_contents($file),true)!=$p)throw new LogicException('Binding changed; manual reconciliation required');
if(!is_file($file))file_put_contents($file,json_encode($p,JSON_PRETTY_PRINT));
echo json_encode(['passed'=>true,'book'=>$book,'sha256'=>hash_file('sha256',$file)]).PHP_EOL;