Added commentUP field to fiscalAPI
This commit is contained in:
@@ -76,10 +76,11 @@ type SellParams struct {
|
|||||||
Rows []ReceiptRow
|
Rows []ReceiptRow
|
||||||
Pays []ReceiptPay
|
Pays []ReceiptPay
|
||||||
Userinfo *Userinfo
|
Userinfo *Userinfo
|
||||||
|
CommentUP string
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) Sell(ctx context.Context, params SellParams) (*SellResponse, error) {
|
func (c *Client) Sell(ctx context.Context, params SellParams) (*SellResponse, error) {
|
||||||
receipt := NewReceipt(params.Rows, params.Pays)
|
receipt := NewReceipt(params.Rows, params.Pays, params.CommentUP)
|
||||||
|
|
||||||
request := FiscalRequest{
|
request := FiscalRequest{
|
||||||
Source: params.Source,
|
Source: params.Source,
|
||||||
|
|||||||
@@ -39,10 +39,11 @@ func CalculateReceiptSum(rows []ReceiptRow) float64 {
|
|||||||
return sum
|
return sum
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewReceipt(rows []ReceiptRow, pays []ReceiptPay) Receipt {
|
func NewReceipt(rows []ReceiptRow, pays []ReceiptPay, commentUp string) Receipt {
|
||||||
return Receipt{
|
return Receipt{
|
||||||
Sum: CalculateReceiptSum(rows),
|
Sum: CalculateReceiptSum(rows),
|
||||||
Round: 0.00,
|
Round: 0.00,
|
||||||
|
CommentUp: commentUp,
|
||||||
Disc: 0,
|
Disc: 0,
|
||||||
DiscType: 0,
|
DiscType: 0,
|
||||||
Rows: rows,
|
Rows: rows,
|
||||||
|
|||||||
@@ -99,6 +99,7 @@ type SellParams struct {
|
|||||||
PayType int
|
PayType int
|
||||||
CardParams *CardParams
|
CardParams *CardParams
|
||||||
Userinfo *api.Userinfo
|
Userinfo *api.Userinfo
|
||||||
|
CommentUP string
|
||||||
}
|
}
|
||||||
|
|
||||||
type CardParams struct {
|
type CardParams struct {
|
||||||
@@ -158,6 +159,11 @@ func (b *SellParamsBuilder) Comment(comment string) *SellParamsBuilder {
|
|||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (b *SellParamsBuilder) CommentUp(commentUp string) *SellParamsBuilder {
|
||||||
|
b.params.CommentUP = commentUp
|
||||||
|
return b
|
||||||
|
}
|
||||||
|
|
||||||
func (b *SellParamsBuilder) PayCash() *SellParamsBuilder {
|
func (b *SellParamsBuilder) PayCash() *SellParamsBuilder {
|
||||||
b.params.PayType = PayTypeCash
|
b.params.PayType = PayTypeCash
|
||||||
b.params.CardParams = nil
|
b.params.CardParams = nil
|
||||||
|
|||||||
Reference in New Issue
Block a user