Andrew Wallo 4 maanden geleden
bovenliggende
commit
9fe08e462d

+ 16
- 2
app/Filament/Company/Resources/Purchases/BillResource/Pages/PayBills.php Bestand weergeven

@@ -220,6 +220,20 @@ class PayBills extends ListRecords
220 220
                                 return $activeCurrency && $activeCurrency !== $bankAccountCurrency;
221 221
                             }),
222 222
                     ]),
223
+                Tables\Columns\IconColumn::make('applyFullAmountAction')
224
+                    ->icon('heroicon-m-chevron-double-right')
225
+                    ->color('primary')
226
+                    ->label('')
227
+                    ->default('')
228
+                    ->alignCenter()
229
+                    ->width('3rem')
230
+                    ->tooltip('Apply full amount')
231
+                    ->action(
232
+                        Tables\Actions\Action::make('applyFullPayment')
233
+                            ->action(function (Bill $record) {
234
+                                $this->paymentAmounts[$record->id] = $record->amount_due;
235
+                            }),
236
+                    ),
223 237
                 CustomTextInputColumn::make('payment_amount')
224 238
                     ->label('Payment amount')
225 239
                     ->alignEnd()
@@ -271,8 +285,8 @@ class PayBills extends ListRecords
271 285
                     ]),
272 286
             ])
273 287
             ->bulkActions([
274
-                Tables\Actions\BulkAction::make('setFullAmounts')
275
-                    ->label('Set full amounts')
288
+                Tables\Actions\BulkAction::make('applyFullAmounts')
289
+                    ->label('Apply full amounts')
276 290
                     ->icon('heroicon-o-banknotes')
277 291
                     ->color('primary')
278 292
                     ->deselectRecordsAfterCompletion()

+ 16
- 2
app/Filament/Company/Resources/Sales/InvoiceResource/Pages/RecordPayments.php Bestand weergeven

@@ -292,6 +292,20 @@ class RecordPayments extends ListRecords
292 292
                                 return $activeCurrency && $activeCurrency !== $bankAccountCurrency;
293 293
                             }),
294 294
                     ]),
295
+                Tables\Columns\IconColumn::make('applyFullAmountAction')
296
+                    ->icon('heroicon-m-chevron-double-right')
297
+                    ->color('primary')
298
+                    ->label('')
299
+                    ->default('')
300
+                    ->alignCenter()
301
+                    ->width('3rem')
302
+                    ->tooltip('Apply full amount')
303
+                    ->action(
304
+                        Tables\Actions\Action::make('applyFullPayment')
305
+                            ->action(function (Invoice $record) {
306
+                                $this->paymentAmounts[$record->id] = $record->amount_due;
307
+                            }),
308
+                    ),
295 309
                 CustomTextInputColumn::make('payment_amount')
296 310
                     ->label('Payment amount')
297 311
                     ->alignEnd()
@@ -343,8 +357,8 @@ class RecordPayments extends ListRecords
343 357
                     ]),
344 358
             ])
345 359
             ->bulkActions([
346
-                Tables\Actions\BulkAction::make('setFullAmounts')
347
-                    ->label('Set full amounts')
360
+                Tables\Actions\BulkAction::make('applyFullAmounts')
361
+                    ->label('Apply full amounts')
348 362
                     ->icon('heroicon-o-banknotes')
349 363
                     ->color('primary')
350 364
                     ->deselectRecordsAfterCompletion()

Laden…
Annuleren
Opslaan