ranjith-dev #668
@@ -17,6 +17,8 @@ class CustomerPoMasterImporter extends Importer
|
|||||||
{
|
{
|
||||||
protected static ?string $model = CustomerPoMaster::class;
|
protected static ?string $model = CustomerPoMaster::class;
|
||||||
|
|
||||||
|
protected array $importedPos = [];
|
||||||
|
|
||||||
public static function getColumns(): array
|
public static function getColumns(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
@@ -67,6 +69,8 @@ class CustomerPoMasterImporter extends Importer
|
|||||||
$plantCod = $this->data['plant'];
|
$plantCod = $this->data['plant'];
|
||||||
$plant = null;
|
$plant = null;
|
||||||
$item = null;
|
$item = null;
|
||||||
|
$customerPo = trim($this->data['customer_po']);
|
||||||
|
$customerName = trim($this->data['customer_name']);
|
||||||
|
|
||||||
if (Str::length($plantCod) < 4 || ! is_numeric($plantCod) || ! preg_match('/^[1-9]\d{3,}$/', $plantCod)) {
|
if (Str::length($plantCod) < 4 || ! is_numeric($plantCod) || ! preg_match('/^[1-9]\d{3,}$/', $plantCod)) {
|
||||||
$warnMsg[] = 'Invalid plant code found';
|
$warnMsg[] = 'Invalid plant code found';
|
||||||
@@ -90,6 +94,23 @@ class CustomerPoMasterImporter extends Importer
|
|||||||
$warnMsg[] = 'Customer PO cannot be empty.';
|
$warnMsg[] = 'Customer PO cannot be empty.';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset($this->importedPos[$customerPo])) {
|
||||||
|
|
||||||
|
if (strtolower(trim($this->importedPos[$customerPo])) != strtolower($customerName)){
|
||||||
|
$warnMsg[] = "Customer PO '{$customerPo}' has multiple customer names in the import file.";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$this->importedPos[$customerPo] = $customerName;
|
||||||
|
}
|
||||||
|
|
||||||
|
$existingPo = CustomerPoMaster::where('plant_id', $plant->id)->where('customer_po', $this->data['customer_po'])->first();
|
||||||
|
|
||||||
|
if ($existingPo && trim(strtolower($existingPo->customer_name)) != trim(strtolower($this->data['customer_name'])))
|
||||||
|
{
|
||||||
|
$warnMsg[] = "Customer PO '{$this->data['customer_po']}' is already mapped to customer '{$existingPo->customer_name}'.";
|
||||||
|
}
|
||||||
|
|
||||||
// $user = User::where('name', $this->data['created_by'])->first();
|
// $user = User::where('name', $this->data['created_by'])->first();
|
||||||
// if (! $user) {
|
// if (! $user) {
|
||||||
// $warnMsg[] = 'User not found';
|
// $warnMsg[] = 'User not found';
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ class MachineResource extends Resource
|
|||||||
Forms\Components\Select::make('plant_id')
|
Forms\Components\Select::make('plant_id')
|
||||||
->label('Plant Name')
|
->label('Plant Name')
|
||||||
->relationship('plant', 'name')
|
->relationship('plant', 'name')
|
||||||
|
->searchable()
|
||||||
->required()
|
->required()
|
||||||
->columnSpan(1)
|
->columnSpan(1)
|
||||||
->reactive()
|
->reactive()
|
||||||
@@ -75,6 +76,7 @@ class MachineResource extends Resource
|
|||||||
Forms\Components\Select::make('line_id')
|
Forms\Components\Select::make('line_id')
|
||||||
->label('Line Name')
|
->label('Line Name')
|
||||||
->relationship('line', 'name')
|
->relationship('line', 'name')
|
||||||
|
->searchable()
|
||||||
->required()
|
->required()
|
||||||
->columnSpan(1)
|
->columnSpan(1)
|
||||||
->reactive()
|
->reactive()
|
||||||
@@ -115,6 +117,7 @@ class MachineResource extends Resource
|
|||||||
Forms\Components\Select::make('work_group_master_id')
|
Forms\Components\Select::make('work_group_master_id')
|
||||||
->label('Group Work Center')
|
->label('Group Work Center')
|
||||||
->relationship('workGroupMaster', 'name')
|
->relationship('workGroupMaster', 'name')
|
||||||
|
->searchable()
|
||||||
->required()
|
->required()
|
||||||
->columnSpan(1)
|
->columnSpan(1)
|
||||||
->reactive()
|
->reactive()
|
||||||
@@ -142,6 +145,7 @@ class MachineResource extends Resource
|
|||||||
$lineId = $get('line_id');
|
$lineId = $get('line_id');
|
||||||
if (! $lineId) {
|
if (! $lineId) {
|
||||||
$set('mGroupWorkError', 'Please select a line first.');
|
$set('mGroupWorkError', 'Please select a line first.');
|
||||||
|
$set('work_group_master_id', null);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ class WorkGroupMasterResource extends Resource
|
|||||||
Forms\Components\Select::make('plant_id')
|
Forms\Components\Select::make('plant_id')
|
||||||
->label('Plant Name')
|
->label('Plant Name')
|
||||||
->relationship('plant', 'name')
|
->relationship('plant', 'name')
|
||||||
|
->searchable()
|
||||||
->reactive()
|
->reactive()
|
||||||
->columnSpan(1)
|
->columnSpan(1)
|
||||||
->required()
|
->required()
|
||||||
@@ -55,22 +56,20 @@ class WorkGroupMasterResource extends Resource
|
|||||||
->afterStateUpdated(function ($state, $set, callable $get) {
|
->afterStateUpdated(function ($state, $set, callable $get) {
|
||||||
$plantId = $get('plant_id');
|
$plantId = $get('plant_id');
|
||||||
|
|
||||||
if (! $plantId) {
|
$set('wgmPlantError', null);
|
||||||
$set('pqPlantError', 'Please select a plant first.');
|
|
||||||
$set('name', null);
|
|
||||||
$set('description', null);
|
|
||||||
$set('operation_number', null);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$set('validationError', null);
|
|
||||||
$set('pqPlantError', null);
|
|
||||||
$set('name', null);
|
$set('name', null);
|
||||||
$set('description', null);
|
$set('description', null);
|
||||||
$set('operation_number', null);
|
$set('operation_number', null);
|
||||||
|
if (! $plantId) {
|
||||||
|
$set('wgmPlantError', 'Please select a plant first.');
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
})
|
})
|
||||||
->hint(fn ($get) => $get('pqPlantError') ? $get('pqPlantError') : null)
|
->extraAttributes(fn ($get) => [
|
||||||
|
'class' => $get('wgmPlantError') ? 'border-red-500' : '',
|
||||||
|
])
|
||||||
|
->hint(fn ($get) => $get('wgmPlantError') ? $get('wgmPlantError') : null)
|
||||||
->hintColor('danger'),
|
->hintColor('danger'),
|
||||||
Forms\Components\TextInput::make('name')
|
Forms\Components\TextInput::make('name')
|
||||||
->label('Group Work Center')
|
->label('Group Work Center')
|
||||||
|
|||||||
@@ -12,10 +12,10 @@
|
|||||||
|
|
||||||
$headerRows = [
|
$headerRows = [
|
||||||
'PRODUCT' => $product,
|
'PRODUCT' => $product,
|
||||||
'MONTH/YEAR' => $monthYear,
|
'MFG. MONTH & YEAR' => $monthYear,
|
||||||
'CUSTOMER PO' => $customerCode,
|
'CUSTOMER PO' => $customerCode,
|
||||||
'CUSTOMER NAME' => $customerName,
|
'CUSTOMER NAME' => $customerName,
|
||||||
'NO OF MASTER BOX' => $masterBox,
|
'MASTER BOX NO.' => $masterBox,
|
||||||
];
|
];
|
||||||
|
|
||||||
$titleHeight = 10;
|
$titleHeight = 10;
|
||||||
@@ -55,6 +55,9 @@
|
|||||||
if ($numItems == 1) {
|
if ($numItems == 1) {
|
||||||
$itemRowHeight -= 0.5;
|
$itemRowHeight -= 0.5;
|
||||||
}
|
}
|
||||||
|
if ($numItems == 2) {
|
||||||
|
$itemRowHeight += 0.4;
|
||||||
|
}
|
||||||
|
|
||||||
if ($itemRowHeight < 3) {
|
if ($itemRowHeight < 3) {
|
||||||
$itemFontSize = '5.5px';
|
$itemFontSize = '5.5px';
|
||||||
@@ -290,7 +293,7 @@
|
|||||||
style="height: <?php echo $logoHeight; ?>mm;
|
style="height: <?php echo $logoHeight; ?>mm;
|
||||||
max-width: <?php echo $logoMaxWidth; ?>mm;
|
max-width: <?php echo $logoMaxWidth; ?>mm;
|
||||||
width: auto;">
|
width: auto;">
|
||||||
C.R.I POLY WRAPPED WINDING WIRE
|
C.R.I. POLY WRAPPED WINDING WIRE
|
||||||
<div class="vertical-line right"></div>
|
<div class="vertical-line right"></div>
|
||||||
{{-- <img src="<?php echo public_path('images/isi_8783.png'); ?>"
|
{{-- <img src="<?php echo public_path('images/isi_8783.png'); ?>"
|
||||||
class="logo"
|
class="logo"
|
||||||
@@ -320,8 +323,8 @@
|
|||||||
<tr class="items-header-row">
|
<tr class="items-header-row">
|
||||||
<td class="col-1 center">MATERIAL CODE</td>
|
<td class="col-1 center">MATERIAL CODE</td>
|
||||||
<td class="col-2 center">DESCRIPTION</td>
|
<td class="col-2 center">DESCRIPTION</td>
|
||||||
<td class="col-3 center">QTY</td>
|
<td class="col-3 center">QTY in kg</td>
|
||||||
<td class="col-4 center">NO OF BOX</td>
|
<td class="col-4 center">NO. OF BOXES</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<!-- Item Rows - ONLY THESE ADJUST DYNAMICALLY -->
|
<!-- Item Rows - ONLY THESE ADJUST DYNAMICALLY -->
|
||||||
@@ -342,13 +345,13 @@
|
|||||||
|
|
||||||
<!-- Gross Weight - FIXED 5mm -->
|
<!-- Gross Weight - FIXED 5mm -->
|
||||||
<tr class="gross-weight-row">
|
<tr class="gross-weight-row">
|
||||||
<td colspan="2" class="label center">GROSS WEIGHT</td>
|
<td colspan="2" class="label center">GROSS WEIGHT(kg)</td>
|
||||||
<td colspan="2" class="center"><?php echo number_format($grossWeight, 3); ?></td>
|
<td colspan="2" class="center"><?php echo number_format($grossWeight, 3); ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<!-- Net Weight - FIXED 5mm -->
|
<!-- Net Weight - FIXED 5mm -->
|
||||||
<tr class="net-weight-row">
|
<tr class="net-weight-row">
|
||||||
<td colspan="2" class="label center">NET WEIGHT</td>
|
<td colspan="2" class="label center">NET WEIGHT(kg)</td>
|
||||||
<td colspan="2" class="center"><?php echo number_format($netWeight, 3); ?></td>
|
<td colspan="2" class="center"><?php echo number_format($netWeight, 3); ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
@@ -368,8 +371,8 @@
|
|||||||
C.R.I. PUMPS PRIVATE LIMITED<br>
|
C.R.I. PUMPS PRIVATE LIMITED<br>
|
||||||
(Unit of {{ $plantName }})<br>
|
(Unit of {{ $plantName }})<br>
|
||||||
{{ $plantAddress }}<br>
|
{{ $plantAddress }}<br>
|
||||||
India Regd.Office : 7/46-1, Keeranatham Road, Saravanampatti, Coimbatore-641 036<br>
|
India Regd.Office : 7/46-1, Keeranatham Road, Saravanampatti, Coimbatore- 641 035<br>
|
||||||
For Feedback/Complaint: C.R.I Customer care cell Toll-Free: 1800 121 1243
|
For Feedback/Complaint: C.R.I. Customer care cell Toll-Free: 1800 121 1243
|
||||||
{{-- <img src="{{ $qrBase64 }}"
|
{{-- <img src="{{ $qrBase64 }}"
|
||||||
style="position: absolute; bottom: 2.8mm; right: 2mm; width: 8mm; height: 6.8mm;"> --}}
|
style="position: absolute; bottom: 2.8mm; right: 2mm; width: 8mm; height: 6.8mm;"> --}}
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
Reference in New Issue
Block a user