Compare commits
12 Commits
renovate/l
...
0555f9faff
| Author | SHA1 | Date | |
|---|---|---|---|
| 0555f9faff | |||
|
|
e8ed47a110 | ||
| 8cbbaa4845 | |||
|
|
055d7707f4 | ||
| cb6b201648 | |||
|
|
55cf2f6924 | ||
| c3089a147c | |||
|
|
d389136223 | ||
| 45f0e39f73 | |||
|
|
173638cd19 | ||
| fe1e1b9918 | |||
|
|
c8c38a05f4 |
@@ -50,7 +50,7 @@ class AlertMailRuleResource extends Resource
|
||||
'InvoiceValidation' => 'InvoiceValidation',
|
||||
'InvoiceDataReport' => 'InvoiceDataReport',
|
||||
'ProductionQuantities' => 'ProductionQuantities',
|
||||
//'Calibration' => 'Calibration',
|
||||
'QualityValidation' => 'QualityValidation',
|
||||
]),
|
||||
Forms\Components\Select::make('rule_name')
|
||||
->label('Rule Name')
|
||||
@@ -60,7 +60,7 @@ class AlertMailRuleResource extends Resource
|
||||
'MaterialInvoiceMail' => 'Material Invoice Mail',
|
||||
'ProductionMail' => 'Production Mail',
|
||||
'InvoiceDataMail' => 'Invoice Data Mail',
|
||||
//'CalibrationMail' => 'Calibration Mail',
|
||||
'QualityMail' => 'Quality Mail',
|
||||
])
|
||||
->required(),
|
||||
Forms\Components\TextInput::make('email')
|
||||
|
||||
@@ -3265,6 +3265,8 @@ class CreateInvoiceValidation extends CreateRecord
|
||||
return;
|
||||
}
|
||||
|
||||
$invalidPackage = false;
|
||||
|
||||
$hasMotorQr = $record->stickerMasterRelation->tube_sticker_motor ?? null;
|
||||
$hasPumpQr = $record->stickerMasterRelation->tube_sticker_pump ?? null;
|
||||
$hasPumpSetQr = $record->stickerMasterRelation->tube_sticker_pumpset ?? null;
|
||||
@@ -3274,17 +3276,18 @@ class CreateInvoiceValidation extends CreateRecord
|
||||
$hasMotorQr = $record->stickerMasterRelation->pack_slip_motor ?? null;
|
||||
$hasPumpQr = $record->stickerMasterRelation->pack_slip_pump ?? null;
|
||||
$hasPumpSetQr = $record->stickerMasterRelation->pack_slip_pumpset ?? null;
|
||||
} elseif (! $hasPumpSetQr && ! $hasPumpQr) {
|
||||
$hasPumpQr = $record->stickerMasterRelation->pack_slip_pump ?? null;
|
||||
}
|
||||
} else {
|
||||
if (! $hasPumpSetQr && ! $hasPumpQr) {
|
||||
$hasPumpQr = $record->stickerMasterRelation->pack_slip_pump ?? null;
|
||||
}
|
||||
|
||||
$invalidPackage = false;
|
||||
$hasTubeMotorQr = $record->stickerMasterRelation->tube_sticker_motor ?? null;
|
||||
$hasPackMotorQr = $record->stickerMasterRelation->pack_slip_motor ?? null;
|
||||
$hasTubePumpSetQr = $record->stickerMasterRelation->tube_sticker_pumpset ?? null;
|
||||
$hasPackPumpSetQr = $record->stickerMasterRelation->pack_slip_pumpset ?? null;
|
||||
if ($hasTubeMotorQr != $hasPackMotorQr || $hasTubePumpSetQr != $hasPackPumpSetQr) {
|
||||
$invalidPackage = true;
|
||||
$hasTubeMotorQr = $record->stickerMasterRelation->tube_sticker_motor ?? null;
|
||||
$hasPackMotorQr = $record->stickerMasterRelation->pack_slip_motor ?? null;
|
||||
$hasTubePumpSetQr = $record->stickerMasterRelation->tube_sticker_pumpset ?? null;
|
||||
$hasPackPumpSetQr = $record->stickerMasterRelation->pack_slip_pumpset ?? null;
|
||||
if ($hasTubeMotorQr != $hasPackMotorQr || $hasTubePumpSetQr != $hasPackPumpSetQr) {
|
||||
$invalidPackage = true;
|
||||
}
|
||||
}
|
||||
|
||||
$hadMotorQr = $record->motor_scanned_status ?? null;
|
||||
|
||||
@@ -237,9 +237,6 @@ class ItemResource extends Resource
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
])
|
||||
// ->filters([
|
||||
// Tables\Filters\TrashedFilter::make(),
|
||||
// ])
|
||||
->filters([
|
||||
Tables\Filters\TrashedFilter::make(),
|
||||
Filter::make('advanced_filters')
|
||||
@@ -251,11 +248,11 @@ class ItemResource extends Resource
|
||||
->options(function (callable $get) {
|
||||
$userHas = Filament::auth()->user()->plant_id;
|
||||
|
||||
return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::pluck('name', 'id')->toArray();
|
||||
return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->orderBy('code')->pluck('name', 'id')->toArray() : Plant::orderBy('code')->pluck('name', 'id')->toArray();
|
||||
})
|
||||
->reactive()
|
||||
->afterStateUpdated(function ($state, callable $set, callable $get): void {
|
||||
$set('item_id', null);
|
||||
$set('code', null);
|
||||
$set('operator_id', null);
|
||||
}),
|
||||
Select::make('code')
|
||||
@@ -300,7 +297,7 @@ class ItemResource extends Resource
|
||||
// Hide all records initially if no filters are applied
|
||||
if (
|
||||
empty($data['Plant']) &&
|
||||
empty($data['item_id']) &&
|
||||
empty($data['code']) &&
|
||||
empty($data['description']) &&
|
||||
empty($data['uom']) &&
|
||||
empty($data['category']) &&
|
||||
@@ -314,8 +311,8 @@ class ItemResource extends Resource
|
||||
$query->where('plant_id', $data['Plant']);
|
||||
}
|
||||
|
||||
if (! empty($data['item_id'])) {
|
||||
$query->where('item_id', $data['item_id']);
|
||||
if (! empty($data['code'])) {
|
||||
$query->where('id', $data['code']);
|
||||
}
|
||||
|
||||
if (! empty($data['description'])) {
|
||||
@@ -337,7 +334,6 @@ class ItemResource extends Resource
|
||||
if (! empty($data['created_to'])) {
|
||||
$query->where('created_at', '<=', $data['created_to']);
|
||||
}
|
||||
|
||||
})
|
||||
->indicateUsing(function (array $data) {
|
||||
$indicators = [];
|
||||
@@ -346,8 +342,8 @@ class ItemResource extends Resource
|
||||
$indicators[] = 'Plant: '.Plant::where('id', $data['Plant'])->value('name');
|
||||
}
|
||||
|
||||
if (! empty($data['item_id'])) {
|
||||
$indicators[] = 'Item Code: '.$data['item_id'];
|
||||
if (! empty($data['code'])) {
|
||||
$indicators[] = 'Item Code: '.Item::where('id', $data['code'])->value('code');
|
||||
}
|
||||
|
||||
if (! empty($data['description'])) {
|
||||
@@ -621,10 +617,10 @@ class ItemResource extends Resource
|
||||
}),
|
||||
// ->maxRows(100000),
|
||||
ExportAction::make()
|
||||
// ->columnMapping(true)
|
||||
// ->columnMapping(true)
|
||||
->label('Export Items')
|
||||
->color('warning')
|
||||
// ->fileName("Items Report " . date('Y-m-d H:i:s'))
|
||||
// ->fileName("Items Report " . date('Y-m-d H:i:s'))
|
||||
->exporter(ItemExporter::class)
|
||||
->visible(function () {
|
||||
return Filament::auth()->user()->can('view export item');
|
||||
|
||||
@@ -601,7 +601,7 @@ class StickerMasterResource extends Resource
|
||||
->options(function (callable $get) {
|
||||
$userHas = Filament::auth()->user()->plant_id;
|
||||
|
||||
return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::pluck('name', 'id')->toArray();
|
||||
return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->orderBy('code')->pluck('name', 'id')->toArray() : Plant::orderBy('code')->pluck('name', 'id')->toArray();
|
||||
})
|
||||
->reactive()
|
||||
->afterStateUpdated(function ($state, callable $set, callable $get): void {
|
||||
|
||||
29
app/Models/StickerPrinting.php
Normal file
29
app/Models/StickerPrinting.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class StickerPrinting extends Model
|
||||
{
|
||||
//
|
||||
|
||||
use SoftDeletes;
|
||||
|
||||
protected $fillable = [
|
||||
'plant_id',
|
||||
'reference_number',
|
||||
'serial_number',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
'created_by',
|
||||
'updated_by',
|
||||
];
|
||||
|
||||
public function plant(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Plant::class);
|
||||
}
|
||||
}
|
||||
@@ -213,6 +213,8 @@ return [
|
||||
|
||||
'user_model' => \App\Models\User::class,
|
||||
|
||||
'user_model_class' => \App\Models\User::class,
|
||||
|
||||
'policies_namespace' => 'App\Policies',
|
||||
],
|
||||
];
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
$sql = <<<'SQL'
|
||||
CREATE TABLE sticker_printings (
|
||||
id BIGINT GENERATED always AS IDENTITY PRIMARY KEY,
|
||||
plant_id BIGINT NOT NULL,
|
||||
|
||||
reference_number TEXT DEFAULT NULL,
|
||||
serial_number TEXT DEFAULT NULL,
|
||||
|
||||
created_at TIMESTAMP NOT NULL DEFAULT NOW(),
|
||||
updated_at TIMESTAMP NOT NULL DEFAULT NOW(),
|
||||
created_by TEXT DEFAULT NULL,
|
||||
updated_by TEXT DEFAULT NULL,
|
||||
deleted_at TIMESTAMP,
|
||||
|
||||
FOREIGN KEY (plant_id) REFERENCES plants (id)
|
||||
);
|
||||
SQL;
|
||||
DB::statement($sql);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('sticker_printings');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user