Disp Amount in Creditos section  Topic is solved

Discussions relating to Jiwa 7 plugin development, and the Jiwa 7 API.

Disp Amount in Creditos section

Postby senthil » Fri Jun 17, 2016 2:19 pm

Hi Mike,

I found that there is one small issue in the Creditos section.i am not sure wheter JIWA automatically added or not.

I have added only line item in the creditor section.but when we view from JIWA application it shows 2 rows with Disp Amount

Please find attached the Sample :

Creditor 00CAP01 with Invoice No "GBFDFPEJHIKDB" the line Item added only that first Row(Trans Amount: 63 Disp Amount 57.27) which is correct.but second row automatically added (Trans Amount:Null and Disp Amount -5.73)

Please find below my Code

sSQL = "SELECT AccountNo FROM CR_MAIN WHERE AccountNo = " & jwDatabase.FormatChar(oTranLine.AccountNo)
If jwDatabase.ExecuteSelect(hwndRead, sSQL) = True Then
If jwDatabase.FetchRow(hwndRead) = True Then
bNewCreditor = False
Else
bNewCreditor = True
End If
End If
jwDatabase.StatementRenew(hwndRead)

If bNewCreditor = False Then
Dim transaction As New JiwaCRBatchTX.CRBatchTranLine

transaction.Creditor.ReadRecordFromAccountNo(oTranLine.AccountNo)
oBatchTx.TransLines.Add(transaction)


transaction.RemitNo = oTranLine.InvoiceNo
transaction.HomeTransAmount = oTranLine.Amount + oTranLine.GST

Dim dispersal As New JiwaFinancials.Jiwa.JiwaCRBatchTX.CRBatchDispersal()
dispersal.Remark = oTranLine.InvoiceRef
dispersal.HomeDispersedAmount = oTranLine.Amount
dispersal.TaxAmount = oTranLine.GST
transaction.Dispersals.Add(dispersal)

End If

iNum = iNum + 1


kinldy advice

Thanks & Regards
Senthilnathan
Attachments
JIWA .png
JIWA .png (151.16 KiB) Viewed 1699 times
senthil
Occasional Contributor
Occasional Contributor
 
Posts: 17
Joined: Thu Sep 18, 2014 7:57 pm

Re: Disp Amount in Creditos section  Topic is solved

Postby Mike.Sheen » Fri Jun 17, 2016 4:57 pm

If I am to understand your question correctly - you don't wan't that second dispersal line appearing?

When you add a transaction, it automatically adds a dispersal for you - so you shouldn't add a dispersal, as you are - just index the existing one:

Code: Select all
            var creditorPurchase = JiwaFinancials.Jiwa.JiwaApplication.Manager.Instance.BusinessLogicFactory.CreateBusinessLogic<JiwaFinancials.Jiwa.JiwaCRBatchTX.CreditorBatchTrans>(null);
            creditorPurchase.BatchType = JiwaFinancials.Jiwa.JiwaCRBatchTX.CreditorBatchTrans.CreditorBatchTypes.Creditor_Purchase;
            creditorPurchase.CreateNew();

            var transaction = new JiwaFinancials.Jiwa.JiwaCRBatchTX.CRBatchTranLine();
            transaction.Creditor.ReadRecordFromAccountNo("5001");
            creditorPurchase.TransLines.Add(transaction);

            transaction.RemitNo = "ABC";
            transaction.HomeTransAmount = 63.00M;

            transaction.Dispersals[1].Remark = "DEF";     // <--- this is referencing the first, automatically added disperal
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2583
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 807


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 0 guests