feat(crm): invoice update notes and PO fields
Allow oo invoices update --description/--po so Notizen can be multiline refs without portal URLs; keep opportunity link support.
This commit is contained in:
+14
-4
@@ -115,11 +115,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 entity / contact updates.
|
||||
// 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
|
||||
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
|
||||
}
|
||||
|
||||
// UpdateInvoice PUTs a full invoice body (OnlyOffice requires complete payload).
|
||||
@@ -196,6 +200,12 @@ func (c *Client) UpdateInvoice(ctx context.Context, id string, p UpdateInvoicePa
|
||||
"status": statusID,
|
||||
"invoiceLines": lines,
|
||||
}
|
||||
if p.DescriptionSet {
|
||||
body["description"] = p.Description
|
||||
}
|
||||
if p.PurchaseOrderSet {
|
||||
body["purchaseOrderNumber"] = p.PurchaseOrder
|
||||
}
|
||||
if p.EntityID != 0 {
|
||||
body["entityId"] = p.EntityID
|
||||
body["entityType"] = p.EntityType
|
||||
|
||||
Reference in New Issue
Block a user