-record(daisy_response, {
sequence :: integer(),
command :: integer(),
data :: binary(),
status :: list(atom())
}).
-type daisy_client() :: {daisy_client, string(), string(), string(), string(), string()}.
-record(daisy_client, {
id :: string(),
vat = "" :: string(),
name :: string(),
address :: string(),
receiver :: string()
}).
-type daisy_sell_item() :: {daisy_sell_item, string(), string(), atom(), number(), number(), number()}.
-record(daisy_sell_item, {
title :: string(),
note = "" :: string(),
tax_group = tax_a :: atom(),
price :: number(),
quantity = 1.0 :: number(),
discount = 0.0 :: number()
}).
-type daisy_payment_item() :: {daisy_payment_item, string(), string(), atom(), number()}.
-record(daisy_payment_item, {
title :: string(),
note = "" :: string(),
type = cash :: atom(),
amount = -1 :: number()
}).
-record(daisy_invoice, {
id :: string(),
seller :: string(),
client :: daisy_client(),
items = [] :: list(daisy_sell_item()),
header = "" :: string(),
footer = "" :: string(),
barcode = undefined :: atom() | undefined,
payments = [] :: list(daisy_payment_item())
}).
|