20250420 #156
@ -1,4 +1,9 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
**2025-04-20**
|
||||||
|
- Fixed #155 - Invoice internal ID should be 5 digits
|
||||||
|
- Fixed #154 - Logo name doesn't get replicated
|
||||||
|
- Fixed #153 - Improved product service form again
|
||||||
|
|
||||||
**2025-04-13**
|
**2025-04-13**
|
||||||
- Fixed #132 - Inches / cm toggle for order page (and show unit on pdf)
|
- Fixed #132 - Inches / cm toggle for order page (and show unit on pdf)
|
||||||
- Fixed #148 - Change amount label to unit price on order form (also textarea)
|
- Fixed #148 - Change amount label to unit price on order form (also textarea)
|
||||||
|
@ -219,11 +219,11 @@ public static function form(Form $form): Form
|
|||||||
->label('Product Services')
|
->label('Product Services')
|
||||||
->addActionLabel('Add new product service')
|
->addActionLabel('Add new product service')
|
||||||
->schema([
|
->schema([
|
||||||
Grid::make(19)
|
Grid::make(9)
|
||||||
->schema([
|
->schema([
|
||||||
Select::make('serviceType')
|
Select::make('serviceType')
|
||||||
|
->columnSpan(2)
|
||||||
->options(ServiceType::all()->pluck('value', 'id'))
|
->options(ServiceType::all()->pluck('value', 'id'))
|
||||||
->columnSpan(4)
|
|
||||||
->placeholder('Select...')
|
->placeholder('Select...')
|
||||||
->searchable()
|
->searchable()
|
||||||
->createOptionForm([
|
->createOptionForm([
|
||||||
@ -239,17 +239,15 @@ public static function form(Form $form): Form
|
|||||||
->createOptionUsing(function (array $data): int {
|
->createOptionUsing(function (array $data): int {
|
||||||
return ServiceType::create($data)->getKey();
|
return ServiceType::create($data)->getKey();
|
||||||
}),
|
}),
|
||||||
|
|
||||||
TextInput::make('serviceFileName')
|
TextInput::make('serviceFileName')
|
||||||
|
->columnSpan(2)
|
||||||
->datalist(ServiceFile::all()->unique('name')->pluck('name')->toArray())
|
->datalist(ServiceFile::all()->unique('name')->pluck('name')->toArray())
|
||||||
->columnSpan(3)
|
|
||||||
->label('Logo Name'),
|
->label('Logo Name'),
|
||||||
|
|
||||||
TextInput::make('placement')
|
TextInput::make('placement')
|
||||||
->datalist(ProductService::all()->unique('placement')->pluck('placement')->toArray())
|
->columnSpan(2)
|
||||||
->columnSpan(3),
|
->datalist(ProductService::all()->unique('placement')->pluck('placement')->toArray()),
|
||||||
TextInput::make('serviceFileSetupNumber')
|
|
||||||
->label('Setup')
|
|
||||||
->columnSpan(1)
|
|
||||||
->rules('numeric'),
|
|
||||||
|
|
||||||
Cluster::make([
|
Cluster::make([
|
||||||
TextInput::make('serviceFileWidth')
|
TextInput::make('serviceFileWidth')
|
||||||
@ -260,43 +258,47 @@ public static function form(Form $form): Form
|
|||||||
->rules('numeric'),
|
->rules('numeric'),
|
||||||
])
|
])
|
||||||
->label('Dimensions')
|
->label('Dimensions')
|
||||||
->columnSpan(4),
|
->columnSpan(2),
|
||||||
|
|
||||||
TextInput::make('amount')
|
|
||||||
->label('Quantity')
|
|
||||||
->prefix('#')
|
|
||||||
->columnSpan(2)
|
|
||||||
->rules('numeric'),
|
|
||||||
|
|
||||||
TextInput::make('amount_price')
|
|
||||||
->label('Unit price')
|
|
||||||
->prefix('$')
|
|
||||||
->columnSpan(2)
|
|
||||||
->rules('numeric'),
|
|
||||||
]),
|
|
||||||
|
|
||||||
Grid::make(19)
|
|
||||||
->schema([
|
|
||||||
TextInput::make('serviceFileCode')
|
|
||||||
->label('Code')
|
|
||||||
->datalist(ServiceFile::all()->unique('code')->pluck('code')->toArray())
|
|
||||||
->columnSpan(2)
|
|
||||||
->placeholder('A1234'),
|
|
||||||
|
|
||||||
Select::make('serviceFileSizeUnit')
|
Select::make('serviceFileSizeUnit')
|
||||||
->columnSpan(2)
|
->columnSpan(1)
|
||||||
->selectablePlaceholder(false)
|
->selectablePlaceholder(false)
|
||||||
->label('Unit')
|
->label('Unit')
|
||||||
->options([
|
->options([
|
||||||
'in' => 'Inches',
|
'in' => 'Inches',
|
||||||
'cm' => 'cm',
|
'cm' => 'cm',
|
||||||
]),
|
]),
|
||||||
|
]),
|
||||||
|
|
||||||
|
Grid::make(9)
|
||||||
|
->schema([
|
||||||
|
TextInput::make('serviceFileCode')
|
||||||
|
->columnSpan(1)
|
||||||
|
->label('Code')
|
||||||
|
->datalist(ServiceFile::all()->unique('code')->pluck('code')->toArray()),
|
||||||
|
|
||||||
|
TextInput::make('serviceFileSetupNumber')
|
||||||
|
->columnSpan(1)
|
||||||
|
->label('Setup Number')
|
||||||
|
->rules('numeric'),
|
||||||
|
|
||||||
|
TextInput::make('amount')
|
||||||
|
->columnSpan(1)
|
||||||
|
->label('Quantity')
|
||||||
|
->prefix('#')
|
||||||
|
->rules('numeric'),
|
||||||
|
|
||||||
|
TextInput::make('amount_price')
|
||||||
|
->columnSpan(1)
|
||||||
|
->label('Unit price')
|
||||||
|
->prefix('$')
|
||||||
|
->rules('numeric'),
|
||||||
|
|
||||||
Textarea::make('notes')
|
Textarea::make('notes')
|
||||||
->placeholder('Thread colors... (press enter for new line)')
|
->columnSpan(5)
|
||||||
|
->placeholder('Thread colors (press enter for new line)')
|
||||||
->autosize()
|
->autosize()
|
||||||
->rows(1)
|
->rows(1),
|
||||||
->columnSpan(15),
|
|
||||||
]),
|
]),
|
||||||
])
|
])
|
||||||
->reorderable()
|
->reorderable()
|
||||||
|
@ -200,6 +200,7 @@ protected function getHeaderActions(): array
|
|||||||
foreach ($this->record->productServices as $service) {
|
foreach ($this->record->productServices as $service) {
|
||||||
/** @var ServiceFile $newServiceFile */
|
/** @var ServiceFile $newServiceFile */
|
||||||
$newServiceFile = $service->serviceFile->replicate();
|
$newServiceFile = $service->serviceFile->replicate();
|
||||||
|
$newServiceFile->save();
|
||||||
|
|
||||||
$newService = $service->replicate();
|
$newService = $service->replicate();
|
||||||
$newService->order_id = $replica->id;
|
$newService->order_id = $replica->id;
|
||||||
|
@ -22,9 +22,7 @@ public function creating(Invoice $invoice): void
|
|||||||
*/
|
*/
|
||||||
public function created(Invoice $invoice): void
|
public function created(Invoice $invoice): void
|
||||||
{
|
{
|
||||||
|
$invoice->internal_id = 'TN'.$invoice->id + 40000;
|
||||||
// $invoice->internal_id = 'TN4'.str_pad($invoice->id, 4, '0', STR_PAD_LEFT);
|
|
||||||
$invoice->internal_id = 'TN'.$invoice->id + 4000;
|
|
||||||
$invoice->saveQuietly();
|
$invoice->saveQuietly();
|
||||||
|
|
||||||
$invoice->calculateTotals();
|
$invoice->calculateTotals();
|
||||||
|
@ -54,7 +54,7 @@
|
|||||||
->assertHasNoErrors();
|
->assertHasNoErrors();
|
||||||
|
|
||||||
$this->assertDatabaseHas('invoices', [
|
$this->assertDatabaseHas('invoices', [
|
||||||
'internal_id' => 'TN4001',
|
'internal_id' => 'TN40001',
|
||||||
'customer_id' => $formData['customer_id'],
|
'customer_id' => $formData['customer_id'],
|
||||||
'status' => $formData['status'],
|
'status' => $formData['status'],
|
||||||
'has_gst' => $formData['has_gst'],
|
'has_gst' => $formData['has_gst'],
|
||||||
@ -65,7 +65,7 @@
|
|||||||
'hst_rate' => $hst_rate,
|
'hst_rate' => $hst_rate,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$invoice = Invoice::where('internal_id', 'TN4001')->firstOrFail();
|
$invoice = Invoice::where('internal_id', 'TN40001')->firstOrFail();
|
||||||
|
|
||||||
$this->assertEquals($invoice->orders->isEmpty(), true);
|
$this->assertEquals($invoice->orders->isEmpty(), true);
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user