|  | @@ -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) {
 |