移除对账

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
@@ -1,94 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
* 财务管理(D1-D10):财务对账、结算表(门店对账单已下线,由采购单账单 bill 表替代)
*/
public function up(): void
{
// 财务对账单表(D1 按品类对账、D2 按供应商筛选)
if (! Schema::hasTable('reconciliation')) {
Schema::create('reconciliation', function (Blueprint $table) {
$table->increments('id')->comment('对账ID');
$table->string('recon_no', 32)->unique()->comment('对账单编号');
$table->string('title', 100)->comment('对账单标题');
$table->date('period_start')->comment('对账周期开始');
$table->date('period_end')->comment('对账周期结束');
$table->integer('category_id')->default(0)->comment('按品类筛选(0为全部,D1');
$table->integer('supplier_id')->default(0)->comment('按供应商筛选(0为全部,D2');
$table->decimal('publish_amount', 10, 2)->default(0)->comment('公布金额合计(D5');
$table->decimal('actual_amount', 10, 2)->default(0)->comment('实际采购金额合计(D5');
$table->decimal('diff_amount', 10, 2)->default(0)->comment('差额合计(D5');
$table->integer('status')->default(0)->comment('状态(0对账中 1已完成 2已生成结算表)');
$table->integer('operator_id')->default(0)->comment('对账员(系统用户ID');
$table->string('remark', 255)->default('')->comment('备注');
$table->timestamps();
$table->index(['period_start', 'period_end'], 'reconciliation_period_index');
$table->comment('财务对账单表');
});
}
// 财务对账明细表(D4 数据修改、D5 差额对比、D6 单品级门店备注、D8 对账状态标记)
if (! Schema::hasTable('reconciliation_item')) {
Schema::create('reconciliation_item', function (Blueprint $table) {
$table->increments('id')->comment('明细ID');
$table->integer('recon_id')->comment('财务对账单ID');
$table->integer('store_id')->comment('门店ID');
$table->integer('order_item_id')->default(0)->comment('门店订货明细ID');
$table->integer('product_id')->comment('商品ID');
$table->string('product_name', 100)->comment('品名(快照)');
$table->decimal('quantity', 10, 2)->default(0)->comment('数量(D4可修改)');
$table->decimal('weight', 10, 3)->default(0)->comment('称重数据(D4可修改)');
$table->decimal('publish_amount', 10, 2)->default(0)->comment('公布金额(门店订货金额)');
$table->decimal('actual_amount', 10, 2)->default(0)->comment('实际采购金额(分摊)');
$table->decimal('diff_amount', 10, 2)->default(0)->comment('差额');
$table->integer('is_reconciled')->default(0)->comment('对账状态(1已对账 0未对账,D8)');
$table->string('store_remark', 255)->default('')->comment('单品级门店备注(D6');
$table->integer('sort')->default(0)->comment('排序');
$table->timestamps();
$table->index(['recon_id'], 'reconciliation_item_recon_index');
$table->index(['store_id', 'is_reconciled'], 'reconciliation_item_store_index');
$table->comment('财务对账明细表');
});
}
// 结算表(D9 对账结束后生成结算表/回框统计表,D10 下载存档)
if (! Schema::hasTable('settlement')) {
Schema::create('settlement', function (Blueprint $table) {
$table->increments('id')->comment('结算ID');
$table->string('settlement_no', 32)->unique()->comment('结算单编号');
$table->integer('recon_id')->default(0)->comment('关联财务对账单ID');
$table->integer('store_id')->default(0)->comment('门店ID0为汇总结算)');
$table->date('period_start')->comment('结算周期开始');
$table->date('period_end')->comment('结算周期结束');
$table->decimal('total_amount', 10, 2)->default(0)->comment('结算总金额(公布)');
$table->decimal('actual_amount', 10, 2)->default(0)->comment('实际采购总金额');
$table->decimal('diff_amount', 10, 2)->default(0)->comment('差额合计');
$table->integer('status')->default(0)->comment('状态(0待结算 1已结算)');
$table->string('file_path', 255)->default('')->comment('导出文件路径(Excel/PDFD10');
$table->integer('operator_id')->default(0)->comment('操作人(系统用户ID');
$table->timestamp('settled_at')->nullable()->comment('结算时间');
$table->string('remark', 255)->default('')->comment('备注');
$table->timestamps();
$table->index(['store_id', 'status'], 'settlement_store_status_index');
$table->comment('结算表');
});
}
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('reconciliation');
Schema::dropIfExists('reconciliation_item');
Schema::dropIfExists('settlement');
}
};
-26
View File
@@ -205,22 +205,6 @@ class PermissionSeeder extends Seeder
'name' => '财务管理',
'icon' => 'AccountBookOutlined',
'children' => [
[
'type' => 'route',
'key' => 'recon.list',
'name' => '财务对账',
'path' => '/recon/list',
'children' => [
['type' => 'rule', 'key' => 'recon.list.query', 'name' => '查询'],
['type' => 'rule', 'key' => 'recon.list.create', 'name' => '新增'],
['type' => 'rule', 'key' => 'recon.list.update', 'name' => '编辑'],
['type' => 'rule', 'key' => 'recon.list.delete', 'name' => '删除'],
['type' => 'rule', 'key' => 'recon.list.build', 'name' => '生成明细'],
['type' => 'rule', 'key' => 'recon.list.settle', 'name' => '生成结算表'],
// 对账明细操作权限点在独立控制器 recon.item 下(D4/D6/D8
['type' => 'rule', 'key' => 'recon.item.item.update', 'name' => '对账明细操作'],
],
],
[
'type' => 'route',
'key' => 'recon.bill',
@@ -252,16 +236,6 @@ class PermissionSeeder extends Seeder
['type' => 'rule', 'key' => 'recon.payment.audit', 'name' => '审核'],
],
],
[
'type' => 'route',
'key' => 'recon.settlement',
'name' => '结算表',
'path' => '/recon/settlement',
'children' => [
['type' => 'rule', 'key' => 'recon.settlement.query', 'name' => '查询'],
['type' => 'rule', 'key' => 'recon.settlement.download', 'name' => '下载导出'],
],
],
],
],
[