2 Commits 4177883c1c ... 2ecf64281d

Autor SHA1 Mensagem Data
  vipulbadhanibng 2ecf64281d Merge branch 'vipulbranch' of http://103.205.66.47:3000/Efacto/Efacto.API_V2 2 anos atrás
  vipulbadhanibng 1343aca592 tax calculation error resloved 2 anos atrás
1 arquivos alterados com 7 adições e 1 exclusões
  1. 7 1
      Efacto.Application/Services/CommonServices.cs

+ 7 - 1
Efacto.Application/Services/CommonServices.cs

@@ -162,9 +162,10 @@ namespace Efacto.Application.Services
                     taxRate = Utilities._util.ConvertToDecimal(gstTaxdef.GstRate);
                 }
 
-
+                decimal OldTaxableAmt = 0;
                 if (!string.IsNullOrEmpty(TaxType) && TaxType == "INCLUSIVE")
                 {
+                    OldTaxableAmt = TaxableAmt;
                     TaxableAmt = (TaxableAmt * 100) / (100 + taxRate);
                 }
 
@@ -186,6 +187,11 @@ namespace Efacto.Application.Services
                 cessAmt = Math.Round(cessAmt, 2);
                 TaxAmt = igstAmt + cgstAmt + sgstAmt + cessAmt;
                 TotalAmt = Utilities._util.ConvertToDecimal(TaxableAmt) + Utilities._util.ConvertToDecimal(TaxAmt);
+                if(Utilities._util.ConvertToDecimal(OldTaxableAmt) > 0 && Utilities._util.ConvertToDecimal(TotalAmt) != Utilities._util.ConvertToDecimal(OldTaxableAmt))
+                {
+                    TaxableAmt = Utilities._util.ConvertToDecimal(OldTaxableAmt) - Utilities._util.ConvertToDecimal(TaxAmt);
+                    TotalAmt = Utilities._util.ConvertToDecimal(TaxableAmt) + Utilities._util.ConvertToDecimal(TaxAmt);
+                }
             }
             _retval.Add("TAXABLEAMT", TaxableAmt);
             _retval.Add("TAX_RATE", taxRate);