Skip to Content
author's profile photo Former Member
Former Member

DI : Docdate of Invoice

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?

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Jan 17, 2005 at 06:48 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.