Andrew Wallo 4 月之前
父節點
當前提交
465da01b33

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

100
                                     return 'Please enter a valid positive amount';
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
                                 if ($ownerRecord->status === InvoiceStatus::Overpaid) {
105
                                 if ($ownerRecord->status === InvoiceStatus::Overpaid) {
106
                                     $newAmountDue = $amountDue + $amount - $currentPaymentAmount;
106
                                     $newAmountDue = $amountDue + $amount - $currentPaymentAmount;

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

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

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

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

Loading…
取消
儲存