diff --git a/app/Console/Commands/SyncDingProcessDetailMirror.php b/app/Console/Commands/SyncDingProcessDetailMirror.php index bd444536..277c6d1c 100644 --- a/app/Console/Commands/SyncDingProcessDetailMirror.php +++ b/app/Console/Commands/SyncDingProcessDetailMirror.php @@ -68,7 +68,6 @@ class SyncDingProcessDetailMirror extends Command if ($businessIds === [] && ! (bool) $this->option('dry-run') && ! (bool) $this->option('skip-invoices') - && $result['workflows'] > 0 && (bool) config('ding_invoice_data.sync_with_oa_process', true)) { try { $month = $invoiceSync->latestPendingMonth(); diff --git a/tests/Feature/Console/SyncDingProcessDetailMirrorTest.php b/tests/Feature/Console/SyncDingProcessDetailMirrorTest.php index 9442d62d..220a1375 100644 --- a/tests/Feature/Console/SyncDingProcessDetailMirrorTest.php +++ b/tests/Feature/Console/SyncDingProcessDetailMirrorTest.php @@ -114,7 +114,7 @@ class SyncDingProcessDetailMirrorTest extends FeatureTestCase ->assertSuccessful(); } - public function test_oa_sync_skips_invoices_when_no_workflow_changed(): void + public function test_oa_sync_skips_invoice_scan_when_no_backlog_is_due(): void { $synchronizer = Mockery::mock(DingProcessDetailMirrorSynchronizer::class); $synchronizer->shouldReceive('sync') @@ -132,7 +132,7 @@ class SyncDingProcessDetailMirrorTest extends FeatureTestCase $this->app->instance(DingProcessDetailMirrorSynchronizer::class, $synchronizer); $invoices = Mockery::mock(DingInvoiceSyncService::class); - $invoices->shouldNotReceive('latestPendingMonth'); + $invoices->shouldReceive('latestPendingMonth')->once()->andReturnNull(); $invoices->shouldNotReceive('syncMonth'); $this->app->instance(DingInvoiceSyncService::class, $invoices);