1 Commits

Author SHA1 Message Date
daniel
b70e95ac5c Added null cheque 2025-10-16 04:36:48 +03:00

View File

@@ -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)
}