Added null cheque
This commit is contained in:
20
vchasno.go
20
vchasno.go
@@ -274,3 +274,23 @@ func (c *Client) QuickSellNamed(ctx context.Context, name string, price float64)
|
|||||||
Price: price,
|
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)
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user