Work on invoices and table spacing
This commit is contained in:
parent
1f1f783aa9
commit
1ffd38fd53
3
.gitignore
vendored
3
.gitignore
vendored
@ -103,3 +103,6 @@ fabric.properties
|
|||||||
.idea/caches/build_file_checksums.ser
|
.idea/caches/build_file_checksums.ser
|
||||||
|
|
||||||
.idea
|
.idea
|
||||||
|
.directory
|
||||||
|
.directory
|
||||||
|
.directory
|
||||||
|
@ -45,6 +45,7 @@ public static function form(Form $form): Form
|
|||||||
->options(Customer::all()->pluck('company_name', 'id'))
|
->options(Customer::all()->pluck('company_name', 'id'))
|
||||||
->reactive()
|
->reactive()
|
||||||
->searchable()
|
->searchable()
|
||||||
|
->disabledOn('edit')
|
||||||
->columnSpan(2),
|
->columnSpan(2),
|
||||||
|
|
||||||
Split::make([
|
Split::make([
|
||||||
@ -56,6 +57,8 @@ public static function form(Form $form): Form
|
|||||||
->columnSpan(2),
|
->columnSpan(2),
|
||||||
Select::make('status')
|
Select::make('status')
|
||||||
->options(InvoiceStatus::class)
|
->options(InvoiceStatus::class)
|
||||||
|
->searchable()
|
||||||
|
->required()
|
||||||
->default(InvoiceStatus::UNPAID),
|
->default(InvoiceStatus::UNPAID),
|
||||||
])->columnSpan(2),
|
])->columnSpan(2),
|
||||||
|
|
||||||
@ -97,24 +100,31 @@ public static function table(Table $table): Table
|
|||||||
->searchable(),
|
->searchable(),
|
||||||
Tables\Columns\TextColumn::make('customer.company_name')
|
Tables\Columns\TextColumn::make('customer.company_name')
|
||||||
->sortable()
|
->sortable()
|
||||||
|
->extraHeaderAttributes(['class' => 'w-full'])
|
||||||
->searchable(),
|
->searchable(),
|
||||||
Tables\Columns\TextColumn::make('created_at')
|
|
||||||
->date()
|
|
||||||
->sortable(),
|
|
||||||
Tables\Columns\TextColumn::make('gst_amount')
|
|
||||||
->label('GST')
|
|
||||||
->prefix('$'),
|
|
||||||
Tables\Columns\TextColumn::make('pst_amount')
|
|
||||||
->label('PST')
|
|
||||||
->prefix('$'),
|
|
||||||
Tables\Columns\TextColumn::make('subtotal')
|
|
||||||
->prefix('$'),
|
|
||||||
Tables\Columns\TextColumn::make('total')
|
|
||||||
->prefix('$')
|
|
||||||
->weight('bold'),
|
|
||||||
Tables\Columns\TextColumn::make('status')
|
Tables\Columns\TextColumn::make('status')
|
||||||
->badge(InvoiceStatus::class)
|
->badge(InvoiceStatus::class)
|
||||||
->sortable(),
|
->sortable(),
|
||||||
|
Tables\Columns\TextColumn::make('created_at')
|
||||||
|
->label('Created')
|
||||||
|
->date()
|
||||||
|
->sortable(),
|
||||||
|
Tables\Columns\TextColumn::make('subtotal')
|
||||||
|
->money('USD')
|
||||||
|
->alignRight(),
|
||||||
|
Tables\Columns\TextColumn::make('gst_amount')
|
||||||
|
->label('GST')
|
||||||
|
// ->prefix('$')
|
||||||
|
->money('USD')
|
||||||
|
->alignRight(),
|
||||||
|
Tables\Columns\TextColumn::make('pst_amount')
|
||||||
|
->label('PST')
|
||||||
|
->money('USD')
|
||||||
|
->alignRight(),
|
||||||
|
Tables\Columns\TextColumn::make('total')
|
||||||
|
->money('USD')
|
||||||
|
->weight('bold')
|
||||||
|
->alignRight(),
|
||||||
])
|
])
|
||||||
|
|
||||||
->filters([
|
->filters([
|
||||||
|
@ -30,10 +30,15 @@ public function table(Table $table): Table
|
|||||||
->columns([
|
->columns([
|
||||||
Tables\Columns\TextColumn::make('customer_po')
|
Tables\Columns\TextColumn::make('customer_po')
|
||||||
->color('code')
|
->color('code')
|
||||||
->weight('bold'),
|
->weight('bold')
|
||||||
Tables\Columns\TextColumn::make('total_product_quantity'),
|
->extraHeaderAttributes(['class' => 'w-full']),
|
||||||
|
Tables\Columns\TextColumn::make('total_product_quantity')
|
||||||
|
->label('Total QTY')
|
||||||
|
->alignRight(),
|
||||||
Tables\Columns\TextColumn::make('total_service_price')
|
Tables\Columns\TextColumn::make('total_service_price')
|
||||||
->prefix('$'),
|
->alignRight()
|
||||||
|
->label('Total price')
|
||||||
|
->money('usd'),
|
||||||
])
|
])
|
||||||
->filters([
|
->filters([
|
||||||
//
|
//
|
||||||
|
@ -37,7 +37,7 @@ public function table(Table $table): Table
|
|||||||
->color('code')
|
->color('code')
|
||||||
->weight('bold')
|
->weight('bold')
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('service_type')
|
Tables\Columns\TextColumn::make('serviceType.name')
|
||||||
->label('Type')
|
->label('Type')
|
||||||
->weight('bold')
|
->weight('bold')
|
||||||
->sortable(),
|
->sortable(),
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
use App\Models\Contact;
|
use App\Models\Contact;
|
||||||
use App\Models\Customer;
|
use App\Models\Customer;
|
||||||
use App\Models\Order;
|
use App\Models\Order;
|
||||||
|
use App\Models\ServiceType;
|
||||||
use Filament\Forms\Components\DatePicker;
|
use Filament\Forms\Components\DatePicker;
|
||||||
use Filament\Forms\Components\Grid;
|
use Filament\Forms\Components\Grid;
|
||||||
use Filament\Forms\Components\Repeater;
|
use Filament\Forms\Components\Repeater;
|
||||||
@ -146,15 +147,11 @@ public static function form(Form $form): Form
|
|||||||
->schema([
|
->schema([
|
||||||
Grid::make(19)
|
Grid::make(19)
|
||||||
->schema([
|
->schema([
|
||||||
TextInput::make('service_type')
|
Select::make('serviceType')
|
||||||
->datalist([
|
->options(ServiceType::all()->pluck('name', 'id'))
|
||||||
'Embroidery',
|
->columnSpan(2)
|
||||||
'SCP',
|
->placeholder('Select...')
|
||||||
'Vinyl',
|
->searchable(),
|
||||||
'Editing',
|
|
||||||
'Digitizing',
|
|
||||||
])
|
|
||||||
->columnSpan(2),
|
|
||||||
TextInput::make('placement')
|
TextInput::make('placement')
|
||||||
->columnSpan(3),
|
->columnSpan(3),
|
||||||
TextInput::make('serviceFileName')
|
TextInput::make('serviceFileName')
|
||||||
@ -243,7 +240,7 @@ public static function table(Table $table): Table
|
|||||||
->searchable()
|
->searchable()
|
||||||
->sortable()
|
->sortable()
|
||||||
->extraHeaderAttributes([
|
->extraHeaderAttributes([
|
||||||
'class' => 'w-8',
|
'class' => 'w-full',
|
||||||
]),
|
]),
|
||||||
TextColumn::make('order_date')
|
TextColumn::make('order_date')
|
||||||
->searchable()
|
->searchable()
|
||||||
|
@ -42,8 +42,15 @@ public static function table(Table $table): Table
|
|||||||
{
|
{
|
||||||
return $table
|
return $table
|
||||||
->columns([
|
->columns([
|
||||||
Tables\Columns\TextColumn::make('name'),
|
Tables\Columns\TextColumn::make('name')
|
||||||
|
->label('Code'),
|
||||||
|
|
||||||
|
Tables\Columns\TextColumn::make('value')
|
||||||
|
->label('Long Name')
|
||||||
|
->extraHeaderAttributes(['class' => 'w-full']),
|
||||||
|
|
||||||
Tables\Columns\TextColumn::make('quantity')
|
Tables\Columns\TextColumn::make('quantity')
|
||||||
|
->alignRight()
|
||||||
->getStateUsing(function (Table $table, Model $record) {
|
->getStateUsing(function (Table $table, Model $record) {
|
||||||
return $record->getQuantityAttribute(
|
return $record->getQuantityAttribute(
|
||||||
$table->getFilter('created_at')->getState()['created_at'],
|
$table->getFilter('created_at')->getState()['created_at'],
|
||||||
@ -52,6 +59,7 @@ public static function table(Table $table): Table
|
|||||||
}),
|
}),
|
||||||
|
|
||||||
Tables\Columns\TextColumn::make('amount')
|
Tables\Columns\TextColumn::make('amount')
|
||||||
|
->alignRight()
|
||||||
->getStateUsing(function (Table $table, Model $record) {
|
->getStateUsing(function (Table $table, Model $record) {
|
||||||
return $record->getAmountAttribute(
|
return $record->getAmountAttribute(
|
||||||
$table->getFilter('created_at')->getState()['created_at'],
|
$table->getFilter('created_at')->getState()['created_at'],
|
||||||
@ -61,6 +69,7 @@ public static function table(Table $table): Table
|
|||||||
->prefix('$'),
|
->prefix('$'),
|
||||||
|
|
||||||
Tables\Columns\TextColumn::make('salesPercentage')
|
Tables\Columns\TextColumn::make('salesPercentage')
|
||||||
|
->alignRight()
|
||||||
->getStateUsing(function (Table $table, Model $record) {
|
->getStateUsing(function (Table $table, Model $record) {
|
||||||
return $record->getSalesPercentageAttribute(
|
return $record->getSalesPercentageAttribute(
|
||||||
$table->getFilter('created_at')->getState()['created_at'],
|
$table->getFilter('created_at')->getState()['created_at'],
|
||||||
@ -68,7 +77,7 @@ public static function table(Table $table): Table
|
|||||||
);
|
);
|
||||||
})
|
})
|
||||||
->suffix('%')
|
->suffix('%')
|
||||||
->label('Sales percentage'),
|
->label('% sales'),
|
||||||
|
|
||||||
Tables\Columns\TextColumn::make('averagePrice')
|
Tables\Columns\TextColumn::make('averagePrice')
|
||||||
->getStateUsing(function (Table $table, Model $record) {
|
->getStateUsing(function (Table $table, Model $record) {
|
||||||
@ -77,6 +86,8 @@ public static function table(Table $table): Table
|
|||||||
$table->getFilter('created_until')->getState()['created_until']
|
$table->getFilter('created_until')->getState()['created_until']
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
|
->alignRight()
|
||||||
|
->label('Average')
|
||||||
->prefix('$'),
|
->prefix('$'),
|
||||||
])
|
])
|
||||||
->filters([
|
->filters([
|
||||||
|
@ -81,7 +81,7 @@ public function getGstAmountAttribute(): float
|
|||||||
return number_format($this->subtotal * 0.05, 2);
|
return number_format($this->subtotal * 0.05, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0.00;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPstAmountAttribute(): float
|
public function getPstAmountAttribute(): float
|
||||||
@ -90,7 +90,7 @@ public function getPstAmountAttribute(): float
|
|||||||
return number_format($this->subtotal * 0.07, 2);
|
return number_format($this->subtotal * 0.07, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0.00;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function orders(): HasMany
|
public function orders(): HasMany
|
||||||
|
@ -16,7 +16,6 @@ class ProductService extends Model
|
|||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
'order_id',
|
'order_id',
|
||||||
'service_file_id',
|
'service_file_id',
|
||||||
// 'service_type',
|
|
||||||
'placement',
|
'placement',
|
||||||
'setup_amount',
|
'setup_amount',
|
||||||
'amount',
|
'amount',
|
||||||
|
@ -24,7 +24,12 @@ public function definition(): array
|
|||||||
return [
|
return [
|
||||||
'created_at' => $order_date,
|
'created_at' => $order_date,
|
||||||
'updated_at' => Carbon::now(),
|
'updated_at' => Carbon::now(),
|
||||||
'customer_po' => $this->faker->randomNumber(6, true),
|
|
||||||
|
'customer_po' => $this->faker->randomElement([
|
||||||
|
$this->faker->randomNumber(6, true),
|
||||||
|
$this->faker->words(rand(2, 6), true),
|
||||||
|
]),
|
||||||
|
|
||||||
'order_type' => $this->faker->randomElement(OrderType::cases())->value,
|
'order_type' => $this->faker->randomElement(OrderType::cases())->value,
|
||||||
'order_date' => $order_date,
|
'order_date' => $order_date,
|
||||||
'due_date' => $due_date,
|
'due_date' => $due_date,
|
||||||
@ -39,7 +44,6 @@ public function definition(): array
|
|||||||
'garments' => $this->faker->boolean(),
|
'garments' => $this->faker->boolean(),
|
||||||
'supplied_file' => $this->faker->boolean(),
|
'supplied_file' => $this->faker->boolean(),
|
||||||
|
|
||||||
// 'order_attributes' => ['New Art', 'Garments', 'Rush'],
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
32
package-lock.json
generated
32
package-lock.json
generated
@ -6,7 +6,7 @@
|
|||||||
"": {
|
"": {
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bootstrap-icons": "^1.11.3",
|
"bootstrap-icons": "^1.11.3",
|
||||||
"puppeteer": "^23.7.1"
|
"puppeteer": "^23.8.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@popperjs/core": "^2.11.6",
|
"@popperjs/core": "^2.11.6",
|
||||||
@ -1546,9 +1546,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/devtools-protocol": {
|
"node_modules/devtools-protocol": {
|
||||||
"version": "0.0.1354347",
|
"version": "0.0.1367902",
|
||||||
"resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1354347.tgz",
|
"resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1367902.tgz",
|
||||||
"integrity": "sha512-BlmkSqV0V84E2WnEnoPnwyix57rQxAM5SKJjf4TbYOCGLAWtz8CDH8RIaGOjPgPCXo2Mce3kxSY497OySidY3Q==",
|
"integrity": "sha512-XxtPuC3PGakY6PD7dG66/o8KwJ/LkH2/EKe19Dcw58w53dv4/vSQEkn/SzuyhHE2q4zPgCkxQBxus3VV4ql+Pg==",
|
||||||
"license": "BSD-3-Clause"
|
"license": "BSD-3-Clause"
|
||||||
},
|
},
|
||||||
"node_modules/didyoumean": {
|
"node_modules/didyoumean": {
|
||||||
@ -2808,17 +2808,17 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/puppeteer": {
|
"node_modules/puppeteer": {
|
||||||
"version": "23.7.1",
|
"version": "23.8.0",
|
||||||
"resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-23.7.1.tgz",
|
"resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-23.8.0.tgz",
|
||||||
"integrity": "sha512-jS6XehagMvxQ12etwY/4EOYZ0Sm8GAsrtGhdQn4AqpJAyHc3RYl7tGd4QYh/MmShDw8sF9FWYQqGidhoXaqokQ==",
|
"integrity": "sha512-MFWDMWoCcOpwNwQIjA9gPKWrEUbj8bLCzkK56w5lZPMUT6wK4FfpgOEPxKffVmXEMYMZzgcjxzqy15b/Q1ibaw==",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@puppeteer/browsers": "2.4.1",
|
"@puppeteer/browsers": "2.4.1",
|
||||||
"chromium-bidi": "0.8.0",
|
"chromium-bidi": "0.8.0",
|
||||||
"cosmiconfig": "^9.0.0",
|
"cosmiconfig": "^9.0.0",
|
||||||
"devtools-protocol": "0.0.1354347",
|
"devtools-protocol": "0.0.1367902",
|
||||||
"puppeteer-core": "23.7.1",
|
"puppeteer-core": "23.8.0",
|
||||||
"typed-query-selector": "^2.12.0"
|
"typed-query-selector": "^2.12.0"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
@ -2829,15 +2829,15 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/puppeteer-core": {
|
"node_modules/puppeteer-core": {
|
||||||
"version": "23.7.1",
|
"version": "23.8.0",
|
||||||
"resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-23.7.1.tgz",
|
"resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-23.8.0.tgz",
|
||||||
"integrity": "sha512-Om/qCZhd+HLoAr7GltrRAZpS3uOXwHu7tXAoDbNcJADHjG2zeAlDArgyIPXYGG4QB/EQUHk13Q6RklNxGM73Pg==",
|
"integrity": "sha512-c2ymGN2M//We7pC+JhP2dE/g4+qnT89BO+EMSZyJmecN3DN6RNqErA7eH7DrWoNIcU75r2nP4VHa4pswAL6NVg==",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@puppeteer/browsers": "2.4.1",
|
"@puppeteer/browsers": "2.4.1",
|
||||||
"chromium-bidi": "0.8.0",
|
"chromium-bidi": "0.8.0",
|
||||||
"debug": "^4.3.7",
|
"debug": "^4.3.7",
|
||||||
"devtools-protocol": "0.0.1354347",
|
"devtools-protocol": "0.0.1367902",
|
||||||
"typed-query-selector": "^2.12.0",
|
"typed-query-selector": "^2.12.0",
|
||||||
"ws": "^8.18.0"
|
"ws": "^8.18.0"
|
||||||
},
|
},
|
||||||
@ -3133,9 +3133,9 @@
|
|||||||
"license": "BSD-3-Clause"
|
"license": "BSD-3-Clause"
|
||||||
},
|
},
|
||||||
"node_modules/streamx": {
|
"node_modules/streamx": {
|
||||||
"version": "2.20.1",
|
"version": "2.20.2",
|
||||||
"resolved": "https://registry.npmjs.org/streamx/-/streamx-2.20.1.tgz",
|
"resolved": "https://registry.npmjs.org/streamx/-/streamx-2.20.2.tgz",
|
||||||
"integrity": "sha512-uTa0mU6WUC65iUvzKH4X9hEdvSW7rbPxPtwfWiLMSj3qTdQbAiUboZTxauKfpFuGIGa1C2BYijZ7wgdUXICJhA==",
|
"integrity": "sha512-aDGDLU+j9tJcUdPGOaHmVF1u/hhI+CsGkT02V3OKlHDV7IukOI+nTWAGkiZEKCO35rWN1wIr4tS7YFr1f4qSvA==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"fast-fifo": "^1.3.2",
|
"fast-fifo": "^1.3.2",
|
||||||
|
@ -18,6 +18,6 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bootstrap-icons": "^1.11.3",
|
"bootstrap-icons": "^1.11.3",
|
||||||
"puppeteer": "^23.7.1"
|
"puppeteer": "^23.8.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
@ -1,10 +1,10 @@
|
|||||||
<style>
|
<style>
|
||||||
* {
|
* {
|
||||||
font-size: 12px;
|
font-size: 10px;
|
||||||
margin: 10px 5px;
|
margin: 10px 5px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
{{$invoice->internal_id}}, page @pageNumber of @totalPages
|
{{$invoice->internal_id}}, page @pageNumber of @totalPages
|
||||||
</footer>'
|
</footer>
|
@ -1,6 +1,12 @@
|
|||||||
@extends('layouts.pdf')
|
@extends('layouts.pdf')
|
||||||
|
|
||||||
<div class="container-fluid pt-4 font-serif" style="font-size: 0.9rem">
|
<style>
|
||||||
|
* {
|
||||||
|
font-size: 0.9rem;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<div class="container-fluid pt-4 font-serif" style="">
|
||||||
<div class="fw-bold">
|
<div class="fw-bold">
|
||||||
TOP NOTCH EMBROIDERY & DIGITIZING LTD.
|
TOP NOTCH EMBROIDERY & DIGITIZING LTD.
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user