diff --git a/app/src/main/assets/pages/Premium.js b/app/src/main/assets/pages/Premium.js index 8d65cc17..46eb8160 100644 --- a/app/src/main/assets/pages/Premium.js +++ b/app/src/main/assets/pages/Premium.js @@ -113,13 +113,12 @@ $(document).ready(function () { var prevAmount = parseInt(Android.getSumPrem(policyId)); var currentBalance = policyValue - prevAmount; var newBalance = currentBalance - Amount; - } var newContribution = Amount + ogContribution; - $('#spBalance').text(policyValue - Amount); - $('#spContribution').text(Amount); + $('#spBalance').text(newBalance); + $('#spContribution').text(newContribution); } }); @@ -301,7 +300,7 @@ $(document).ready(function () { }); } else if (results == true) { var PremiumId = Android.SavePremiums(jsonPremium, parseInt(policyId), parseInt(premiumId), parseInt(FamilyId)); - policystatus = ActivePolicy; + policystatus = PolicyBalance > 0 ? IdlePolicy : ActivePolicy; Paydate = $('#txtPayDate').val(); Android.UpdatePolicy(parseInt(policyId), Paydate, policystatus); Android.UpdateInsureePolicy(parseInt(policyId));