cancel
Showing results for 
Search instead for 
Did you mean: 

DI : Docdate of Invoice

Former Member
0 Kudos

Hi,

I'm creating an invoive with delphi 6.That's my code:

idisp:=vcmp.GetBusinessObject(oInvoices);

idisp.QueryInterface(IID_IDocuments,ido);

odo:=TDocuments.Create(nil);

odo.ConnectTo(ido);

odo.DocType:=dDocument_Items;

odo.CardCode:='bp001';

<b>odo.DocDate:=StrtoDateTime('13.01.05');

odo.DocDueDate:=StrToDateTime('18.01.05'); </b>

odo.Lines.ItemCode:='156';

odo.Lines.Quantity:=20;

odo.Lines.Price:=1.64;

rok:=odo.Add;

Everything is working fine, but my problem is that

docdate and docduedate is always saved with the actual date (in this case 17.01.05). I did the same in Business One and it worked there.

Do anybody know what the problem is?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Can you try with

oInvoices.DocDate := IncDay(now, -5);

oInvoices.DocDueDate := IncDay(now, -1);

just to see if is a problem with the date format.

I tried in Delphi 7 and DI 6.5 and worked fine.

Ribeiro Santos

Former Member
0 Kudos

I tried it and it happend the same.

I'm using di 6.5 too.

Former Member
0 Kudos

is anybody having another idea. I can't imagine that this problem is caused by using delphi 6 instaed of 7.0.

Message was edited by: Juergen Richter