Issue in Windows 2012 server (64 bit)

Discussions relating to breakout scripting, .NET and COM programming with Jiwa objects.

Re: Issue in Windows 2012 server (64 bit)

Postby senthil » Wed Jan 07, 2015 2:56 pm

Dear mike,

thanks for the information.

May I get some sample codes(.NET) for Connectivity and Transactions? so that I can follow to write the code.

Thanks & Regards
Senthilnathan
senthil
Occasional Contributor
Occasional Contributor
 
Posts: 17
Joined: Thu Sep 18, 2014 7:57 pm

Re: Issue in Windows 2012 server (64 bit)

Postby Mike.Sheen » Wed Jan 07, 2015 4:07 pm

senthil wrote:Dear mike,

thanks for the information.

May I get some sample codes(.NET) for Connectivity and Transactions? so that I can follow to write the code.

Thanks & Regards
Senthilnathan


Hi Senthil,

The version 7 forums has samples and the version 7 documentation also has a few examples of using the .NET API.

Mike
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: 2440
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 755

Re: Issue in Windows 2012 server (64 bit)

Postby senthil » Tue Jun 23, 2015 9:14 pm

Dear Mike,

I have configurare the JIWA 7 and convert/Rewrite the Existing Vb.net code
i found that some of the methods/properties not available in JIWA 7.is there any way to easily indentify the JIWA 6 method equal to JIWA 7
For Example:
Public jwJiwaSalesOrder As JiwaFinancials.Jiwa.JiwaSales.SalesOrder.SalesOrder
jwJiwaSalesOrder = JiwaApplication.Manager.Instance.BusinessLogicFactory.CreateBusinessLogic(Of JiwaSales.SalesOrder.SalesOrder)(Nothing)
jwJiwaCommonLib.Database = jwDatabase
This method not avaliable
If .PrepareNewOrder(JiwaSalesOrder.NewSalesOrderTypes.e_NewSalesOrder, CurrDebtorID, True) <> JiwaSalesOrder.SalesOrderReturnCodes.e_SalesOrderReturnCodeSuccess Then
end if

may i know alternative method for the "PrepareNewOrder" in JIWA 7?

Thanks & Regards
Senthilnathan
senthil
Occasional Contributor
Occasional Contributor
 
Posts: 17
Joined: Thu Sep 18, 2014 7:57 pm

Re: Issue in Windows 2012 server (64 bit)

Postby Mike.Sheen » Tue Jun 23, 2015 10:57 pm

senthil wrote:Dear Mike,

I have configurare the JIWA 7 and convert/Rewrite the Existing Vb.net code
i found that some of the methods/properties not available in JIWA 7.is there any way to easily indentify the JIWA 6 method equal to JIWA 7
For Example:
Public jwJiwaSalesOrder As JiwaFinancials.Jiwa.JiwaSales.SalesOrder.SalesOrder
jwJiwaSalesOrder = JiwaApplication.Manager.Instance.BusinessLogicFactory.CreateBusinessLogic(Of JiwaSales.SalesOrder.SalesOrder)(Nothing)
jwJiwaCommonLib.Database = jwDatabase
This method not avaliable
If .PrepareNewOrder(JiwaSalesOrder.NewSalesOrderTypes.e_NewSalesOrder, CurrDebtorID, True) <> JiwaSalesOrder.SalesOrderReturnCodes.e_SalesOrderReturnCodeSuccess Then
end if

may i know alternative method for the "PrepareNewOrder" in JIWA 7?

Thanks & Regards
Senthilnathan


Hi Senthil,

In version 7 creating a new order we use the CreateNew method instead of the PrepareNewOrder in version 6. An example is below (taken from here)

Code: Select all
Dim salesOrder As JiwaSales.SalesOrder.SalesOrder = JiwaApplication.Manager.Instance.BusinessLogicFactory.CreateBusinessLogic(Of JiwaSales.SalesOrder.SalesOrder)(Nothing)
salesOrder.CreateNew(JiwaSales.SalesOrder.SalesOrder.NewSalesOrderTypes.e_NewSalesOrder, "1001", False)
 Dim lkey As String = ""
 salesOrder.SalesOrderLines.AddInventoryItem("1170", JiwaSales.SalesOrder.SalesOrderLineCollection.SalesOrderLineInventorySeedTypes.e_SalesOrderLinePartNo, lkey)
salesOrder.SalesOrderLines(lkey).QuantityOrdered = 5
salesOrder.Save()

Console.WriteLine(String.Format("New Invoice No. is : {0}", salesOrder.InvoiceNo))

JiwaApplication.Manager.Instance.LogOff()
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: 2440
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 755

Re: Issue in Windows 2012 server (64 bit)

Postby senthil » Wed Jun 24, 2015 1:48 pm

Hi Mike,

Thanks for the information.

when I am Create New Sales Order and i am getting following Error message .I have verified in JIWA the Part No,Account No already exist.

Error
This inventory item does not have an 'Ship on Completion' ledger account attached

after i set as DebotSeedIsID as false I am getting Different Error
.CreateNew(SalesOrder.NewSalesOrderTypes.e_NewSalesOrder, CurrDebtorID, False)

Error - Debtor with Account No. of 'F7AFB8440AC8482F8559' not found. Last SQL :

kindly advice.

Thanks & Regards
Senthilnathan
senthil
Occasional Contributor
Occasional Contributor
 
Posts: 17
Joined: Thu Sep 18, 2014 7:57 pm

Re: Issue in Windows 2012 server (64 bit)

Postby Mike.Sheen » Wed Jun 24, 2015 5:46 pm

senthil wrote:Hi Mike,

Thanks for the information.

when I am Create New Sales Order and i am getting following Error message .I have verified in JIWA the Part No,Account No already exist.

Error
This inventory item does not have an 'Ship on Completion' ledger account attached

after i set as DebotSeedIsID as false I am getting Different Error
.CreateNew(SalesOrder.NewSalesOrderTypes.e_NewSalesOrder, CurrDebtorID, False)

Error - Debtor with Account No. of 'F7AFB8440AC8482F8559' not found. Last SQL :

kindly advice.

Thanks & Regards
Senthilnathan


The first error message indicates that the inventory item you are using is not configured correctly. View the item in Jiwa via inventory maintenance and you will see that there is one or more ledger accounts not attached to the item which need to be. Correct that and error message will no longer occur - See below.

ShipCompletionLedger.PNG
Inventory Maintenance form


The second error you are getting - "Debtor with Account No. of 'F7AFB8440AC8482F8559' not found" means exactly that - "F7AFB8440AC8482F8559" looks like a DebtorID, not an account no - so "DebtorSeedIsID" should be True, not False.

Mike
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: 2440
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 755

Re: Issue in Windows 2012 server (64 bit)

Postby senthil » Wed Jun 24, 2015 7:46 pm

Hi Mike,

Thanks for the information,now the create new sales order working .

and I am try to add Sales Order payment I am getting this Error .i could not indetify the paymenttypeid property in the payment class
"The parameterized query '(@InvoiceID char(20),@PaymentID char(20),@InvoiceHistoryID char(' expects the parameter '@PaymentTypeID', which was not supplied"

Dim objPayment As New JiwaFinancials.Jiwa.JiwaSales.SalesOrder.Payment

With objPayment

.AmountPaid = Convert.ToDecimal(PaymentAmount)
TotalPaid = TotalPaid + PaymentAmount
.PaymentDate = InterfaceDT
.PaymentRef = PaymentRef
.BankName = "ROS"
.ProcessPayment = True

End With
jwJiwaSalesOrder.SalesOrderPayments.Add(objPayment)


in JIWA 6 we are passing like

If (jwJiwaSalesOrder.AddSalesOrderPayment(jwJiwaSalesOrderPayment.PaymentTypeID, NewKey) = JiwaSalesOrder.SalesOrderReturnCodes.e_SalesOrderReturnCodeSuccess) Then
With jwJiwaSalesOrder.SalesOrderPayments(NewKey)

.AmountPaid = PaymentAmount
TotalPaid = TotalPaid + PaymentAmount
.PaymentDate = InterfaceDT
.PaymentRef = PaymentRef
.BankName = "ROS"
'.AccountName = CardName

.ProcessPayment = True
End With
Else
LogMessage(0, "Error Saving Payment!")
End If

kindly advice
senthil
Occasional Contributor
Occasional Contributor
 
Posts: 17
Joined: Thu Sep 18, 2014 7:57 pm

Re: Issue in Windows 2012 server (64 bit)

Postby Mike.Sheen » Fri Jun 26, 2015 12:24 am

Hi Senthil,

You need to set the PaymentType property of the payment before saving the order. I recommend doing this before adding the payment to the collection.

The SalesOrder object has a PaymentTypes collection - you need to identify which one you want the payment to be associated with, then set the PaymentType of the Payment to be that.
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: 2440
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 755

Re: Issue in Windows 2012 server (64 bit)

Postby senthil » Fri Jun 26, 2015 5:26 pm

Hi Mike,

Thanks for the information .

I have set the payment type and i getting foreign key error.
The INSERT statement conflicted with the FOREIGN KEY constraint "FK_SO_Payments_SO_PaymentTypes". The conflict occurred in database "RottnestExpress", table "dbo.SO_PaymentTypes", column 'TypeID'.

i trace the qry in sql profiler and i found that the "PaymentTypeID" values passed internally (every time passed different value) is not match with typeid.(please find attached sql trace Qry)

Code
Dim objPayment As New JiwaFinancials.Jiwa.JiwaSales.SalesOrder.Payment

Dim obType As New JiwaFinancials.Jiwa.JiwaSales.SalesOrder.PaymentType
obType.PayType = SalesOrder.SalesOrderPayTypes.e_SalesOrderPayTypeCash
jwJiwaSalesOrder.PaymentTypes.Add(obType)


With objPayment
.AmountPaid = Convert.ToDecimal(PaymentAmount)
TotalPaid = TotalPaid + PaymentAmount
.PaymentDate = InterfaceDT
.PaymentRef = PaymentRef
.BankName = "ROS"
.PaymentType = obType
.ProcessPayment = True
End With
jwJiwaSalesOrder.SalesOrderPayments.Add(objPayment).

kindly advice.
Attachments
SqlTrace.txt
(2.46 KiB) Downloaded 131 times
senthil
Occasional Contributor
Occasional Contributor
 
Posts: 17
Joined: Thu Sep 18, 2014 7:57 pm

Re: Issue in Windows 2012 server (64 bit)

Postby Scott.Pearce » Fri Jun 26, 2015 6:05 pm

Some of the terminology is misleading.

A payment must have a payment type attached to it - such payment types are defined in "Sales->Configuration->Payment Types".

If you look in "Sales->Configuration->Payment Types", you will see that for each payment type defined, a payment type must be set! There are 2 things called payment type and each are actually different!! A better use of terminology would have been:

A payment must have a payment method attached to it - such payment methods are defined in "Sales->Configuration->Payment Methods" and can be managed by the user. Each payment method must have a payment type attached. Payment types are hard coded.

Anyway, all that aside, what you need to do is this:

Code: Select all
Dim _PaymentTypes As New JiwaFinancials.Jiwa.JiwaSales.SalesOrder.PaymentTypeCollection
_PaymentTypes.Read()

Dim objPayment As New JiwaFinancials.Jiwa.JiwaSales.SalesOrder.Payment

With objPayment
   .AmountPaid = Convert.ToDecimal(PaymentAmount)
   TotalPaid = TotalPaid + PaymentAmount
   .PaymentDate = InterfaceDT
   .PaymentRef = PaymentRef
   .BankName = "ROS"
   .PaymentType = _PaymentTypes(1)
   .ProcessPayment = True
End With



After line 2 above you will have a collection of all the payment types defined in the system. In the example above I simply apply the 1st payment type to the payment. You may, however, wish to iterate through the collection of payment types and then select a particular one, i.e. the one with the name of "Fred" or the first one that is of .paymenttype "cash".
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 742
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 221

PreviousNext

Return to Technical / Programming

Who is online

Users browsing this forum: No registered users and 1 guest