feat(client): 出库明细成本/售价/利润三列重设计 + 建单利润列 + 入库列头统一
- 出库详情抽屉(管理员):数量/成本价/售价/利润 + 合计金额/合计利润 双行; operator 见 售价/小计(服务端抹零+前端隐藏双保险);利润负数 danger - 出库建单:商品名称下带编码(字体同系列列);金额列→利润列(实时); 底栏合计利润(仅管理员);进价列仅管理员;提交发新 key(cost_price/sale_price) - 入库建单列头:进价(单瓶)/ 参考售价 / 总进价 - 退单弹窗金额改售价口径(与冲应收一致);打印保留待定价回退成本兼容 - models 字段随后端消歧改名;golden 重打;新增抽屉双形态 widget 测试 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JJ1g8XV1YhhmHRzhwWEW7o
This commit is contained in:
@@ -1045,7 +1045,7 @@ Future<Uint8List> buildStockInOrderPdfImpl(
|
||||
final rows = <List<String>>[];
|
||||
for (final it in order.items) {
|
||||
totalQty += it.quantity;
|
||||
totalAmt += it.totalPrice;
|
||||
totalAmt += it.costAmount;
|
||||
rows.add([
|
||||
it.productCode ?? '',
|
||||
it.productName ?? '',
|
||||
@@ -1054,8 +1054,8 @@ Future<Uint8List> buildStockInOrderPdfImpl(
|
||||
it.batchNo ?? '',
|
||||
_d10(it.productionDate),
|
||||
_qtyStr(it.quantity),
|
||||
it.unitPrice.toStringAsFixed(2),
|
||||
it.totalPrice.toStringAsFixed(2),
|
||||
it.costPrice.toStringAsFixed(2),
|
||||
it.costAmount.toStringAsFixed(2),
|
||||
'',
|
||||
]);
|
||||
}
|
||||
@@ -1112,9 +1112,9 @@ Future<Uint8List> buildStockOutOrderPdfImpl(
|
||||
final rows = <List<String>>[];
|
||||
for (final it in order.items) {
|
||||
// 出库单「单价」= 售价:App 单据存 sale_price;历史导入单 sale_price=0、
|
||||
// 实际售价存在 unit_price/total_price,故 sale_price 为空时回退到 unit_price。
|
||||
final unit = it.salePrice > 0 ? it.salePrice : it.unitPrice;
|
||||
final amt = it.salePrice > 0 ? it.salePrice * it.quantity : it.totalPrice;
|
||||
// 实际售价存在 cost_price/cost_amount(源列直存),故售价为空时回退成本列。
|
||||
final unit = it.salePrice > 0 ? it.salePrice : it.costPrice;
|
||||
final amt = it.salePrice > 0 ? it.saleAmount : it.costAmount;
|
||||
totalQty += it.quantity;
|
||||
totalAmt += amt;
|
||||
rows.add([
|
||||
|
||||
@@ -240,7 +240,7 @@ Future<void> printStockInOrderImpl(
|
||||
double totalAmt = 0;
|
||||
for (final item in order.items) {
|
||||
totalQty += item.quantity;
|
||||
totalAmt += item.totalPrice;
|
||||
totalAmt += item.costAmount;
|
||||
rows.write('''<tr>
|
||||
<td>${item.productCode ?? ''}</td>
|
||||
<td>${item.productName ?? ''}</td>
|
||||
@@ -249,8 +249,8 @@ Future<void> printStockInOrderImpl(
|
||||
<td class="c">${item.batchNo ?? ''}</td>
|
||||
<td class="c">${_d10(item.productionDate)}</td>
|
||||
<td class="r">${item.quantity % 1 == 0 ? item.quantity.toStringAsFixed(0) : item.quantity.toStringAsFixed(3)}</td>
|
||||
<td class="r">${item.unitPrice.toStringAsFixed(2)}</td>
|
||||
<td class="r">${item.totalPrice.toStringAsFixed(2)}</td>
|
||||
<td class="r">${item.costPrice.toStringAsFixed(2)}</td>
|
||||
<td class="r">${item.costAmount.toStringAsFixed(2)}</td>
|
||||
<td></td>
|
||||
</tr>''');
|
||||
}
|
||||
@@ -324,10 +324,9 @@ Future<void> printStockOutOrderImpl(
|
||||
double totalAmt = 0;
|
||||
for (final item in order.items) {
|
||||
// 出库单「单价」= 售价:App 单据存 sale_price;历史导入单 sale_price=0、
|
||||
// 实际售价存在 unit_price/total_price,故 sale_price 为空时回退到 unit_price。
|
||||
final unit = item.salePrice > 0 ? item.salePrice : item.unitPrice;
|
||||
final amt =
|
||||
item.salePrice > 0 ? item.salePrice * item.quantity : item.totalPrice;
|
||||
// 实际售价存在 cost_price/cost_amount(源列直存),故售价为空时回退成本列。
|
||||
final unit = item.salePrice > 0 ? item.salePrice : item.costPrice;
|
||||
final amt = item.salePrice > 0 ? item.saleAmount : item.costAmount;
|
||||
totalQty += item.quantity;
|
||||
totalAmt += amt;
|
||||
rows.write('''<tr>
|
||||
|
||||
Reference in New Issue
Block a user