种菜未报销排除种菜明细已报销订单

This commit is contained in:
qiuxiang 2026-10-20 11:03:06 +08:00
parent ffa4bbf15f
commit 21b29d06eb
2 changed files with 4 additions and 3 deletions

View File

@ -1455,13 +1455,14 @@ class SyncStoreReceiptOrderMatches extends Command
}
/**
* 种菜未报销订单号:只取聚水潭订单标签明细里「是否种菜订单=是」的订单号。
* 种菜未报销订单号:聚水潭订单标签明细里「是否种菜订单=是」,且尚未出现在种菜明细表。
*
* @return array<string,true>
*/
private function plantingUnreimbursedCores(): array
{
$companyId = (int) $this->option('company');
$reimbursementCores = $this->plantingReimbursementCores();
$positiveLabels = [];
foreach (app(JstOrderLabelPlantingRules::class)->map($companyId) as $label => $flag) {
if ($flag === '是') {
@ -1472,7 +1473,7 @@ class SyncStoreReceiptOrderMatches extends Command
$cores = [];
foreach (app(PlantingOrderLabelLookup::class)->orderNumbers($companyId, $positiveLabels) as $orderNo) {
$core = self::orderCoreNo((string) $orderNo);
if ($core !== '') {
if ($core !== '' && ! isset($reimbursementCores[$core])) {
$cores[$core] = true;
}
}

View File

@ -6,7 +6,7 @@ use Illuminate\Support\Facades\Schema;
/**
* 业绩明细新增「种菜未报销」列(放在种菜报销后面):
* 仅按聚水潭订单标签明细「是否种菜订单=是」的订单号命中,金额取收入金额。
* 按聚水潭订单标签明细「是否种菜订单=是」且未出现在种菜明细表的订单号命中,金额取收入金额。
*/
return new class extends Migration
{