Commit cf620eec authored by smanohar's avatar smanohar

Discount posting was wrong in case voucher is against only purchase return

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@216114 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 7a1b9976
......@@ -878,6 +878,7 @@ public class VoucherConf extends ActionHandlerEJB //implements ReceiptAdvConfLoc
{
rcpAmt = actualAmt;
}
System.out.println("Account 1.1 rcpAmt [" +rcpAmt + "]");
/// 30-12-04 amish this block transferd from here to above
// itemCode = lds_det.getitemstring(i,"item_code")
// itemSer = lds_det.getitemstring(i,"item_ser")
......@@ -988,14 +989,16 @@ public class VoucherConf extends ActionHandlerEJB //implements ReceiptAdvConfLoc
// rcpMra = rcpMra - porcpReco - nonPayable
//shiri 05/06/06 addeded disc_amt. as it is later posted to mra a/c and therfore gets subtracted
//pravin 03/06/2016 rcpTaxAmt sub from mra amt as posted separatally in below
// 04-feb-2020 manoharan discount is already included in net amount of porcpdet so not to add the same
rcpMra = rcpMra - nonPayable + discAmt - rcpTaxAmt;
//rcpMra = rcpMra - nonPayable - rcpTaxAmt;
// end shiri uncommenting 1/6/06
/// praportionate mra as per the voucher quantity.
rcpMra = rcpMra * (decQty/rcpQty);
mraPPV = rcpAmt - (rcpMra + nonPayable ); // changes by pravin 14/10/2016 non payable tax should not add in ppv /// voucher amount - rcp mra amount
rcpAmt = rcpMra;
} ///amish 14-05-04 // calculate MRA and post diff to PPV a/c
System.out.println("Account 1.2 rcpAmt [" +rcpAmt + "]");
///////////////////////////////////////////
// 20/07/00 manoharan
......@@ -1030,6 +1033,7 @@ public class VoucherConf extends ActionHandlerEJB //implements ReceiptAdvConfLoc
{
detMap = (HashMap) DetList.get(findIndex);
foundAmt = (double) Double.parseDouble( "" + detMap.get("amount"));
System.out.println("Account 2.2 acctCodePh [" + acctCodePh + "] rcpAmt [" +rcpAmt + "] foundAmt [" + foundAmt + "]");
detMap.put("amount", foundAmt + rcpAmt );
if ("S".equals(postType))
{
......@@ -1039,6 +1043,7 @@ public class VoucherConf extends ActionHandlerEJB //implements ReceiptAdvConfLoc
}
else
{
System.out.println("Account 2.3 acctCodePh [" + acctCodePh + "] rcpAmt [" +rcpAmt + "] foundAmt [" + 0 + "]");
detMap = new HashMap();
detMap.put("tran_id", tranId);
......@@ -1117,6 +1122,7 @@ public class VoucherConf extends ActionHandlerEJB //implements ReceiptAdvConfLoc
findIndex = findExistingIndex(DetList,acctCodePh, cctrCodePh,analCode,projCode);
detMap = (HashMap) DetList.get(findIndex);
foundAmt = (double) Double.parseDouble( "" + detMap.get("amount"));
System.out.println("Account 2.4 acctCodePh [" + acctCodePh + "] recoAmt [" +recoAmt + "] foundAmt [" + 0 + "]");
detMap.put("amount", foundAmt - recoAmt );
DetList.set(findIndex, detMap);
}
......@@ -1130,10 +1136,12 @@ public class VoucherConf extends ActionHandlerEJB //implements ReceiptAdvConfLoc
detMap = (HashMap) DetList.get(findIndex);
foundAmt = (double) Double.parseDouble( "" + detMap.get("amount"));
detMap.put("amount", foundAmt + recoAmt );
System.out.println("Account 2.5 acctReco [" + acctReco + "] recoAmt [" +recoAmt + "] foundAmt [" + foundAmt + "]");
DetList.set(findIndex, detMap);
}
else
{
System.out.println("Account 2.6 acctReco [" + acctReco + "] recoAmt [" +recoAmt + "] foundAmt [" + 0 + "]");
detMap = new HashMap();
lineCount++;
detMap.put("tran_id", tranId);
......@@ -1300,8 +1308,11 @@ public class VoucherConf extends ActionHandlerEJB //implements ReceiptAdvConfLoc
}
//For the following process refer to number 2) in the above note
if (discAmt != 0 ) //Change by Brijesh Soni on 04-2005 as instruction by Amish
{
if (discAmt > 0) // 04-feb-2020 manoharan in case of return it is already in negative sign
{
discAmt = 0 - discAmt;
}
// commented by shiri 05/06/06, disc has to get posted to the mra a/c
//if isnull(acctCodeDisc) or len(trim(acctCodeDisc)) = 0 then
......@@ -1341,11 +1352,13 @@ public class VoucherConf extends ActionHandlerEJB //implements ReceiptAdvConfLoc
{
detMap = (HashMap) DetList.get(findIndex);
foundAmt = (double) Double.parseDouble( "" + detMap.get("amount"));
System.out.println("Account 5.1 acctCodeDisc [" + acctCodeDisc + "] discAmt [" + discAmt + "] foundAmt ["+ foundAmt+ "] amount [" +(foundAmt + discAmt) + "]");
detMap.put("amount", foundAmt + discAmt );
DetList.set(findIndex, detMap);
}
else
{
System.out.println("Account 5.2 acctCodeDisc [" + acctCodeDisc + "] discAmt [" + discAmt + "] foundAmt ["+ 0+ "]");
detMap = new HashMap();
lineCount++;
detMap.put("tran_id", tranId);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment