Updated: Reference Module
This commit is contained in:
parent
208f909824
commit
bf830dc03b
|
|
@ -20,4 +20,8 @@ class Adjustment extends Model
|
|||
return $this->hasMany(AdjustedProduct::class, 'adjustment_id', 'id');
|
||||
}
|
||||
|
||||
public function getReferenceAttribute($value) {
|
||||
return strtoupper($value) . '_' . str_pad($this->attributes['id'], 6, '0', STR_PAD_LEFT );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ class AdjustmentController extends Controller
|
|||
abort_if(Gate::denies('create_adjustments'), 403);
|
||||
|
||||
$request->validate([
|
||||
'reference' => 'required|string|max:255|unique:adjustments,reference',
|
||||
'reference' => 'required|string|max:255',
|
||||
'date' => 'required|date',
|
||||
'note' => 'nullable|string|max:1000',
|
||||
'product_ids' => 'required',
|
||||
|
|
@ -94,7 +94,7 @@ class AdjustmentController extends Controller
|
|||
abort_if(Gate::denies('edit_adjustments'), 403);
|
||||
|
||||
$request->validate([
|
||||
'reference' => 'required|string|max:255|unique:adjustments,reference,' . $adjustment->id,
|
||||
'reference' => 'required|string|max:255',
|
||||
'date' => 'required|date',
|
||||
'note' => 'nullable|string|max:1000',
|
||||
'product_ids' => 'required',
|
||||
|
|
|
|||
|
|
@ -29,14 +29,14 @@
|
|||
<div class="col-lg-6">
|
||||
<div class="form-group">
|
||||
<label for="reference">Reference <span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" name="reference" required>
|
||||
<input type="text" class="form-control" name="reference" required readonly value="ADJ">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<div class="from-group">
|
||||
<div class="form-group">
|
||||
<label for="date">Date <span class="text-danger">*</span></label>
|
||||
<input type="date" class="form-control" name="date" required>
|
||||
<input type="date" class="form-control" name="date" required value="{{ now()->format('Y-m-d') }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
<div class="col-lg-6">
|
||||
<div class="form-group">
|
||||
<label for="reference">Reference <span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" name="reference" required value="{{ $adjustment->reference }}">
|
||||
<input type="text" class="form-control" name="reference" required value="{{ $adjustment->getAttributes()['reference'] }}" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
|
|
|
|||
|
|
@ -124,6 +124,11 @@
|
|||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="margin-top: 25px;">
|
||||
<div class="col-xs-12">
|
||||
<p style="font-style: italic;text-align: center">Computer generated invoice. {{ settings()->company_name }} © {{ date('Y') }}.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class AdjustmentsDataTable extends DataTable
|
|||
->dom("<'row'<'col-md-3'l><'col-md-5 mb-2'B><'col-md-4'f>> .
|
||||
'tr' .
|
||||
<'row'<'col-md-5'i><'col-md-7 mt-2'p>>")
|
||||
->orderBy(0)
|
||||
->orderBy(4)
|
||||
->buttons(
|
||||
Button::make('excel')
|
||||
->text('<i class="bi bi-file-earmark-excel-fill"></i> Excel'),
|
||||
|
|
@ -60,7 +60,10 @@ class AdjustmentsDataTable extends DataTable
|
|||
Column::computed('action')
|
||||
->exportable(false)
|
||||
->printable(false)
|
||||
->className('text-center align-middle')
|
||||
->className('text-center align-middle'),
|
||||
|
||||
Column::make('created_at')
|
||||
->visible(false)
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,9 +22,9 @@
|
|||
<span class="badge badge-pill badge-danger">0</span>
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-menu-right dropdown-menu-lg pt-0">
|
||||
<div class="dropdown-header bg-light"><strong>You have 0 notification!</strong></div>
|
||||
<div class="dropdown-header bg-light"><strong>You have 0 notification.</strong></div>
|
||||
<a class="dropdown-item" href="#">
|
||||
No Notification...
|
||||
<i class="bi bi-app-indicator mr-2 text-danger"></i> No notification available.
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
|
|
|
|||
Loading…
Reference in New Issue