快递对账小汇总去掉回填框 (#1571)
This commit is contained in:
parent
a46250e36a
commit
bb316015d0
@ -44,28 +44,8 @@
|
||||
@php($target = \App\Support\CourierBills\SummaryMapper::classify($item->label))
|
||||
<tr>
|
||||
<td>{{ $item->label }} @if ($item->manual)<span class="cbr-chip">手工</span>@endif</td>
|
||||
@php($blankRow = ! $item->manual && $item->bill_amount === null && $item->self_amount === null)
|
||||
@if ($open && $blankRow)
|
||||
<td class="num" colspan="2">
|
||||
<form method="POST" action="{{ $action('fill-item', ['statement' => $cbStatement->id, 'item' => $item->id]) }}" class="cbr-form" style="justify-content:flex-end;gap:6px">@csrf
|
||||
<input type="number" step="0.0001" name="bill" placeholder="快递提供" aria-label="{{ $item->label }} 快递提供金额" style="width:7em;text-align:right">
|
||||
<input type="number" step="0.01" name="self" placeholder="自算" aria-label="{{ $item->label }} 自算金额" style="width:7em;text-align:right">
|
||||
<button type="submit">回填</button>
|
||||
</form>
|
||||
</td>
|
||||
@else
|
||||
<td class="num">{{ $billMoney($item->bill_amount) }}</td>
|
||||
<td class="num">
|
||||
@if ($open && ($item->manual || (in_array(preg_replace('/\s+/u', '', $item->label), $cbFeeLabels ?? [], true) && $item->bill_amount !== null)))
|
||||
<form method="POST" action="{{ $action('fill-item', ['statement' => $cbStatement->id, 'item' => $item->id]) }}" class="cbr-form" style="justify-content:flex-end;gap:6px">@csrf
|
||||
<input type="number" step="0.01" name="self" value="{{ $item->self_amount === null ? '' : (float) $item->self_amount }}" aria-label="{{ $item->label }} 自算金额" style="width:7em;text-align:right">
|
||||
<button type="submit">回填</button>
|
||||
</form>
|
||||
@else
|
||||
{{ $money($item->self_amount) }}
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
<td class="num">{{ $money($item->self_amount) }}</td>
|
||||
<td class="num cbr-diff">{{ $item->bill_amount === null && $item->self_amount === null ? '' : $money((float) $item->bill_amount - (float) $item->self_amount) }}</td>
|
||||
<td class="cbr-muted">{{ ['supplement' => '补给快递', 'waybill' => '面单'][$target] ?? \App\Support\CourierBills\SummaryMapper::DIFF_COLUMNS[$target] }}</td>
|
||||
<td>
|
||||
@ -86,7 +66,7 @@
|
||||
<label>快递提供金额<input type="number" step="0.0001" name="bill"></label>
|
||||
<label>自算金额<input type="number" step="0.01" name="self" placeholder="扣快递填负数"></label>
|
||||
<button type="submit">加一行</button>
|
||||
<span class="cbr-muted">项目名称决定归到汇总哪一列,按平时手工汇总的叫法写。附加费(一张附加费表一行,名字就是账单里的表名)只读了快递金额,自算先是 0,手工核对后在上面直接回填;回填后变成手工行,删掉就恢复原样。</span>
|
||||
<span class="cbr-muted">项目名称决定归到汇总哪一列,按平时手工汇总的叫法写。类目照上月小汇总排;系统还没有数据的类目先空着(以后接上记账、违约金等数据后自动带入,和配件补发扣款一样)。要手工改某一类目,在这里加一行同名项目,手工行优先,删掉就恢复系统的数。</span>
|
||||
</form>
|
||||
@endif
|
||||
</section>
|
||||
|
||||
@ -49,7 +49,7 @@ final class CourierBillPagesTest extends FeatureTestCase
|
||||
$this->get($statementUrl)->assertOk()->assertSeeText('8.0040')->assertSeeText('13.0040');
|
||||
$this->post(route("business.$section.courier-bills.add-item", ['statement' => $statement->id]), ['label' => '上楼费', 'bill' => 20, 'self' => 15])->assertRedirect();
|
||||
$manual = $db->table('courier_bill_summary_items')->where('statement_id', $statement->id)->where('label', '上楼费')->value('id');
|
||||
$this->get($statementUrl)->assertOk()->assertSee('回填');
|
||||
$this->get($statementUrl)->assertOk()->assertDontSee('>回填</button>', false);
|
||||
$this->from($statementUrl)->post(route("business.$section.courier-bills.fill-item", ['statement' => $statement->id, 'item' => $manual]), ['self' => 15])
|
||||
->assertRedirect($statementUrl)->assertSessionHas('courier_bills_message');
|
||||
// 导入手工小汇总类目:本月小汇总照它排,空行能回填快递金额和自算金额
|
||||
@ -57,7 +57,7 @@ final class CourierBillPagesTest extends FeatureTestCase
|
||||
['运费10月', 1, 1, 0], ['快递记账', null, -3, 3], ['匹配不到', 1, null, 1], ['总计', 2, -2, 4]]]), '河北中通10月发送版.xlsx', null, null, true);
|
||||
$this->post(route("business.$section.courier-bills.import-summary-templates"), ['month' => '2026-10', 'files' => [$template]])
|
||||
->assertRedirect()->assertSessionHas('courier_bills_message', fn ($m) => str_contains($m, '记下 1 家'));
|
||||
$this->get($statementUrl)->assertOk()->assertSeeText('运费10月')->assertSeeText('快递记账')->assertSee('placeholder="快递提供"', false);
|
||||
$this->get($statementUrl)->assertOk()->assertSeeText('运费10月')->assertSeeText('快递记账')->assertDontSee('placeholder="快递提供"', false);
|
||||
$this->get(route('business.pages.show', ['section' => $section, 'page' => 'courier-bill-reconciliation', 'cb_view' => 'upload', 'month' => '2026-10']))
|
||||
->assertOk()->assertSeeText('导入手工小汇总');
|
||||
$line = $db->table('courier_bill_lines')->where('waybill_no', 'ZT999')->first();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user