Added invoice upload directory creation logic while choosing plant on resource page
Some checks failed
Gemini PR Review / Gemini PR Review (pull_request) Waiting to run
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Waiting to run
Laravel Larastan / larastan (pull_request) Waiting to run
Laravel Pint / pint (pull_request) Waiting to run
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Some checks failed
Gemini PR Review / Gemini PR Review (pull_request) Waiting to run
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Waiting to run
Laravel Larastan / larastan (pull_request) Waiting to run
Laravel Pint / pint (pull_request) Waiting to run
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
This commit is contained in:
@@ -77,7 +77,7 @@ class InvoiceValidationResource extends Resource
|
|||||||
->afterStateUpdated(function ($state, callable $set, callable $get) {
|
->afterStateUpdated(function ($state, callable $set, callable $get) {
|
||||||
$plantId = $get('plant_id');
|
$plantId = $get('plant_id');
|
||||||
$set('update_invoice', null);
|
$set('update_invoice', null);
|
||||||
// Ensure `linestop_id` is not cleared
|
|
||||||
if (! $plantId) {
|
if (! $plantId) {
|
||||||
$set('invoice_number', null);
|
$set('invoice_number', null);
|
||||||
$set('serial_number', null);
|
$set('serial_number', null);
|
||||||
@@ -87,6 +87,11 @@ class InvoiceValidationResource extends Resource
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
|
$plantCode = Plant::find($plantId)?->code ?? null;
|
||||||
|
$directory = "uploads/temp/{$plantCode}";
|
||||||
|
if (! Storage::disk('local')->exists($directory)) {
|
||||||
|
Storage::disk('local')->makeDirectory($directory);
|
||||||
|
}
|
||||||
$set('ivPlantError', null);
|
$set('ivPlantError', null);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user