feat(crm): allow updating invoice terms via oo

Needed to put issuer NIE in Bedingungen without a full recreate.
This commit is contained in:
2026-08-06 13:35:08 +01:00
parent 7f35b0e910
commit 31c556d34c
2 changed files with 18 additions and 10 deletions
+11 -6
View File
@@ -117,13 +117,15 @@ func (c *Client) CreateInvoice(ctx context.Context, p CreateInvoiceParams) (map[
// UpdateInvoiceParams are fields for PUT /api/2.0/crm/invoice/{id}.
// Loads the current invoice and merges non-zero / set fields.
type UpdateInvoiceParams struct {
EntityID int64 // link to opportunity; 0 = leave unchanged
EntityType int
ContactID int64 // 0 = leave unchanged
Description string // invoice notes; empty + DescriptionSet=false keeps existing
DescriptionSet bool
PurchaseOrder string
EntityID int64 // link to opportunity; 0 = leave unchanged
EntityType int
ContactID int64 // 0 = leave unchanged
Description string // invoice notes; empty + DescriptionSet=false keeps existing
DescriptionSet bool
PurchaseOrder string
PurchaseOrderSet bool
Terms string
TermsSet bool
}
// UpdateInvoice PUTs a full invoice body (OnlyOffice requires complete payload).
@@ -206,6 +208,9 @@ func (c *Client) UpdateInvoice(ctx context.Context, id string, p UpdateInvoicePa
if p.PurchaseOrderSet {
body["purchaseOrderNumber"] = p.PurchaseOrder
}
if p.TermsSet {
body["terms"] = p.Terms
}
if p.EntityID != 0 {
body["entityId"] = p.EntityID
body["entityType"] = p.EntityType