jonattanvargas-habi commented on PR #5780:
URL: https://github.com/apache/fineract/pull/5780#issuecomment-4339345264

     Hi @alberto-art3ch                                                         
                                                                                
   
   
    In Colombia, VAT (IVA, 19%) on insurance and similar loan charges is 
**passed through to the customer**: the customer pays `base + VAT` as a single 
line in the repayment schedule. The bank collects the full      
     amount and remits the VAT portion to the tax authority. 
                                                                                
                                                                                
                                                         
     With the current PR, after `applyTaxIfConfigured`:                         
                                                                                
                                                         
     - `m_loan_charge.amount` = base
     - `m_loan_charge.tax_amount` = computed tax                                
                                                                                
                                                         
     - `feeChargesDue` on the schedule = base only                              
                                                                                
                                                         
                                                                                
                                                                                
                                                         
     This works perfectly for tax models where the bank absorbs the tax (e.g. 
savings withholding tax). But for pass-through tax, the customer's 
`feeChargesDue` is short by the tax amount — the VAT lives only in      
     journal entries and doesn't surface in what the customer must pay in the 
schedule.                                                                       
                                                           
                                                                                
                                                                                
                                                         
     ### Proposal                                                               
                                                                                
                                                         
      
     A `tax_added_to_amount` boolean on `m_tax_group` (default `false` to 
preserve current behavior). When `true`, `applyTaxIfConfigured` sums the tax 
into `amount` so the outstanding reflects what the customer       
     actually owes:  
                                                                                
                                                                                
                                                         
     ```java         
     // LoanChargeService.applyTaxIfConfigured
     loanCharge.setTaxAmount(totalTax);
     if (taxGroup.isTaxAddedToAmount()) {
     }                                                                          
                                                                                
                                                         
     loanCharge.setAmountOutstanding(loanCharge.calculateOutstanding());
     loanCharge.getTaxDetails().clear();                                        
                                                                                
                                                         
     taxSplit.forEach((component, taxAmt) ->                                    
                                                                                
                                                         
         loanCharge.getTaxDetails().add(new LoanChargeTaxDetails(loanCharge, 
component, taxAmt)));
     ```                                                                        
                                                                                
                                                         
                     
     Schema delta:                                                              
                                                                                
                                                         
                     
     ```xml                                                                     
                                                                                
                                                         
     <changeSet author="fineract" id="loan-charge-tax-3">
         <addColumn tableName="m_tax_group">             
             <column name="tax_added_to_amount" type="BOOLEAN" 
defaultValueBoolean="false">                                                    
                                                                          
                 <constraints nullable="false"/>                                
                                                                                
                                                         
             </column>                                                          
                                                                                
                                                         
         </addColumn>                                                           
                                                                                
                                                         
     </changeSet>    
     ```                                                                        
                                                                                
                                                         
                     
     The flag is queryable via `taxGroup.isTaxAddedToAmount()` 
(Lombok-generated getter) and exposed in `TaxGroupData` for the API. The 
accounting separation (your `LoanCommonAccountingHelper` and
     `ChargeTaxPaymentDTO` work) stays unchanged — `tax_amount` is still 
persisted separately, journal entries still split fee vs tax. Only the 
customer-facing outstanding changes.                                     
                                                                                
                                                                                
                    
     I'd be happy to open a follow-up PR with the migration, the flag, the API 
exposure on `TaxGroupData`, and tests covering both modes — once this PR lands, 
or earlier if you'd prefer a single combined PR.          
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to