Class InvoiceEntry

Represents invoice entries and lets you create new or modify existing invoice entries

Examples

InvoiceEntry i;

i.setValue("description", "test");
i.setValue("quantity", "1");
i.setValue("pricePrUnit", "700");
i.setValue("discount", "0.2");
Date d; // Default value for date is today
i.setValue("date", d.toString());

Constructors

InvoiceEntry()

Initializes a new instance of the InvoiceEntry class.

Declaration

InvoiceEntry

Examples

InvoiceEntry i;

i.setValue("description", "test");
i.setValue("quantity", "1");
i.setValue("pricePrUnit", "700");
i.setValue("discount", "0.2");
Date d; // Default value for date is today
i.setValue("date", d.toString());

Methods

getDiscount()

Gets the discount of the current InvoiceEntry object in percent.

Declaration

String getDiscount()

Returns

Type Description
String The discount in percent as a String-representation of a number with 2 decimals accuracy.

getDiscountMoney()

Gets the discount of the current InvoiceEntry object in money.

Declaration

String getDiscountMoney()

Returns

Type Description
String The discount in money as a String-representation of a number with 2 decimals accuracy.

getPricePrUnit()

Returns the price per unit of the current InvoiceEntry object.

Declaration

String getPricePrUnit()

Returns

Type Description
String Price per unit as a String-representation of a number with 2 decimals accuracy.

getValue(String)

Gets the value of the specified field.

Declaration

String getValue(String field)

Parameters

Type Name Description
String field Name of the field which contains the value.

Returns

Type Description
String The value of the field.

load(Integer)

Loads an existing InvoiceEntry object.

Declaration

Bool load(Integer id)

Parameters

Type Name Description
Integer id The ID of the invoice entry to be loaded.

Returns

Type Description
Bool

save()

Saves the existing InvoiceEntry object and returns the ID.

Declaration

Integer save()

Returns

Type Description
Integer The ID of the saved InvoiceEntry object.

setDiscount(Float)

Sets the discount of the current InvoiceEntry object with the given percent.

Declaration

Void setDiscount(Float percent)

Parameters

Type Name Description
Float percent The discount in percent.

Returns

Type Description
Void

setDiscountMoney(Float)

Sets the discount of the current InvoiceEntry object with the given money.

Declaration

Void setDiscountMoney(Float money)

Parameters

Type Name Description
Float money The discount in money.

Returns

Type Description
Void

setPricePrUnit(Float)

Sets the price per unit for the current InvoiceEntry object with the given price.

Declaration

Void SetPricePrUnit(Float price)

Parameters

Type Name Description
Float price The price per unit.

Returns

Type Description
Void

setValue(String,String)

Sets a field of the current InvoiceEntry object with the given value.

Declaration

Void setValue(String field, String value)

Parameters

Type Name Description
String field The field to set, see list
String value The value of the specified field.

Returns

Type Description
Void