Page 1 of 1

Disp Amount in Creditos section

PostPosted: Fri Jun 17, 2016 2:19 pm
by senthil
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

Re: Disp Amount in Creditos section  Topic is solved

PostPosted: Fri Jun 17, 2016 4:57 pm
by Mike.Sheen
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