-
Notifications
You must be signed in to change notification settings - Fork 5.6k
[Components] Sage Intacct new components #19136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jcortes
wants to merge
1
commit into
master
Choose a base branch
from
sage-intacct-new-components
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
152 changes: 152 additions & 0 deletions
152
components/sage_intacct/actions/create-bill/create-bill.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,152 @@ | ||
| import app from "../../sage_intacct.app.mjs"; | ||
| import utils from "../../common/utils.mjs"; | ||
|
|
||
| export default { | ||
| key: "sage_intacct-create-bill", | ||
| name: "Create Bill", | ||
| description: "Creates a new bill. After you create a bill, it can be moved through the normal Accounts Payable workflow. [See the documentation](https://developer.sage.com/intacct/apis/intacct/1/intacct-openapi/groups/accounts-payable/groups/bills/tags/accounts_payable_bills/paths/create-accounts-payable-bill)", | ||
| version: "0.0.1", | ||
| annotations: { | ||
| readOnlyHint: false, | ||
| openWorldHint: true, | ||
| destructiveHint: false, | ||
| }, | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| billNumber: { | ||
| propDefinition: [ | ||
| app, | ||
| "billNumber", | ||
| ], | ||
| }, | ||
| vendorId: { | ||
| propDefinition: [ | ||
| app, | ||
| "vendorId", | ||
| ], | ||
| }, | ||
| referenceNumber: { | ||
| propDefinition: [ | ||
| app, | ||
| "referenceNumber", | ||
| ], | ||
| }, | ||
| description: { | ||
| propDefinition: [ | ||
| app, | ||
| "description", | ||
| ], | ||
| }, | ||
| createdDate: { | ||
| propDefinition: [ | ||
| app, | ||
| "createdDate", | ||
| ], | ||
| }, | ||
| postingDate: { | ||
| propDefinition: [ | ||
| app, | ||
| "postingDate", | ||
| ], | ||
| }, | ||
| dueDate: { | ||
| propDefinition: [ | ||
| app, | ||
| "dueDate", | ||
| ], | ||
| }, | ||
| discountCutOffDate: { | ||
| propDefinition: [ | ||
| app, | ||
| "discountCutOffDate", | ||
| ], | ||
| }, | ||
| recommendedPaymentDate: { | ||
| propDefinition: [ | ||
| app, | ||
| "recommendedPaymentDate", | ||
| ], | ||
| }, | ||
| paymentPriority: { | ||
| propDefinition: [ | ||
| app, | ||
| "paymentPriority", | ||
| ], | ||
| }, | ||
| isOnHold: { | ||
| propDefinition: [ | ||
| app, | ||
| "isOnHold", | ||
| ], | ||
| }, | ||
| isTaxInclusive: { | ||
| propDefinition: [ | ||
| app, | ||
| "isTaxInclusive", | ||
| ], | ||
| }, | ||
| txnCurrency: { | ||
| propDefinition: [ | ||
| app, | ||
| "txnCurrency", | ||
| ], | ||
| }, | ||
| lines: { | ||
| propDefinition: [ | ||
| app, | ||
| "lines", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const { | ||
| app, | ||
| billNumber, | ||
| vendorId, | ||
| referenceNumber, | ||
| description, | ||
| createdDate, | ||
| postingDate, | ||
| dueDate, | ||
| discountCutOffDate, | ||
| recommendedPaymentDate, | ||
| paymentPriority, | ||
| isOnHold, | ||
| isTaxInclusive, | ||
| txnCurrency, | ||
| lines, | ||
| } = this; | ||
|
|
||
| const response = await app.createBill({ | ||
| $, | ||
| data: { | ||
| billNumber, | ||
| referenceNumber, | ||
| description, | ||
| postingDate, | ||
| discountCutOffDate, | ||
| recommendedPaymentDate, | ||
| paymentPriority, | ||
| isOnHold, | ||
| isTaxInclusive, | ||
| createdDate, | ||
| dueDate, | ||
| ...(vendorId && { | ||
| vendor: { | ||
| id: vendorId, | ||
| }, | ||
| }), | ||
| ...(txnCurrency && { | ||
| currency: { | ||
| txnCurrency, | ||
| }, | ||
| }), | ||
| lines: utils.parseJson(lines), | ||
| }, | ||
| }); | ||
|
|
||
| $.export("$summary", "Successfully created bill"); | ||
| return response; | ||
| }, | ||
| }; | ||
127 changes: 127 additions & 0 deletions
127
components/sage_intacct/actions/create-vendor/create-vendor.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,127 @@ | ||
| import app from "../../sage_intacct.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "sage_intacct-create-vendor", | ||
| name: "Create Vendor", | ||
| description: "Creates a new vendor. When you add a new vendor, you can provide key descriptive information about that vendor and establish how you want to pay them. [See the documentation](https://developer.sage.com/intacct/apis/intacct/1/intacct-openapi/groups/accounts-payable/groups/vendors/tags/accounts_payable_vendors/paths/create-accounts-payable-vendor)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| annotations: { | ||
| readOnlyHint: false, | ||
| openWorldHint: true, | ||
| destructiveHint: false, | ||
| }, | ||
| props: { | ||
| app, | ||
| vendorId: { | ||
| propDefinition: [ | ||
| app, | ||
| "vendorId", | ||
| ], | ||
| }, | ||
| name: { | ||
| propDefinition: [ | ||
| app, | ||
| "vendorName", | ||
| ], | ||
| }, | ||
| taxId: { | ||
| propDefinition: [ | ||
| app, | ||
| "vendorTaxId", | ||
| ], | ||
| }, | ||
| creditLimit: { | ||
| propDefinition: [ | ||
| app, | ||
| "vendorCreditLimit", | ||
| ], | ||
| }, | ||
| billingType: { | ||
| propDefinition: [ | ||
| app, | ||
| "vendorBillingType", | ||
| ], | ||
| }, | ||
| paymentPriority: { | ||
| propDefinition: [ | ||
| app, | ||
| "vendorPaymentPriority", | ||
| ], | ||
| }, | ||
| status: { | ||
| propDefinition: [ | ||
| app, | ||
| "vendorStatus", | ||
| ], | ||
| }, | ||
| isOnHold: { | ||
| propDefinition: [ | ||
| app, | ||
| "vendorIsOnHold", | ||
| ], | ||
| }, | ||
| doNotPay: { | ||
| propDefinition: [ | ||
| app, | ||
| "vendorDoNotPay", | ||
| ], | ||
| }, | ||
| notes: { | ||
| propDefinition: [ | ||
| app, | ||
| "vendorNotes", | ||
| ], | ||
| }, | ||
| vendorAccountNumber: { | ||
| propDefinition: [ | ||
| app, | ||
| "vendorAccountNumber", | ||
| ], | ||
| }, | ||
| preferredPaymentMethod: { | ||
| propDefinition: [ | ||
| app, | ||
| "vendorPreferredPaymentMethod", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const { | ||
| app, | ||
| vendorId, | ||
| name, | ||
| taxId, | ||
| creditLimit, | ||
| billingType, | ||
| paymentPriority, | ||
| status, | ||
| isOnHold, | ||
| doNotPay, | ||
| notes, | ||
| vendorAccountNumber, | ||
| preferredPaymentMethod, | ||
| } = this; | ||
|
|
||
| const response = await app.createVendor({ | ||
| $, | ||
| data: { | ||
| id: vendorId, | ||
| name, | ||
| taxId, | ||
| creditLimit, | ||
| billingType, | ||
| paymentPriority, | ||
| status, | ||
| isOnHold, | ||
| doNotPay, | ||
| notes, | ||
| vendorAccountNumber, | ||
| preferredPaymentMethod, | ||
| }, | ||
jcortes marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }); | ||
|
|
||
| $.export("$summary", "Successfully created vendor"); | ||
| return response; | ||
| }, | ||
| }; | ||
39 changes: 39 additions & 0 deletions
39
components/sage_intacct/actions/delete-bill/delete-bill.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| import app from "../../sage_intacct.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "sage_intacct-delete-bill", | ||
| name: "Delete Bill", | ||
| description: "Deletes a bill. You can only delete unpaid bills that are in a Posted, Draft, or Declined state. [See the documentation](https://developer.sage.com/intacct/apis/intacct/1/intacct-openapi/groups/accounts-payable/groups/bills/tags/accounts_payable_bills/paths/delete-accounts-payable-bill-key)", | ||
| version: "0.0.1", | ||
| annotations: { | ||
| readOnlyHint: false, | ||
| openWorldHint: true, | ||
| destructiveHint: true, | ||
| }, | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| billKey: { | ||
| propDefinition: [ | ||
| app, | ||
| "billKey", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const { | ||
| app, | ||
| billKey, | ||
| } = this; | ||
|
|
||
| await app.deleteBill({ | ||
| $, | ||
| billKey, | ||
| }); | ||
|
|
||
| $.export("$summary", "Successfully deleted bill"); | ||
| return { | ||
| success: true, | ||
| }; | ||
| }, | ||
jcortes marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }; | ||
39 changes: 39 additions & 0 deletions
39
components/sage_intacct/actions/delete-vendor/delete-vendor.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| import app from "../../sage_intacct.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "sage_intacct-delete-vendor", | ||
| name: "Delete Vendor", | ||
| description: "Deletes a vendor. You can only delete vendors that aren't tied to any transactions or payments. [See the documentation](https://developer.sage.com/intacct/apis/intacct/1/intacct-openapi/groups/accounts-payable/groups/vendors/tags/accounts_payable_vendors/paths/delete-accounts-payable-vendor-key)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| annotations: { | ||
| readOnlyHint: false, | ||
| openWorldHint: true, | ||
| destructiveHint: true, | ||
| }, | ||
| props: { | ||
| app, | ||
| vendorKey: { | ||
| propDefinition: [ | ||
| app, | ||
| "vendorKey", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const { | ||
| app, | ||
| vendorKey, | ||
| } = this; | ||
|
|
||
| await app.deleteVendor({ | ||
| $, | ||
| vendorKey, | ||
| }); | ||
|
|
||
| $.export("$summary", "Successfully deleted vendor"); | ||
| return { | ||
| success: true, | ||
| }; | ||
jcortes marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }, | ||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| import app from "../../sage_intacct.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "sage_intacct-list-bills", | ||
| name: "List Bills", | ||
| description: "Returns up to 100 object references from the collection with a key, ID, and link for each bill. [See the documentation](https://developer.sage.com/intacct/apis/intacct/1/intacct-openapi/groups/accounts-payable/groups/bills/tags/accounts_payable_bills/paths/list-accounts-payable-bill)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| annotations: { | ||
| readOnlyHint: true, | ||
| openWorldHint: true, | ||
| destructiveHint: false, | ||
| }, | ||
| props: { | ||
| app, | ||
| }, | ||
| async run({ $ }) { | ||
| const { app } = this; | ||
|
|
||
| const response = await app.listBills({ | ||
| $, | ||
| }); | ||
|
|
||
| $.export("$summary", "Successfully listed bills"); | ||
| return response; | ||
| }, | ||
| }; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.