resolved bug in production plan importer
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 16s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 13s
Laravel Pint / pint (pull_request) Successful in 6m57s
Laravel Larastan / larastan (pull_request) Failing after 9m14s
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 16s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 13s
Laravel Pint / pint (pull_request) Successful in 6m57s
Laravel Larastan / larastan (pull_request) Failing after 9m14s
This commit is contained in:
@@ -132,24 +132,28 @@ class ProductionPlanImporter extends Importer
|
||||
if(!$itemAgaPlant){
|
||||
$warnMsg[] = 'Item not found against plant code';
|
||||
}
|
||||
else {
|
||||
$line = $itemAgaPlant->line_id;
|
||||
|
||||
$line = $itemAgaPlant->line_id;
|
||||
|
||||
if(!$line){
|
||||
$warnMsg[] = 'Line not mapped for that item code';
|
||||
if (!$line) {
|
||||
$warnMsg[] = 'Line not mapped for that item code';
|
||||
}
|
||||
}
|
||||
|
||||
$user = Filament::auth()->user();
|
||||
|
||||
$operatorName = $user->name;
|
||||
|
||||
if (Str::length($this->data['plan_quantity']) < 0 || ! is_numeric($this->data['plan_quantity']) || $this->data['plan_quantity'] <= 0) {
|
||||
$warnMsg[] = 'Invalid plan quantity found';
|
||||
if (!empty($this->data['plan_quantity'])) {
|
||||
if (Str::length($this->data['plan_quantity']) < 0 || ! is_numeric($this->data['plan_quantity']) || $this->data['plan_quantity'] <= 0) {
|
||||
$warnMsg[] = 'Invalid plan quantity found';
|
||||
}
|
||||
}
|
||||
|
||||
if (! empty($warnMsg)) {
|
||||
throw new RowImportFailedException(implode(', ', $warnMsg));
|
||||
} else {
|
||||
|
||||
$productionPlan = ProductionPlan::where('plant_id', $plant->id)
|
||||
->where('line_id', $line)
|
||||
->where('item_id', $itemAgaPlant->id)
|
||||
|
||||
Reference in New Issue
Block a user