-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Enhance Fortnox component with new actions and properties #19208
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
luancazarine
wants to merge
8
commits into
master
Choose a base branch
from
19182-app-fortnox---add-more-useful-endpoints
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 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
603ba20
Enhance Fortnox component with new actions and properties
luancazarine cc19f4f
Update components/fortnox/actions/list-invoices/list-invoices.mjs
luancazarine 9dfa75d
Add new properties to list-customers action in Fortnox component
luancazarine ac32c62
Refactor Fortnox actions for improved clarity and functionality
luancazarine 3c0c68d
Update components/fortnox/actions/list-supplier-invoices/list-supplie…
luancazarine 105a3e4
Add terms of delivery and payment to Fortnox component
luancazarine 99ff765
Update due date description in create-invoice action and remove dueDa…
luancazarine 8e3126c
Remove terms of delivery and payment from Fortnox component
luancazarine 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
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
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
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
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
32 changes: 32 additions & 0 deletions
32
components/fortnox/actions/get-supplier-invoice/get-supplier-invoice.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,32 @@ | ||
| import app from "../../fortnox.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "fortnox-get-supplier-invoice", | ||
| name: "Get Supplier Invoice", | ||
| description: "Retrieve a supplier invoice. [See the documentation](https://api.fortnox.se/apidocs#tag/fortnox_SupplierInvoices/operation/get_39)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
| }, | ||
| props: { | ||
| app, | ||
| supplierInvoiceNumber: { | ||
| propDefinition: [ | ||
| app, | ||
| "supplierInvoiceNumber", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const { SupplierInvoice } = await this.app.getSupplierInvoice({ | ||
| $, | ||
| supplierInvoiceNumber: this.supplierInvoiceNumber, | ||
| }); | ||
|
|
||
| $.export("$summary", `Successfully retrieved supplier invoice with number ${this.supplierInvoiceNumber}`); | ||
| return SupplierInvoice; | ||
| }, | ||
| }; |
27 changes: 27 additions & 0 deletions
27
components/fortnox/actions/list-accounts/list-accounts.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,27 @@ | ||
| import app from "../../fortnox.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "fortnox-list-accounts", | ||
| name: "List Accounts", | ||
| description: "List all accounts in Fortnox. [See the documentation](https://api.fortnox.se/apidocs#tag/fortnox_Accounts/operation/list_2)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
| }, | ||
| props: { | ||
| app, | ||
| }, | ||
| async run({ $ }) { | ||
| const { Accounts: accounts } = await this.app.listAccounts({ | ||
| $, | ||
| }); | ||
|
|
||
| $.export("$summary", `Successfully retrieved ${accounts.length} account${accounts.length === 1 | ||
| ? "" | ||
| : "s"}`); | ||
| return accounts; | ||
luancazarine marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }, | ||
| }; | ||
109 changes: 109 additions & 0 deletions
109
components/fortnox/actions/list-articles/list-articles.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,109 @@ | ||
| import app from "../../fortnox.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "fortnox-list-articles", | ||
| name: "List Articles", | ||
| description: "List all articles in Fortnox. [See the documentation](https://api.fortnox.se/apidocs#tag/fortnox_Articles/operation/list_4)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
| }, | ||
| props: { | ||
| app, | ||
| filter: { | ||
| type: "string", | ||
| label: "Filter", | ||
| description: "Filter the articles by Active or Inactive", | ||
| options: [ | ||
| "active", | ||
| "inactive", | ||
| ], | ||
| optional: true, | ||
| }, | ||
| articlenumber: { | ||
| type: "string", | ||
| label: "Article Number", | ||
| description: "Filter by article number", | ||
| optional: true, | ||
| }, | ||
| description: { | ||
| type: "string", | ||
| label: "Description", | ||
| description: "Filter by description", | ||
| optional: true, | ||
| }, | ||
| ean: { | ||
| type: "string", | ||
| label: "EAN", | ||
| description: "Filter by EAN", | ||
| optional: true, | ||
| }, | ||
| suppliernumber: { | ||
| type: "string", | ||
| label: "Supplier Number", | ||
| description: "Filter by supplier number", | ||
| optional: true, | ||
| }, | ||
| manufacturer: { | ||
| type: "string", | ||
| label: "Manufacturer", | ||
| description: "Filter by manufacturer", | ||
| optional: true, | ||
| }, | ||
| manufacturerarticlenumber: { | ||
| type: "string", | ||
| label: "Manufacturer Article Number", | ||
| description: "Filter by manufacturer article number", | ||
| optional: true, | ||
| }, | ||
| webshop: { | ||
| type: "string", | ||
| label: "Webshop", | ||
| description: "Filter by web shop", | ||
| optional: true, | ||
| }, | ||
| lastmodified: { | ||
| type: "string", | ||
| label: "Last Modified", | ||
| description: "Filter by last modified date", | ||
| optional: true, | ||
| }, | ||
| sortby: { | ||
| type: "string", | ||
| label: "Sort By", | ||
| description: "Sort the articles by the specified field", | ||
| optional: true, | ||
| options: [ | ||
| "articlenumber", | ||
| "quantityinstock", | ||
| "reservedquantity", | ||
| "stockvalue", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const { Articles } = await this.app.listArticles({ | ||
| $, | ||
| params: { | ||
| filter: this.filter, | ||
| articlenumber: this.articlenumber, | ||
| description: this.description, | ||
| ean: this.ean, | ||
| suppliernumber: this.suppliernumber, | ||
| manufacturer: this.manufacturer, | ||
| manufacturerarticlenumber: this.manufacturerarticlenumber, | ||
| webshop: this.webshop, | ||
| lastmodified: this.lastmodified, | ||
| sortby: this.sortby, | ||
| }, | ||
| }); | ||
|
|
||
| $.export("$summary", `Successfully retrieved ${Articles.length} article${Articles.length === 1 | ||
| ? "" | ||
| : "s"}`); | ||
| return Articles; | ||
| }, | ||
| }; |
121 changes: 121 additions & 0 deletions
121
components/fortnox/actions/list-customers/list-customers.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,121 @@ | ||
| import app from "../../fortnox.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "fortnox-list-customers", | ||
| name: "List Customers", | ||
| description: "List all customers in Fortnox. [See the documentation](https://api.fortnox.se/apidocs#tag/fortnox_Customers/operation/list_15)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
| }, | ||
| props: { | ||
| app, | ||
| filter: { | ||
| type: "string", | ||
| label: "Filter", | ||
| description: "Filter the customers by Active or Inactive", | ||
| options: [ | ||
| "active", | ||
| "inactive", | ||
| ], | ||
| optional: true, | ||
| }, | ||
| customernumber: { | ||
| type: "string", | ||
| label: "Customer Number", | ||
| description: "Filter by customer number", | ||
| optional: true, | ||
| }, | ||
| name: { | ||
| type: "string", | ||
| label: "Name", | ||
| description: "Filter by name", | ||
| optional: true, | ||
| }, | ||
| zipcode: { | ||
| type: "string", | ||
| label: "Zip Code", | ||
| description: "Filter by zip code", | ||
| optional: true, | ||
| }, | ||
| city: { | ||
| type: "string", | ||
| label: "City", | ||
| description: "Filter by city", | ||
| optional: true, | ||
| }, | ||
| email: { | ||
| type: "string", | ||
| label: "Email", | ||
| description: "Filter by email", | ||
| optional: true, | ||
| }, | ||
| phone: { | ||
| type: "string", | ||
| label: "Phone", | ||
| description: "Filter by phone", | ||
| optional: true, | ||
| }, | ||
| organisationnumber: { | ||
| type: "string", | ||
| label: "Organisation Number", | ||
| description: "Filter by organisation number", | ||
| optional: true, | ||
| }, | ||
| gln: { | ||
| type: "string", | ||
| label: "GLN", | ||
| description: "Filter by GLN", | ||
| optional: true, | ||
| }, | ||
| glndelivery: { | ||
| type: "string", | ||
| label: "GLN Delivery", | ||
| description: "Filter by GLN Delivery", | ||
| optional: true, | ||
luancazarine marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }, | ||
| lastmodified: { | ||
| type: "string", | ||
| label: "Last Modified", | ||
| description: "Filter by last modified date", | ||
| optional: true, | ||
luancazarine marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }, | ||
| sortby: { | ||
| type: "string", | ||
| label: "Sort By", | ||
| description: "Sort the customers by the specified field", | ||
| optional: true, | ||
| options: [ | ||
| "customernumber", | ||
| "name", | ||
| ], | ||
| }, | ||
luancazarine marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }, | ||
| async run({ $ }) { | ||
| const { Customers } = await this.app.listCustomers({ | ||
| $, | ||
| params: { | ||
| filter: this.filter, | ||
| customernumber: this.customernumber, | ||
| name: this.name, | ||
| zipcode: this.zipcode, | ||
| city: this.city, | ||
| email: this.email, | ||
| phone: this.phone, | ||
| organisationnumber: this.organisationnumber, | ||
| gln: this.gln, | ||
| glndelivery: this.glndelivery, | ||
| lastmodified: this.lastmodified, | ||
| sortby: this.sortby, | ||
| }, | ||
| }); | ||
|
|
||
| $.export("$summary", `Successfully retrieved ${Customers.length} customer${Customers.length === 1 | ||
| ? "" | ||
| : "s"}`); | ||
| return Customers; | ||
| }, | ||
| }; | ||
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.