GetAsNumber with a negative number?

Discussion created by arnojansen1 on Dec 1, 2016
Latest reply on Dec 2, 2016 by arnojansen1



I have build a invoices solution where i calculate a due date based on terms.

Payment_terms are:

Due On Receipt

Due on Specific date

Net -7 days prior check in day

Net 7 days after check in day

Net 14 days from invoice date


The first two easy that becomes manual input.


The "net -7 days prior check in day" is my problem Where we receive an invoice lets say today and is due when 7 days before clients check in to a hotel room that can be any day, lets say 8Feb17. But invoice due date is always 7 days before check in day so in this example 1Feb17 (ideally it would take into account you cannot pay on saturday and sunday at least not in New Zealand).


I have used below: case calculation but it ignores if "getasnumber" is -7  (minus7)


adding 7 days to check in sorted and so is 14 days.



Case (

  GetAsNumber ( Suppliers::Payment_terms ) > 0 ;

    Invoice_date + Suppliers::Payment_terms ;

  Self < Invoice_date ; Invoice_date ;

  Self  )


how to change this case so it takes "minus" days into account


Thanks for your help as always