changed logic in production order importer
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 17s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 18s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 14s
Laravel Larastan / larastan (pull_request) Failing after 5m44s
Laravel Pint / pint (pull_request) Successful in 5m56s
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 17s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 18s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 14s
Laravel Larastan / larastan (pull_request) Failing after 5m44s
Laravel Pint / pint (pull_request) Successful in 5m56s
This commit is contained in:
@@ -239,7 +239,13 @@ class ProductionOrderImporter extends Importer
|
||||
|
||||
$prefix = $year.$monthNumber;
|
||||
|
||||
$last = ProductionOrder::where('production_order', 'like', "{$prefix}%")->orderByDesc('production_order')->first(); // ProductionOrder::where('production_order', 'like', $prefix.'%')->orderBy('production_order', 'desc')->first();
|
||||
// $last = ProductionOrder::where('production_order', 'like', "{$prefix}%")->orderByDesc('production_order')->first(); // ProductionOrder::where('production_order', 'like', $prefix.'%')->orderBy('production_order', 'desc')->first();
|
||||
|
||||
$last = ProductionOrder::where('production_order', 'like', "{$prefix}%")->where(function ($query) {
|
||||
$query->whereNull('outer_status')
|
||||
->orWhere('outer_status', '')
|
||||
->orWhere('outer_status', '0');
|
||||
})->orderByDesc('production_order')->first();
|
||||
|
||||
if ($last) {
|
||||
$lastSeq = substr($last->production_order, -4);
|
||||
@@ -255,7 +261,13 @@ class ProductionOrderImporter extends Importer
|
||||
|
||||
$prefixSerial = $plantCod.$wareHouseNo.$year.$month;
|
||||
|
||||
$last = ProductionOrder::where('to_serial_number', 'like', "{$prefixSerial}%")->orderByDesc('to_serial_number')->first();
|
||||
// $last = ProductionOrder::where('to_serial_number', 'like', "{$prefixSerial}%")->orderByDesc('to_serial_number')->first();
|
||||
|
||||
$last = ProductionOrder::where('to_serial_number', 'like', "{$prefixSerial}%")->where(function ($query) {
|
||||
$query->whereNull('outer_status')
|
||||
->orWhere('outer_status', '')
|
||||
->orWhere('outer_status', '0');
|
||||
})->orderByDesc('to_serial_number')->first();
|
||||
|
||||
if (!$last && !empty($wareHouseNo)) {
|
||||
$oldPrefixSerial = $plantCod . $year . $month;
|
||||
|
||||
Reference in New Issue
Block a user