回筐逻辑修改

This commit is contained in:
liu
2026-08-14 23:47:49 +08:00
parent 4bdaf2a219
commit 7c3f6147ac
20 changed files with 325 additions and 342 deletions
+10 -18
View File
@@ -8,44 +8,36 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Modules\SystemUser\Models\SysUserModel;
/**
* 门店回筐记录模型(压筐=生成账单时自动写入并累加门店待回;回筐=门店退回手动登记并扣减待回
* 门店回筐记录模型(周转筐/托盘跟账单走,生成账单时写入完整快照
*
* 数量正数=压筐(附加金额),负数=回筐(抵扣金额);数量为 0 不写记录
*/
class ContainerReturnModel extends Model
{
use HasFactory;
/** 类型:压筐(账单生成压出,系统写入只读) */
public const int TYPE_PRESS = 1;
/** 类型:回筐(门店退回,后台手动登记) */
public const int TYPE_RETURN = 2;
/** 类型中文名 */
public const array TYPE_NAMES = [
self::TYPE_PRESS => '压筐',
self::TYPE_RETURN => '回筐',
];
protected $table = 'container_return';
protected $primaryKey = 'id';
protected $fillable = [
'store_id',
'bill_id',
'type',
'box_num',
'tray_num',
'return_date',
'box_price',
'tray_price',
'amount',
'operator_id',
'remark',
];
protected $casts = [
'store_id' => 'integer',
'bill_id' => 'integer',
'type' => 'integer',
'box_num' => 'integer',
'tray_num' => 'integer',
'return_date' => 'date:Y-m-d',
'box_price' => 'decimal:2',
'tray_price' => 'decimal:2',
'amount' => 'decimal:2',
'operator_id' => 'integer',
'created_at' => 'datetime:Y-m-d H:i:s',
];
@@ -59,7 +51,7 @@ class ContainerReturnModel extends Model
}
/**
* 关联账单(压筐记录)
* 关联账单
*/
public function bill(): BelongsTo
{
-2
View File
@@ -38,8 +38,6 @@ class StoreModel extends Model
protected $casts = [
'level_id' => 'integer',
'payment_cycle_days' => 'integer',
'pending_box_num' => 'integer',
'pending_tray_num' => 'integer',
'total_purchase_amount' => 'decimal:2',
'status' => 'integer',
];