Instance Method

addItem(productCode:description:price:)

Add a new InvoiceItem to the invoice with the minimum required details, specifying the product code or SKU, the description and the total price for the item. The resulting invoice item will have a quantity of 1.

Declaration

@discardableResult func addItem(productCode: String, description: String, price: Decimal) -> InvoiceBuilder

Return Value

The current InvoiceBuilder instance for fluent access.

Parameters

productCode

The product code or SKU for the item.

description

The description of the item.

unitPrice

The total price of the item.