Andrew Wallo 4 个月前
父节点
当前提交
465da01b33

+ 1
- 1
app/Filament/Company/Resources/Sales/InvoiceResource/RelationManagers/PaymentsRelationManager.php 查看文件

@@ -100,7 +100,7 @@ class PaymentsRelationManager extends RelationManager
100 100
                                     return 'Please enter a valid positive amount';
101 101
                                 }
102 102
 
103
-                                $currentPaymentAmount = $record?->getRawOriginal('amount') ?? 0;
103
+                                $currentPaymentAmount = $record?->amount ?? 0;
104 104
 
105 105
                                 if ($ownerRecord->status === InvoiceStatus::Overpaid) {
106 106
                                     $newAmountDue = $amountDue + $amount - $currentPaymentAmount;

+ 2
- 2
app/Models/Accounting/Invoice.php 查看文件

@@ -386,7 +386,7 @@ class Invoice extends Document
386 386
 
387 387
         $journalEntryData = [];
388 388
 
389
-        $totalInInvoiceCurrency = $this->getRawOriginal('total');
389
+        $totalInInvoiceCurrency = $this->total;
390 390
         $journalEntryData[] = [
391 391
             'type' => JournalEntryType::Debit,
392 392
             'account_id' => Account::getAccountsReceivableAccount($this->company_id)->id,
@@ -395,7 +395,7 @@ class Invoice extends Document
395 395
         ];
396 396
 
397 397
         $totalLineItemSubtotalInInvoiceCurrency = (int) $this->lineItems()->sum('subtotal');
398
-        $invoiceDiscountTotalInInvoiceCurrency = (int) $this->getRawOriginal('discount_total');
398
+        $invoiceDiscountTotalInInvoiceCurrency = (int) $this->discount_total;
399 399
         $remainingDiscountInInvoiceCurrency = $invoiceDiscountTotalInInvoiceCurrency;
400 400
 
401 401
         foreach ($this->lineItems as $index => $lineItem) {

+ 1
- 1
app/Services/ReportService.php 查看文件

@@ -209,7 +209,7 @@ class ReportService
209 209
             foreach ($account->journalEntries as $journalEntry) {
210 210
                 $transaction = $journalEntry->transaction;
211 211
                 $signedAmount = $journalEntry->signed_amount;
212
-                $amount = $journalEntry->getRawOriginal('amount');
212
+                $amount = $journalEntry->amount;
213 213
 
214 214
                 if ($journalEntry->type->isDebit()) {
215 215
                     $periodDebitTotal += $amount;

正在加载...
取消
保存