2 Replies Latest reply on May 5, 2016 8:06 PM by user19752

    Invoice - Insert date Case statement

    ChristofferRexen_1

      Hello everyone,

       

      I am currently working on a script for an Invoice solution.

       

      The solution is only meant to bill two ( 2 ) times a year, each on a specific day.

       

      15.01.XXXX (Year) - EU format

      01.07.XXXX (Year) - EU format

       

      Now, i have made a script, which by the looks of it, sets either of the above dates for future billing in a field, lets call it "NextInvoiceDate".

      Case ( 

       

      Date ( Month ( Get ( CurrentDate ) ) ; Day ( Get ( CurrentDate ) ) ; Year ( Get ( CurrentDate ) ) ) ≥ InvoiceDate1 ('Static' field which is set to 15.01.XXXX (Year) ) ; "01/" & "07/" & Year ( Get ( CurrentDate ) ) ;

       

       

      Date ( Month ( Get ( CurrentDate ) ) ; Day ( Get ( CurrentDate ) ) ; Year ( Get ( CurrentDate ) ) ) ≥ InvoiceDate2 ('Static' field which is set to 01.07.XXXX (Year) )  ; "15/" & "01/" & Year ( Get ( CurrentDate ) )

       

      )

      Although, the script ends by putting the last date in the above script step into "NextInvoiceDate".

       

      I want the script to set either of the above dates, let's say 01.07. Year ( Get ( CurrentDate ) ) into "NextInvoiceDate", since we passed 15.01. Year ( Get ( CurrentDate ) )

      And vice versa, if passed 15.01. Year ( Get ( CurrentDate ) ), then put 01.07. Year ( Get ( CurrentDate ) ), so no billing is missed.

       

      Any thoughts?

      Best regards