ce1cbf404c
后端: - fix(backend): InventoryLog 增加 Product/Warehouse 关联,Logs 接口加 Preload 修复流水记录显示"-" - feat(backend): 新增 /inventory/batches 批次追踪接口 - feat(backend): 新增财务记录、编号规则接口(finance、number_rule handler) - fix(backend): service/stock_test.go 修复 model.Date 类型错误 前端: - feat(client): 入库/出库管理 Tab 调换顺序(审核在前),审核 Tab 加新建按钮,列表 Tab 无按钮 - feat(client): 入库单/出库单增加详情弹窗,显示完整单据信息和商品明细 - feat(client): 完善出库单新建表单(StockOutFormScreen),支持选客户/仓库/商品 - fix(client): StockInItem/StockOutItem.fromJson 修复读取嵌套 product 对象而非平铺字段 - feat(client): 批次追踪页面(BatchTrackingScreen)及侧边栏入口 - feat(client): 财务管理、盘点、编号规则接入真实后端 API - fix(client): 入库/出库审核通过后 invalidate inventoryListProvider 刷新库存 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
53 lines
1.4 KiB
Dart
53 lines
1.4 KiB
Dart
class FinanceRecord {
|
|
final int id;
|
|
final String type; // receivable | payable | receipt | payment
|
|
final double amount;
|
|
final double balance;
|
|
final String? refType;
|
|
final int? refId;
|
|
final String? partnerName;
|
|
final String? recordDate;
|
|
final String? remark;
|
|
|
|
const FinanceRecord({
|
|
required this.id,
|
|
required this.type,
|
|
required this.amount,
|
|
required this.balance,
|
|
this.refType,
|
|
this.refId,
|
|
this.partnerName,
|
|
this.recordDate,
|
|
this.remark,
|
|
});
|
|
|
|
String get typeLabel {
|
|
switch (type) {
|
|
case 'receivable':
|
|
return '应收账款';
|
|
case 'payable':
|
|
return '应付账款';
|
|
case 'receipt':
|
|
return '收款';
|
|
case 'payment':
|
|
return '付款';
|
|
default:
|
|
return type;
|
|
}
|
|
}
|
|
|
|
factory FinanceRecord.fromJson(Map<String, dynamic> json) => FinanceRecord(
|
|
id: (json['id'] as num).toInt(),
|
|
type: json['type'] as String,
|
|
amount: (json['amount'] as num).toDouble(),
|
|
balance: (json['balance'] as num).toDouble(),
|
|
refType: json['ref_type'] as String?,
|
|
refId:
|
|
json['ref_id'] != null ? (json['ref_id'] as num).toInt() : null,
|
|
partnerName:
|
|
(json['partner'] as Map<String, dynamic>?)?['name'] as String?,
|
|
recordDate: json['record_date'] as String?,
|
|
remark: json['remark'] as String?,
|
|
);
|
|
}
|