From b70e95ac5cc226e57ca0f1d30b7bd5a43c75fd71 Mon Sep 17 00:00:00 2001 From: daniel Date: Thu, 16 Oct 2025 04:36:48 +0300 Subject: [PATCH] Added null cheque --- vchasno.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) 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) +}