diff --git a/vchasno.go b/vchasno.go index 243b3e2..9990c03 100644 --- a/vchasno.go +++ b/vchasno.go @@ -274,3 +274,23 @@ func (c *Client) QuickSellNamed(ctx context.Context, name string, price float64) Price: price, }) } + +func (c *Client) ZeroReceipt(ctx context.Context) (*api.SellResponse, error) { + return c.api.Sell(ctx, api.SellParams{ + Cashier: c.cashier, + Source: c.source, + Rows: []api.ReceiptRow{}, + Pays: []api.ReceiptPay{}, + CommentUP: "Нульовий чек", + }) +} + +func (c *Client) ZeroReceiptWithTimeout(timeout time.Duration) (*api.SellResponse, error) { + ctx, cancel := context.WithTimeout(context.Background(), timeout) + defer cancel() + return c.ZeroReceipt(ctx) +} + +func (c *Client) ZeroReceiptDefault() (*api.SellResponse, error) { + return c.ZeroReceiptWithTimeout(c.defaults.DefaultTimeout) +}