Skip to content

Commit e01ceec

Browse files
authored
Xero Accounting - New or Updated Quote (#19398)
* new-or-updated-quote * versions * fix summary * add contactId async options
1 parent 01b5dcf commit e01ceec

File tree

45 files changed

+254
-176
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+254
-176
lines changed

components/xero_accounting_api/actions/add-line-item-to-invoice/add-line-item-to-invoice.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default {
88
key: "xero_accounting_api-add-line-item-to-invoice",
99
name: "Add Items to Existing Sales Invoice",
1010
description: "Adds line items to an existing sales invoice. [See the docs here](https://developer.xero.com/documentation/api/accounting/invoices#post-invoices)",
11-
version: "0.0.4",
11+
version: "0.0.5",
1212
annotations: {
1313
destructiveHint: false,
1414
openWorldHint: true,

components/xero_accounting_api/actions/create-bank-transaction/create-bank-transaction.mjs

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "xero_accounting_api-create-bank-transaction",
66
name: "Create Bank Transaction",
77
description: "Create a new bank transaction [See the documentation](https://developer.xero.com/documentation/api/accounting/banktransactions#put-banktransactions)",
8-
version: "0.1.3",
8+
version: "0.1.4",
99
annotations: {
1010
destructiveHint: true,
1111
openWorldHint: true,
@@ -22,25 +22,30 @@ export default {
2222
},
2323
bankAccountCode: {
2424
type: "string",
25-
label: "Bank account code",
25+
label: "Bank Account Code",
2626
description: "The Account Code of the Bank Account of the transaction. If Code is not included then AccountID is required.",
2727
optional: true,
2828
},
2929
bankAccountId: {
3030
type: "string",
31-
label: "Bank account ID",
31+
label: "Bank Account ID",
3232
description: "The ID of the Bank Account transaction. If AccountID is not included then Code is required.",
3333
optional: true,
3434
},
3535
contactId: {
36-
type: "string",
37-
label: "Contact ID",
38-
description: "Id of the contact associated to the bank transaction.",
36+
propDefinition: [
37+
xeroAccountingApi,
38+
"contactId",
39+
(c) => ({
40+
tenantId: c.tenantId,
41+
}),
42+
],
43+
description: "ID of the contact associated to the bank transaction.",
3944
optional: true,
4045
},
4146
contactName: {
4247
type: "string",
43-
label: "Contact name",
48+
label: "Contact Name",
4449
description: "Name of the contact associated to the bank transaction. If there is no contact matching this name, a new contact is created.",
4550
optional: true,
4651
},
@@ -59,12 +64,12 @@ export default {
5964
},
6065
lineItems: {
6166
type: "object",
62-
label: "Line items",
67+
label: "Line Items",
6368
description: "See [LineItems](https://developer.xero.com/documentation/api/banktransactions#LineItemsPOST). The LineItems element can contain any number of individual LineItem sub-elements. At least **one** is required to create a bank transaction.",
6469
},
6570
isReconciled: {
6671
type: "boolean",
67-
label: "Is reconciled",
72+
label: "Is Reconciled",
6873
description: "Boolean to show if transaction is reconciled. Conversion related apps can set the IsReconciled flag in scenarios when a matching bank statement line is not available. [Learn more](http://help.xero.com/#Q_BankRecNoImport)",
6974
optional: true,
7075
},
@@ -82,13 +87,13 @@ export default {
8287
},
8388
currencyCode: {
8489
type: "string",
85-
label: "Currency code",
90+
label: "Currency Code",
8691
description: "The currency that bank transaction has been raised in (see [Currencies](https://developer.xero.com/documentation/api/currencies)). Setting currency is only supported on overpayments.",
8792
optional: true,
8893
},
8994
currencyRate: {
9095
type: "string",
91-
label: "Currency rate",
96+
label: "Currency Rate",
9297
description: "Exchange rate to base currency when money is spent or received. e.g. 0.7500 Only used for bank transactions in non base currency. If this isn't specified for non base currency accounts then either the user-defined rate (preference) or the [XE.com day rate](http://help.xero.com/#CurrencySettings$Rates) will be used. Setting currency is only supported on overpayments.",
9398
optional: true,
9499
},
@@ -110,7 +115,7 @@ export default {
110115
},
111116
lineAmountTypes: {
112117
type: "string",
113-
label: "Line amount types",
118+
label: "Line Amount Types",
114119
description: "Line amounts are exclusive of tax by default if you don't specify this element. See [Line Amount Types](https://developer.xero.com/documentation/api/types#LineAmountTypes)",
115120
optional: true,
116121
options: [

components/xero_accounting_api/actions/create-bill/create-bill.mjs

Lines changed: 16 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import {
2-
deleteKeys,
32
formatLineItems,
43
isValidDate,
54
removeNullEntries,
@@ -10,7 +9,7 @@ export default {
109
key: "xero_accounting_api-create-bill",
1110
name: "Create Bill",
1211
description: "Creates a new bill (Accounts Payable)[See the docs here](https://developer.xero.com/documentation/api/accounting/invoices)",
13-
version: "0.0.4",
12+
version: "0.0.5",
1413
annotations: {
1514
destructiveHint: false,
1615
openWorldHint: true,
@@ -28,7 +27,7 @@ export default {
2827
invoiceNumber: {
2928
type: "string",
3029
optional: true,
31-
label: "Invoice number",
30+
label: "Invoice Number",
3231
description: "Unique alpha numeric code identifying invoice",
3332
},
3433
reference: {
@@ -37,19 +36,14 @@ export default {
3736
label: "Reference",
3837
description: "ACCREC only - additional reference number",
3938
},
40-
contact: {
41-
type: "object",
42-
label: "Contact information",
43-
description: `Provide an object. Enter the column name for the key and the corresponding column value.
44-
[See object documentation](https://developer.xero.com/documentation/api/accounting/contacts/#post-contacts).
45-
Example:
46-
\`{
47-
"ContactID":"Existing contact ID. *Note: If contactID is populated, other key-value pairs would be ignored",
48-
"Name":"MyCorp Inc",
49-
"FirstName":"Sir",
50-
"LastName":"Bush",
51-
"EmailAddress": "jonny@mailinator.com"
52-
}\``,
39+
contactId: {
40+
propDefinition: [
41+
xeroAccountingApi,
42+
"contactId",
43+
(c) => ({
44+
tenantId: c.tenantId,
45+
}),
46+
],
5347
},
5448
lineItems: {
5549
propDefinition: [
@@ -60,19 +54,19 @@ export default {
6054
date: {
6155
type: "string",
6256
optional: true,
63-
label: "Invoice date",
57+
label: "Invoice Date",
6458
description: "Date invoice was issued - YYYY-MM-DD",
6559
},
6660
dueDate: {
6761
type: "string",
6862
optional: true,
69-
label: "Invoice due date",
63+
label: "Invoice Due Date",
7064
description: "Date invoice is due - YYYY-MM-DD",
7165
},
7266
currencyCode: {
7367
type: "string",
7468
optional: true,
75-
label: "The invoice currency",
69+
label: "The Invoice Currency",
7670
description:
7771
"The currency that invoice has been raised in. Refer to [object documentation](https://www.xe.com/iso4217.php)",
7872
},
@@ -83,14 +77,9 @@ export default {
8377
tenantId: this.tenantId,
8478
data: removeNullEntries({
8579
Type: "ACCPAY",
86-
Contact: this.contact?.ContactID
87-
? deleteKeys(this.contact, [
88-
"Name",
89-
"FirstName",
90-
"LastName",
91-
"EmailAddress",
92-
])
93-
: this.contact,
80+
Contact: {
81+
ContactID: this.contactId,
82+
},
9483
LineItems: formatLineItems(this.lineItems),
9584
Date: isValidDate(this.date, "Date") && this.date,
9685
DueDate: isValidDate(this.dueDate, "DueDate") && this.dueDate,

components/xero_accounting_api/actions/create-credit-note/create-credit-note.mjs

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
key: "xero_accounting_api-create-credit-note",
77
name: "Create Credit Note",
88
description: "Creates a new credit note.",
9-
version: "0.1.3",
9+
version: "0.1.4",
1010
annotations: {
1111
destructiveHint: true,
1212
openWorldHint: true,
@@ -22,9 +22,14 @@ export default {
2222
],
2323
},
2424
contactId: {
25-
label: "Contact ID",
26-
type: "string",
27-
description: "Id of the contact associated to the credit note.",
25+
propDefinition: [
26+
xeroAccountingApi,
27+
"contactId",
28+
(c) => ({
29+
tenantId: c.tenantId,
30+
}),
31+
],
32+
description: "ID of the contact associated to the credit note",
2833
optional: true,
2934
},
3035
contactName: {
@@ -69,7 +74,7 @@ export default {
6974
],
7075
},
7176
lineAmountTypes: {
72-
label: "Line amount types",
77+
label: "Line Amount Types",
7378
type: "string",
7479
description: "See [Invoice Line Amount Types](https://developer.xero.com/documentation/api/Types#LineAmountTypes)",
7580
optional: true,
@@ -80,19 +85,19 @@ export default {
8085
],
8186
},
8287
lineItems: {
83-
label: "Line items",
88+
label: "Line Items",
8489
type: "object",
8590
description: "See [Invoice Line Items](https://developer.xero.com/documentation/api/Invoices#LineItems)",
8691
optional: true,
8792
},
8893
currencyCode: {
89-
label: "Currency code",
94+
label: "Currency Code",
9095
type: "string",
9196
description: "Currency used for the Credit Note",
9297
optional: true,
9398
},
9499
creditNoteNumber: {
95-
label: "Credit note number",
100+
label: "Credit Note Number",
96101
type: "string",
97102
description: "[ACCRECCREDIT](https://developer.xero.com/documentation/api/types#CreditNoteTypes) - Unique alpha numeric code identifying credit note ( *when missing will auto-generate from your Organisation Invoice Settings*)\n[ACCPAYCREDIT](https://developer.xero.com/documentation/api/types#CreditNoteTypes) - non-unique alpha numeric code identifying credit note. This value will also display as Reference in the UI.",
98103
optional: true,
@@ -104,19 +109,19 @@ export default {
104109
optional: true,
105110
},
106111
sentToContact: {
107-
label: "Sent to contact",
112+
label: "Sent to Contact",
108113
type: "boolean",
109114
description: "Boolean to indicate if a credit note has been sent to a contact via the Xero app (currently read only)",
110115
optional: true,
111116
},
112117
currencyRate: {
113-
label: "Currency rate",
118+
label: "Currency Rate",
114119
type: "string",
115120
description: "The currency rate for a multicurrency invoice. If no rate is specified, the [XE.com day rate](http://help.xero.com/#CurrencySettings$Rates) is used",
116121
optional: true,
117122
},
118123
brandingThemeId: {
119-
label: "Branding theme ID",
124+
label: "Branding Theme ID",
120125
type: "string",
121126
description: "See [BrandingThemes](https://developer.xero.com/documentation/api/branding-themes)",
122127
optional: true,

components/xero_accounting_api/actions/create-history-note/create-history-note.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "xero_accounting_api-create-history-note",
66
name: "Create History Note",
77
description: "Creates a new note adding it to a document.",
8-
version: "0.1.3",
8+
version: "0.1.4",
99
annotations: {
1010
destructiveHint: false,
1111
openWorldHint: true,

components/xero_accounting_api/actions/create-item/create-item.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "xero_accounting_api-create-item",
66
name: "Create Item",
77
description: "Creates a new item.",
8-
version: "0.1.3",
8+
version: "0.1.4",
99
annotations: {
1010
destructiveHint: false,
1111
openWorldHint: true,

components/xero_accounting_api/actions/create-payment/create-payment.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "xero_accounting_api-create-payment",
66
name: "Create Payment",
77
description: "Creates a new payment",
8-
version: "0.1.3",
8+
version: "0.1.4",
99
annotations: {
1010
destructiveHint: false,
1111
openWorldHint: true,

components/xero_accounting_api/actions/create-tracking-category/create-tracking-category.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
key: "xero_accounting_api-create-tracking-category",
77
name: "Create tracking category",
88
description: "Create a new tracking category [See the documentation](https://developer.xero.com/documentation/api/accounting/trackingcategories#put-trackingcategories).",
9-
version: "0.0.2",
9+
version: "0.0.3",
1010
annotations: {
1111
destructiveHint: false,
1212
openWorldHint: true,

components/xero_accounting_api/actions/create-update-contact/create-update-contact.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
key: "xero_accounting_api-create-update-contact",
77
name: "Create or update contact ",
88
description: "Creates a new contact or updates a contact if a contact already exists. [See the docs here](https://developer.xero.com/documentation/api/accounting/contacts)",
9-
version: "0.1.1",
9+
version: "0.1.2",
1010
annotations: {
1111
destructiveHint: true,
1212
openWorldHint: true,

components/xero_accounting_api/actions/delete-tracking-category-option/delete-tracking-category-option.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "xero_accounting_api-delete-tracking-category-option",
66
name: "Delete tracking category option",
77
description: "Delete a tracking category option by ID [See the documentation](https://developer.xero.com/documentation/api/accounting/trackingcategories#delete-trackingcategories).",
8-
version: "0.0.2",
8+
version: "0.0.3",
99
annotations: {
1010
destructiveHint: true,
1111
openWorldHint: true,

0 commit comments

Comments
 (0)