Compare commits
97 Commits
ea3cebe7f2
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 7276765aa4 | |||
|
|
1ce7995105 | ||
| 164a1becac | |||
|
|
d5cd1437fe | ||
| 6ad91c8c96 | |||
|
|
d4d101c5c9 | ||
| a6496b59c1 | |||
|
|
b8cb0aa237 | ||
| 027bacbce8 | |||
|
|
eef42d9736 | ||
| 6a87067387 | |||
|
|
3316c11036 | ||
| 4ac1e9f7c7 | |||
|
|
bf22ef5af0 | ||
| 2f84b269a1 | |||
|
|
52868742c0 | ||
| 8de311cdfb | |||
|
|
30175a71d3 | ||
| f4f10e8748 | |||
|
|
5fe8eeaeee | ||
| d1e4114504 | |||
|
|
fa10ea14fe | ||
| 375bffe6ce | |||
|
|
f0af6853ee | ||
| 3de0ca365c | |||
|
|
d213049fdd | ||
| 16cbe67c8b | |||
|
|
42e926f9c2 | ||
| 85b214d5f3 | |||
|
|
140249e824 | ||
| 88fb7367ea | |||
|
|
5a77cdfdc2 | ||
| 15e0ed2014 | |||
|
|
015976dcb5 | ||
| e3caf06da5 | |||
|
|
7627aa07fd | ||
| 3e1b784215 | |||
|
|
aad961260a | ||
| 907ade608a | |||
|
|
305d28617b | ||
| d82befeeaa | |||
|
|
851e753b74 | ||
| b91a9acc34 | |||
|
|
c94688a794 | ||
| a5187ea7be | |||
|
|
9db6227566 | ||
|
|
d24b4f35f4 | ||
| cb3d43deb2 | |||
|
|
56656264c0 | ||
| d31a392c21 | |||
|
|
abf33605f5 | ||
| b5392c822e | |||
|
|
60eb3c05a5 | ||
| 64af602434 | |||
|
|
ccd06a4b6e | ||
| 6bfe9b383e | |||
|
|
0d6ced5f63 | ||
| 4e9ad8a666 | |||
|
|
faa355ad79 | ||
| 336865d102 | |||
|
|
cc75016575 | ||
| 1f83dbefb0 | |||
|
|
6180cdda52 | ||
| 496a0fe80e | |||
|
|
776d1664ce | ||
| df5dc3067a | |||
|
|
65b4ce50d3 | ||
| 316d670eb3 | |||
|
|
c338751a48 | ||
| 069d3bfa7b | |||
|
|
075591459f | ||
| 9ea8163f55 | |||
|
|
fc0a132c73 | ||
| f068b1b79a | |||
|
|
a7e07affa0 | ||
| 6bf54a89ae | |||
|
|
65f64b2915 | ||
| b94ce1e3f2 | |||
|
|
9ab0709c6d | ||
| 5e5234e080 | |||
|
|
33425d6549 | ||
|
|
3d11ecc882 | ||
| cba529b1d1 | |||
|
|
518f61b24d | ||
|
|
7bdf72cc9f | ||
|
|
b7d2ca4111 | ||
| 0df5f9356c | |||
|
|
a62c4ce0c7 | ||
| e069d4030a | |||
|
|
29b9eae080 | ||
| 1709135963 | |||
|
|
2e6129970c | ||
|
|
7e2098318e | ||
| 8d4c245090 | |||
|
|
021cdfa9c2 | ||
| 0e3c9dcd2b | |||
|
|
7e97eed775 |
@@ -4,8 +4,10 @@ namespace App\Console\Commands;
|
||||
|
||||
use App\Mail\ImportTransitMail;
|
||||
use App\Models\AlertMailRule;
|
||||
use App\Models\EmployeeMaster;
|
||||
use App\Models\ImportTransit;
|
||||
use App\Models\Plant;
|
||||
use Filament\Facades\Filament;
|
||||
use Illuminate\Console\Command;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
use App\Exports\ImportTransitReportExport;
|
||||
@@ -81,11 +83,22 @@ class SendImportTransit extends Command
|
||||
'local'
|
||||
);
|
||||
|
||||
$updatedBy = $tableData->last()?->updated_by;
|
||||
|
||||
$employee = EmployeeMaster::where('code', $updatedBy)
|
||||
->select('name', 'mobile_number')
|
||||
->first();
|
||||
|
||||
$employeeName = $employee?->name;
|
||||
$mobileNumber = $employee?->mobile_number;
|
||||
|
||||
$mail = new ImportTransitMail(
|
||||
$scheduleType,
|
||||
$tableData,
|
||||
$mailSubject,
|
||||
$fileName
|
||||
$fileName,
|
||||
$employeeName,
|
||||
$mobileNumber,
|
||||
);
|
||||
|
||||
$toEmails = collect(explode(',', $rule->email))
|
||||
@@ -111,11 +124,9 @@ class SendImportTransit extends Command
|
||||
->cc($ccEmails)
|
||||
->send($mail);
|
||||
|
||||
$this->info(
|
||||
"Mail sent → Rule {$rule->id} | To: " . implode(', ', $toEmails)
|
||||
);
|
||||
}
|
||||
$this->info("Mail sent → Rule {$rule->id} | To: " . implode(', ', $toEmails));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -300,6 +300,8 @@ class ClassCharacteristicExporter extends Exporter
|
||||
->label('ZQMM QTY'),
|
||||
ExportColumn::make('zmm_operating_temperature')
|
||||
->label('ZMM OPERATING TEMPERATURE'),
|
||||
ExportColumn::make('zmm_axial_force')
|
||||
->label('ZMM AXIAL FORCE'),
|
||||
ExportColumn::make('mark_status')
|
||||
->label('MARKED STATUS'),
|
||||
ExportColumn::make('marked_datetime')
|
||||
|
||||
@@ -36,15 +36,6 @@ class InvoiceValidationExporter extends Exporter
|
||||
->label('ITEM DESCRIPTION'),
|
||||
ExportColumn::make('stickerMaster.item.uom')
|
||||
->label('UNIT OF MEASURE'),
|
||||
ExportColumn::make('stickerMaster.material_type')
|
||||
->label('MATERIAL TYPE')
|
||||
->formatStateUsing(fn ($state) => match ($state) {
|
||||
1 => 'Individual',
|
||||
2 => 'Bundle',
|
||||
3 => 'Quantity',
|
||||
4 => 'Bundle Individual',
|
||||
default => '-',
|
||||
}),
|
||||
ExportColumn::make('motor_scanned_status')
|
||||
->label('MOTOR SCANNED STATUS'),
|
||||
ExportColumn::make('pump_scanned_status')
|
||||
@@ -65,10 +56,6 @@ class InvoiceValidationExporter extends Exporter
|
||||
->label('LOAD RATE'),
|
||||
ExportColumn::make('upload_status')
|
||||
->label('UPLOAD STATUS'),
|
||||
ExportColumn::make('batch_number')
|
||||
->label('BATCH NUMBER'),
|
||||
ExportColumn::make('quantity')
|
||||
->label('QUANTITY'),
|
||||
ExportColumn::make('operator_id')
|
||||
->label('OPERATOR ID'),
|
||||
ExportColumn::make('created_at')
|
||||
@@ -90,7 +77,7 @@ class InvoiceValidationExporter extends Exporter
|
||||
|
||||
public static function getCompletedNotificationBody(Export $export): string
|
||||
{
|
||||
$body = 'Your invoice validation export has completed and '.number_format($export->successful_rows).' '.str('row')->plural($export->successful_rows).' exported.';
|
||||
$body = 'Your serial invoice validation export has completed and '.number_format($export->successful_rows).' '.str('row')->plural($export->successful_rows).' exported.';
|
||||
|
||||
if ($failedRowsCount = $export->getFailedRowsCount()) {
|
||||
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to export.';
|
||||
|
||||
85
app/Filament/Exports/MaterialInvoiceValidationExporter.php
Normal file
85
app/Filament/Exports/MaterialInvoiceValidationExporter.php
Normal file
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Exports;
|
||||
|
||||
use App\Models\InvoiceValidation;
|
||||
use Filament\Actions\Exports\ExportColumn;
|
||||
use Filament\Actions\Exports\Exporter;
|
||||
use Filament\Actions\Exports\Models\Export;
|
||||
|
||||
class MaterialInvoiceValidationExporter extends Exporter
|
||||
{
|
||||
protected static ?string $model = InvoiceValidation::class;
|
||||
|
||||
public static function getColumns(): array
|
||||
{
|
||||
static $rowNumber = 0;
|
||||
|
||||
return [
|
||||
// ExportColumn::make('id')
|
||||
// ->label('ID'),
|
||||
ExportColumn::make('no')
|
||||
->label('NO')
|
||||
->state(function ($record) use (&$rowNumber) {
|
||||
// Increment and return the row number
|
||||
return ++$rowNumber;
|
||||
}),
|
||||
ExportColumn::make('plant.code')
|
||||
->label('PLANT CODE'),
|
||||
ExportColumn::make('invoice_number')
|
||||
->label('INVOICE NUMBER'),
|
||||
ExportColumn::make('stickerMaster.item.code')
|
||||
->label('ITEM CODE'),
|
||||
ExportColumn::make('stickerMaster.item.description')
|
||||
->label('ITEM DESCRIPTION'),
|
||||
ExportColumn::make('stickerMaster.item.uom')
|
||||
->label('UNIT OF MEASURE'),
|
||||
ExportColumn::make('stickerMaster.material_type')
|
||||
->label('MATERIAL TYPE')
|
||||
->formatStateUsing(fn ($state) => match ($state) {
|
||||
1 => 'Individual',
|
||||
2 => 'Bundle',
|
||||
3 => 'Quantity',
|
||||
4 => 'Bundle Individual',
|
||||
default => '-',
|
||||
}),
|
||||
ExportColumn::make('serial_number')
|
||||
->label('SERIAL NUMBER'),
|
||||
ExportColumn::make('batch_number')
|
||||
->label('BATCH NUMBER'),
|
||||
ExportColumn::make('quantity')
|
||||
->label('QUANTITY'),
|
||||
ExportColumn::make('load_rate')
|
||||
->label('LOAD RATE'),
|
||||
ExportColumn::make('upload_status')
|
||||
->label('UPLOAD STATUS'),
|
||||
ExportColumn::make('operator_id')
|
||||
->label('OPERATOR ID'),
|
||||
ExportColumn::make('created_at')
|
||||
->label('CREATED AT'),
|
||||
// ->dateTimeFormat('d-m-Y H:i:s'),
|
||||
ExportColumn::make('created_by')
|
||||
->label('CREATED BY'),
|
||||
ExportColumn::make('updated_at')
|
||||
->label('UPDATED AT'),
|
||||
// ->dateTimeFormat('d-m-Y H:i:s'),
|
||||
ExportColumn::make('updated_by')
|
||||
->label('UPDATED BY'),
|
||||
ExportColumn::make('deleted_at')
|
||||
->enabledByDefault(false)
|
||||
->label('DELETED AT'),
|
||||
// ->dateTimeFormat('d-m-Y H:i:s'),
|
||||
];
|
||||
}
|
||||
|
||||
public static function getCompletedNotificationBody(Export $export): string
|
||||
{
|
||||
$body = 'Your material invoice validation export has completed and '.number_format($export->successful_rows).' '.str('row')->plural($export->successful_rows).' exported.';
|
||||
|
||||
if ($failedRowsCount = $export->getFailedRowsCount()) {
|
||||
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to export.';
|
||||
}
|
||||
|
||||
return $body;
|
||||
}
|
||||
}
|
||||
@@ -39,8 +39,6 @@ class ProductionCharacteristicExporter extends Exporter
|
||||
->label('OBSERVED VALUE'),
|
||||
ExportColumn::make('status')
|
||||
->label('STATUS'),
|
||||
ExportColumn::make('inspection_status')
|
||||
->label('INSPECTION STATUS'),
|
||||
ExportColumn::make('remark')
|
||||
->label('REMARK'),
|
||||
ExportColumn::make('created_at')
|
||||
|
||||
@@ -14,6 +14,7 @@ class TempClassCharacteristicExporter extends Exporter
|
||||
public static function getColumns(): array
|
||||
{
|
||||
static $rowNumber = 0;
|
||||
|
||||
return [
|
||||
ExportColumn::make('no')
|
||||
->label('NO')
|
||||
@@ -299,6 +300,8 @@ class TempClassCharacteristicExporter extends Exporter
|
||||
->label('ZQMM QTY'),
|
||||
ExportColumn::make('zmm_operating_temperature')
|
||||
->label('ZMM OPERATING TEMPERATURE'),
|
||||
ExportColumn::make('zmm_axial_force')
|
||||
->label('ZMM AXIAL FORCE'),
|
||||
ExportColumn::make('winded_serial_number')
|
||||
->label('WINDED SERIAL NUMBER'),
|
||||
ExportColumn::make('model_type')
|
||||
@@ -321,10 +324,10 @@ class TempClassCharacteristicExporter extends Exporter
|
||||
|
||||
public static function getCompletedNotificationBody(Export $export): string
|
||||
{
|
||||
$body = 'Your temp class characteristic export has completed and ' . number_format($export->successful_rows) . ' ' . str('row')->plural($export->successful_rows) . ' exported.';
|
||||
$body = 'Your temp class characteristic export has completed and '.number_format($export->successful_rows).' '.str('row')->plural($export->successful_rows).' exported.';
|
||||
|
||||
if ($failedRowsCount = $export->getFailedRowsCount()) {
|
||||
$body .= ' ' . number_format($failedRowsCount) . ' ' . str('row')->plural($failedRowsCount) . ' failed to export.';
|
||||
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to export.';
|
||||
}
|
||||
|
||||
return $body;
|
||||
|
||||
68
app/Filament/Exports/WireMasterPackingExporter.php
Normal file
68
app/Filament/Exports/WireMasterPackingExporter.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Exports;
|
||||
|
||||
use App\Models\WireMasterPacking;
|
||||
use Filament\Actions\Exports\ExportColumn;
|
||||
use Filament\Actions\Exports\Exporter;
|
||||
use Filament\Actions\Exports\Models\Export;
|
||||
|
||||
class WireMasterPackingExporter extends Exporter
|
||||
{
|
||||
protected static ?string $model = WireMasterPacking::class;
|
||||
|
||||
public static function getColumns(): array
|
||||
{
|
||||
static $rowNumber = 0;
|
||||
return [
|
||||
ExportColumn::make('no')
|
||||
->label('NO')
|
||||
->state(function ($record) use (&$rowNumber) {
|
||||
// Increment and return the row number
|
||||
return ++$rowNumber;
|
||||
}),
|
||||
ExportColumn::make('plant.code')
|
||||
->label('PLANT CODE'),
|
||||
ExportColumn::make('item.code')
|
||||
->label('ITEM CODE'),
|
||||
ExportColumn::make('customerPo.customer_po')
|
||||
->label('CUSTOMER PO NUMBER'),
|
||||
ExportColumn::make('wire_packing_number')
|
||||
->label('WIRE PACKING NUMBER'),
|
||||
ExportColumn::make('process_order')
|
||||
->label('PROCESS ORDER'),
|
||||
ExportColumn::make('batch_number')
|
||||
->label('BATCH NUMBER'),
|
||||
ExportColumn::make('weight')
|
||||
->label('WEIGHT'),
|
||||
ExportColumn::make('wire_packing_status')
|
||||
->label('WIRE PACKING STATUS'),
|
||||
ExportColumn::make('created_at')
|
||||
->label('CREATED AT'),
|
||||
ExportColumn::make('updated_at')
|
||||
->label('UPDATED AT'),
|
||||
ExportColumn::make('scanned_at')
|
||||
->label('SCANNED AT'),
|
||||
ExportColumn::make('created_by')
|
||||
->label('CREATED BY'),
|
||||
ExportColumn::make('updated_by')
|
||||
->label('UPDATED BY'),
|
||||
ExportColumn::make('scanned_by')
|
||||
->label('SCANNED BY'),
|
||||
ExportColumn::make('deleted_at')
|
||||
->label('DELETED AT')
|
||||
->enabledByDefault(false),
|
||||
];
|
||||
}
|
||||
|
||||
public static function getCompletedNotificationBody(Export $export): string
|
||||
{
|
||||
$body = 'Your wire master packing export has completed and ' . number_format($export->successful_rows) . ' ' . str('row')->plural($export->successful_rows) . ' exported.';
|
||||
|
||||
if ($failedRowsCount = $export->getFailedRowsCount()) {
|
||||
$body .= ' ' . number_format($failedRowsCount) . ' ' . str('row')->plural($failedRowsCount) . ' failed to export.';
|
||||
}
|
||||
|
||||
return $body;
|
||||
}
|
||||
}
|
||||
@@ -579,6 +579,10 @@ class ClassCharacteristicImporter extends Importer
|
||||
->label('ZMM OPERATING TEMPERATURE')
|
||||
->exampleHeader('ZMM OPERATING TEMPERATURE')
|
||||
->example(''),
|
||||
ImportColumn::make('zmm_axial_force')
|
||||
->label('ZMM AXIAL FORCE')
|
||||
->exampleHeader('ZMM AXIAL FORCE')
|
||||
->example(''),
|
||||
ImportColumn::make('mark_status')
|
||||
->label('MARKED STATUS')
|
||||
->exampleHeader('MARKED STATUS')
|
||||
|
||||
@@ -111,6 +111,13 @@ class CustomerPoMasterImporter extends Importer
|
||||
$warnMsg[] = "Customer PO '{$this->data['customer_po']}' is already mapped to customer '{$existingPo->customer_name}'.";
|
||||
}
|
||||
|
||||
$existingPoItem = CustomerPoMaster::where('plant_id', $plant->id)->where('item_id', $item->id)->where('customer_po', $this->data['customer_po'])->where('customer_name', $this->data['customer_name'])->first();
|
||||
|
||||
if ($existingPoItem)
|
||||
{
|
||||
$warnMsg[] = "Customer PO '{$this->data['customer_po']}' is already exist with item code '{$this->data['item']}' and customer name '{$this->data['customer_name']}'.";
|
||||
}
|
||||
|
||||
// $user = User::where('name', $this->data['created_by'])->first();
|
||||
// if (! $user) {
|
||||
// $warnMsg[] = 'User not found';
|
||||
|
||||
@@ -579,6 +579,10 @@ class TempClassCharacteristicImporter extends Importer
|
||||
->label('ZMM OPERATING TEMPERATURE')
|
||||
->exampleHeader('ZMM OPERATING TEMPERATURE')
|
||||
->example(''),
|
||||
ImportColumn::make('zmm_axial_force')
|
||||
->label('ZMM AXIAL FORCE')
|
||||
->exampleHeader('ZMM AXIAL FORCE')
|
||||
->example(''),
|
||||
ImportColumn::make('winded_serial_number')
|
||||
->label('WINDed SERIAL NUMBER')
|
||||
->exampleHeader('WINDED SERIAL NUMBER')
|
||||
@@ -605,15 +609,15 @@ class TempClassCharacteristicImporter extends Importer
|
||||
// 'email' => $this->data['email'],
|
||||
// ]);
|
||||
|
||||
return new TempClassCharacteristic();
|
||||
return new TempClassCharacteristic;
|
||||
}
|
||||
|
||||
public static function getCompletedNotificationBody(Import $import): string
|
||||
{
|
||||
$body = 'Your temp class characteristic import has completed and ' . number_format($import->successful_rows) . ' ' . str('row')->plural($import->successful_rows) . ' imported.';
|
||||
$body = 'Your temp class characteristic import has completed and '.number_format($import->successful_rows).' '.str('row')->plural($import->successful_rows).' imported.';
|
||||
|
||||
if ($failedRowsCount = $import->getFailedRowsCount()) {
|
||||
$body .= ' ' . number_format($failedRowsCount) . ' ' . str('row')->plural($failedRowsCount) . ' failed to import.';
|
||||
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to import.';
|
||||
}
|
||||
|
||||
return $body;
|
||||
|
||||
96
app/Filament/Imports/WireMasterPackingImporter.php
Normal file
96
app/Filament/Imports/WireMasterPackingImporter.php
Normal file
@@ -0,0 +1,96 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Imports;
|
||||
|
||||
use App\Models\WireMasterPacking;
|
||||
use Filament\Actions\Imports\ImportColumn;
|
||||
use Filament\Actions\Imports\Importer;
|
||||
use Filament\Actions\Imports\Models\Import;
|
||||
|
||||
class WireMasterPackingImporter extends Importer
|
||||
{
|
||||
protected static ?string $model = WireMasterPacking::class;
|
||||
|
||||
public static function getColumns(): array
|
||||
{
|
||||
return [
|
||||
ImportColumn::make('plant')
|
||||
->requiredMapping()
|
||||
->exampleHeader('PLANT CODE')
|
||||
->example('1000')
|
||||
->label('PLANT CODE')
|
||||
->relationship(resolveUsing: 'code')
|
||||
->rules(['required']),
|
||||
ImportColumn::make('item')
|
||||
->requiredMapping()
|
||||
->exampleHeader('ITEM CODE')
|
||||
->example('630214')
|
||||
->label('ITEM CODE')
|
||||
->relationship(resolveUsing: 'code')
|
||||
->rules(['required']),
|
||||
ImportColumn::make('customer_po_master_id')
|
||||
->requiredMapping()
|
||||
->exampleHeader('CUSTOMER PO NUMBER')
|
||||
->example('PO12345')
|
||||
->label('CUSTOMER PO NUMBER')
|
||||
->numeric()
|
||||
->rules(['required', 'integer']),
|
||||
ImportColumn::make('wire_packing_number')
|
||||
->exampleHeader('WIRE PACKING NUMBER')
|
||||
->example('WP001')
|
||||
->label('WIRE PACKING NUMBER'),
|
||||
ImportColumn::make('process_order')
|
||||
->exampleHeader('PROCESS ORDER')
|
||||
->example('PO001')
|
||||
->label('PROCESS ORDER'),
|
||||
ImportColumn::make('batch_number')
|
||||
->exampleHeader('BATCH NUMBER')
|
||||
->example('BN001')
|
||||
->label('BATCH NUMBER'),
|
||||
ImportColumn::make('weight')
|
||||
->exampleHeader('WEIGHT')
|
||||
->example('100.5')
|
||||
->label('WEIGHT'),
|
||||
ImportColumn::make('wire_packing_status')
|
||||
->exampleHeader('WIRE PACKING STATUS')
|
||||
->example('Active')
|
||||
->label('WIRE PACKING STATUS'),
|
||||
ImportColumn::make('scanned_at')
|
||||
->requiredMapping()
|
||||
->rules(['required', 'datetime']),
|
||||
ImportColumn::make('created_by')
|
||||
->exampleHeader('CREATED BY')
|
||||
->example('John Doe')
|
||||
->label('CREATED BY'),
|
||||
ImportColumn::make('updated_by')
|
||||
->exampleHeader('UPDATED BY')
|
||||
->example('Jane Smith')
|
||||
->label('UPDATED BY'),
|
||||
ImportColumn::make('scanned_by')
|
||||
->exampleHeader('SCANNED BY')
|
||||
->example('John Doe')
|
||||
->label('SCANNED BY'),
|
||||
];
|
||||
}
|
||||
|
||||
public function resolveRecord(): ?WireMasterPacking
|
||||
{
|
||||
// return WireMasterPacking::firstOrNew([
|
||||
// // Update existing records, matching them by `$this->data['column_name']`
|
||||
// 'email' => $this->data['email'],
|
||||
// ]);
|
||||
|
||||
return new WireMasterPacking();
|
||||
}
|
||||
|
||||
public static function getCompletedNotificationBody(Import $import): string
|
||||
{
|
||||
$body = 'Your wire master packing import has completed and ' . number_format($import->successful_rows) . ' ' . str('row')->plural($import->successful_rows) . ' imported.';
|
||||
|
||||
if ($failedRowsCount = $import->getFailedRowsCount()) {
|
||||
$body .= ' ' . number_format($failedRowsCount) . ' ' . str('row')->plural($failedRowsCount) . ' failed to import.';
|
||||
}
|
||||
|
||||
return $body;
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
namespace App\Filament\Pages;
|
||||
|
||||
use App\Mail\VisitorOutMail;
|
||||
use App\Models\EmployeeMaster;
|
||||
use App\Models\Plant;
|
||||
use App\Models\VisitorEntry;
|
||||
use Carbon\Carbon;
|
||||
@@ -15,6 +17,8 @@ use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Notifications\Notification;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use App\Mail\VisitorMail;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
|
||||
class GateOutEntry extends Page implements HasForms
|
||||
{
|
||||
@@ -162,6 +166,16 @@ class GateOutEntry extends Page implements HasForms
|
||||
$entry->out_time = now();
|
||||
$entry->save();
|
||||
|
||||
$employee = EmployeeMaster::find($entry->employee_master_id);
|
||||
|
||||
if ($employee && !empty($employee->email)) {
|
||||
Mail::to($employee->email)
|
||||
->send(new VisitorOutMail($entry)); // or ->send()
|
||||
}
|
||||
else{
|
||||
\Log::warning('No email found for employee ID: ' . $entry->employee_master_id);
|
||||
}
|
||||
|
||||
Notification::make()
|
||||
->title('Gate Pass Processed')
|
||||
->body('Visitor marked as exited.')
|
||||
|
||||
@@ -15,6 +15,7 @@ use Filament\Forms\Components\Section;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Notifications\Notification;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class WireMasterPrint extends Page
|
||||
{
|
||||
@@ -77,41 +78,69 @@ class WireMasterPrint extends Page
|
||||
return [];
|
||||
}
|
||||
|
||||
return CustomerPoMaster::where('plant_id', $plantId)->pluck('customer_po', 'id');
|
||||
return CustomerPoMaster::where('plant_id', $plantId)->distinct()->pluck('customer_po', 'customer_po'); //->pluck('customer_po', 'id'); ->distinct()
|
||||
})
|
||||
->required(),
|
||||
select::make('scan_pallet_no')
|
||||
->required()
|
||||
->afterStateUpdated(function ($state, callable $set) {
|
||||
$set('scan_pallet_no', null);
|
||||
}),
|
||||
Select::make('scan_pallet_no')
|
||||
->label('Scan Pallet No')
|
||||
->reactive()
|
||||
->searchable()
|
||||
->options(function ($get) {
|
||||
|
||||
$plantId = $get('plant_id');
|
||||
$customerPoId = $get('customer_po_master_id');
|
||||
// $plantId = $get('plant_id');
|
||||
// $customerPoId = $get('customer_po_master_id');
|
||||
|
||||
if (! $plantId || ! $customerPoId) {
|
||||
// if (! $plantId || ! $customerPoId) {
|
||||
// return [];
|
||||
// }
|
||||
|
||||
// $palletNumbers = WireMasterPacking::query()
|
||||
// ->select('wire_packing_number')
|
||||
// ->where('plant_id', $plantId)
|
||||
// ->where('customer_po_master_id', $customerPoId)
|
||||
// ->whereNotNull('wire_packing_number')
|
||||
// ->groupBy('wire_packing_number')
|
||||
// ->havingRaw('COUNT(*) = COUNT(wire_packing_status)')
|
||||
// ->havingRaw("SUM(CASE WHEN TRIM(wire_packing_status) = '' THEN 1 ELSE 0 END) = 0")
|
||||
// ->orderBy('wire_packing_number', 'asc')
|
||||
// ->pluck('wire_packing_number')
|
||||
// ->toArray();
|
||||
|
||||
// return collect($palletNumbers)
|
||||
// ->mapWithKeys(fn ($number) => [$number => $number])
|
||||
// ->toArray();
|
||||
|
||||
//..New Logic
|
||||
|
||||
$plantId = $get('plant_id');
|
||||
$customerPo = $get('customer_po_master_id');
|
||||
|
||||
if (! $plantId || ! $customerPo)
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
$poIds = CustomerPoMaster::where('plant_id', $plantId)->where('customer_po', $customerPo)->pluck('id');
|
||||
$palletNumbers = WireMasterPacking::query()
|
||||
->select('wire_packing_number')
|
||||
->where('plant_id', $plantId)
|
||||
->where('customer_po_master_id', $customerPoId)
|
||||
->whereIn('customer_po_master_id', $poIds)
|
||||
->whereNotNull('wire_packing_number')
|
||||
->groupBy('wire_packing_number')
|
||||
->havingRaw('COUNT(*) = COUNT(wire_packing_status)')
|
||||
->havingRaw("SUM(CASE WHEN TRIM(wire_packing_status) = '' THEN 1 ELSE 0 END) = 0")
|
||||
->orderBy('wire_packing_number', 'asc')
|
||||
->orderBy('wire_packing_number')
|
||||
->pluck('wire_packing_number')
|
||||
->toArray();
|
||||
|
||||
return collect($palletNumbers)
|
||||
->mapWithKeys(fn ($number) => [$number => $number])
|
||||
->toArray();
|
||||
return collect($palletNumbers) ->mapWithKeys(fn ($number) => [$number => $number]) ->toArray();
|
||||
})
|
||||
->afterStateUpdated(function ($state, callable $set, $get) {
|
||||
$palletNo = $state;
|
||||
$plantId = $get('plant_id');
|
||||
|
||||
|
||||
$this->dispatch('loadData', $palletNo, $plantId);
|
||||
})
|
||||
->extraAttributes([
|
||||
|
||||
@@ -60,6 +60,7 @@ class AlertMailRuleResource extends Resource
|
||||
'InvoiceTransit' => 'InvoiceTransit',
|
||||
'ImportTransit' => 'ImportTransit',
|
||||
'VehicleReport' => 'VehicleReport',
|
||||
'ExportDispatchReport' => 'ExportDispatchReport'
|
||||
]),
|
||||
Forms\Components\Select::make('rule_name')
|
||||
->label('Rule Name')
|
||||
@@ -73,6 +74,7 @@ class AlertMailRuleResource extends Resource
|
||||
'InvoiceTransitMail' => 'Invoice Transit Mail',
|
||||
'ImportTransitMail' => 'Import Transit Mail',
|
||||
'VehicleReportMail' => 'Vehicle Report Mail',
|
||||
'ExportDispatchReportMail' => 'Export Dispatch Report Mail'
|
||||
])
|
||||
->required(),
|
||||
Forms\Components\TextInput::make('email')
|
||||
|
||||
@@ -6,25 +6,24 @@ use App\Filament\Exports\CharacteristicApproverMasterExporter;
|
||||
use App\Filament\Imports\CharacteristicApproverMasterImporter;
|
||||
use App\Filament\Resources\CharacteristicApproverMasterResource\Pages;
|
||||
use App\Models\CharacteristicApproverMaster;
|
||||
use App\Models\Item;
|
||||
use App\Models\Machine;
|
||||
use App\Models\Plant;
|
||||
use Filament\Facades\Filament;
|
||||
use Filament\Forms;
|
||||
use Filament\Forms\Components\DateTimePicker;
|
||||
use Filament\Forms\Components\Section;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Tables;
|
||||
use Filament\Tables\Actions\ExportAction;
|
||||
use Filament\Tables\Actions\ImportAction;
|
||||
use Filament\Tables\Filters\Filter;
|
||||
use Filament\Tables\Table;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
use Illuminate\Validation\Rule;
|
||||
use Filament\Forms\Components\DateTimePicker;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Tables\Filters\Filter;
|
||||
|
||||
class CharacteristicApproverMasterResource extends Resource
|
||||
{
|
||||
@@ -34,6 +33,8 @@ class CharacteristicApproverMasterResource extends Resource
|
||||
|
||||
protected static ?string $navigationGroup = 'Laser Marking';
|
||||
|
||||
protected static ?int $navigationSort = 2;
|
||||
|
||||
public static function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
@@ -224,7 +225,8 @@ class CharacteristicApproverMasterResource extends Resource
|
||||
Forms\Components\TextInput::make('duration2')
|
||||
->label('Duration (HH.MM)')
|
||||
->reactive()
|
||||
->length(4)
|
||||
->minLength(4)
|
||||
->maxLength(5)
|
||||
->regex('/^([0-9]|0[0-9]|1[0-9]|2[0-3])\.(0[0-9]|[1-5][0-9])$/')
|
||||
->validationMessages([
|
||||
'regex' => 'Duration must be HH.MM format (example: 00.00 - 23.59)',
|
||||
@@ -256,7 +258,8 @@ class CharacteristicApproverMasterResource extends Resource
|
||||
Forms\Components\TextInput::make('duration3')
|
||||
->label('Duration (HH.MM)')
|
||||
->reactive()
|
||||
->length(4)
|
||||
->minLength(4)
|
||||
->maxLength(5)
|
||||
->regex('/^([0-9]|0[0-9]|1[0-9]|2[0-3])\.(0[0-9]|[1-5][0-9])$/')
|
||||
->validationMessages([
|
||||
'regex' => 'Duration must be HH.MM format (example: 00.00 - 23.59)',
|
||||
@@ -411,7 +414,7 @@ class CharacteristicApproverMasterResource extends Resource
|
||||
if ($userHas && strlen($userHas) > 0) {
|
||||
return Plant::where('id', $userHas)->pluck('name', 'id')->toArray();
|
||||
} else {
|
||||
return Plant::whereHas('requestCharacteristics', function ($query) {
|
||||
return Plant::whereHas('characteristicApproverMaster', function ($query) {
|
||||
$query->whereNotNull('id');
|
||||
})->orderBy('code')->pluck('name', 'id');
|
||||
}
|
||||
@@ -434,7 +437,7 @@ class CharacteristicApproverMasterResource extends Resource
|
||||
return [];
|
||||
}
|
||||
|
||||
return Machine::whereHas('requestCharacteristics', function ($query) use ($plantId) {
|
||||
return Machine::whereHas('characteristicApproverMaster', function ($query) use ($plantId) {
|
||||
if ($plantId) {
|
||||
$query->where('plant_id', $plantId);
|
||||
}
|
||||
|
||||
@@ -11,22 +11,22 @@ use App\Models\Machine;
|
||||
use App\Models\Plant;
|
||||
use Filament\Facades\Filament;
|
||||
use Filament\Forms;
|
||||
use Filament\Forms\Components\DateTimePicker;
|
||||
use Filament\Forms\Components\Section;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Forms\Get;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Tables;
|
||||
use Filament\Tables\Actions\ExportAction;
|
||||
use Filament\Tables\Actions\ImportAction;
|
||||
use Filament\Tables\Filters\Filter;
|
||||
use Filament\Tables\Table;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
use Illuminate\Validation\Rule;
|
||||
use Str;
|
||||
use Filament\Tables\Filters\Filter;
|
||||
use Filament\Forms\Components\DateTimePicker;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
|
||||
class ClassCharacteristicResource extends Resource
|
||||
{
|
||||
@@ -974,6 +974,12 @@ class ClassCharacteristicResource extends Resource
|
||||
->afterStateUpdated(function (callable $set) {
|
||||
$set('updated_by', Filament::auth()->user()?->name);
|
||||
}),
|
||||
Forms\Components\TextInput::make('zmm_axial_force')
|
||||
->label('ZMM AXIAL FORCE')
|
||||
->reactive()
|
||||
->afterStateUpdated(function (callable $set) {
|
||||
$set('updated_by', Filament::auth()->user()?->name);
|
||||
}),
|
||||
Forms\Components\TextInput::make('mark_status')
|
||||
->label('MARKED STATUS')
|
||||
->reactive()
|
||||
@@ -1814,6 +1820,10 @@ class ClassCharacteristicResource extends Resource
|
||||
->label('ZMM OPERATING TEMPERATURE')
|
||||
->alignCenter()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('zmm_axial_force')
|
||||
->label('ZMM AXIAL FORCE')
|
||||
->alignCenter()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('mark_status')
|
||||
->label('MARKED STATUS')
|
||||
->alignCenter()
|
||||
|
||||
@@ -82,6 +82,13 @@ class CustomerPoMasterResource extends Resource
|
||||
|
||||
return ($currentPage - 1) * $perPage + $rowLoop->iteration;
|
||||
}),
|
||||
Tables\Columns\TextColumn::make('id')
|
||||
->label('ID')
|
||||
->numeric()
|
||||
->alignCenter()
|
||||
->sortable()
|
||||
->searchable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
Tables\Columns\TextColumn::make('plant.name')
|
||||
->label('Plant')
|
||||
->alignCenter()
|
||||
@@ -110,10 +117,18 @@ class CustomerPoMasterResource extends Resource
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
Tables\Columns\TextColumn::make('created_by')
|
||||
->label('Created By')
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
Tables\Columns\TextColumn::make('updated_at')
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
Tables\Columns\TextColumn::make('updated_by')
|
||||
->label('Updated By')
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
Tables\Columns\TextColumn::make('deleted_at')
|
||||
->dateTime()
|
||||
->sortable()
|
||||
|
||||
@@ -12,6 +12,7 @@ use Filament\Facades\Filament;
|
||||
use Filament\Forms;
|
||||
use Filament\Forms\Components\Actions\Action;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Forms\Get;
|
||||
use Filament\Notifications\Notification;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Tables;
|
||||
@@ -39,18 +40,32 @@ class EquipmentMasterResource extends Resource
|
||||
return $form
|
||||
->schema([
|
||||
Forms\Components\Select::make('plant_id')
|
||||
->label('Plant')
|
||||
->reactive()
|
||||
->label('Plant Name')
|
||||
->relationship('plant', 'name')
|
||||
->required()
|
||||
->searchable()
|
||||
->reactive()
|
||||
->options(function (callable $get) {
|
||||
$userHas = Filament::auth()->user()->plant_id;
|
||||
|
||||
return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::orderBy('code')->pluck('name', 'id')->toArray();
|
||||
})
|
||||
->required(),
|
||||
->disabled(fn (Get $get) => ! empty($get('id')))
|
||||
->afterStateUpdated(function ($state, callable $set, callable $get) {
|
||||
$set('machine_id', null);
|
||||
$set('updated_by', Filament::auth()->user()?->name);
|
||||
})
|
||||
->default(function () {
|
||||
|
||||
$userHas = Filament::auth()->user()->plant_id;
|
||||
|
||||
return ($userHas && strlen($userHas) > 0) ? $userHas : optional(EquipmentMaster::latest()->first())->plant_id;
|
||||
}),
|
||||
Forms\Components\Select::make('machine_id')
|
||||
// ->relationship('machine', 'name')
|
||||
->label('Work Center')
|
||||
->required()
|
||||
->searchable()
|
||||
->reactive()
|
||||
->options(function (callable $get) {
|
||||
$plantId = $get('plant_id');
|
||||
@@ -60,15 +75,30 @@ class EquipmentMasterResource extends Resource
|
||||
|
||||
return \App\Models\Machine::where('plant_id', $plantId)->pluck('work_center', 'id');
|
||||
})
|
||||
->required(),
|
||||
->disabled(fn (Get $get) => ! empty($get('id')))
|
||||
->afterStateUpdated(function ($state, callable $set) {
|
||||
$set('updated_by', Filament::auth()->user()?->name);
|
||||
}),
|
||||
Forms\Components\TextInput::make('name')
|
||||
->label('Name'),
|
||||
->label('Name')
|
||||
->afterStateUpdated(function ($state, callable $set) {
|
||||
$set('updated_by', Filament::auth()->user()?->name);
|
||||
}),
|
||||
Forms\Components\TextInput::make('description')
|
||||
->label('Description'),
|
||||
->label('Description')
|
||||
->afterStateUpdated(function ($state, callable $set) {
|
||||
$set('updated_by', Filament::auth()->user()?->name);
|
||||
}),
|
||||
Forms\Components\TextInput::make('make')
|
||||
->label('Make'),
|
||||
->label('Make')
|
||||
->afterStateUpdated(function ($state, callable $set) {
|
||||
$set('updated_by', Filament::auth()->user()?->name);
|
||||
}),
|
||||
Forms\Components\TextInput::make('model')
|
||||
->label('Model'),
|
||||
->label('Model')
|
||||
->afterStateUpdated(function ($state, callable $set) {
|
||||
$set('updated_by', Filament::auth()->user()?->name);
|
||||
}),
|
||||
Forms\Components\TextInput::make('equipment_number')
|
||||
->label('Equipment Number')
|
||||
->reactive()
|
||||
@@ -82,6 +112,8 @@ class EquipmentMasterResource extends Resource
|
||||
];
|
||||
})
|
||||
->afterStateUpdated(function ($state, callable $set) {
|
||||
$set('updated_by', Filament::auth()->user()?->name);
|
||||
|
||||
if (! $state) {
|
||||
return;
|
||||
}
|
||||
@@ -108,7 +140,10 @@ class EquipmentMasterResource extends Resource
|
||||
// }
|
||||
// }),
|
||||
Forms\Components\TextInput::make('instrument_serial_number')
|
||||
->label('Instrument Serial Number'),
|
||||
->label('Instrument Serial Number')
|
||||
->afterStateUpdated(function ($state, callable $set) {
|
||||
$set('updated_by', Filament::auth()->user()?->name);
|
||||
}),
|
||||
// Forms\Components\DateTimePicker::make('calibrated_on')
|
||||
// ->label('Calibrated On')
|
||||
// ->required(),
|
||||
@@ -128,6 +163,7 @@ class EquipmentMasterResource extends Resource
|
||||
$frequency = $get('frequency') ?? '1';
|
||||
$nextDate = self::calculateNextCalibrationDate($state, $frequency);
|
||||
$set('next_calibration_date', $nextDate);
|
||||
$set('updated_by', Filament::auth()->user()?->name);
|
||||
}),
|
||||
// ->afterStateUpdated(function ($state, callable $get, callable $set) {
|
||||
// $frequency = (int) $get('frequency');
|
||||
@@ -152,6 +188,7 @@ class EquipmentMasterResource extends Resource
|
||||
$calibratedOn = $get('calibrated_on');
|
||||
$nextDate = self::calculateNextCalibrationDate($calibratedOn, $state);
|
||||
$set('next_calibration_date', $nextDate);
|
||||
$set('updated_by', Filament::auth()->user()?->name);
|
||||
}),
|
||||
// ->afterStateUpdated(function ($state, callable $get, callable $set) {
|
||||
// $calibratedOn = $get('calibrated_on');
|
||||
@@ -171,12 +208,21 @@ class EquipmentMasterResource extends Resource
|
||||
Forms\Components\DateTimePicker::make('next_calibration_date')
|
||||
->label('Next Calibration Date')
|
||||
->readOnly()
|
||||
->required(),
|
||||
->required()
|
||||
->afterStateUpdated(function ($state, callable $set) {
|
||||
$set('updated_by', Filament::auth()->user()?->name);
|
||||
}),
|
||||
|
||||
Forms\Components\TextInput::make('calibrated_by')
|
||||
->label('Calibrated By'),
|
||||
->label('Calibrated By')
|
||||
->afterStateUpdated(function ($state, callable $set) {
|
||||
$set('updated_by', Filament::auth()->user()?->name);
|
||||
}),
|
||||
Forms\Components\Textarea::make('calibration_certificate')
|
||||
->label('Calibration Certificate'),
|
||||
->label('Calibration Certificate')
|
||||
->afterStateUpdated(function ($state, callable $set) {
|
||||
$set('updated_by', Filament::auth()->user()?->name);
|
||||
}),
|
||||
|
||||
Forms\Components\FileUpload::make('attachment')
|
||||
->label('PDF Upload')
|
||||
@@ -185,7 +231,10 @@ class EquipmentMasterResource extends Resource
|
||||
->disk('local')
|
||||
->directory('uploads/temp')
|
||||
->preserveFilenames()
|
||||
->reactive(),
|
||||
->reactive()
|
||||
->afterStateUpdated(function ($state, callable $set) {
|
||||
$set('updated_by', Filament::auth()->user()?->name);
|
||||
}),
|
||||
|
||||
// Forms\Components\Actions::make([
|
||||
// Action::make('uploadNow')
|
||||
@@ -341,7 +390,11 @@ class EquipmentMasterResource extends Resource
|
||||
->label('Created By')
|
||||
->default(Filament::auth()->user()?->name),
|
||||
Forms\Components\Hidden::make('updated_by')
|
||||
->label('Updated By'),
|
||||
->label('Updated By')
|
||||
->default(Filament::auth()->user()?->name),
|
||||
Forms\Components\TextInput::make('id')
|
||||
->hidden()
|
||||
->readOnly(),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -359,7 +412,7 @@ class EquipmentMasterResource extends Resource
|
||||
return ($currentPage - 1) * $perPage + $rowLoop->iteration;
|
||||
}),
|
||||
Tables\Columns\TextColumn::make('plant.name')
|
||||
->label('Plant')
|
||||
->label('Plant Name')
|
||||
->alignCenter()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('machine.work_center')
|
||||
@@ -413,24 +466,30 @@ class EquipmentMasterResource extends Resource
|
||||
->alignCenter()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('created_by')
|
||||
->label('Created Bys')
|
||||
->alignCenter()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('updated_by')
|
||||
->label('Updated By')
|
||||
->label('Created By')
|
||||
->alignCenter()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('created_at')
|
||||
->label('Created At')
|
||||
->dateTime()
|
||||
->alignCenter()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('updated_by')
|
||||
->label('Updated By')
|
||||
->alignCenter()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
->toggleable(isToggledHiddenByDefault: false),
|
||||
Tables\Columns\TextColumn::make('updated_at')
|
||||
->label('Updated At')
|
||||
->dateTime()
|
||||
->alignCenter()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: false),
|
||||
Tables\Columns\TextColumn::make('deleted_at')
|
||||
->label('Deleted At')
|
||||
->dateTime()
|
||||
->alignCenter()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
])
|
||||
->filters([
|
||||
|
||||
@@ -5,6 +5,7 @@ namespace App\Filament\Resources;
|
||||
use AlperenErsoy\FilamentExport\Actions\FilamentExportBulkAction;
|
||||
use App\Filament\Exports\AxnExporter;
|
||||
use App\Filament\Exports\InvoiceValidationExporter;
|
||||
use App\Filament\Exports\MaterialInvoiceValidationExporter;
|
||||
use App\Filament\Imports\InvoiceValidationImporter;
|
||||
use App\Filament\Imports\SapInvoiceValidationImporter;
|
||||
use App\Filament\Resources\InvoiceValidationResource\Pages;
|
||||
@@ -1164,12 +1165,19 @@ class InvoiceValidationResource extends Resource
|
||||
->visible(function () {
|
||||
return Filament::auth()->user()->can('view import sap invoice');
|
||||
}),
|
||||
ExportAction::make('invoice_export')
|
||||
->label('Export Invoices')
|
||||
ExportAction::make('serial_invoice_export')
|
||||
->label('Export Serial Invoices')
|
||||
->color('warning')
|
||||
->exporter(InvoiceValidationExporter::class)
|
||||
->visible(function () {
|
||||
return Filament::auth()->user()->can('view export invoice');
|
||||
return Filament::auth()->user()->can('view export serial invoice');
|
||||
}),
|
||||
ExportAction::make('material_invoice_export')
|
||||
->label('Export Material Invoices')
|
||||
->color('warning')
|
||||
->exporter(MaterialInvoiceValidationExporter::class)
|
||||
->visible(function () {
|
||||
return Filament::auth()->user()->can('view export material invoice');
|
||||
}),
|
||||
ExportAction::make('axn_export')
|
||||
->label('Export Asn')
|
||||
|
||||
@@ -11,13 +11,17 @@ use App\Models\Plant;
|
||||
use App\Models\WorkGroupMaster;
|
||||
use Filament\Facades\Filament;
|
||||
use Filament\Forms;
|
||||
use Filament\Forms\Components\DateTimePicker;
|
||||
use Filament\Forms\Components\Section;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Forms\Get;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Tables;
|
||||
use Filament\Tables\Actions\ExportAction;
|
||||
use Filament\Tables\Actions\ImportAction;
|
||||
use Filament\Tables\Filters\Filter;
|
||||
use Filament\Tables\Table;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
@@ -66,6 +70,8 @@ class MachineResource extends Resource
|
||||
return;
|
||||
} else {
|
||||
$set('mPlantError', null);
|
||||
$set('line_id', null);
|
||||
$set('work_group_master_id', null);
|
||||
}
|
||||
})
|
||||
->extraAttributes(fn ($get) => [
|
||||
@@ -107,6 +113,7 @@ class MachineResource extends Resource
|
||||
// return;
|
||||
// }
|
||||
$set('mLineError', null);
|
||||
$set('work_group_master_id', null);
|
||||
}
|
||||
})
|
||||
->extraAttributes(fn ($get) => [
|
||||
@@ -249,7 +256,177 @@ class MachineResource extends Resource
|
||||
])
|
||||
->filters([
|
||||
Tables\Filters\TrashedFilter::make(),
|
||||
Filter::make('advanced_filters')
|
||||
->label('Advanced Filters')
|
||||
->form([
|
||||
Select::make('Plant')
|
||||
->label('Search by Plant Name')
|
||||
->nullable()
|
||||
->options(function (callable $get) {
|
||||
$userHas = Filament::auth()->user()->plant_id;
|
||||
|
||||
// return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::orderBy('code')->pluck('name', 'id')->toArray();
|
||||
if ($userHas && strlen($userHas) > 0) {
|
||||
return Plant::where('id', $userHas)->pluck('name', 'id')->toArray();
|
||||
} else {
|
||||
return Plant::whereHas('machines', function ($query) {
|
||||
$query->whereNotNull('id');
|
||||
})->orderBy('code')->pluck('name', 'id')->toArray();
|
||||
}
|
||||
})
|
||||
->searchable()
|
||||
->reactive()
|
||||
->afterStateUpdated(function ($state, callable $set, callable $get): void {
|
||||
$set('code', null);
|
||||
$set('operator_id', null);
|
||||
}),
|
||||
Select::make('Line')
|
||||
->label('Search by Line')
|
||||
->searchable()
|
||||
->options(function (callable $get) {
|
||||
$plantId = $get('Plant');
|
||||
if (empty($plantId)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return Line::whereHas('machines', function ($query) use ($plantId) {
|
||||
if ($plantId) {
|
||||
$query->where('plant_id', $plantId);
|
||||
}
|
||||
})->pluck('name', 'id');
|
||||
})
|
||||
->searchable()
|
||||
->reactive(),
|
||||
TextInput::make('name')
|
||||
->label('Description')
|
||||
->reactive(),
|
||||
Select::make('work_group_master')
|
||||
->label('Search by Work Group Center')
|
||||
->options(function (callable $get) {
|
||||
$plantId = $get('Plant');
|
||||
|
||||
return WorkGroupMaster::whereHas('machines', function ($query) use ($plantId) {
|
||||
if ($plantId) {
|
||||
$query->where('plant_id', $plantId);
|
||||
}
|
||||
})
|
||||
->pluck('name', 'id')
|
||||
->toArray();
|
||||
})
|
||||
->searchable()
|
||||
->reactive(),
|
||||
Select::make('work_center')
|
||||
->label('Search by Work Center')
|
||||
->options(function (callable $get) {
|
||||
|
||||
$plantId = $get('Plant');
|
||||
$workGroupMasterId = $get('work_group_master');
|
||||
|
||||
if (! $workGroupMasterId) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return Machine::query()
|
||||
->when($plantId, fn ($q) => $q->where('plant_id', $plantId))
|
||||
->where('work_group_master_id', $workGroupMasterId)
|
||||
->pluck('work_center', 'work_center')
|
||||
->toArray();
|
||||
})
|
||||
->searchable()
|
||||
->reactive(),
|
||||
DateTimePicker::make(name: 'created_from')
|
||||
->label('Created From')
|
||||
->placeholder(placeholder: 'Select From DateTime')
|
||||
->reactive()
|
||||
->native(false),
|
||||
DateTimePicker::make('created_to')
|
||||
->label('Created To')
|
||||
->placeholder(placeholder: 'Select To DateTime')
|
||||
->reactive()
|
||||
->native(false),
|
||||
])
|
||||
->query(function ($query, array $data) {
|
||||
// Hide all records initially if no filters are applied
|
||||
if (empty($data['Plant']) && empty($data['Line']) && empty($data['name']) && empty($data['work_group_master']) && empty($data['created_from']) && empty($data['created_to']) && empty($data['updated_from']) && empty($data['updated_to'])) {
|
||||
// return $query->whereRaw('1 = 0');
|
||||
}
|
||||
|
||||
if (! empty($data['Plant'])) { // $plant = $data['Plant'] ?? null
|
||||
$query->where('plant_id', $data['Plant']);
|
||||
} else {
|
||||
$userHas = Filament::auth()->user()->plant_id;
|
||||
|
||||
if ($userHas && strlen($userHas) > 0) {
|
||||
return $query->whereRaw('1 = 0');
|
||||
}
|
||||
}
|
||||
|
||||
if (! empty($data['Line'])) {
|
||||
$query->where('line_id', $data['Line']);
|
||||
}
|
||||
|
||||
if (! empty($data['name'])) {
|
||||
$query->where('name', $data['name']);
|
||||
}
|
||||
|
||||
if (! empty($data['work_group_master'])) {
|
||||
$query->where('work_group_master_id', $data['work_group_master']);
|
||||
}
|
||||
|
||||
if (! empty($data['work_center'])) {
|
||||
$query->where('work_center', $data['work_center']);
|
||||
}
|
||||
|
||||
if (! empty($data['created_from'])) {
|
||||
$query->where('created_at', '>=', $data['created_from']);
|
||||
}
|
||||
|
||||
if (! empty($data['created_to'])) {
|
||||
$query->where('created_at', '<=', $data['created_to']);
|
||||
}
|
||||
|
||||
})
|
||||
->indicateUsing(function (array $data) {
|
||||
$indicators = [];
|
||||
|
||||
if (! empty($data['Plant'])) {
|
||||
$indicators[] = 'Plant: '.Plant::where('id', $data['Plant'])->value('name');
|
||||
} else {
|
||||
$userHas = Filament::auth()->user()->plant_id;
|
||||
|
||||
if ($userHas && strlen($userHas) > 0) {
|
||||
return 'Plant: Choose plant to filter records.';
|
||||
}
|
||||
}
|
||||
|
||||
if (! empty($data['Line'])) {
|
||||
$indicators[] = 'Line Name: '.Line::where('id', $data['Line'])->value('name');
|
||||
}
|
||||
|
||||
if (! empty($data['name'])) {
|
||||
$indicators[] = 'Description: '.$data['name'];
|
||||
}
|
||||
|
||||
if (! empty($data['work_group_master'])) {
|
||||
$indicators[] = 'Work Group Center: '.WorkGroupMaster::where('id', $data['work_group_master'])->value('name');
|
||||
}
|
||||
|
||||
if (! empty($data['work_center'])) {
|
||||
$indicators[] = 'Work Center: '.Machine::where('work_center', $data['work_center'])->value('work_center');
|
||||
}
|
||||
|
||||
if (! empty($data['created_from'])) {
|
||||
$indicators[] = 'From: '.$data['created_from'];
|
||||
}
|
||||
|
||||
if (! empty($data['created_to'])) {
|
||||
$indicators[] = 'To: '.$data['created_to'];
|
||||
}
|
||||
|
||||
return $indicators;
|
||||
}),
|
||||
])
|
||||
->filtersFormMaxHeight('280px')
|
||||
->actions([
|
||||
Tables\Actions\ViewAction::make(),
|
||||
Tables\Actions\EditAction::make(),
|
||||
|
||||
@@ -27,6 +27,8 @@ class PanelBoxValidationResource extends Resource
|
||||
|
||||
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
|
||||
|
||||
protected static ?string $navigationGroup = 'Panel Box';
|
||||
|
||||
public $isSubmitted = false;
|
||||
|
||||
public $data = [];
|
||||
@@ -176,6 +178,8 @@ class PanelBoxValidationResource extends Resource
|
||||
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
||||
|
||||
$pId = $get('line_id');
|
||||
$plantId = $get('plant_id');
|
||||
$plaCode = Plant::find($plantId)?->code;
|
||||
$set('part_validation_type', null);
|
||||
$set('show_validation_image', false);
|
||||
$set('validation1_image_url', null);
|
||||
@@ -269,14 +273,6 @@ class PanelBoxValidationResource extends Resource
|
||||
$set('part_validation_type_options', []);
|
||||
$set('validation1_image_url', null);
|
||||
|
||||
return;
|
||||
} elseif (strlen($sNumber) < 9) {
|
||||
$set('validationError', 'Serial Number must be at least 9 digits.');
|
||||
$set('part_validation_type', null);
|
||||
$set('show_validation_image', false);
|
||||
$set('part_validation_type_options', []);
|
||||
$set('validation1_image_url', null);
|
||||
|
||||
return;
|
||||
}
|
||||
// }
|
||||
@@ -285,34 +281,132 @@ class PanelBoxValidationResource extends Resource
|
||||
$set('validationError', null);
|
||||
}
|
||||
}
|
||||
// if ($state && str_contains($state, '|')) {
|
||||
|
||||
if ($state && str_contains($state, '|')) {
|
||||
// $parts = explode('|', $state);
|
||||
|
||||
$parts = explode('|', $state);
|
||||
// $itemCode = trim($parts[0]); // Extract item code // 123456|123456789
|
||||
|
||||
$itemCode = trim($parts[0]); // Extract item code // 123456|123456789
|
||||
// $serialNumber = trim($parts[1]);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// // $parts = explode('/', $state);
|
||||
|
||||
$serialNumber = trim($parts[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
// $parts = explode('/', $state);
|
||||
// // $itemCode = trim($parts[1] ?? ''); // item code
|
||||
// // $serialNumber = trim($parts[2] ?? ''); // serial number
|
||||
|
||||
// $itemCode = trim($parts[1] ?? ''); // item code
|
||||
// $serialNumber = trim($parts[2] ?? ''); // serial number
|
||||
// $parts = array_map('trim', explode('/', $state));
|
||||
|
||||
$parts = array_map('trim', explode('/', $state));
|
||||
// // Expected format: 121245/165467/2606/1002634
|
||||
// if (count($parts) != 4) {
|
||||
// Notification::make()
|
||||
// ->title('Invalid QR Format')
|
||||
// ->body('Expected format: plantcode/itemcode/yearmm/serialnumber')
|
||||
// ->danger()
|
||||
// ->send();
|
||||
|
||||
$serialNumber = end($parts); // last part
|
||||
// return;
|
||||
// }
|
||||
|
||||
// item code depends on format
|
||||
$itemCode = $parts[1] ?? '';
|
||||
}
|
||||
// $serialNumber = end($parts); // last part
|
||||
|
||||
// $itemCode = $parts[1] ?? '';
|
||||
// }
|
||||
|
||||
// Store serial number before resetting fields
|
||||
$previousSerialNumber = $serialNumber;
|
||||
|
||||
$previousItemCode = $itemCode;
|
||||
|
||||
if (str_contains($state, '|')) {
|
||||
|
||||
$parts = array_map('trim', explode('|', $state));
|
||||
|
||||
if (count($parts) != 2) {
|
||||
Notification::make()
|
||||
->title('Invalid QR Format')
|
||||
->body('Expected format: ItemCode|SerialNumber')
|
||||
->danger()
|
||||
->send();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$itemCode = $parts[0];
|
||||
$serialNumber = $parts[1];
|
||||
|
||||
if($serialNumber == '' || $serialNumber == null){
|
||||
Notification::make()
|
||||
->title('Unknown Serial number')
|
||||
->body("Serial number can't be empty!")
|
||||
->danger()
|
||||
->send();
|
||||
|
||||
$set('item_id', null);
|
||||
return;
|
||||
}
|
||||
elseif (! ctype_alnum($serialNumber)) {
|
||||
$set('validationError', 'Serial Number should contain alpha-numeric values.');
|
||||
$set('item_id', null);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
elseif (str_contains($state, '/'))
|
||||
{
|
||||
$parts = array_map('trim', explode('/', $state));
|
||||
|
||||
if (count($parts) != 4) {
|
||||
|
||||
Notification::make()
|
||||
->title('Invalid QR Format')
|
||||
->body('Expected format: plantcode/itemcode/yearmm/serialnumber')
|
||||
->danger()
|
||||
->send();
|
||||
$set('item_id', null);
|
||||
return;
|
||||
}
|
||||
|
||||
$plantCode = $parts[0];
|
||||
$itemCode = $parts[1];
|
||||
$yearMonth = $parts[2];
|
||||
$serialNumber = $parts[3];
|
||||
|
||||
if($serialNumber == '' || $serialNumber == null){
|
||||
Notification::make()
|
||||
->title('Unknown Serial number')
|
||||
->body("Serial number can't be empty!")
|
||||
->danger()
|
||||
->send();
|
||||
|
||||
$set('item_id', null);
|
||||
return;
|
||||
}
|
||||
elseif (! ctype_alnum($serialNumber)) {
|
||||
$set('validationError', 'Serial Number should contain alpha-numeric values.');
|
||||
$set('item_id', null);
|
||||
return;
|
||||
}
|
||||
else if($plantCode != $plaCode){
|
||||
Notification::make()
|
||||
->title('Invalid Plant Code')
|
||||
->body("Scanned plant code doesn't match the selected plant.")
|
||||
->danger()
|
||||
->send();
|
||||
$set('item_id', null);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
Notification::make()
|
||||
->title('Invalid QR Format')
|
||||
->body('QR must be in either ItemCode|SerialNumber or PlantCode/ItemCode/YearMM/SerialNumber format.')
|
||||
->danger()
|
||||
->send();
|
||||
$set('item_id', null);
|
||||
$set('validationError', null);
|
||||
return;
|
||||
}
|
||||
|
||||
if (strlen($itemCode) < 6) {
|
||||
$set('validationError', 'Item code must be at least 6 digits.');
|
||||
@@ -332,29 +426,6 @@ class PanelBoxValidationResource extends Resource
|
||||
|
||||
return;
|
||||
}
|
||||
//elseif ($serialNumber == '') {
|
||||
// $set('validationError', 'Waiting for full QR scan...');
|
||||
|
||||
// return;
|
||||
// } elseif (strlen($serialNumber) < 9) {
|
||||
// $set('validationError', 'Serial Number must be at least 9 digits.');
|
||||
// $set('part_validation_type', null);
|
||||
// $set('show_validation_image', false);
|
||||
// $set('part_validation_type_options', []);
|
||||
// $set('validation1_image_url', null);
|
||||
|
||||
// return;
|
||||
// } elseif (! ctype_alnum($serialNumber)) {
|
||||
// $set('validationError', 'Serial Number should contain alpha-numeric values.');
|
||||
// $set('item_id', null);
|
||||
// $set('part_validation_type', null);
|
||||
// $set('show_validation_image', false);
|
||||
// $set('part_validation_type_options', []);
|
||||
// $set('validation1_image_url', null);
|
||||
|
||||
// return;
|
||||
// }
|
||||
|
||||
else {
|
||||
$set('validationError', null);
|
||||
}
|
||||
@@ -419,6 +490,7 @@ class PanelBoxValidationResource extends Resource
|
||||
// $set('serial_number', null);
|
||||
// $set('serial_number', $serialNumber);
|
||||
}
|
||||
|
||||
// Check if user input matches the database values
|
||||
foreach ($partValidationColumns as $field) {
|
||||
if ($get("{$field}_visible")) {
|
||||
@@ -436,7 +508,7 @@ class PanelBoxValidationResource extends Resource
|
||||
$serialExists = PanelBoxValidation::where('serial_number', $serialNumber)->where('plant_id', $plantId)->exists();
|
||||
|
||||
if ($serialExists && ! $get('id')) {
|
||||
$set('validationError', 'Serial number already exists in quality validation.');
|
||||
$set('validationError', 'Serial number already exists in panel box validation.');
|
||||
$set('sticker_master_id', null);
|
||||
$set('uom', null);
|
||||
$set('serial_number', null);
|
||||
@@ -553,14 +625,43 @@ class PanelBoxValidationResource extends Resource
|
||||
$options['part_validation4'] = 'Part Validation 4';
|
||||
}
|
||||
|
||||
// Save options in hidden field
|
||||
$set('part_validation_type_options', $options);
|
||||
|
||||
})
|
||||
// ->extraAttributes(fn ($get) => [
|
||||
// 'class' => $get('validationError') ? 'border-red-500' : '',
|
||||
// 'id' => 'item_id',
|
||||
// 'onkeydown' => "if (event.key === 'Enter') { event.preventDefault(); event.stopPropagation(); return false; }",
|
||||
// ])
|
||||
|
||||
->extraAttributes(fn ($get) => [
|
||||
'class' => $get('validationError') ? 'border-red-500' : '',
|
||||
'id' => 'item_id',
|
||||
'onkeydown' => "if (event.key === 'Enter') { event.preventDefault(); event.stopPropagation(); return false; }",
|
||||
'onkeydown' => "
|
||||
if (event.key === 'Enter') {
|
||||
const serialFields = [
|
||||
'serial_number_motor_qr', 'serial_number_pump_qr', 'pack_slip_motor_qr',
|
||||
'name_plate_motor_qr', 'tube_sticker_motor_qr', 'warranty_card_qr'
|
||||
];
|
||||
const partValidationColumns = [
|
||||
'part_validation1', 'part_validation2', 'part_validation3',
|
||||
'part_validation4', 'part_validation5'
|
||||
];
|
||||
|
||||
const allFields = [...serialFields.map(f => f + '_visible'), ...partValidationColumns.map(f => f + '_visible')];
|
||||
|
||||
const anyVisible = allFields.some(key => {
|
||||
const el = document.querySelector('[wire\\\\:model*=\"' + key + '\"]');
|
||||
return el && (el.value === '1' || el.value === 'true' || el.checked);
|
||||
});
|
||||
|
||||
if (anyVisible) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
",
|
||||
])
|
||||
->hint(fn ($get) => $get('validationError') ? $get('validationError') : null)
|
||||
->hintColor('danger'),
|
||||
@@ -595,6 +696,16 @@ class PanelBoxValidationResource extends Resource
|
||||
return;
|
||||
}
|
||||
|
||||
if (!preg_match('/^\d+\/\d+\/\d+\/\d+$/', $state)) {
|
||||
Notification::make()
|
||||
->title('Invalid QR Format')
|
||||
->body('Expected format: plantcode/itemcode/yearmm/serialnumber')
|
||||
->danger()
|
||||
->send();
|
||||
$set('serial_number_panel_qr', null);
|
||||
return;
|
||||
}
|
||||
|
||||
$parts = explode('/', $state);
|
||||
$extracted = trim(end($parts));
|
||||
|
||||
@@ -632,11 +743,21 @@ class PanelBoxValidationResource extends Resource
|
||||
return;
|
||||
}
|
||||
|
||||
if (!preg_match('/^\d+\/\d+\/\d+\/\d+$/', $state)) {
|
||||
Notification::make()
|
||||
->title('Invalid QR Format')
|
||||
->body('Expected format: plantcode/itemcode/yearmm/serialnumber')
|
||||
->danger()
|
||||
->send();
|
||||
$set('pack_slip_panel_qr', null);
|
||||
return;
|
||||
}
|
||||
|
||||
$parts = explode('/', $state);
|
||||
$extracted = trim(end($parts));
|
||||
|
||||
if (count($parts) < 3 || $extracted == '') {
|
||||
$set('packSlipPanelError', 'Format must be: SupplierCode/ItemCode/SerialNumber');
|
||||
if ($extracted == '') {
|
||||
$set('packSlipPanelError', "SerialNumber can't be empty!");
|
||||
$set('pack_slip_panel_qr', null);
|
||||
return;
|
||||
}
|
||||
@@ -675,11 +796,21 @@ class PanelBoxValidationResource extends Resource
|
||||
return;
|
||||
}
|
||||
|
||||
if (!preg_match('/^\d+\/\d+\/\d+\/\d+$/', $state)) {
|
||||
Notification::make()
|
||||
->title('Invalid QR Format')
|
||||
->body('Expected format: plantcode/itemcode/yearmm/serialnumber')
|
||||
->danger()
|
||||
->send();
|
||||
$set('serial_number_panel_qr', null);
|
||||
return;
|
||||
}
|
||||
|
||||
$parts = explode('/', $state);
|
||||
$extracted = trim(end($parts));
|
||||
|
||||
if (count($parts) < 3 || $extracted == '') {
|
||||
$set('namePlatePanelError', 'Format must be: SupplierCode/ItemCode/SerialNumber');
|
||||
if ($extracted == '') {
|
||||
$set('namePlatePanelError', "SerialNumber cant't be empty!");
|
||||
$set('name_plate_panel_qr', null);
|
||||
return;
|
||||
}
|
||||
@@ -718,11 +849,21 @@ class PanelBoxValidationResource extends Resource
|
||||
return;
|
||||
}
|
||||
|
||||
if (!preg_match('/^\d+\/\d+\/\d+\/\d+$/', $state)) {
|
||||
Notification::make()
|
||||
->title('Invalid QR Format')
|
||||
->body('Expected format: plantcode/itemcode/yearmm/serialnumber')
|
||||
->danger()
|
||||
->send();
|
||||
$set('serial_number_panel_qr', null);
|
||||
return;
|
||||
}
|
||||
|
||||
$parts = explode('/', $state);
|
||||
$extracted = trim(end($parts));
|
||||
|
||||
if (count($parts) < 3 || $extracted == '') {
|
||||
$set('tubeStickerPanelError', 'Format must be: SupplierCode/ItemCode/SerialNumber');
|
||||
if ($extracted == '') {
|
||||
$set('tubeStickerPanelError', "SerialNumber can't be empty!");
|
||||
$set('tube_sticker_panel_qr', null);
|
||||
return;
|
||||
}
|
||||
@@ -741,7 +882,7 @@ class PanelBoxValidationResource extends Resource
|
||||
return;
|
||||
}
|
||||
})
|
||||
->hint(fn ($get) => $get('tubeStickerPanelError') ?? null)
|
||||
->hint(fn ($get ) => $get('tubeStickerPanelError') ?? null)
|
||||
->hintColor('danger')
|
||||
->extraAttributes(fn ($get) => [
|
||||
'class' => $get('tubeStickerPanelError') ? 'border-red-500' : '',
|
||||
@@ -762,11 +903,21 @@ class PanelBoxValidationResource extends Resource
|
||||
return;
|
||||
}
|
||||
|
||||
if (!preg_match('/^\d+\/\d+\/\d+\/\d+$/', $state)) {
|
||||
Notification::make()
|
||||
->title('Invalid QR Format')
|
||||
->body('Expected format: plantcode/itemcode/yearmm/serialnumber')
|
||||
->danger()
|
||||
->send();
|
||||
$set('serial_number_panel_qr', null);
|
||||
return;
|
||||
}
|
||||
|
||||
$parts = explode('/', $state);
|
||||
$extracted = trim(end($parts));
|
||||
|
||||
if (count($parts) < 3 || $extracted == '') {
|
||||
$set('warrantyCardPanelError', 'Format must be: SupplierCode/ItemCode/SerialNumber');
|
||||
if ($extracted == '') {
|
||||
$set('warrantyCardPanelError', "SerialNumber can't be empty!");
|
||||
$set('warranty_card_qr', null);
|
||||
return;
|
||||
}
|
||||
@@ -774,7 +925,7 @@ class PanelBoxValidationResource extends Resource
|
||||
$expected = $get('serial_number');
|
||||
|
||||
if ($extracted != $expected) {
|
||||
$set('warrantyCardPanelError', 'Tube Sticker Panel serial does not match.');
|
||||
$set('warrantyCardPanelError', 'Warranty Card Panel serial does not match.');
|
||||
$set('warranty_card_qr', null);
|
||||
return;
|
||||
}
|
||||
@@ -826,7 +977,6 @@ class PanelBoxValidationResource extends Resource
|
||||
|
||||
if ($state == null || trim($state) == '') {
|
||||
$set('part_validation1_error', null);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -845,7 +995,6 @@ class PanelBoxValidationResource extends Resource
|
||||
$set('part_validation1_error', null);
|
||||
} else {
|
||||
$set('part_validation1_error', 'Invalid input for part validation 1.');
|
||||
|
||||
return;
|
||||
}
|
||||
})
|
||||
@@ -1078,7 +1227,6 @@ class PanelBoxValidationResource extends Resource
|
||||
Forms\Components\Hidden::make('updated_by')
|
||||
->label('Updated By')
|
||||
->default(Filament::auth()->user()?->name),
|
||||
|
||||
Forms\Components\View::make('components.panel-checklist-wrapper')
|
||||
->visible(fn ($livewire) => $livewire->showChecklist)
|
||||
->statePath('checklist')
|
||||
|
||||
@@ -65,8 +65,13 @@ class CreatePanelBoxValidation extends CreateRecord {
|
||||
$this->showChecklist = true;
|
||||
$this->halt();
|
||||
}
|
||||
|
||||
return $data;
|
||||
else{
|
||||
\Filament\Notifications\Notification::make()
|
||||
->title('Characteristics not found for the scanned item.')
|
||||
->danger()
|
||||
->send();
|
||||
$this->halt();
|
||||
}
|
||||
}
|
||||
|
||||
protected function checkIfHasCharacteristics(array $data)
|
||||
|
||||
@@ -10,6 +10,8 @@ class ViewPanelBoxValidation extends ViewRecord
|
||||
{
|
||||
protected static string $resource = PanelBoxValidationResource::class;
|
||||
|
||||
public bool $showChecklist = false;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
|
||||
@@ -973,6 +973,12 @@ class TempClassCharacteristicResource extends Resource
|
||||
->afterStateUpdated(function (callable $set) {
|
||||
$set('updated_by', Filament::auth()->user()?->name);
|
||||
}),
|
||||
Forms\Components\TextInput::make('zmm_axial_force')
|
||||
->label('ZMM AXIAL FORCE')
|
||||
->reactive()
|
||||
->afterStateUpdated(function (callable $set) {
|
||||
$set('updated_by', Filament::auth()->user()?->name);
|
||||
}),
|
||||
Forms\Components\TextInput::make('winded_serial_number')
|
||||
->label('WINDED SERIAL NUMBER')
|
||||
->reactive()
|
||||
@@ -1584,6 +1590,10 @@ class TempClassCharacteristicResource extends Resource
|
||||
->label('ZMM OPERATING TEMPERATURE')
|
||||
->alignCenter()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('zmm_axial_force')
|
||||
->label('ZMM AXIAL FORCE')
|
||||
->alignCenter()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('winded_serial_number')
|
||||
->label('WINDED SERIAL NUMBER')
|
||||
->alignCenter()
|
||||
|
||||
@@ -23,6 +23,10 @@ use Filament\Tables\Filters\Filter;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\DateTimePicker;
|
||||
use Str;
|
||||
use Filament\Tables\Actions\ExportAction;
|
||||
use Filament\Tables\Actions\ImportAction;
|
||||
use App\Filament\Exports\WireMasterPackingExporter;
|
||||
use App\Filament\Imports\WireMasterPackingImporter;
|
||||
|
||||
class WireMasterPackingResource extends Resource
|
||||
{
|
||||
@@ -61,9 +65,14 @@ class WireMasterPackingResource extends Resource
|
||||
return [];
|
||||
}
|
||||
|
||||
return CustomerPoMaster::where('plant_id', $plantId)->pluck('customer_po', 'id');
|
||||
// return CustomerPoMaster::where('plant_id', $plantId)->pluck('customer_po', 'id');
|
||||
return CustomerPoMaster::where('plant_id', $plantId)->distinct()->pluck('customer_po', 'customer_po');
|
||||
|
||||
})
|
||||
->required(),
|
||||
->required()
|
||||
->afterStateUpdated(function ($state, callable $set) {
|
||||
$set('wire_packing_number', null);
|
||||
}),
|
||||
Forms\Components\TextInput::make('wire_packing_number')
|
||||
->label('Scan Wire Packing No')
|
||||
->reactive()
|
||||
@@ -160,13 +169,19 @@ class WireMasterPackingResource extends Resource
|
||||
->options(function ($get) {
|
||||
|
||||
$plantId = $get('plant_id');
|
||||
$customerPo = $get('customer_po_master_id');
|
||||
|
||||
if (! $plantId) {
|
||||
if (!$plantId || !$customerPo) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$customerPoIds = CustomerPoMaster::where('plant_id', $plantId)
|
||||
->where('customer_po', $customerPo)
|
||||
->pluck('id');
|
||||
|
||||
return WireMasterPacking::query()
|
||||
->where('plant_id', $plantId)
|
||||
->whereIn('customer_po_master_id', $customerPoIds)
|
||||
->where(function ($query) {
|
||||
$query->whereNull('wire_packing_status')
|
||||
->orWhere('wire_packing_status', '');
|
||||
@@ -468,6 +483,22 @@ class WireMasterPackingResource extends Resource
|
||||
Tables\Actions\ForceDeleteBulkAction::make(),
|
||||
Tables\Actions\RestoreBulkAction::make(),
|
||||
]),
|
||||
])
|
||||
->headerActions([
|
||||
ImportAction::make()
|
||||
->label('Import Wire Packing Master')
|
||||
->color('warning')
|
||||
->importer(WireMasterPackingImporter::class)
|
||||
->visible(function () {
|
||||
return Filament::auth()->user()->can('view import wire packing master');
|
||||
}),
|
||||
ExportAction::make()
|
||||
->label('Export Wire Packing Master')
|
||||
->color('warning')
|
||||
->exporter(WireMasterPackingExporter::class)
|
||||
->visible(function () {
|
||||
return Filament::auth()->user()->can('view export wire packing master');
|
||||
}),
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -164,10 +164,6 @@ class CreateWireMasterPacking extends CreateRecord
|
||||
return;
|
||||
}
|
||||
|
||||
$itemId = Item::where('code', $materialCode)
|
||||
->where('plant_id', $plantId)
|
||||
->value('id');
|
||||
|
||||
$icodeAgaCPoPlant = CustomerPoMaster::where('item_id', $itemId)->where('plant_id', $plantId)->first();
|
||||
|
||||
if(!$icodeAgaCPoPlant)
|
||||
@@ -214,23 +210,24 @@ class CreateWireMasterPacking extends CreateRecord
|
||||
return;
|
||||
}
|
||||
|
||||
$customerPoRecord = CustomerPoMaster::where('id', $customerPo)
|
||||
$customerPoRecord = CustomerPoMaster::where('customer_po', $customerPo)
|
||||
->where('plant_id', $plantId)
|
||||
->where('item_id', $itemId)
|
||||
->first();
|
||||
|
||||
$customerPoName = $customerPoRecord->customer_po;
|
||||
// $customerPoName = $customerPoRecord->customer_po;
|
||||
|
||||
if ($customerPoRecord) {
|
||||
$customerPoName = $customerPoRecord->customer_po;
|
||||
} else {
|
||||
$customerPoName = null;
|
||||
}
|
||||
// if ($customerPoRecord) {
|
||||
// $customerPoName = $customerPoRecord->customer_po;
|
||||
// } else {
|
||||
// $customerPoName = null;
|
||||
// }
|
||||
|
||||
if(!$customerPoRecord)
|
||||
{
|
||||
Notification::make()
|
||||
->title("PO Not Found")
|
||||
->body("Customer PO '$customerPoName' for Item '$materialCode' not found against Plant '$plantcode'")
|
||||
->body("Customer PO '$customerPoRecord->customer_po' for Item '$materialCode' not found against Plant '$plantcode'")
|
||||
->danger()
|
||||
->duration(5000)
|
||||
->send();
|
||||
@@ -247,7 +244,7 @@ class CreateWireMasterPacking extends CreateRecord
|
||||
return;
|
||||
}
|
||||
|
||||
$alreadyScannedQty = WireMasterPacking::where('customer_po_master_id', $customerPo)
|
||||
$alreadyScannedQty = WireMasterPacking::where('customer_po_master_id', $customerPoRecord->id)
|
||||
->where('plant_id', $plantId)
|
||||
->where('item_id', $itemId)
|
||||
->selectRaw('SUM(CAST(weight AS NUMERIC)) as total_weight')
|
||||
@@ -259,7 +256,7 @@ class CreateWireMasterPacking extends CreateRecord
|
||||
{
|
||||
Notification::make()
|
||||
->title("Scanned Weight Exceeds PO Quantity")
|
||||
->body("Scanned weight '$weight' and already scanned weight '$alreadyScannedQty' exceeds allowed quantity '{$customerPoRecord->quantity}' for PO '$customerPoName' and Item '$materialCode'")
|
||||
->body("Scanned weight '$weight' and already scanned weight '$alreadyScannedQty' exceeds allowed quantity '{$customerPoRecord->quantity}' for PO '$customerPoRecord->customer_po' and Item '$materialCode'")
|
||||
->danger()
|
||||
->duration(5000)
|
||||
->send();
|
||||
@@ -268,6 +265,7 @@ class CreateWireMasterPacking extends CreateRecord
|
||||
'process_order' => null,
|
||||
'plant_id' => $plantId,
|
||||
'customer_po_master_id' => $customerPo,
|
||||
'item_id' => $itemId,
|
||||
'wire_packing_number' => $wirePackNo,
|
||||
'Sno_quantity' => 0,
|
||||
'created_by' => $operatorName,
|
||||
@@ -294,7 +292,7 @@ class CreateWireMasterPacking extends CreateRecord
|
||||
'item_id' => $itemId,
|
||||
'wire_packing_number' => $wirePackNo,
|
||||
'process_order' => $processOrderId . '-' . $coilNo,
|
||||
'customer_po_master_id' => $customerPo,
|
||||
'customer_po_master_id' => $customerPoRecord->id,
|
||||
'weight' => $weight,
|
||||
'created_by' => $createdBy,
|
||||
'scanned_by' => $operatorName,
|
||||
@@ -314,6 +312,7 @@ class CreateWireMasterPacking extends CreateRecord
|
||||
$this->form->fill([
|
||||
'plant_id' => $plantId,
|
||||
'customer_po_master_id' => $customerPo,
|
||||
'item_id' => $itemId,
|
||||
'wire_packing_number' => $wirePackNo,
|
||||
'process_order' => null,
|
||||
// 'pending_pallet_list' => $pendingPallet,
|
||||
@@ -334,6 +333,7 @@ class CreateWireMasterPacking extends CreateRecord
|
||||
$this->form->fill([
|
||||
'plant_id' => $plantId,
|
||||
'customer_po_master_id' => $customerPo,
|
||||
'item_id' => $itemId,
|
||||
'wire_packing_number' => $wirePackNo,
|
||||
'process_order' => null,
|
||||
// 'pending_pallet_list' => $pendingPallet,
|
||||
|
||||
@@ -5,6 +5,7 @@ namespace App\Filament\Resources;
|
||||
use App\Filament\Exports\WorkGroupMasterExporter;
|
||||
use App\Filament\Imports\WorkGroupMasterImporter;
|
||||
use App\Filament\Resources\WorkGroupMasterResource\Pages;
|
||||
use App\Models\Line;
|
||||
use App\Models\Plant;
|
||||
use App\Models\WorkGroupMaster;
|
||||
use Filament\Facades\Filament;
|
||||
@@ -20,6 +21,11 @@ use Filament\Tables\Table;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
use Illuminate\Validation\Rule;
|
||||
use Filament\Forms\Components\DateTimePicker;
|
||||
use Filament\Forms\Components\FileUpload;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Tables\Filters\Filter;
|
||||
|
||||
class WorkGroupMasterResource extends Resource
|
||||
{
|
||||
@@ -166,7 +172,144 @@ class WorkGroupMasterResource extends Resource
|
||||
])
|
||||
->filters([
|
||||
Tables\Filters\TrashedFilter::make(),
|
||||
Filter::make('advanced_filters')
|
||||
->label('Advanced Filters')
|
||||
->form([
|
||||
Select::make('Plant')
|
||||
->label('Search by Plant Name')
|
||||
->nullable()
|
||||
->options(function (callable $get) {
|
||||
$userHas = Filament::auth()->user()->plant_id;
|
||||
|
||||
// return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::orderBy('code')->pluck('name', 'id')->toArray();
|
||||
if ($userHas && strlen($userHas) > 0) {
|
||||
return Plant::where('id', $userHas)->pluck('name', 'id')->toArray();
|
||||
} else {
|
||||
return Plant::whereHas('workGroupMasters', function ($query) {
|
||||
$query->whereNotNull('id');
|
||||
})->orderBy('code')->pluck('name', 'id')->toArray();
|
||||
}
|
||||
})
|
||||
->searchable()
|
||||
->reactive()
|
||||
->afterStateUpdated(function ($state, callable $set, callable $get): void {
|
||||
$set('code', null);
|
||||
$set('operator_id', null);
|
||||
}),
|
||||
Select::make('name')
|
||||
->label('Search by Work Group Center')
|
||||
->searchable()
|
||||
->options(function (callable $get) {
|
||||
$plantId = $get('Plant');
|
||||
|
||||
if(!$plantId){
|
||||
return [];
|
||||
}
|
||||
else{
|
||||
return $plantId ? WorkGroupMaster::where('plant_id', $plantId)->distinct()->pluck('name', 'name')->toArray(): [];
|
||||
}
|
||||
})
|
||||
->searchable()
|
||||
->reactive(),
|
||||
TextInput::make('description')
|
||||
->label('Description')
|
||||
->reactive(),
|
||||
TextInput::make('operation_number')
|
||||
->label('Operation Number')
|
||||
->reactive(),
|
||||
DateTimePicker::make(name: 'created_from')
|
||||
->label('Created From')
|
||||
->placeholder(placeholder: 'Select From DateTime')
|
||||
->reactive()
|
||||
->native(false),
|
||||
DateTimePicker::make('created_to')
|
||||
->label('Created To')
|
||||
->placeholder(placeholder: 'Select To DateTime')
|
||||
->reactive()
|
||||
->native(false),
|
||||
])
|
||||
->query(function ($query, array $data) {
|
||||
// Hide all records initially if no filters are applied
|
||||
if (empty($data['Plant']) && empty($data['name']) && empty($data['description']) && empty($data['operation_number']) && empty($data['created_from']) && empty($data['created_to']) && empty($data['updated_from']) && empty($data['updated_to'])) {
|
||||
// return $query->whereRaw('1 = 0');
|
||||
}
|
||||
|
||||
if (! empty($data['Plant'])) { // $plant = $data['Plant'] ?? null
|
||||
$query->where('plant_id', $data['Plant']);
|
||||
} else {
|
||||
$userHas = Filament::auth()->user()->plant_id;
|
||||
|
||||
if ($userHas && strlen($userHas) > 0) {
|
||||
return $query->whereRaw('1 = 0');
|
||||
}
|
||||
}
|
||||
|
||||
if (! empty($data['name'])) {
|
||||
$query->where('name', $data['name']);
|
||||
}
|
||||
|
||||
if (! empty($data['description'])) {
|
||||
$query->where('description', $data['description']);
|
||||
}
|
||||
|
||||
if (! empty($data['operation_number'])) {
|
||||
$query->where('operation_number', $data['operation_number']);
|
||||
}
|
||||
|
||||
if (! empty($data['created_from'])) {
|
||||
$query->where('created_at', '>=', $data['created_from']);
|
||||
}
|
||||
|
||||
if (! empty($data['created_to'])) {
|
||||
$query->where('created_at', '<=', $data['created_to']);
|
||||
}
|
||||
|
||||
})
|
||||
->indicateUsing(function (array $data) {
|
||||
$indicators = [];
|
||||
|
||||
if (! empty($data['Plant'])) {
|
||||
$indicators[] = 'Plant: '.Plant::where('id', $data['Plant'])->value('name');
|
||||
} else {
|
||||
$userHas = Filament::auth()->user()->plant_id;
|
||||
|
||||
if ($userHas && strlen($userHas) > 0) {
|
||||
return 'Plant: Choose plant to filter records.';
|
||||
}
|
||||
}
|
||||
|
||||
if (! empty($data['name'])) {
|
||||
$indicators[] = 'Work Group Name: ' . $data['name'];
|
||||
}
|
||||
|
||||
if (! empty($data['description'])) {
|
||||
$indicators[] = 'Description: ' . $data['description'];
|
||||
}
|
||||
|
||||
if (! empty($data['operation_number'])) {
|
||||
$indicators[] = 'Operation Number: ' . $data['operation_number'];
|
||||
}
|
||||
|
||||
if (! empty($data['created_from'])) {
|
||||
$indicators[] = 'From: '.$data['created_from'];
|
||||
}
|
||||
|
||||
if (! empty($data['created_to'])) {
|
||||
$indicators[] = 'To: '.$data['created_to'];
|
||||
}
|
||||
|
||||
if (! empty($data['updated_from'])) {
|
||||
$indicators[] = 'From: '.$data['updated_from'];
|
||||
}
|
||||
|
||||
if (! empty($data['updated_to'])) {
|
||||
$indicators[] = 'To: '.$data['updated_to'];
|
||||
}
|
||||
|
||||
return $indicators;
|
||||
}),
|
||||
])
|
||||
->filtersFormMaxHeight('280px')
|
||||
->actions([
|
||||
Tables\Actions\ViewAction::make(),
|
||||
Tables\Actions\EditAction::make(),
|
||||
|
||||
@@ -1286,9 +1286,9 @@ class CharacteristicsController extends Controller
|
||||
], 404);
|
||||
}
|
||||
|
||||
$machineId = $machine->id;
|
||||
$machineId = $machine->id; //
|
||||
|
||||
$availFields = ['class', 'arbid', 'gamng', 'lmnga', 'zz1_cn_bill_ord', 'zmm_amps', 'zmm_brand', 'zmm_degreeofprotection', 'zmm_delivery', 'zmm_dir_rot', 'zmm_discharge', 'zmm_discharge_max', 'zmm_discharge_min', 'zmm_duty', 'zmm_eff_motor', 'zmm_eff_pump', 'zmm_frequency', 'zmm_head', 'zmm_heading', 'zmm_head_max', 'zmm_head_minimum', 'zmm_idx_eff_mtr', 'zmm_idx_eff_pump', 'zmm_kvacode', 'zmm_maxambtemp', 'zmm_mincoolingflow', 'zmm_motorseries', 'zmm_motor_model', 'zmm_outlet', 'zmm_phase', 'zmm_pressure', 'zmm_pumpflowtype', 'zmm_pumpseries', 'zmm_pump_model', 'zmm_ratedpower', 'zmm_region', 'zmm_servicefactor', 'zmm_servicefactormaximumamps', 'zmm_speed', 'zmm_suction', 'zmm_suctionxdelivery', 'zmm_supplysource', 'zmm_temperature', 'zmm_thrustload', 'zmm_volts', 'zmm_wire', 'zmm_package', 'zmm_pvarrayrating', 'zmm_isi', 'zmm_isimotor', 'zmm_isipump', 'zmm_isipumpset', 'zmm_pumpset_model', 'zmm_stages', 'zmm_headrange', 'zmm_overall_efficiency', 'zmm_connection', 'zmm_min_bore_size', 'zmm_isireference', 'zmm_category', 'zmm_submergence', 'zmm_capacitorstart', 'zmm_capacitorrun', 'zmm_inch', 'zmm_motor_type', 'zmm_dismantle_direction', 'zmm_eff_ovrall', 'zmm_bodymoc', 'zmm_rotormoc', 'zmm_dlwl', 'zmm_inputpower', 'zmm_imp_od', 'zmm_ambtemp', 'zmm_de', 'zmm_dischargerange', 'zmm_efficiency_class', 'zmm_framesize', 'zmm_impellerdiameter', 'zmm_insulationclass', 'zmm_maxflow', 'zmm_minhead', 'zmm_mtrlofconst', 'zmm_nde', 'zmm_powerfactor', 'zmm_tagno', 'zmm_year', 'zmm_laser_name', 'zmm_logo_cp', 'zmm_logo_ce', 'zmm_logo_nsf', 'zmm_logo_eac', 'zmm_grwt_motor', 'zmm_grwt_pump', 'zmm_grwt_pset', 'zmm_grwt_cable', 'zmm_grwt_pf', 'zmm_newt_motor', 'zmm_newt_pump', 'zmm_newt_pset', 'zmm_newt_cable', 'zmm_newt_pf', 'zmm_operating_range', 'zmm_intake_air', 'zmm_oxygen_transfer_rate', 'zmm_air_inlet_pipesize', 'zmm_sump_depth', 'zmm_poles', 'zmm_motor_heading', 'zmm_motor_speed', 'zmm_beenote', 'zmm_beenumber', 'zmm_beestar', 'zmm_eff_ttl', 'zmm_labelperiod', 'zmm_modelyear', 'zmm_performance_factor', 'zqmm_qty', 'zmm_operating_temperature', 'zmm_codeclass', 'zmm_colour', 'zmm_grade', 'zmm_isivalve', 'zmm_isi_wc', 'zmm_length', 'zmm_license_cml_no', 'zmm_mfgmonyr', 'zmm_motoridentification', 'zmm_packtype', 'zmm_panel', 'zmm_pumpidentification', 'zmm_psettype', 'zmm_size', 'zmm_type', 'zmm_usp', 'marked_datetime', 'marked_by', 'motor_pump_pumpset_status', 'motor_machine_name', 'pump_machine_name', 'name_plate_machine_name', 'pending_released_status', 'has_work_flow_id']; // 'mark_status','marked_physical_count', 'marked_expected_time', 'man_marked_status', 'man_marked_datetime', 'man_marked_by', 'motor_marked_status', 'motor_marked_physical_count', 'motor_expected_time', 'motor_marked_by', 'pump_marked_status', 'pump_marked_physical_count', 'pump_expected_time', 'pump_marked_by', 'name_plate_marked_status', 'name_plate_expected_time', 'name_plate_marked_by', 'winded_serial_number', 'part_validation_1', 'part_validation_2', 'samlight_logged_name'
|
||||
$availFields = ['class', 'arbid', 'gamng', 'lmnga', 'zz1_cn_bill_ord', 'zmm_amps', 'zmm_brand', 'zmm_degreeofprotection', 'zmm_delivery', 'zmm_dir_rot', 'zmm_discharge', 'zmm_discharge_max', 'zmm_discharge_min', 'zmm_duty', 'zmm_eff_motor', 'zmm_eff_pump', 'zmm_frequency', 'zmm_head', 'zmm_heading', 'zmm_head_max', 'zmm_head_minimum', 'zmm_idx_eff_mtr', 'zmm_idx_eff_pump', 'zmm_kvacode', 'zmm_maxambtemp', 'zmm_mincoolingflow', 'zmm_motorseries', 'zmm_motor_model', 'zmm_outlet', 'zmm_phase', 'zmm_pressure', 'zmm_pumpflowtype', 'zmm_pumpseries', 'zmm_pump_model', 'zmm_ratedpower', 'zmm_region', 'zmm_servicefactor', 'zmm_servicefactormaximumamps', 'zmm_speed', 'zmm_suction', 'zmm_suctionxdelivery', 'zmm_supplysource', 'zmm_temperature', 'zmm_thrustload', 'zmm_volts', 'zmm_wire', 'zmm_package', 'zmm_pvarrayrating', 'zmm_isi', 'zmm_isimotor', 'zmm_isipump', 'zmm_isipumpset', 'zmm_pumpset_model', 'zmm_stages', 'zmm_headrange', 'zmm_overall_efficiency', 'zmm_connection', 'zmm_min_bore_size', 'zmm_isireference', 'zmm_category', 'zmm_submergence', 'zmm_capacitorstart', 'zmm_capacitorrun', 'zmm_inch', 'zmm_motor_type', 'zmm_dismantle_direction', 'zmm_eff_ovrall', 'zmm_bodymoc', 'zmm_rotormoc', 'zmm_dlwl', 'zmm_inputpower', 'zmm_imp_od', 'zmm_ambtemp', 'zmm_de', 'zmm_dischargerange', 'zmm_efficiency_class', 'zmm_framesize', 'zmm_impellerdiameter', 'zmm_insulationclass', 'zmm_maxflow', 'zmm_minhead', 'zmm_mtrlofconst', 'zmm_nde', 'zmm_powerfactor', 'zmm_tagno', 'zmm_year', 'zmm_laser_name', 'zmm_logo_cp', 'zmm_logo_ce', 'zmm_logo_nsf', 'zmm_logo_eac', 'zmm_grwt_motor', 'zmm_grwt_pump', 'zmm_grwt_pset', 'zmm_grwt_cable', 'zmm_grwt_pf', 'zmm_newt_motor', 'zmm_newt_pump', 'zmm_newt_pset', 'zmm_newt_cable', 'zmm_newt_pf', 'zmm_operating_range', 'zmm_intake_air', 'zmm_oxygen_transfer_rate', 'zmm_air_inlet_pipesize', 'zmm_sump_depth', 'zmm_poles', 'zmm_motor_heading', 'zmm_motor_speed', 'zmm_beenote', 'zmm_beenumber', 'zmm_beestar', 'zmm_eff_ttl', 'zmm_labelperiod', 'zmm_modelyear', 'zmm_performance_factor', 'zqmm_qty', 'zmm_operating_temperature', 'zmm_axial_force', 'zmm_codeclass', 'zmm_colour', 'zmm_grade', 'zmm_isivalve', 'zmm_isi_wc', 'zmm_length', 'zmm_license_cml_no', 'zmm_mfgmonyr', 'zmm_motoridentification', 'zmm_packtype', 'zmm_panel', 'zmm_pumpidentification', 'zmm_psettype', 'zmm_size', 'zmm_type', 'zmm_usp', 'marked_datetime', 'marked_by', 'motor_pump_pumpset_status', 'motor_machine_name', 'pump_machine_name', 'name_plate_machine_name', 'pending_released_status', 'has_work_flow_id']; // 'mark_status','marked_physical_count', 'marked_expected_time', 'man_marked_status', 'man_marked_datetime', 'man_marked_by', 'motor_marked_status', 'motor_marked_physical_count', 'motor_expected_time', 'motor_marked_by', 'pump_marked_status', 'pump_marked_physical_count', 'pump_expected_time', 'pump_marked_by', 'name_plate_marked_status', 'name_plate_expected_time', 'name_plate_marked_by', 'winded_serial_number', 'part_validation_1', 'part_validation_2', 'samlight_logged_name'
|
||||
|
||||
if ($itemCode != '' && $itemCode != null && $itemCode && Str::length($itemCode) > 0) {
|
||||
$existingJobNo = ClassCharacteristic::where('aufnr', $jobNo)->first(); // ->where('machine_id', $machineId)->where('plant_id', $plantId)
|
||||
@@ -1845,7 +1845,7 @@ class CharacteristicsController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
$masterFields = ['class', 'arbid', 'gamng', 'lmnga', 'zz1_cn_bill_ord', 'zmm_amps', 'zmm_brand', 'zmm_degreeofprotection', 'zmm_delivery', 'zmm_dir_rot', 'zmm_discharge', 'zmm_discharge_max', 'zmm_discharge_min', 'zmm_duty', 'zmm_eff_motor', 'zmm_eff_pump', 'zmm_frequency', 'zmm_head', 'zmm_heading', 'zmm_head_max', 'zmm_head_minimum', 'zmm_idx_eff_mtr', 'zmm_idx_eff_pump', 'zmm_kvacode', 'zmm_maxambtemp', 'zmm_mincoolingflow', 'zmm_motorseries', 'zmm_motor_model', 'zmm_outlet', 'zmm_phase', 'zmm_pressure', 'zmm_pumpflowtype', 'zmm_pumpseries', 'zmm_pump_model', 'zmm_ratedpower', 'zmm_region', 'zmm_servicefactor', 'zmm_servicefactormaximumamps', 'zmm_speed', 'zmm_suction', 'zmm_suctionxdelivery', 'zmm_supplysource', 'zmm_temperature', 'zmm_thrustload', 'zmm_volts', 'zmm_wire', 'zmm_package', 'zmm_pvarrayrating', 'zmm_isi', 'zmm_isimotor', 'zmm_isipump', 'zmm_isipumpset', 'zmm_pumpset_model', 'zmm_stages', 'zmm_headrange', 'zmm_overall_efficiency', 'zmm_connection', 'zmm_min_bore_size', 'zmm_isireference', 'zmm_category', 'zmm_submergence', 'zmm_capacitorstart', 'zmm_capacitorrun', 'zmm_inch', 'zmm_motor_type', 'zmm_dismantle_direction', 'zmm_eff_ovrall', 'zmm_bodymoc', 'zmm_rotormoc', 'zmm_dlwl', 'zmm_inputpower', 'zmm_imp_od', 'zmm_ambtemp', 'zmm_de', 'zmm_dischargerange', 'zmm_efficiency_class', 'zmm_framesize', 'zmm_impellerdiameter', 'zmm_insulationclass', 'zmm_maxflow', 'zmm_minhead', 'zmm_mtrlofconst', 'zmm_nde', 'zmm_powerfactor', 'zmm_tagno', 'zmm_year', 'zmm_laser_name', 'zmm_logo_cp', 'zmm_logo_ce', 'zmm_logo_nsf', 'zmm_logo_eac', 'zmm_grwt_motor', 'zmm_grwt_pump', 'zmm_grwt_pset', 'zmm_newt_motor', 'zmm_newt_pump', 'zmm_newt_pset', 'zmm_operating_range', 'zmm_intake_air', 'zmm_oxygen_transfer_rate', 'zmm_air_inlet_pipesize', 'zmm_sump_depth', 'zmm_poles', 'zmm_motor_heading', 'zmm_motor_speed', 'zmm_beenote', 'zmm_beenumber', 'zmm_beestar', 'zmm_eff_ttl', 'zmm_labelperiod', 'zmm_modelyear', 'zmm_performance_factor', 'zqmm_qty', 'zmm_operating_temperature', 'pending_released_status'];
|
||||
$masterFields = ['class', 'arbid', 'gamng', 'lmnga', 'zz1_cn_bill_ord', 'zmm_amps', 'zmm_brand', 'zmm_degreeofprotection', 'zmm_delivery', 'zmm_dir_rot', 'zmm_discharge', 'zmm_discharge_max', 'zmm_discharge_min', 'zmm_duty', 'zmm_eff_motor', 'zmm_eff_pump', 'zmm_frequency', 'zmm_head', 'zmm_heading', 'zmm_head_max', 'zmm_head_minimum', 'zmm_idx_eff_mtr', 'zmm_idx_eff_pump', 'zmm_kvacode', 'zmm_maxambtemp', 'zmm_mincoolingflow', 'zmm_motorseries', 'zmm_motor_model', 'zmm_outlet', 'zmm_phase', 'zmm_pressure', 'zmm_pumpflowtype', 'zmm_pumpseries', 'zmm_pump_model', 'zmm_ratedpower', 'zmm_region', 'zmm_servicefactor', 'zmm_servicefactormaximumamps', 'zmm_speed', 'zmm_suction', 'zmm_suctionxdelivery', 'zmm_supplysource', 'zmm_temperature', 'zmm_thrustload', 'zmm_volts', 'zmm_wire', 'zmm_package', 'zmm_pvarrayrating', 'zmm_isi', 'zmm_isimotor', 'zmm_isipump', 'zmm_isipumpset', 'zmm_pumpset_model', 'zmm_stages', 'zmm_headrange', 'zmm_overall_efficiency', 'zmm_connection', 'zmm_min_bore_size', 'zmm_isireference', 'zmm_category', 'zmm_submergence', 'zmm_capacitorstart', 'zmm_capacitorrun', 'zmm_inch', 'zmm_motor_type', 'zmm_dismantle_direction', 'zmm_eff_ovrall', 'zmm_bodymoc', 'zmm_rotormoc', 'zmm_dlwl', 'zmm_inputpower', 'zmm_imp_od', 'zmm_ambtemp', 'zmm_de', 'zmm_dischargerange', 'zmm_efficiency_class', 'zmm_framesize', 'zmm_impellerdiameter', 'zmm_insulationclass', 'zmm_maxflow', 'zmm_minhead', 'zmm_mtrlofconst', 'zmm_nde', 'zmm_powerfactor', 'zmm_tagno', 'zmm_year', 'zmm_laser_name', 'zmm_logo_cp', 'zmm_logo_ce', 'zmm_logo_nsf', 'zmm_logo_eac', 'zmm_grwt_motor', 'zmm_grwt_pump', 'zmm_grwt_pset', 'zmm_newt_motor', 'zmm_newt_pump', 'zmm_newt_pset', 'zmm_operating_range', 'zmm_intake_air', 'zmm_oxygen_transfer_rate', 'zmm_air_inlet_pipesize', 'zmm_sump_depth', 'zmm_poles', 'zmm_motor_heading', 'zmm_motor_speed', 'zmm_beenote', 'zmm_beenumber', 'zmm_beestar', 'zmm_eff_ttl', 'zmm_labelperiod', 'zmm_modelyear', 'zmm_performance_factor', 'zqmm_qty', 'zmm_operating_temperature', 'zmm_axial_force', 'pending_released_status'];
|
||||
|
||||
$isInsertOrUpdate = false;
|
||||
|
||||
@@ -2175,7 +2175,7 @@ class CharacteristicsController extends Controller
|
||||
|
||||
$columnsToShow = ['mark_status', 'marked_datetime', 'marked_physical_count', 'marked_expected_time', 'marked_by', 'man_marked_status', 'man_marked_datetime', 'man_marked_by', 'motor_marked_status', 'motor_marked_physical_count', 'motor_expected_time', 'motor_marked_by', 'pump_marked_status', 'pump_marked_physical_count', 'pump_expected_time', 'pump_marked_by', 'name_plate_marked_status', 'name_plate_expected_time', 'name_plate_marked_by', 'motor_pump_pumpset_status', 'winded_serial_number', 'motor_machine_name', 'pump_machine_name', 'name_plate_machine_name', 'part_validation_1', 'part_validation_2', 'samlight_logged_name', 'pending_released_status', 'has_work_flow_id'];
|
||||
|
||||
$characteristicsColumns = ['class', 'arbid', 'gamng', 'lmnga', 'zz1_cn_bill_ord', 'zmm_amps', 'zmm_brand', 'zmm_degreeofprotection', 'zmm_delivery', 'zmm_dir_rot', 'zmm_discharge', 'zmm_discharge_max', 'zmm_discharge_min', 'zmm_duty', 'zmm_eff_motor', 'zmm_eff_pump', 'zmm_frequency', 'zmm_head', 'zmm_heading', 'zmm_head_max', 'zmm_head_minimum', 'zmm_idx_eff_mtr', 'zmm_idx_eff_pump', 'zmm_kvacode', 'zmm_maxambtemp', 'zmm_mincoolingflow', 'zmm_motorseries', 'zmm_motor_model', 'zmm_outlet', 'zmm_phase', 'zmm_pressure', 'zmm_pumpflowtype', 'zmm_pumpseries', 'zmm_pump_model', 'zmm_ratedpower', 'zmm_region', 'zmm_servicefactor', 'zmm_servicefactormaximumamps', 'zmm_speed', 'zmm_suction', 'zmm_suctionxdelivery', 'zmm_supplysource', 'zmm_temperature', 'zmm_thrustload', 'zmm_volts', 'zmm_wire', 'zmm_package', 'zmm_pvarrayrating', 'zmm_isi', 'zmm_isimotor', 'zmm_isipump', 'zmm_isipumpset', 'zmm_pumpset_model', 'zmm_stages', 'zmm_headrange', 'zmm_overall_efficiency', 'zmm_connection', 'zmm_min_bore_size', 'zmm_isireference', 'zmm_category', 'zmm_submergence', 'zmm_capacitorstart', 'zmm_capacitorrun', 'zmm_inch', 'zmm_motor_type', 'zmm_dismantle_direction', 'zmm_eff_ovrall', 'zmm_bodymoc', 'zmm_rotormoc', 'zmm_dlwl', 'zmm_inputpower', 'zmm_imp_od', 'zmm_ambtemp', 'zmm_de', 'zmm_dischargerange', 'zmm_efficiency_class', 'zmm_framesize', 'zmm_impellerdiameter', 'zmm_insulationclass', 'zmm_maxflow', 'zmm_minhead', 'zmm_mtrlofconst', 'zmm_nde', 'zmm_powerfactor', 'zmm_tagno', 'zmm_year', 'zmm_laser_name', 'zmm_logo_cp', 'zmm_logo_ce', 'zmm_logo_nsf', 'zmm_logo_eac', 'zmm_grwt_motor', 'zmm_grwt_pump', 'zmm_grwt_pset', 'zmm_newt_motor', 'zmm_newt_pump', 'zmm_newt_pset', 'zmm_operating_range', 'zmm_intake_air', 'zmm_oxygen_transfer_rate', 'zmm_air_inlet_pipesize', 'zmm_sump_depth', 'zmm_poles', 'zmm_motor_heading', 'zmm_motor_speed', 'zmm_beenote', 'zmm_beenumber', 'zmm_beestar', 'zmm_eff_ttl', 'zmm_labelperiod', 'zmm_modelyear', 'zmm_performance_factor', 'zqmm_qty', 'zmm_operating_temperature'];
|
||||
$characteristicsColumns = ['class', 'arbid', 'gamng', 'lmnga', 'zz1_cn_bill_ord', 'zmm_amps', 'zmm_brand', 'zmm_degreeofprotection', 'zmm_delivery', 'zmm_dir_rot', 'zmm_discharge', 'zmm_discharge_max', 'zmm_discharge_min', 'zmm_duty', 'zmm_eff_motor', 'zmm_eff_pump', 'zmm_frequency', 'zmm_head', 'zmm_heading', 'zmm_head_max', 'zmm_head_minimum', 'zmm_idx_eff_mtr', 'zmm_idx_eff_pump', 'zmm_kvacode', 'zmm_maxambtemp', 'zmm_mincoolingflow', 'zmm_motorseries', 'zmm_motor_model', 'zmm_outlet', 'zmm_phase', 'zmm_pressure', 'zmm_pumpflowtype', 'zmm_pumpseries', 'zmm_pump_model', 'zmm_ratedpower', 'zmm_region', 'zmm_servicefactor', 'zmm_servicefactormaximumamps', 'zmm_speed', 'zmm_suction', 'zmm_suctionxdelivery', 'zmm_supplysource', 'zmm_temperature', 'zmm_thrustload', 'zmm_volts', 'zmm_wire', 'zmm_package', 'zmm_pvarrayrating', 'zmm_isi', 'zmm_isimotor', 'zmm_isipump', 'zmm_isipumpset', 'zmm_pumpset_model', 'zmm_stages', 'zmm_headrange', 'zmm_overall_efficiency', 'zmm_connection', 'zmm_min_bore_size', 'zmm_isireference', 'zmm_category', 'zmm_submergence', 'zmm_capacitorstart', 'zmm_capacitorrun', 'zmm_inch', 'zmm_motor_type', 'zmm_dismantle_direction', 'zmm_eff_ovrall', 'zmm_bodymoc', 'zmm_rotormoc', 'zmm_dlwl', 'zmm_inputpower', 'zmm_imp_od', 'zmm_ambtemp', 'zmm_de', 'zmm_dischargerange', 'zmm_efficiency_class', 'zmm_framesize', 'zmm_impellerdiameter', 'zmm_insulationclass', 'zmm_maxflow', 'zmm_minhead', 'zmm_mtrlofconst', 'zmm_nde', 'zmm_powerfactor', 'zmm_tagno', 'zmm_year', 'zmm_laser_name', 'zmm_logo_cp', 'zmm_logo_ce', 'zmm_logo_nsf', 'zmm_logo_eac', 'zmm_grwt_motor', 'zmm_grwt_pump', 'zmm_grwt_pset', 'zmm_newt_motor', 'zmm_newt_pump', 'zmm_newt_pset', 'zmm_operating_range', 'zmm_intake_air', 'zmm_oxygen_transfer_rate', 'zmm_air_inlet_pipesize', 'zmm_sump_depth', 'zmm_poles', 'zmm_motor_heading', 'zmm_motor_speed', 'zmm_beenote', 'zmm_beenumber', 'zmm_beestar', 'zmm_eff_ttl', 'zmm_labelperiod', 'zmm_modelyear', 'zmm_performance_factor', 'zqmm_qty', 'zmm_operating_temperature', 'zmm_axial_force'];
|
||||
|
||||
$characteristicsData = ClassCharacteristic::where('aufnr', $jobNumber)->where('machine_id', $machineId)->where('plant_id', $plantId)->distinct()->get($characteristicsColumns); // ->get();
|
||||
|
||||
@@ -2709,7 +2709,7 @@ class CharacteristicsController extends Controller
|
||||
|
||||
// $columnsToShow = ['mark_status', 'marked_datetime', 'marked_physical_count', 'marked_expected_time', 'marked_by', 'man_marked_status', 'man_marked_datetime', 'man_marked_by', 'motor_marked_status', 'motor_marked_physical_count', 'motor_expected_time', 'motor_marked_by', 'pump_marked_status', 'pump_marked_physical_count', 'pump_expected_time', 'pump_marked_by', 'name_plate_marked_status', 'name_plate_expected_time', 'name_plate_marked_by', 'motor_pump_pumpset_status', 'winded_serial_number', 'motor_machine_name', 'pump_machine_name', 'name_plate_machine_name', 'part_validation_1', 'part_validation_2', 'samlight_logged_name', 'pending_released_status', 'has_work_flow_id'];
|
||||
|
||||
$characteristicsColumns = ['class', 'arbid', 'gamng', 'lmnga', 'zz1_cn_bill_ord', 'zmm_amps', 'zmm_brand', 'zmm_degreeofprotection', 'zmm_delivery', 'zmm_dir_rot', 'zmm_discharge', 'zmm_discharge_max', 'zmm_discharge_min', 'zmm_duty', 'zmm_eff_motor', 'zmm_eff_pump', 'zmm_frequency', 'zmm_head', 'zmm_heading', 'zmm_head_max', 'zmm_head_minimum', 'zmm_idx_eff_mtr', 'zmm_idx_eff_pump', 'zmm_kvacode', 'zmm_maxambtemp', 'zmm_mincoolingflow', 'zmm_motorseries', 'zmm_motor_model', 'zmm_outlet', 'zmm_phase', 'zmm_pressure', 'zmm_pumpflowtype', 'zmm_pumpseries', 'zmm_pump_model', 'zmm_ratedpower', 'zmm_region', 'zmm_servicefactor', 'zmm_servicefactormaximumamps', 'zmm_speed', 'zmm_suction', 'zmm_suctionxdelivery', 'zmm_supplysource', 'zmm_temperature', 'zmm_thrustload', 'zmm_volts', 'zmm_wire', 'zmm_package', 'zmm_pvarrayrating', 'zmm_isi', 'zmm_isimotor', 'zmm_isipump', 'zmm_isipumpset', 'zmm_pumpset_model', 'zmm_stages', 'zmm_headrange', 'zmm_overall_efficiency', 'zmm_connection', 'zmm_min_bore_size', 'zmm_isireference', 'zmm_category', 'zmm_submergence', 'zmm_capacitorstart', 'zmm_capacitorrun', 'zmm_inch', 'zmm_motor_type', 'zmm_dismantle_direction', 'zmm_eff_ovrall', 'zmm_bodymoc', 'zmm_rotormoc', 'zmm_dlwl', 'zmm_inputpower', 'zmm_imp_od', 'zmm_ambtemp', 'zmm_de', 'zmm_dischargerange', 'zmm_efficiency_class', 'zmm_framesize', 'zmm_impellerdiameter', 'zmm_insulationclass', 'zmm_maxflow', 'zmm_minhead', 'zmm_mtrlofconst', 'zmm_nde', 'zmm_powerfactor', 'zmm_tagno', 'zmm_year', 'zmm_laser_name', 'zmm_logo_cp', 'zmm_logo_ce', 'zmm_logo_nsf', 'zmm_logo_eac', 'zmm_grwt_motor', 'zmm_grwt_pump', 'zmm_grwt_pset', 'zmm_newt_motor', 'zmm_newt_pump', 'zmm_newt_pset', 'zmm_operating_range', 'zmm_intake_air', 'zmm_oxygen_transfer_rate', 'zmm_air_inlet_pipesize', 'zmm_sump_depth', 'zmm_poles', 'zmm_motor_heading', 'zmm_motor_speed', 'zmm_beenote', 'zmm_beenumber', 'zmm_beestar', 'zmm_eff_ttl', 'zmm_labelperiod', 'zmm_modelyear', 'zmm_performance_factor', 'zqmm_qty', 'zmm_operating_temperature'];
|
||||
$characteristicsColumns = ['class', 'arbid', 'gamng', 'lmnga', 'zz1_cn_bill_ord', 'zmm_amps', 'zmm_brand', 'zmm_degreeofprotection', 'zmm_delivery', 'zmm_dir_rot', 'zmm_discharge', 'zmm_discharge_max', 'zmm_discharge_min', 'zmm_duty', 'zmm_eff_motor', 'zmm_eff_pump', 'zmm_frequency', 'zmm_head', 'zmm_heading', 'zmm_head_max', 'zmm_head_minimum', 'zmm_idx_eff_mtr', 'zmm_idx_eff_pump', 'zmm_kvacode', 'zmm_maxambtemp', 'zmm_mincoolingflow', 'zmm_motorseries', 'zmm_motor_model', 'zmm_outlet', 'zmm_phase', 'zmm_pressure', 'zmm_pumpflowtype', 'zmm_pumpseries', 'zmm_pump_model', 'zmm_ratedpower', 'zmm_region', 'zmm_servicefactor', 'zmm_servicefactormaximumamps', 'zmm_speed', 'zmm_suction', 'zmm_suctionxdelivery', 'zmm_supplysource', 'zmm_temperature', 'zmm_thrustload', 'zmm_volts', 'zmm_wire', 'zmm_package', 'zmm_pvarrayrating', 'zmm_isi', 'zmm_isimotor', 'zmm_isipump', 'zmm_isipumpset', 'zmm_pumpset_model', 'zmm_stages', 'zmm_headrange', 'zmm_overall_efficiency', 'zmm_connection', 'zmm_min_bore_size', 'zmm_isireference', 'zmm_category', 'zmm_submergence', 'zmm_capacitorstart', 'zmm_capacitorrun', 'zmm_inch', 'zmm_motor_type', 'zmm_dismantle_direction', 'zmm_eff_ovrall', 'zmm_bodymoc', 'zmm_rotormoc', 'zmm_dlwl', 'zmm_inputpower', 'zmm_imp_od', 'zmm_ambtemp', 'zmm_de', 'zmm_dischargerange', 'zmm_efficiency_class', 'zmm_framesize', 'zmm_impellerdiameter', 'zmm_insulationclass', 'zmm_maxflow', 'zmm_minhead', 'zmm_mtrlofconst', 'zmm_nde', 'zmm_powerfactor', 'zmm_tagno', 'zmm_year', 'zmm_laser_name', 'zmm_logo_cp', 'zmm_logo_ce', 'zmm_logo_nsf', 'zmm_logo_eac', 'zmm_grwt_motor', 'zmm_grwt_pump', 'zmm_grwt_pset', 'zmm_newt_motor', 'zmm_newt_pump', 'zmm_newt_pset', 'zmm_operating_range', 'zmm_intake_air', 'zmm_oxygen_transfer_rate', 'zmm_air_inlet_pipesize', 'zmm_sump_depth', 'zmm_poles', 'zmm_motor_heading', 'zmm_motor_speed', 'zmm_beenote', 'zmm_beenumber', 'zmm_beestar', 'zmm_eff_ttl', 'zmm_labelperiod', 'zmm_modelyear', 'zmm_performance_factor', 'zqmm_qty', 'zmm_operating_temperature', 'zmm_axial_force'];
|
||||
|
||||
$characteristicsData = ClassCharacteristic::where('aufnr', $jobNumber)->where('machine_id', $machineId)->where('plant_id', $plantId)->distinct()->get($characteristicsColumns); // ->get();
|
||||
|
||||
@@ -2951,7 +2951,7 @@ class CharacteristicsController extends Controller
|
||||
|
||||
// $columnsToShow = ['mark_status', 'marked_datetime', 'marked_physical_count', 'marked_expected_time', 'marked_by', 'man_marked_status', 'man_marked_datetime', 'man_marked_by', 'motor_marked_status', 'motor_marked_physical_count', 'motor_expected_time', 'motor_marked_by', 'pump_marked_status', 'pump_marked_physical_count', 'pump_expected_time', 'pump_marked_by', 'name_plate_marked_status', 'name_plate_expected_time', 'name_plate_marked_by', 'motor_pump_pumpset_status', 'winded_serial_number', 'motor_machine_name', 'pump_machine_name', 'name_plate_machine_name', 'part_validation_1', 'part_validation_2', 'samlight_logged_name', 'pending_released_status', 'has_work_flow_id'];
|
||||
|
||||
// $characteristicsColumns = ['class', 'arbid', 'gamng', 'lmnga', 'zz1_cn_bill_ord', 'zmm_amps', 'zmm_brand', 'zmm_degreeofprotection', 'zmm_delivery', 'zmm_dir_rot', 'zmm_discharge', 'zmm_discharge_max', 'zmm_discharge_min', 'zmm_duty', 'zmm_eff_motor', 'zmm_eff_pump', 'zmm_frequency', 'zmm_head', 'zmm_heading', 'zmm_head_max', 'zmm_head_minimum', 'zmm_idx_eff_mtr', 'zmm_idx_eff_pump', 'zmm_kvacode', 'zmm_maxambtemp', 'zmm_mincoolingflow', 'zmm_motorseries', 'zmm_motor_model', 'zmm_outlet', 'zmm_phase', 'zmm_pressure', 'zmm_pumpflowtype', 'zmm_pumpseries', 'zmm_pump_model', 'zmm_ratedpower', 'zmm_region', 'zmm_servicefactor', 'zmm_servicefactormaximumamps', 'zmm_speed', 'zmm_suction', 'zmm_suctionxdelivery', 'zmm_supplysource', 'zmm_temperature', 'zmm_thrustload', 'zmm_volts', 'zmm_wire', 'zmm_package', 'zmm_pvarrayrating', 'zmm_isi', 'zmm_isimotor', 'zmm_isipump', 'zmm_isipumpset', 'zmm_pumpset_model', 'zmm_stages', 'zmm_headrange', 'zmm_overall_efficiency', 'zmm_connection', 'zmm_min_bore_size', 'zmm_isireference', 'zmm_category', 'zmm_submergence', 'zmm_capacitorstart', 'zmm_capacitorrun', 'zmm_inch', 'zmm_motor_type', 'zmm_dismantle_direction', 'zmm_eff_ovrall', 'zmm_bodymoc', 'zmm_rotormoc', 'zmm_dlwl', 'zmm_inputpower', 'zmm_imp_od', 'zmm_ambtemp', 'zmm_de', 'zmm_dischargerange', 'zmm_efficiency_class', 'zmm_framesize', 'zmm_impellerdiameter', 'zmm_insulationclass', 'zmm_maxflow', 'zmm_minhead', 'zmm_mtrlofconst', 'zmm_nde', 'zmm_powerfactor', 'zmm_tagno', 'zmm_year', 'zmm_laser_name', 'zmm_logo_cp', 'zmm_logo_ce', 'zmm_logo_nsf', 'zmm_logo_eac', 'zmm_beenote', 'zmm_beenumber', 'zmm_beestar', 'zmm_codeclass', 'zmm_colour', 'zmm_grade', 'zmm_grwt_pset', 'zmm_grwt_cable', 'zmm_grwt_motor', 'zmm_grwt_pf', 'zmm_grwt_pump', 'zmm_isivalve', 'zmm_isi_wc', 'zmm_labelperiod', 'zmm_length', 'zmm_license_cml_no', 'zmm_mfgmonyr', 'zmm_modelyear', 'zmm_motoridentification', 'zmm_newt_pset', 'zmm_newt_cable', 'zmm_newt_motor', 'zmm_newt_pf', 'zmm_newt_pump', 'zmm_packtype', 'zmm_panel', 'zmm_performance_factor', 'zmm_pumpidentification', 'zmm_psettype', 'zmm_size', 'zmm_eff_ttl', 'zmm_type', 'zmm_usp', 'zmm_operating_range', 'zmm_intake_air', 'zmm_oxygen_transfer_rate', 'zmm_air_inlet_pipesize', 'zmm_sump_depth', 'zmm_poles', 'zmm_motor_heading', 'zmm_motor_speed', 'zqmm_qty', 'zmm_operating_temperature'];
|
||||
// $characteristicsColumns = ['class', 'arbid', 'gamng', 'lmnga', 'zz1_cn_bill_ord', 'zmm_amps', 'zmm_brand', 'zmm_degreeofprotection', 'zmm_delivery', 'zmm_dir_rot', 'zmm_discharge', 'zmm_discharge_max', 'zmm_discharge_min', 'zmm_duty', 'zmm_eff_motor', 'zmm_eff_pump', 'zmm_frequency', 'zmm_head', 'zmm_heading', 'zmm_head_max', 'zmm_head_minimum', 'zmm_idx_eff_mtr', 'zmm_idx_eff_pump', 'zmm_kvacode', 'zmm_maxambtemp', 'zmm_mincoolingflow', 'zmm_motorseries', 'zmm_motor_model', 'zmm_outlet', 'zmm_phase', 'zmm_pressure', 'zmm_pumpflowtype', 'zmm_pumpseries', 'zmm_pump_model', 'zmm_ratedpower', 'zmm_region', 'zmm_servicefactor', 'zmm_servicefactormaximumamps', 'zmm_speed', 'zmm_suction', 'zmm_suctionxdelivery', 'zmm_supplysource', 'zmm_temperature', 'zmm_thrustload', 'zmm_volts', 'zmm_wire', 'zmm_package', 'zmm_pvarrayrating', 'zmm_isi', 'zmm_isimotor', 'zmm_isipump', 'zmm_isipumpset', 'zmm_pumpset_model', 'zmm_stages', 'zmm_headrange', 'zmm_overall_efficiency', 'zmm_connection', 'zmm_min_bore_size', 'zmm_isireference', 'zmm_category', 'zmm_submergence', 'zmm_capacitorstart', 'zmm_capacitorrun', 'zmm_inch', 'zmm_motor_type', 'zmm_dismantle_direction', 'zmm_eff_ovrall', 'zmm_bodymoc', 'zmm_rotormoc', 'zmm_dlwl', 'zmm_inputpower', 'zmm_imp_od', 'zmm_ambtemp', 'zmm_de', 'zmm_dischargerange', 'zmm_efficiency_class', 'zmm_framesize', 'zmm_impellerdiameter', 'zmm_insulationclass', 'zmm_maxflow', 'zmm_minhead', 'zmm_mtrlofconst', 'zmm_nde', 'zmm_powerfactor', 'zmm_tagno', 'zmm_year', 'zmm_laser_name', 'zmm_logo_cp', 'zmm_logo_ce', 'zmm_logo_nsf', 'zmm_logo_eac', 'zmm_beenote', 'zmm_beenumber', 'zmm_beestar', 'zmm_codeclass', 'zmm_colour', 'zmm_grade', 'zmm_grwt_pset', 'zmm_grwt_cable', 'zmm_grwt_motor', 'zmm_grwt_pf', 'zmm_grwt_pump', 'zmm_isivalve', 'zmm_isi_wc', 'zmm_labelperiod', 'zmm_length', 'zmm_license_cml_no', 'zmm_mfgmonyr', 'zmm_modelyear', 'zmm_motoridentification', 'zmm_newt_pset', 'zmm_newt_cable', 'zmm_newt_motor', 'zmm_newt_pf', 'zmm_newt_pump', 'zmm_packtype', 'zmm_panel', 'zmm_performance_factor', 'zmm_pumpidentification', 'zmm_psettype', 'zmm_size', 'zmm_eff_ttl', 'zmm_type', 'zmm_usp', 'zmm_operating_range', 'zmm_intake_air', 'zmm_oxygen_transfer_rate', 'zmm_air_inlet_pipesize', 'zmm_sump_depth', 'zmm_poles', 'zmm_motor_heading', 'zmm_motor_speed', 'zqmm_qty', 'zmm_operating_temperature', 'zmm_axial_force'];
|
||||
|
||||
// $characteristicsData = ClassCharacteristic::where('aufnr', $jobNumber)->where('machine_id', $machineId)->where('plant_id', $plantId)->distinct()->get($characteristicsColumns); // ->get();
|
||||
|
||||
|
||||
@@ -19,182 +19,23 @@ class PalletPrintController extends Controller
|
||||
//
|
||||
}
|
||||
|
||||
public function print(Request $request, $pallet, $plant)
|
||||
{
|
||||
|
||||
$customerId = $request->query('customer');
|
||||
|
||||
// $customerName = $request->query('customer_name');
|
||||
|
||||
// $items = WireMasterPacking::with('item')
|
||||
// ->where('plant_id', $plant)
|
||||
// ->where('wire_packing_number', $pallet)
|
||||
// ->get()
|
||||
// ->groupBy('item_id')
|
||||
// ->map(function ($rows) {
|
||||
// $first = $rows->first();
|
||||
|
||||
// return (object) [
|
||||
// 'code' => $first->item->code,
|
||||
// 'description' => $first->item->description,
|
||||
// 'box_count' => $rows->count(),
|
||||
// 'weight' => $rows->sum('weight'),
|
||||
// ];
|
||||
// })
|
||||
// ->values();
|
||||
|
||||
$items = WireMasterPacking::with('item')
|
||||
->where('plant_id', $plant)
|
||||
->where('wire_packing_number', $pallet)
|
||||
->get()
|
||||
->map(function ($row) {
|
||||
return (object) [
|
||||
'code' => $row->item->code,
|
||||
'description' => $row->item->description,
|
||||
'box_count' => 1, // each row = one box
|
||||
'weight' => $row->weight,
|
||||
];
|
||||
});
|
||||
|
||||
$masterBox = WireMasterPacking::where('plant_id', $plant)
|
||||
->where('wire_packing_number', $pallet)
|
||||
->value('customer_po_master_id');
|
||||
|
||||
$customer = CustomerPoMaster::find($masterBox);
|
||||
|
||||
$customerCode = $customer->customer_po ?? '';
|
||||
$customerName = $customer->customer_name ?? '';
|
||||
|
||||
// $masterBox = WireMasterPacking::where('plant_id', $plant)
|
||||
// ->where('wire_packing_number', $pallet)
|
||||
// ->distinct('customer_po')
|
||||
// ->count('customer_po');
|
||||
|
||||
// $pallets = WireMasterPacking::where('plant_id', $plant)
|
||||
// ->select('wire_packing_number', 'updated_at')
|
||||
// ->distinct('wire_packing_number')
|
||||
// ->orderBy('wire_packing_number')
|
||||
// ->orderBy('updated_at', 'asc')
|
||||
// ->get()
|
||||
// ->pluck('wire_packing_number')
|
||||
// ->values();
|
||||
|
||||
// $currentPalletNo = $pallets->search($pallet) + 1;
|
||||
|
||||
// $totalBoxes = WireMasterPacking::where('plant_id', $plant)
|
||||
// // ->where('wire_packing_number', $pallet)
|
||||
// ->distinct()
|
||||
// ->count('customer_po');
|
||||
|
||||
// $boxLabel = $currentPalletNo . '/' . $totalBoxes;
|
||||
|
||||
$totalBoxes = WireMasterPacking::where('plant_id', $plant)
|
||||
->where('customer_po_master_id', $customerId)
|
||||
->distinct('wire_packing_number')
|
||||
->count('wire_packing_number');
|
||||
|
||||
$completedPallets = WireMasterPacking::where('plant_id', $plant)
|
||||
->where('customer_po_master_id', $customerId)
|
||||
->select('wire_packing_number')
|
||||
->groupBy('wire_packing_number')
|
||||
->havingRaw(
|
||||
'COUNT(*) = COUNT(CASE WHEN wire_packing_status = ? THEN 1 END)',
|
||||
['Completed']
|
||||
)
|
||||
->orderBy('wire_packing_number')
|
||||
->pluck('wire_packing_number')
|
||||
->values();
|
||||
|
||||
$index = $completedPallets->search($pallet);
|
||||
|
||||
$currentPalletNo = ($index !== false) ? $index + 1 : 0;
|
||||
|
||||
$boxLabel = $currentPalletNo.'/'.$totalBoxes;
|
||||
|
||||
// $completedPallets = WireMasterPacking::where('plant_id', $plant)
|
||||
// ->select('wire_packing_number')
|
||||
// ->groupBy('wire_packing_number')
|
||||
// ->havingRaw('COUNT(*) = COUNT(CASE WHEN wire_packing_status = ? THEN 1 END)', ['Completed'])
|
||||
// ->orderBy('wire_packing_number')
|
||||
// ->pluck('wire_packing_number')
|
||||
// ->values();
|
||||
|
||||
// $currentPalletNo = $completedPallets->search($pallet) != false
|
||||
// ? $completedPallets->search($pallet) + 1
|
||||
// : 0;
|
||||
|
||||
// $boxLabel = $currentPalletNo . '/' . $totalBoxes;
|
||||
|
||||
$grossWeight = $items->sum('weight');
|
||||
$widthPt = 85 * 2.83465; // 85mm → points
|
||||
$heightPt = 100 * 2.83465; // 100mm → points
|
||||
|
||||
$plantName = Plant::where('id', $plant)->value('name');
|
||||
|
||||
$plantAddress = Plant::where('id', $plant)->value('address');
|
||||
|
||||
$pdf = Pdf::loadView('pdf.wire-pallet', [
|
||||
'product' => 'Submersible Winding Wire',
|
||||
'plantName' => $plantName,
|
||||
'plantAddress' => $plantAddress,
|
||||
'monthYear' => now()->format('M-y'),
|
||||
'branch' => '',
|
||||
'customerCode' => $customerCode,
|
||||
'customerName' => $customerName,
|
||||
'masterBox' => $boxLabel,
|
||||
'items' => $items,
|
||||
'grossWeight' => $grossWeight + 3.050,
|
||||
'netWeight' => $grossWeight,
|
||||
// 'grossWeight' => $grossWeight,
|
||||
// 'netWeight' => $grossWeight - 3.05,
|
||||
'pallet' => $pallet,
|
||||
])->setPaper([0, 0, $widthPt, $heightPt], 'portrait');
|
||||
|
||||
return $pdf->stream("Pallet-{$pallet}.pdf");
|
||||
// $pdfPath = storage_path("app/public/Pallet-{$pallet}.pdf");
|
||||
// $pdf->save($pdfPath);
|
||||
|
||||
// $printerName = 'Tsc';
|
||||
// $output = [];
|
||||
// $returnVar = 0;
|
||||
|
||||
// exec("lp -d {$printerName} " . escapeshellarg($pdfPath), $output, $returnVar);
|
||||
|
||||
// if ($returnVar == 0) {
|
||||
// return response()->json([
|
||||
// 'status' => 'success',
|
||||
// 'message' => "PDF sent to printer $printerName successfully."
|
||||
// ]);
|
||||
// } else {
|
||||
// return response()->json([
|
||||
// 'status' => 'error',
|
||||
// 'message' => "Failed to send PDF to printer $printerName.",
|
||||
// 'output' => $output,
|
||||
// 'code' => $returnVar
|
||||
// ], 500);
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
|
||||
// public function print(Request $request, $pallet, $plant)
|
||||
// {
|
||||
|
||||
// $customerId = $request->query('customer');
|
||||
|
||||
// $items = WireMasterPacking::with('item')
|
||||
// ->where('plant_id', $plant)
|
||||
// ->where('wire_packing_number', $pallet)
|
||||
// ->get()
|
||||
// ->map(function ($row) {
|
||||
// return (object) [
|
||||
// 'code' => $row->item->code,
|
||||
// 'description' => $row->item->description,
|
||||
// 'box_count' => 1, // each row = one box
|
||||
// 'weight' => $row->weight,
|
||||
// ];
|
||||
// });
|
||||
// ->where('plant_id', $plant)
|
||||
// ->where('wire_packing_number', $pallet)
|
||||
// ->get()
|
||||
// ->map(function ($row) {
|
||||
// return (object) [
|
||||
// 'code' => $row->item->code,
|
||||
// 'description' => $row->item->description,
|
||||
// 'box_count' => 1, // each row = one box
|
||||
// 'weight' => $row->weight,
|
||||
// ];
|
||||
// });
|
||||
|
||||
// $masterBox = WireMasterPacking::where('plant_id', $plant)
|
||||
// ->where('wire_packing_number', $pallet)
|
||||
@@ -205,6 +46,29 @@ class PalletPrintController extends Controller
|
||||
// $customerCode = $customer->customer_po ?? '';
|
||||
// $customerName = $customer->customer_name ?? '';
|
||||
|
||||
// // $masterBox = WireMasterPacking::where('plant_id', $plant)
|
||||
// // ->where('wire_packing_number', $pallet)
|
||||
// // ->distinct('customer_po')
|
||||
// // ->count('customer_po');
|
||||
|
||||
// // $pallets = WireMasterPacking::where('plant_id', $plant)
|
||||
// // ->select('wire_packing_number', 'updated_at')
|
||||
// // ->distinct('wire_packing_number')
|
||||
// // ->orderBy('wire_packing_number')
|
||||
// // ->orderBy('updated_at', 'asc')
|
||||
// // ->get()
|
||||
// // ->pluck('wire_packing_number')
|
||||
// // ->values();
|
||||
|
||||
// // $currentPalletNo = $pallets->search($pallet) + 1;
|
||||
|
||||
// // $totalBoxes = WireMasterPacking::where('plant_id', $plant)
|
||||
// // // ->where('wire_packing_number', $pallet)
|
||||
// // ->distinct()
|
||||
// // ->count('customer_po');
|
||||
|
||||
// // $boxLabel = $currentPalletNo . '/' . $totalBoxes;
|
||||
|
||||
// $totalBoxes = WireMasterPacking::where('plant_id', $plant)
|
||||
// ->where('customer_po_master_id', $customerId)
|
||||
// ->distinct('wire_packing_number')
|
||||
@@ -226,7 +90,7 @@ class PalletPrintController extends Controller
|
||||
|
||||
// $currentPalletNo = ($index !== false) ? $index + 1 : 0;
|
||||
|
||||
// $boxLabel = $currentPalletNo . '/' . $totalBoxes;
|
||||
// $boxLabel = $currentPalletNo.'/'.$totalBoxes;
|
||||
|
||||
// // $completedPallets = WireMasterPacking::where('plant_id', $plant)
|
||||
// // ->select('wire_packing_number')
|
||||
@@ -243,50 +107,180 @@ class PalletPrintController extends Controller
|
||||
// // $boxLabel = $currentPalletNo . '/' . $totalBoxes;
|
||||
|
||||
// $grossWeight = $items->sum('weight');
|
||||
// $widthPt = 85 * 2.83465; // 85mm → points
|
||||
// $widthPt = 85 * 2.83465; // 85mm → points
|
||||
// $heightPt = 100 * 2.83465; // 100mm → points
|
||||
|
||||
// $plantName = Plant::where('id', $plant)->value('name');
|
||||
|
||||
// $plantAddress = Plant::where('id', $plant)->value('address');
|
||||
|
||||
// $qrBase64 = $this->generateQrDataUri($pallet);
|
||||
|
||||
// $mpdf = new Mpdf([
|
||||
// 'format' => [85, 100],
|
||||
// 'margin_left' => 0,
|
||||
// 'margin_right' => 0,
|
||||
// 'margin_top' => 0,
|
||||
// 'margin_bottom' => 0,
|
||||
// 'tempDir' => '/var/www/tmp/mpdf'
|
||||
// ]);
|
||||
|
||||
// $html = view('pdf.wire-pallet', [
|
||||
// 'product' => 'Submersible Winding Wire',
|
||||
// 'plantName' => $plantName,
|
||||
// $pdf = Pdf::loadView('pdf.wire-pallet', [
|
||||
// 'product' => 'Submersible Winding Wire',
|
||||
// 'plantName' => $plantName,
|
||||
// 'plantAddress' => $plantAddress,
|
||||
// 'monthYear' => now()->format('M-y'),
|
||||
// 'monthYear' => now()->format('M-y'),
|
||||
// 'branch' => '',
|
||||
// 'customerCode' => $customerCode,
|
||||
// 'customerName' => $customerName,
|
||||
// 'masterBox' => $pallet,
|
||||
// 'items' => $items,
|
||||
// 'grossWeight' => $grossWeight,
|
||||
// 'netWeight' => $grossWeight - 3.05,
|
||||
// 'pallet' => $pallet,
|
||||
// 'qrBase64' => $qrBase64,
|
||||
// ])->render();
|
||||
// 'masterBox' => $boxLabel,
|
||||
// 'items' => $items,
|
||||
// 'grossWeight' => $grossWeight + 3.050,
|
||||
// 'netWeight' => $grossWeight,
|
||||
// // 'grossWeight' => $grossWeight,
|
||||
// // 'netWeight' => $grossWeight - 3.05,
|
||||
// 'pallet' => $pallet,
|
||||
// ])->setPaper([0, 0, $widthPt, $heightPt], 'portrait');
|
||||
|
||||
// $mpdf->WriteHTML($html);
|
||||
// return $mpdf->Output("Pallet-{$pallet}.pdf", 'I'); // 'I' = inline view in browser
|
||||
// return $pdf->stream("Pallet-{$pallet}.pdf");
|
||||
// // $pdfPath = storage_path("app/public/Pallet-{$pallet}.pdf");
|
||||
// // $pdf->save($pdfPath);
|
||||
|
||||
// // $printerName = 'Tsc';
|
||||
// // $output = [];
|
||||
// // $returnVar = 0;
|
||||
|
||||
// // exec("lp -d {$printerName} " . escapeshellarg($pdfPath), $output, $returnVar);
|
||||
|
||||
// // if ($returnVar == 0) {
|
||||
// // return response()->json([
|
||||
// // 'status' => 'success',
|
||||
// // 'message' => "PDF sent to printer $printerName successfully."
|
||||
// // ]);
|
||||
// // } else {
|
||||
// // return response()->json([
|
||||
// // 'status' => 'error',
|
||||
// // 'message' => "Failed to send PDF to printer $printerName.",
|
||||
// // 'output' => $output,
|
||||
// // 'code' => $returnVar
|
||||
// // ], 500);
|
||||
// // }
|
||||
// }
|
||||
|
||||
// private function generateQrDataUri(string $data): string
|
||||
// {
|
||||
// $qr = new \Mpdf\QrCode\QrCode($data, 'H');
|
||||
// $output = new \Mpdf\QrCode\Output\Png();
|
||||
// $pngData = $output->output($qr, 80, [255, 255, 255], [0, 0, 0]);
|
||||
// return 'data:image/png;base64,' . base64_encode($pngData);
|
||||
// }
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
|
||||
public function print(Request $request, $pallet, $plant)
|
||||
{
|
||||
|
||||
$customerPoMasterId = WireMasterPacking::where('plant_id', $plant)
|
||||
->where('wire_packing_number', $pallet)
|
||||
->value('customer_po_master_id');
|
||||
|
||||
$masterIds = WireMasterPacking::where('plant_id', $plant)
|
||||
->where('wire_packing_number', $pallet)
|
||||
->pluck('customer_po_master_id');
|
||||
|
||||
$customerPo = CustomerPoMaster::whereIn('id', $masterIds)
|
||||
->value('customer_po');
|
||||
|
||||
$customerPoMasterIds = CustomerPoMaster::where('customer_po', $customerPo)
|
||||
->pluck('id');
|
||||
|
||||
$items = WireMasterPacking::with('item')
|
||||
->where('plant_id', $plant)
|
||||
->where('wire_packing_number', $pallet)
|
||||
->get()
|
||||
->map(function ($row) {
|
||||
return (object) [
|
||||
'code' => $row->item->code,
|
||||
'description' => $row->item->description,
|
||||
'box_count' => 1, // each row = one box
|
||||
'weight' => $row->weight,
|
||||
];
|
||||
});
|
||||
|
||||
$customer = CustomerPoMaster::find($customerPoMasterId);
|
||||
|
||||
$customerCode = $customer->customer_po ?? '';
|
||||
$customerName = $customer->customer_name ?? '';
|
||||
|
||||
// $totalBoxes = WireMasterPacking::where('plant_id', $plant)
|
||||
// ->where('customer_po_master_id', $customerPoMasterId)
|
||||
// ->select('wire_packing_number')
|
||||
// ->groupBy('wire_packing_number')
|
||||
// ->havingRaw(
|
||||
// 'COUNT(*) = COUNT(CASE WHEN wire_packing_status = ? THEN 1 END)',
|
||||
// ['Completed']
|
||||
// )
|
||||
// ->count();
|
||||
|
||||
$totalBoxes = WireMasterPacking::where('plant_id', $plant)
|
||||
->whereIn('customer_po_master_id', $customerPoMasterIds)
|
||||
->select('wire_packing_number')
|
||||
->groupBy('wire_packing_number')
|
||||
->havingRaw(
|
||||
'COUNT(*) = COUNT(CASE WHEN wire_packing_status = ? THEN 1 END)',
|
||||
['Completed']
|
||||
)
|
||||
->count();
|
||||
|
||||
// $completedPallets = WireMasterPacking::where('plant_id', $plant)
|
||||
// ->where('customer_po_master_id', $customerPoMasterId)
|
||||
// ->select('wire_packing_number')
|
||||
// ->groupBy('wire_packing_number')
|
||||
// ->havingRaw(
|
||||
// 'COUNT(*) = COUNT(CASE WHEN wire_packing_status = ? THEN 1 END)',
|
||||
// ['Completed']
|
||||
// )
|
||||
// ->orderBy('wire_packing_number')
|
||||
// ->pluck('wire_packing_number')
|
||||
// ->values();
|
||||
|
||||
$completedPallets = WireMasterPacking::where('plant_id', $plant)
|
||||
->whereIn('customer_po_master_id', $customerPoMasterIds)
|
||||
->select('wire_packing_number')
|
||||
->groupBy('wire_packing_number')
|
||||
->havingRaw(
|
||||
'COUNT(*) = COUNT(CASE WHEN wire_packing_status = ? THEN 1 END)',
|
||||
['Completed']
|
||||
)
|
||||
->orderBy('wire_packing_number')
|
||||
->pluck('wire_packing_number')
|
||||
->values();
|
||||
|
||||
$index = $completedPallets->search($pallet);
|
||||
|
||||
$currentPalletNo = ($index !== false) ? $index + 1 : 0;
|
||||
|
||||
$boxLabel = $currentPalletNo.'/'.$totalBoxes;
|
||||
|
||||
$grossWeight = $items->sum('weight');
|
||||
$widthPt = 85 * 2.83465; // 85mm → points
|
||||
$heightPt = 100 * 2.83465; // 100mm → points
|
||||
|
||||
$plantName = Plant::where('id', $plant)->value('name');
|
||||
|
||||
$plantAddress = Plant::where('id', $plant)->value('address');
|
||||
|
||||
$scannedAt = WireMasterPacking::where('plant_id', $plant)
|
||||
->where('wire_packing_number', $pallet)
|
||||
->value('scanned_at');
|
||||
|
||||
$pdf = Pdf::loadView('pdf.wire-pallet', [
|
||||
'product' => 'Submersible Winding Wire',
|
||||
'plantName' => $plantName,
|
||||
'plantAddress' => $plantAddress,
|
||||
// 'monthYear' => now()->format('M-y'),
|
||||
'monthYear' => $scannedAt
|
||||
? \Carbon\Carbon::parse($scannedAt)->format('M-y')
|
||||
: '',
|
||||
'branch' => '',
|
||||
'customerCode' => $customerCode,
|
||||
'customerName' => $customerName,
|
||||
'masterBox' => $boxLabel,
|
||||
'items' => $items,
|
||||
'grossWeight' => $grossWeight + 3.050,
|
||||
'netWeight' => $grossWeight,
|
||||
'pallet' => $pallet,
|
||||
])->setPaper([0, 0, $widthPt, $heightPt], 'portrait');
|
||||
|
||||
return $pdf->stream("Pallet-{$pallet}.pdf");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
|
||||
@@ -151,12 +151,27 @@ public $records = [];
|
||||
|
||||
$characteristic = ProductCharacteristicsMaster::find($characteristicId);
|
||||
|
||||
if (($characteristic?->inspection_type ?? null) === 'Value') {
|
||||
if (
|
||||
$characteristic &&
|
||||
is_numeric($value) &&
|
||||
$value >= $characteristic->lower &&
|
||||
$value <= $characteristic->upper
|
||||
$itemCharacteristic = ProductCharacteristicsMaster::where('plant_id', $this->data['plant_id'])
|
||||
->where('line_id', $this->data['line_id'])
|
||||
->where('name', $characteristic->name)
|
||||
->where('item_id', $itemId)
|
||||
->first();
|
||||
|
||||
// if (($characteristic?->inspection_type ?? null) === 'Value') {
|
||||
// if ($characteristic && is_numeric($value) && (($value >= $characteristic->lower && $value <= $characteristic->upper) || $value == $characteristic->lower || $value == $characteristic->upper)
|
||||
// ) {
|
||||
// $status = 'Ok';
|
||||
// } else {
|
||||
// $status = 'NotOk';
|
||||
// }
|
||||
// }
|
||||
// else {
|
||||
// $status = $value;
|
||||
// }
|
||||
|
||||
if (($itemCharacteristic?->inspection_type ?? null) === 'Value') {
|
||||
|
||||
if ($itemCharacteristic && is_numeric($value) && $value >= $itemCharacteristic->lower && $value <= $itemCharacteristic->upper
|
||||
) {
|
||||
$status = 'Ok';
|
||||
} else {
|
||||
@@ -167,7 +182,7 @@ public $records = [];
|
||||
$status = $value;
|
||||
}
|
||||
|
||||
ProductionCharacteristic::create([
|
||||
$prod = ProductionCharacteristic::create([
|
||||
'plant_id' => $this->data['plant_id'] ?? null,
|
||||
'item_id' => $itemId ?? null,
|
||||
'line_id' => $this->data['line_id'] ?? null,
|
||||
@@ -182,6 +197,15 @@ public $records = [];
|
||||
]);
|
||||
}
|
||||
|
||||
if (! $prod) {
|
||||
Notification::make()
|
||||
->title('Failed to save Panel Box Validation')
|
||||
->body('Something went wrong while inserting data.')
|
||||
->danger()
|
||||
->send();
|
||||
return;
|
||||
}
|
||||
|
||||
$this->showChecklist = false;
|
||||
|
||||
$this->dispatch('checklist-saved');
|
||||
@@ -201,7 +225,7 @@ public $records = [];
|
||||
|
||||
$characteristic = ProductCharacteristicsMaster::find($characteristicId);
|
||||
|
||||
if (! $characteristic || ! is_numeric($value) || $value <= $characteristic->lower || $value >= $characteristic->upper){
|
||||
if (! $characteristic || ! is_numeric($value) || ($value < $characteristic->lower || $value > $characteristic->upper)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -218,11 +242,24 @@ public $records = [];
|
||||
|
||||
$characteristic = ProductCharacteristicsMaster::find($characteristicId);
|
||||
|
||||
$itemCode = $this->data['item_id'];
|
||||
|
||||
$itemId = Item::where('plant_id', $characteristic->plant_id)->where('code', $itemCode)->value('id');
|
||||
|
||||
$characteristic = ProductCharacteristicsMaster::find($characteristicId);
|
||||
|
||||
$limit = ProductCharacteristicsMaster::where('plant_id', $characteristic->plant_id)
|
||||
->where('line_id', $characteristic->line_id)
|
||||
->where('name', $characteristic->name)
|
||||
->where('item_id', $itemId)
|
||||
->first();
|
||||
|
||||
if (! $characteristic || ! is_numeric($value)) {
|
||||
return 'Not Ok';
|
||||
}
|
||||
// return ($value >= $characteristic->lower && $value <= $characteristic->upper) ? 'Ok' : 'Not Ok';
|
||||
|
||||
return ($value > $characteristic->lower && $value < $characteristic->upper) ? 'Ok' : 'Not Ok';
|
||||
return ($value >= $limit->lower && $value <= $limit->upper) ? 'Ok' : 'Not Ok';
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -23,15 +23,21 @@ class ImportTransitMail extends Mailable
|
||||
|
||||
public $excelPath;
|
||||
|
||||
public $name;
|
||||
|
||||
public $mobileNo;
|
||||
|
||||
/**
|
||||
* Create a new message instance.
|
||||
*/
|
||||
public function __construct($scheduleType, $tableData, $mailSubject, $excelPath)
|
||||
public function __construct($scheduleType, $tableData, $mailSubject, $excelPath, $name, $mobileNo)
|
||||
{
|
||||
$this->scheduleType = $scheduleType;
|
||||
$this->tableData = $tableData ?? [];
|
||||
$this->mailSubject = $mailSubject ?? 'Import Transit';
|
||||
$this->excelPath = $excelPath;
|
||||
$this->name = $name;
|
||||
$this->mobileNo = $mobileNo;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -81,7 +87,7 @@ class ImportTransitMail extends Mailable
|
||||
'company' => 'CRI Digital Manufacturing Solutions',
|
||||
'greeting' => $greeting,
|
||||
'tableData' => $this->tableData,
|
||||
'wishes' => 'Thanks & Regards,<br>CRI Digital Manufacturing Solutions',
|
||||
'wishes' => "Thanks & Regards,<br>CRI Digital Manufacturing Solutions<br><b>Updated By</b> - $this->name<br>For any queries, please contact the number below<br>+91 $this->mobileNo",
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
63
app/Mail/VisitorOutMail.php
Normal file
63
app/Mail/VisitorOutMail.php
Normal file
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
namespace App\Mail;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Mail\Mailables\Content;
|
||||
use Illuminate\Mail\Mailables\Envelope;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class VisitorOutMail extends Mailable
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
public $entry;
|
||||
|
||||
|
||||
/**
|
||||
* Create a new message instance.
|
||||
*/
|
||||
public function __construct($entry)
|
||||
{
|
||||
$this->entry = $entry;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the message envelope.
|
||||
*/
|
||||
public function envelope(): Envelope
|
||||
{
|
||||
return new Envelope(
|
||||
subject: 'Visitor Out Notification',
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the message content definition.
|
||||
*/
|
||||
public function content(): Content
|
||||
{
|
||||
$greeting = '<b>Dear Sir</b>';
|
||||
|
||||
return new Content(
|
||||
view: 'mail.visitor-out',
|
||||
with: [
|
||||
'company' => 'CRI Digital Manufacturing Solutions',
|
||||
'greeting' => $greeting,
|
||||
'wishes' => 'Thanks & Regards,<br>CRI Digital Manufacturing Solutions',
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the attachments for the message.
|
||||
*
|
||||
* @return array<int, \Illuminate\Mail\Mailables\Attachment>
|
||||
*/
|
||||
public function attachments(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
@@ -153,6 +153,7 @@ class ClassCharacteristic extends Model
|
||||
'zmm_motor_speed',
|
||||
'zqmm_qty',
|
||||
'zmm_operating_temperature',
|
||||
'zmm_axial_force',
|
||||
'mark_status',
|
||||
'marked_datetime',
|
||||
'marked_physical_count',
|
||||
|
||||
@@ -61,6 +61,11 @@ class Line extends Model
|
||||
return $this->hasMany(ProcessOrder::class);
|
||||
}
|
||||
|
||||
public function machines()
|
||||
{
|
||||
return $this->hasMany(Machine::class);
|
||||
}
|
||||
|
||||
public function productCharacteristicsMasters()
|
||||
{
|
||||
return $this->hasMany(ProductCharacteristicsMaster::class);
|
||||
|
||||
@@ -53,6 +53,11 @@ class Machine extends Model
|
||||
return $this->hasMany(RequestCharacteristic::class, 'machine_id', 'id');
|
||||
}
|
||||
|
||||
public function characteristicApproverMaster()
|
||||
{
|
||||
return $this->hasMany(CharacteristicApproverMaster::class, 'machine_id', 'id');
|
||||
}
|
||||
|
||||
public function productionCharacteristics()
|
||||
{
|
||||
return $this->hasMany(ProductionCharacteristic::class, 'machine_id', 'id');
|
||||
|
||||
@@ -49,6 +49,11 @@ class Plant extends Model
|
||||
return $this->hasMany(StickerMaster::class, 'plant_id', 'id');
|
||||
}
|
||||
|
||||
public function locators(): HasMany
|
||||
{
|
||||
return $this->hasMany(Locator::class, 'plant_id', 'id');
|
||||
}
|
||||
|
||||
public function weightValidations(): HasMany
|
||||
{
|
||||
return $this->hasMany(WeightValidation::class, 'plant_id', 'id');
|
||||
@@ -104,6 +109,11 @@ class Plant extends Model
|
||||
return $this->hasMany(WorkGroupMaster::class, 'plant_id', 'id');
|
||||
}
|
||||
|
||||
public function machines()
|
||||
{
|
||||
return $this->hasMany(Machine::class, 'plant_id', 'id');
|
||||
}
|
||||
|
||||
public function processOrders()
|
||||
{
|
||||
return $this->hasMany(ProcessOrder::class, 'plant_id', 'id');
|
||||
@@ -178,4 +188,14 @@ class Plant extends Model
|
||||
{
|
||||
return $this->hasMany(AsrsItemValidation::class, 'plant_id', 'id');
|
||||
}
|
||||
|
||||
// public function locatorValidations()
|
||||
// {
|
||||
// return $this->hasMany(LocatorValidation::class, 'plant_id', 'id');
|
||||
// }
|
||||
|
||||
public function characteristicApproverMaster()
|
||||
{
|
||||
return $this->hasMany(CharacteristicApproverMaster::class, 'plant_id', 'id');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,6 +150,7 @@ class TempClassCharacteristic extends Model
|
||||
'zmm_motor_speed',
|
||||
'zqmm_qty',
|
||||
'zmm_operating_temperature',
|
||||
'zmm_axial_force',
|
||||
'winded_serial_number',
|
||||
'model_type',
|
||||
'has_work_flow_id',
|
||||
|
||||
@@ -30,6 +30,11 @@ class WorkGroupMaster extends Model
|
||||
return $this->hasMany(ProductCharacteristicsMaster::class);
|
||||
}
|
||||
|
||||
public function machines()
|
||||
{
|
||||
return $this->hasMany(Machine::class, 'work_group_master_id');
|
||||
}
|
||||
|
||||
// public function rejectReasons()
|
||||
// {
|
||||
// return $this->hasMany(RejectReason::class, 'work_group_master_id', 'id');
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
$sql1 = <<<'SQL'
|
||||
ALTER TABLE class_characteristics
|
||||
ADD COLUMN zmm_axial_force TEXT DEFAULT NULL
|
||||
SQL;
|
||||
|
||||
DB::statement($sql1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
// Schema::table('class_characteristics', function (Blueprint $table) {
|
||||
// //
|
||||
// });
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
$sql1 = <<<'SQL'
|
||||
ALTER TABLE temp_class_characteristics
|
||||
ADD COLUMN zmm_axial_force TEXT DEFAULT NULL
|
||||
SQL;
|
||||
|
||||
DB::statement($sql1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
// Schema::table('temp_class_characteristics', function (Blueprint $table) {
|
||||
// //
|
||||
// });
|
||||
}
|
||||
};
|
||||
@@ -91,7 +91,9 @@ class PermissionSeeder extends Seeder
|
||||
Permission::updateOrCreate(['name' => 'view import serial invoice']);
|
||||
Permission::updateOrCreate(['name' => 'view import material invoice']);
|
||||
Permission::updateOrCreate(['name' => 'view import invoice']);
|
||||
Permission::updateOrCreate(['name' => 'view export invoice']);
|
||||
Permission::updateOrCreate(['name' => 'view import sap invoice']);
|
||||
Permission::updateOrCreate(['name' => 'view export serial invoice']);
|
||||
Permission::updateOrCreate(['name' => 'view export material invoice']);
|
||||
Permission::updateOrCreate(['name' => 'view export asn invoice']);
|
||||
|
||||
Permission::updateOrCreate(['name' => 'view import locator invoice validation']);
|
||||
@@ -228,7 +230,14 @@ class PermissionSeeder extends Seeder
|
||||
|
||||
Permission::updateOrCreate(['name' => 'view import asrs item validation']);
|
||||
Permission::updateOrCreate(['name' => 'view export asrs item validation']);
|
||||
|
||||
Permission::updateOrCreate(['name' => 'view import employee master']);
|
||||
Permission::updateOrCreate(['name' => 'view export employee master']);
|
||||
Permission::updateOrCreate(['name' => 'view import visitor entries']);
|
||||
Permission::updateOrCreate(['name' => 'view export visitor entries']);
|
||||
Permission::updateOrCreate(['name' => 'view gate entry page']);
|
||||
|
||||
Permission::updateOrCreate(['name' => 'view import locator validation']);
|
||||
Permission::updateOrCreate(['name' => 'view export locator validation']);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,6 +83,15 @@
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="border:1px solid #d1d5db;font-weight:bold;">
|
||||
No of Person
|
||||
</td>
|
||||
<td style="border:1px solid #d1d5db;">
|
||||
{{ $visitor->number_of_person }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="border:1px solid #d1d5db;font-weight:bold;">
|
||||
Visit Time
|
||||
|
||||
119
resources/views/mail/visitor-out.blade.php
Normal file
119
resources/views/mail/visitor-out.blade.php
Normal file
@@ -0,0 +1,119 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Visitor Out Notification</title>
|
||||
</head>
|
||||
<body style="margin:0;padding:0;background:#ffffff;font-family:Arial,Helvetica,sans-serif;">
|
||||
|
||||
<table width="100%" cellpadding="0" cellspacing="0" style="background:#ffffff;">
|
||||
<tr>
|
||||
<td align="center">
|
||||
|
||||
<table width="700" cellpadding="0" cellspacing="0" style="background:#ffffff;border:1px solid #e5e7eb;">
|
||||
|
||||
<!-- Header -->
|
||||
<tr>
|
||||
<td style="background:#0f766e;padding:20px;text-align:center;">
|
||||
<h2 style="margin:0;color:#ffffff;">
|
||||
Visitor Out Notification
|
||||
</h2>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- Content -->
|
||||
<tr>
|
||||
<td style="padding:25px;">
|
||||
|
||||
<p style="margin-top:0;">
|
||||
{!! $greeting !!}
|
||||
</p>
|
||||
|
||||
<p>
|
||||
A visitor has checked out. Please find the details below:
|
||||
</p>
|
||||
|
||||
<table width="100%" cellpadding="10" cellspacing="0"
|
||||
style="border-collapse:collapse;margin-top:15px;">
|
||||
|
||||
<tr>
|
||||
<td style="border:1px solid #d1d5db;width:30%;font-weight:bold;">
|
||||
Visitor Name
|
||||
</td>
|
||||
<td style="border:1px solid #d1d5db;">
|
||||
{{ $entry?->name ?? '-' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="border:1px solid #d1d5db;font-weight:bold;">
|
||||
Mobile Number
|
||||
</td>
|
||||
<td style="border:1px solid #d1d5db;">
|
||||
{{ $entry?->mobile_number ?? '-' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="border:1px solid #d1d5db;font-weight:bold;">
|
||||
Company
|
||||
</td>
|
||||
<td style="border:1px solid #d1d5db;">
|
||||
{{ $entry?->company ?? '-' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="border:1px solid #d1d5db;font-weight:bold;">
|
||||
Purpose of Visit
|
||||
</td>
|
||||
<td style="border:1px solid #d1d5db;">
|
||||
{{ $entry?->purpose_of_visit ?? '-' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="border:1px solid #d1d5db;font-weight:bold;">
|
||||
No of Persons
|
||||
</td>
|
||||
<td style="border:1px solid #d1d5db;">
|
||||
{{ $entry?->number_of_person ?? '-' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="border:1px solid #d1d5db;font-weight:bold;">
|
||||
Out Time
|
||||
</td>
|
||||
<td style="border:1px solid #d1d5db;">
|
||||
{{ $entry?->out_time?->format('d-m-Y h:i A') ?? '-' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
<br>
|
||||
|
||||
<p>
|
||||
{!! $wishes !!}
|
||||
</p>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- Footer -->
|
||||
<tr>
|
||||
<td style="padding:15px;text-align:center;border-top:1px solid #e5e7eb;font-size:12px;color:#666;">
|
||||
© {{ date('Y') }} {{ $company }}<br>
|
||||
Visitor Management System
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -26,7 +26,7 @@
|
||||
$grossWeightHeight = 5;
|
||||
$netWeightHeight = 5;
|
||||
$licenseHeight = 5;
|
||||
$companyInfoHeight = 6.9;
|
||||
$companyInfoHeight = 6.9; //6.9
|
||||
$logoHeight = $titleHeight * 0.8;
|
||||
$logoMaxWidth = 20;
|
||||
$isilogoHeight = $titleHeight * 0.9;
|
||||
@@ -240,8 +240,13 @@
|
||||
/* Column widths */
|
||||
.col-1 { width: 22%; }
|
||||
.col-2 { width: 45%; }
|
||||
.col-3 { width: 11%; }
|
||||
.col-4 { width: 29%; }
|
||||
|
||||
/* .col-1 { width: 20%; }
|
||||
.col-2 { width: 48%; }
|
||||
.col-3 { width: 15%; }
|
||||
.col-4 { width: 25%; }
|
||||
.col-4 { width: 17%; } */
|
||||
|
||||
/* Force exact heights for rows - ALL FIXED EXCEPT ITEM ROWS */
|
||||
.title-row {
|
||||
|
||||
Reference in New Issue
Block a user