File tree Expand file tree Collapse file tree 3 files changed +17
-7
lines changed
CustomerResource/RelationManagers
SupplierResource/RelationManagers Expand file tree Collapse file tree 3 files changed +17
-7
lines changed Original file line number Diff line number Diff line change 66use Filament \Resources \RelationManagers \RelationManager ;
77use Filament \Tables ;
88use Filament \Tables \Table ;
9+ use Malzariey \FilamentDaterangepickerFilter \Filters \DateRangeFilter ;
910
1011class SalesRelationManager extends RelationManager
1112{
@@ -15,13 +16,17 @@ public function table(Table $table): Table
1516 {
1617 return $ table
1718 ->columns ([
18- Tables \Columns \TextColumn::make ('invoice_number ' ),
19+ Tables \Columns \TextColumn::make ('invoice_number ' )
20+ ->searchable (),
1921 Tables \Columns \TextColumn::make ('sale_date ' )
2022 ->date (),
2123 Tables \Columns \TextColumn::make ('total_amount ' ),
2224 Tables \Columns \TextColumn::make ('paid_amount ' ),
2325 Tables \Columns \TextColumn::make ('paymentType.name ' ),
2426 ])
27+ ->filters ([
28+ DateRangeFilter::make ('sale_date ' ),
29+ ])
2530 ->actions ([
2631 Tables \Actions \Action::make ('Download Invoice ' )
2732 ->icon ('heroicon-o-document-arrow-down ' )
Original file line number Diff line number Diff line change @@ -158,16 +158,16 @@ public static function table(Table $table): Table
158158 ->columns ([
159159 Tables \Columns \TextColumn::make ('purchase_code ' )
160160 ->searchable (),
161+ Tables \Columns \TextColumn::make ('order_date ' )
162+ ->date ()
163+ ->sortable (),
161164 Tables \Columns \TextColumn::make ('supplier.company_name ' )
162165 ->numeric ()
163166 ->sortable (),
164167 Tables \Columns \TextColumn::make ('total_amount ' )
165168 ->formatStateUsing (fn ($ state ): string => number_format ($ state , 2 ).' ' .$ currency ),
166169 Tables \Columns \TextColumn::make ('remaining_amount ' )
167170 ->formatStateUsing (fn ($ state ): string => number_format ($ state , 2 ).' ' .$ currency ),
168- Tables \Columns \TextColumn::make ('order_date ' )
169- ->date ()
170- ->sortable (),
171171 Tables \Columns \TextColumn::make ('status ' )
172172 ->badge ()
173173 ->sortable (),
Original file line number Diff line number Diff line change 77use Filament \Resources \RelationManagers \RelationManager ;
88use Filament \Tables ;
99use Filament \Tables \Table ;
10+ use Malzariey \FilamentDaterangepickerFilter \Filters \DateRangeFilter ;
1011
1112class PurchaseOrdersRelationManager extends RelationManager
1213{
@@ -28,18 +29,22 @@ public function table(Table $table): Table
2829 ->columns ([
2930 Tables \Columns \TextColumn::make ('purchase_code ' )
3031 ->searchable (),
32+ Tables \Columns \TextColumn::make ('order_date ' )
33+ ->date ()
34+ ->sortable (),
3135 Tables \Columns \TextColumn::make ('total_amount ' )
3236 ->formatStateUsing (fn ($ state ): string => number_format ($ state , 2 )),
3337 Tables \Columns \TextColumn::make ('remaining_amount ' )
3438 ->getStateUsing (function ($ record ): float {
3539 return $ record ->total_amount - $ record ->paid_amount ;
3640 })
3741 ->formatStateUsing (fn ($ state ): string => number_format ($ state , 2 )),
38- Tables \Columns \TextColumn::make ('order_date ' )
39- ->date ()
40- ->sortable (),
4142 Tables \Columns \TextColumn::make ('status ' )
4243 ->badge (),
44+ Tables \Columns \TextColumn::make ('user.name ' ),
45+ ])
46+ ->filters ([
47+ DateRangeFilter::make ('order_date ' ),
4348 ])
4449 ->actions ([
4550 Tables \Actions \ViewAction::make (),
You can’t perform that action at this time.
0 commit comments