Skip to main content
Represents invoice entries and lets you create new or modify existing invoice entries

Constructors

InvoiceEntry()

Initializes a new instance of the InvoiceEntry class.

Methods

getDiscount()

Gets the discount of the current InvoiceEntry object in percent.
Returns: CRMScript.Global.String - The discount in percent as a String-representation of a number with 2 decimals accuracy.
The save-function calculates the discount in percent and money. So if the discount is set in money (setDiscountMoney(Float)), you have to save the entry before getting the corresponding value in percent.

getDiscountMoney()

Gets the discount of the current InvoiceEntry object in money.
Returns: CRMScript.Global.String - The discount in money as a String-representation of a number with 2 decimals accuracy.
The save-function calculates the discount in percent and money. So if the discount is set in percent (setDiscount()), you have to save the entry before getting the corresponding value in money with this function.

getPricePrUnit()

Returns the price per unit of the current InvoiceEntry object.
Returns: CRMScript.Global.String - Price per unit as a String-representation of a number with 2 decimals accuracy.

getValue(String)

Gets the value of the specified field.
Returns: CRMScript.Global.String - The value of the field.
Available fields:
  • messageId the id which this invoice entry is connected to
  • description the descriptive text of this invoice entry
  • type ID of the type for this invoice entry
  • quantity the number of units invoiced
  • pricePrUnit price per unit (precision 2)
  • discount discount in percentage for this invoice entry (precision 2)
  • discountMoney discount in money (precision 2)
  • date the date for this invoice entry

load(Integer)

Loads an existing InvoiceEntry object.
Returns: CRMScript.Global.Bool

save()

Saves the existing InvoiceEntry object and returns the ID.
Returns: CRMScript.Global.Integer - The ID of the saved InvoiceEntry object.

setDiscount(Float)

Sets the discount of the current InvoiceEntry object with the given percent.
Returns: CRMScript.Global.Void
If discount is set in both percent and money, the save-function use the money-version.

setDiscountMoney(Float)

Sets the discount of the current InvoiceEntry object with the given money.
Returns: CRMScript.Global.Void
If both setDiscount() and this function has been used, the save-function uses the discount in money.

setPricePrUnit(Float)

Sets the price per unit for the current InvoiceEntry object with the given price.
Returns: CRMScript.Global.Void

setValue(String,String)

Sets a field of the current InvoiceEntry object with the given value.
Returns: CRMScript.Global.Void
Available fields:
  • messageId the ID of the message which this invoice entry is connected to
  • description a description of the invoice entry
  • type the ID of the type which this invoice entry will be saved as
  • quantity number of invoiced unites (this can be a float value)
  • pricePrUnit price pr. unit (this can be a float value of precision 2)
  • discount discount given in percentage (float value of precision 2). If discountMoney is also specified, this field will be ignored
  • discountMoney discount in money
  • date the date of the invoice entry