1 Commits

Author SHA1 Message Date
63e7f1a344 Update dependency vite to v7
Some checks failed
renovate/artifacts Artifact file update failure
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 9s
Gemini PR Review / review (pull_request) Successful in 28s
Laravel Pint / pint (pull_request) Successful in 2m4s
Laravel Larastan / larastan (pull_request) Failing after 3m9s
2025-12-14 00:01:01 +00:00
2 changed files with 83 additions and 60 deletions

View File

@@ -53,7 +53,6 @@ class CreateInvoiceValidation extends CreateRecord
public bool $showCapacitorInput = false; public bool $showCapacitorInput = false;
public $excel_file; public $excel_file;
public $mInvoiceNo;
public function getFormActions(): array public function getFormActions(): array
{ {
@@ -104,8 +103,6 @@ class CreateInvoiceValidation extends CreateRecord
{ {
$invoiceNumber = trim($invoiceNumber); $invoiceNumber = trim($invoiceNumber);
$parts = explode('.', $invoiceNumber);
$this->showCapacitorInput = false; $this->showCapacitorInput = false;
$user = Filament::auth()->user(); $user = Filament::auth()->user();
@@ -121,62 +118,6 @@ class CreateInvoiceValidation extends CreateRecord
// ..GET SERIAL INVOICE API // ..GET SERIAL INVOICE API
if(strlen($invoiceNumber) > 15)
{
$payloadJson = base64_decode(strtr($parts[1], '-_', '+/'));
if (empty($payloadJson)) {
Notification::make()
->title('Invalid payload for scanned qr code.')
->danger()
->seconds(1)
->send();
return;
}
$payload = json_decode($payloadJson, true);
if (!isset($payload['data'])) {
Notification::make()
->title('Invalid payload for scanned qr code.')
->info()
->seconds(1)
->send();
return;
}
$documentData = $payload['data'];
if($documentData == '' || $documentData == ''){
Notification::make()
->title('Invalid payload for scanned qr code.')
->info()
->seconds(1)
->send();
return;
}
// Extract DocNo
preg_match('/"DocNo"\s*:\s*"([^"]+)"/', $documentData, $matches);
if (!isset($matches[1])) {
Notification::make()
->title('Invoice number not found.')
->info()
->seconds(1)
->send();
return;
}
if (isset($matches[1])) {
$invoiceNumber = $matches[1];
}
}
//dd($invoiceNumber);
// .. // ..
$updateStatus = $this->form->getState()['update_invoice'] ?? null; $updateStatus = $this->form->getState()['update_invoice'] ?? null;
@@ -2801,6 +2742,19 @@ class CreateInvoiceValidation extends CreateRecord
->send(); ->send();
$this->dispatch('playWarnSound'); $this->dispatch('playWarnSound');
// $mailData = $this->getMail();
// $mPlantName = $mailData['plant_name'];
// $emails = $mailData['emails'];
// $mInvoiceType = 'Material';
// if (! empty($emails)) {
// Mail::to($emails)->send(
// new InvalidSerialMail($mSerNo, $invoiceNumber, $mPlantName, $mInvoiceType, $itemCode, 'ItemNotValidMaterialType')
// );
// } else {
// \Log::warning("No recipients found for plant {$plantId}, module Serial, rule invalid_serial.");
// }
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
'invoice_number' => $invoiceNumber, 'invoice_number' => $invoiceNumber,
@@ -2830,6 +2784,19 @@ class CreateInvoiceValidation extends CreateRecord
->send(); ->send();
$this->dispatch('playWarnSound'); $this->dispatch('playWarnSound');
// $mailData = $this->getMail();
// $mPlantName = $mailData['plant_name'];
// $emails = $mailData['emails'];
// $mInvoiceType = 'Material';
// if (! empty($emails)) {
// Mail::to($emails)->send(
// new InvalidSerialMail($mSerNo, $invoiceNumber, $mPlantName, $mInvoiceType, $itemCode, 'ItemNotInvoice')
// );
// } else {
// \Log::warning("No recipients found for plant {$plantId}, module Serial, rule invalid_serial.");
// }
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
'invoice_number' => $invoiceNumber, 'invoice_number' => $invoiceNumber,
@@ -2858,6 +2825,19 @@ class CreateInvoiceValidation extends CreateRecord
->send(); ->send();
$this->dispatch('playWarnSound'); $this->dispatch('playWarnSound');
// $mailData = $this->getMail();
// $mPlantName = $mailData['plant_name'];
// $emails = $mailData['emails'];
// $mInvoiceType = 'Material';
// if (! empty($emails)) {
// Mail::to($emails)->send(
// new InvalidSerialMail($mSerNo, $invoiceNumber, $mPlantName, $mInvoiceType, $itemCode, 'Item')
// );
// } else {
// \Log::warning("No recipients found for plant {$plantId}, module Serial, rule invalid_serial.");
// }
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
'invoice_number' => $invoiceNumber, 'invoice_number' => $invoiceNumber,
@@ -3401,6 +3381,19 @@ class CreateInvoiceValidation extends CreateRecord
->send(); ->send();
$this->dispatch('playNotificationSound'); $this->dispatch('playNotificationSound');
// $mInvoiceType = 'Serial';
// $mailData = $this->getMail();
// $mPlantName = $mailData['plant_name'];
// $emails = $mailData['emails'];
// if (! empty($emails)) {
// Mail::to($emails)->send(
// new InvalidSerialMail($serNo, $invoiceNumber, $mPlantName, $mInvoiceType, $itemCode, 'CompletedSerialInvoice')
// );
// } else {
// \Log::warning("No recipients found for plant {$plantId}, module Serial, rule invalid_serial.");
// }
$filename = $invoiceNumber.'.xlsx'; $filename = $invoiceNumber.'.xlsx';
$directory = 'uploads/temp'; $directory = 'uploads/temp';
$disk = Storage::disk('local'); $disk = Storage::disk('local');
@@ -3518,6 +3511,20 @@ class CreateInvoiceValidation extends CreateRecord
$this->dispatch('playNotificationSound'); $this->dispatch('playNotificationSound');
// $mInvoiceType = 'Serial';
// $mailData = $this->getMail();
// $mPlantName = $mailData['plant_name'];
// $emails = $mailData['emails'];
// if (! empty($emails)) {
// // Mail::to($emails)->send(new InvalidSerialMail($serNo, $invoiceNumber, $mPlantName, $mInvoiceType));
// Mail::to($emails)->send(
// new InvalidSerialMail($serNo, $invoiceNumber, $mPlantName, $mInvoiceType, $itemCode, 'CSerialInvoice')
// );
// } else {
// \Log::warning("No recipients found for plant {$plantId}, module Serial, rule invalid_serial.");
// }
$filename = $invoiceNumber.'.xlsx'; $filename = $invoiceNumber.'.xlsx';
$directory = 'uploads/temp'; $directory = 'uploads/temp';
$disk = Storage::disk('local'); $disk = Storage::disk('local');
@@ -3577,6 +3584,22 @@ class CreateInvoiceValidation extends CreateRecord
$this->dispatch('playWarnSound'); $this->dispatch('playWarnSound');
// $mInvoiceType = 'Serial';
// $mailData = $this->getMail();
// $mPlantName = $mailData['plant_name'];
// $emails = $mailData['emails'];
// $mUserName = Filament::auth()->user()->name;
// if (! empty($emails)) {
// // Mail::to($emails)->send(new InvalidSerialMail($serNo, $invoiceNumber, $mPlantName, $mInvoiceType));
// Mail::to($emails)->send(
// new InvalidSerialMail($serNo, $invoiceNumber, $mPlantName, $mInvoiceType, $itemCode, $mUserName, 'DuplicateCapacitorQR')
// );
// } else {
// \Log::warning("No recipients found for plant {$plantId}, module Serial, rule invalid_serial.");
// }
$this->form->fill([ $this->form->fill([
'plant_id' => $plantId, 'plant_id' => $plantId,
'invoice_number' => $invoiceNumber, 'invoice_number' => $invoiceNumber,

View File

@@ -13,6 +13,6 @@
"laravel-vite-plugin": "^1.2.0", "laravel-vite-plugin": "^1.2.0",
"postcss": "^8.4.47", "postcss": "^8.4.47",
"tailwindcss": "^3.4.13", "tailwindcss": "^3.4.13",
"vite": "^6.0.11" "vite": "^7.0.0"
} }
} }