diff --git a/modules/EcommerceFinance/Repositories/DingProcessDetailMirrorRepository.php b/modules/EcommerceFinance/Repositories/DingProcessDetailMirrorRepository.php index 6627d0be..02e0854f 100644 --- a/modules/EcommerceFinance/Repositories/DingProcessDetailMirrorRepository.php +++ b/modules/EcommerceFinance/Repositories/DingProcessDetailMirrorRepository.php @@ -510,78 +510,6 @@ class DingProcessDetailMirrorRepository { $query->where('ding_process_detail_mirror.source_scope', $this->scope()); - if (array_key_exists('include_paid', $filters) && $filters['include_paid'] !== '1') { - $query->whereNotExists(function (Builder $paidApproval): void { - $paidApproval - ->selectRaw('1') - ->from('ding_process_detail_mirror as paid_approval') - ->whereColumn( - 'paid_approval.business_id', - 'ding_process_detail_mirror.business_id', - ) - ->whereColumn( - 'paid_approval.source_scope', - 'ding_process_detail_mirror.source_scope', - ) - ->where('paid_approval.cashier_status', 'completed'); - }); - if ($this->structuredPaymentsEnabled()) { - $query->whereNotExists(function (Builder $fullyPaidApproval): void { - $fullyPaidApproval - ->select('payment_fully_paid.business_id') - ->from('ding_process_payment_mirror as payment_fully_paid') - ->whereColumn( - 'payment_fully_paid.business_id', - 'ding_process_detail_mirror.business_id', - ) - ->whereColumn( - 'payment_fully_paid.source_scope', - 'ding_process_detail_mirror.source_scope', - ) - ->groupBy( - 'payment_fully_paid.business_id', - 'payment_fully_paid.source_scope', - ) - ->havingRaw( - 'SUM(COALESCE(payment_fully_paid.amount, 0)) > 0', - ) - ->havingRaw( - 'SUM(COALESCE(payment_fully_paid.amount, 0)) + 0.01 >= (' - . 'SELECT SUM(COALESCE(detail_fully_paid.amount, 0)) ' - . 'FROM ding_process_detail_mirror AS detail_fully_paid ' - . 'WHERE detail_fully_paid.business_id = ding_process_detail_mirror.business_id ' - . 'AND detail_fully_paid.source_scope = ding_process_detail_mirror.source_scope' - . ')', - ); - }); - } else { - $query->whereNotExists(function (Builder $fullyPaidApproval): void { - $fullyPaidApproval - ->select('fully_paid_approval.business_id') - ->from('ding_process_detail_mirror as fully_paid_approval') - ->whereColumn( - 'fully_paid_approval.business_id', - 'ding_process_detail_mirror.business_id', - ) - ->whereColumn( - 'fully_paid_approval.source_scope', - 'ding_process_detail_mirror.source_scope', - ) - ->groupBy( - 'fully_paid_approval.business_id', - 'fully_paid_approval.source_scope', - ) - ->havingRaw( - 'SUM(COALESCE(fully_paid_approval.bank_amount, 0)) > 0', - ) - ->havingRaw( - 'SUM(COALESCE(fully_paid_approval.bank_amount, 0)) + 0.01 ' - . '>= SUM(COALESCE(fully_paid_approval.amount, 0))', - ); - }); - } - } - $paidStart = $this->filterDate($filters['paid_start'] ?? ''); $paidEnd = $this->filterDate($filters['paid_end'] ?? ''); if ($paidStart === '' && $paidEnd === '') { diff --git a/modules/EcommerceFinance/View/ProcessDetailsPageData.php b/modules/EcommerceFinance/View/ProcessDetailsPageData.php index 26568e1e..2d371c92 100644 --- a/modules/EcommerceFinance/View/ProcessDetailsPageData.php +++ b/modules/EcommerceFinance/View/ProcessDetailsPageData.php @@ -232,7 +232,6 @@ class ProcessDetailsPageData 'current_approver_name' => mb_substr(trim((string) $request->query('current_approver_name', '')), 0, 100), 'waiting_bucket' => $waitingBucket, 'keyword' => mb_substr(trim((string) $request->query('keyword', '')), 0, 100), - 'include_paid' => $request->boolean('include_paid') ? '1' : '', ]; } diff --git a/resources/views/business/pages/financial-operations/process-details-content.blade.php b/resources/views/business/pages/financial-operations/process-details-content.blade.php index 6be1e69e..d50017b1 100644 --- a/resources/views/business/pages/financial-operations/process-details-content.blade.php +++ b/resources/views/business/pages/financial-operations/process-details-content.blade.php @@ -267,10 +267,6 @@ grid-column: span 5; } - .process-details-field.is-paid-toggle { - grid-column: span 3; - } - .process-details-field.is-business { grid-column: span 3; } @@ -314,61 +310,6 @@ box-shadow: 0 0 0 3px rgba(133, 102, 50, .2); } - .process-details-paid-scope { - display: inline-flex; - align-items: center; - gap: .5rem; - height: 2.125rem; - padding: 0 .65rem; - border: 1px solid var(--vip-border, #D8D2C7); - border-radius: .5rem; - background: #fff; - color: var(--vip-content-ink, #171717) !important; - font-size: .8125rem !important; - font-weight: 500 !important; - cursor: pointer; - } - - .process-details-paid-scope input { - position: absolute; - width: 1px; - height: 1px; - margin: -1px; - overflow: hidden; - clip: rect(0 0 0 0); - } - - .process-details-paid-scope__box { - display: inline-flex; - align-items: center; - justify-content: center; - width: 1rem; - height: 1rem; - border: 1px solid var(--vip-border, #D8D2C7); - border-radius: .25rem; - background: #fff; - color: #fff; - } - - .process-details-paid-scope__box .material-icons-outlined { - font-size: .8rem; - opacity: 0; - } - - .process-details-paid-scope input:checked + .process-details-paid-scope__box { - border-color: var(--vip-content-accent-dark, #856632); - background: var(--vip-content-accent-dark, #856632); - } - - .process-details-paid-scope input:checked + .process-details-paid-scope__box .material-icons-outlined { - opacity: 1; - } - - .process-details-paid-scope input:focus-visible + .process-details-paid-scope__box { - outline: none; - box-shadow: 0 0 0 3px rgba(133, 102, 50, .2); - } - .process-details-combobox { position: relative; display: flex; @@ -1000,7 +941,6 @@ .process-details-field.is-date-range, .process-details-field.is-waiting, .process-details-field.is-keyword, - .process-details-field.is-paid-toggle, .process-details-actions { grid-column: span 6; } @@ -1056,7 +996,6 @@ .process-details-field.is-approver, .process-details-field.is-date-range, .process-details-field.is-waiting, - .process-details-field.is-paid-toggle, .process-details-field.is-keyword, .process-details-actions { grid-column: 1; @@ -1317,22 +1256,6 @@ @endforeach -
- 页面默认仅展示现金付款节点尚未完成的审批;需核对历史全量时,可勾选“包含已付款审批”。 + 付款状态可直接选择“待付款”或“已付款”:待付款只展示尚未完成付款的审批,已付款只展示已有付款事实的审批。 应付金额按审批费用明细汇总;实际付款按审批表单中的结构化付款明细汇总。 未产生付款记录的审批,其实际付款按 0 元展示,因此应付金额与实际付款金额不要求相等。 打款日期以审批单为准:审批单在所选期间有打款记录时,整张审批单的明细和付款金额都计入汇总; diff --git a/tests/Feature/Business/ProcessDetailsPageTest.php b/tests/Feature/Business/ProcessDetailsPageTest.php index 7c976571..5ea64c9e 100644 --- a/tests/Feature/Business/ProcessDetailsPageTest.php +++ b/tests/Feature/Business/ProcessDetailsPageTest.php @@ -104,9 +104,9 @@ class ProcessDetailsPageTest extends FeatureTestCase ->assertSee('name="waiting_bucket"', false) ->assertSee('value="1_2d" selected', false) ->assertSee('2天以上', false) - ->assertSee('name="include_paid"', false) - ->assertSee('包含已付款审批') - ->assertSee('页面默认仅展示现金付款节点尚未完成的审批') + ->assertDontSee('name="include_paid"', false) + ->assertDontSee('包含已付款审批') + ->assertSee('付款状态可直接选择“待付款”或“已付款”') ->assertDontSee('name="entry_start"', false) ->assertDontSee('name="entry_end"', false) ->assertSee('placeholder="开始日期"', false) @@ -119,6 +119,7 @@ class ProcessDetailsPageTest extends FeatureTestCase ->assertSee('name="payment_state"', false) ->assertSee('审批状态') ->assertSee('付款状态') + ->assertSee('