Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OE Invoice date

Status
Not open for further replies.

joelabine

Programmer
Feb 28, 2013
21
CA
Hi,

I'm generating shipments and invoices in OE module in a home made software.
What happened today is really weird. When I look at the shipments and invoices created today by my software I realize that they don't have the same date! Some have yesterday's date and some have today's date...All mixed up. All of them where created from the same computer. I can confirm the computer has the right date and time.

Here is a preview of my code (very simplified)
Code:
vOEORDH>>Init
vOEORDH>>Fields("ORDNUMBER")>>Value = "OENUMBER"
vOEORDH>>Order = 1
IF vOEORDH>>Exists THEN
	vOEORDH>>Read
	vOEORDH>>Order = 0

	//Add quantity shipped "QTYSHIPPED" to the OE0500 view

	vOEORDH>>Fields("INVPRODUCE")>>Value = "1"//Invoice Will Be Produced
	vOEORDH>>Fields("OECOMMAND")>>Value = "4"//Process O/E Command
	vOEORDH>>Process
	vOEORDH>>Update
END IF

I tried adding the following lines before the Process function. This seems to let me force a date (In the following example 2014-11-07) for the invoice but not the shipment.
Code:
vOEORDH>>Fields("SHIPDATE")>>Value = 41950
vOEORDH>>Fields("INVDATE")>>Value = 41950

I find it strange that Accpac let me do this. Anyway why is Accpac not initializing these fields correctly?
Pleas let me know which fields I should configure to be sure that everything is fine. Or let me know if I'm doing something wrong.

Accpac version :5.6A update 3

Thanks.
 
Ok, using "SHIDATE" let me force shipment date.
But I'm still asking why Accpac is not handling this correctly.
 
It is handling it correctly - you just don't understand what it is doing.
Look at the OE invoice entry screen, on the Totals tab you have a separate date field for the Shipment Date. This defaults to the Session Date, so you need to change it.

Sage 300 ERP Certified Consultant
 
Ok so basically changing the value of "INVDATE" and "SHIDAT" will solve my problem?
 
Maybe I did not explain myself correctly (or did not understand your answer correctly). Sorry English is not my first language.

What can I do to avoid this behaviour? I want all my shipment and invoice to have the current date.

Thanks
 
I remember having trouble with dates when shipping and invoicing. If I recall correctly you have to set the INVDATE after setting INVPRODUCE to 1, otherwise it will reset the field value to the default value.
 
Hi DjangMan, Thanks for the info.


I thought that those fields would have been set automatically by Accpac, just like it does in the UI.
Do you guys know if there are any other fields that I should set before shipping and invoicing so my software acts like the UI?

Thanks again
 
So if I understand correctly dates are set when Open is called (or as soon as the object is allocated) on a Accpac.Session objet? Is this right?
So if my software starts on November 11th and creates an invoice on November 12th, the invoice will be November 11th.

If the following is right than how can the following happen?. Invoices on the 10th than on the 11th then on the 10th again and finally to the 11th.
 
I can't explain the anomalies in your dates because a) I did not write the code, b) I did not run the application, c) I was not there, d) I don't have your data to review, f) I don't care.
Set the dates in your code and get over it.
This most be one of the longest senseless discussions about dates....

Sage 300 ERP Certified Consultant
 
So sorry to bother you Ettienne or anyone here. Just want to make sure I understand right and I do things correctly... I thought this was the purpose of this forum.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top