移除对账

This commit is contained in:
liu
2026-08-14 15:54:53 +08:00
parent 629d28a369
commit f0927e57e9
20 changed files with 1 additions and 2363 deletions
-82
View File
@@ -1,82 +0,0 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
/**
* 对账明细模型(订货量/称重/数量/金额可修改,diff = publish actual
*/
class ReconciliationItemModel extends Model
{
/** 未对账 */
public const NOT_RECONCILED = 0;
/** 已对账 */
public const RECONCILED = 1;
protected $table = 'reconciliation_item';
protected $primaryKey = 'id';
protected $fillable = [
'recon_id',
'store_id',
'order_item_id',
'product_id',
'product_name',
'quantity',
'weight',
'publish_amount',
'actual_amount',
'diff_amount',
'is_reconciled',
'store_remark',
'sort',
];
protected $casts = [
'recon_id' => 'integer',
'store_id' => 'integer',
'order_item_id' => 'integer',
'product_id' => 'integer',
'quantity' => 'decimal:2',
'weight' => 'decimal:3',
'publish_amount' => 'decimal:2',
'actual_amount' => 'decimal:2',
'diff_amount' => 'decimal:2',
'is_reconciled' => 'integer',
'sort' => 'integer',
];
/**
* 所属对账单
*/
public function recon(): BelongsTo
{
return $this->belongsTo(ReconciliationModel::class, 'recon_id', 'id');
}
/**
* 所属门店
*/
public function store(): BelongsTo
{
return $this->belongsTo(StoreModel::class, 'store_id', 'id');
}
/**
* 对账商品
*/
public function product(): BelongsTo
{
return $this->belongsTo(ProductModel::class, 'product_id', 'id');
}
/**
* 溯源订货明细
*/
public function orderItem(): BelongsTo
{
return $this->belongsTo(StoreOrderItemModel::class, 'order_item_id', 'id');
}
}
-75
View File
@@ -1,75 +0,0 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Modules\SystemUser\Models\SysUserModel;
/**
* 财务对账模型(公布金额 vs 实际金额 vs 差额,按品类/供应商筛选)
*/
class ReconciliationModel extends Model
{
/** 状态:草稿 */
public const STATUS_DRAFT = 0;
/** 状态:对账中 */
public const STATUS_WORKING = 1;
/** 状态:已结算 */
public const STATUS_SETTLED = 2;
protected $table = 'reconciliation';
protected $primaryKey = 'id';
protected $fillable = [
'recon_no',
'title',
'period_start',
'period_end',
'category_id',
'supplier_id',
'publish_amount',
'actual_amount',
'diff_amount',
'status',
'operator_id',
'remark',
];
protected $casts = [
'period_start' => 'date:Y-m-d',
'period_end' => 'date:Y-m-d',
'category_id' => 'integer',
'supplier_id' => 'integer',
'publish_amount' => 'decimal:2',
'actual_amount' => 'decimal:2',
'diff_amount' => 'decimal:2',
'status' => 'integer',
'operator_id' => 'integer',
];
/**
* 制单人(后台系统用户)
*/
public function operator(): BelongsTo
{
return $this->belongsTo(SysUserModel::class, 'operator_id', 'id');
}
/**
* 对账明细
*/
public function items(): HasMany
{
return $this->hasMany(ReconciliationItemModel::class, 'recon_id', 'id')->orderBy('sort');
}
/**
* 结算表
*/
public function settlements(): HasMany
{
return $this->hasMany(SettlementModel::class, 'recon_id', 'id');
}
}
-74
View File
@@ -1,74 +0,0 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Modules\SystemUser\Models\SysUserModel;
/**
* 结算表模型(对账结算按门店聚合生成,可导出存档)
*/
class SettlementModel extends Model
{
/** 状态:待结算 */
public const STATUS_PENDING = 0;
/** 状态:已结算 */
public const STATUS_SETTLED = 1;
protected $table = 'settlement';
protected $primaryKey = 'id';
protected $fillable = [
'settlement_no',
'recon_id',
'store_id',
'period_start',
'period_end',
'total_amount',
'actual_amount',
'diff_amount',
'status',
'file_path',
'operator_id',
'settled_at',
'remark',
];
protected $casts = [
'recon_id' => 'integer',
'store_id' => 'integer',
'period_start' => 'date:Y-m-d',
'period_end' => 'date:Y-m-d',
'total_amount' => 'decimal:2',
'actual_amount' => 'decimal:2',
'diff_amount' => 'decimal:2',
'status' => 'integer',
'operator_id' => 'integer',
'settled_at' => 'datetime',
];
/**
* 来源对账单
*/
public function recon(): BelongsTo
{
return $this->belongsTo(ReconciliationModel::class, 'recon_id', 'id');
}
/**
* 结算门店
*/
public function store(): BelongsTo
{
return $this->belongsTo(StoreModel::class, 'store_id', 'id');
}
/**
* 制单人(后台系统用户)
*/
public function operator(): BelongsTo
{
return $this->belongsTo(SysUserModel::class, 'operator_id', 'id');
}
}