- 
                Notifications
    
You must be signed in to change notification settings  - Fork 5.5k
 
Quickbooks Online - new actions #14630
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
          
     Merged
      
      
    
  
     Merged
                    Changes from all commits
      Commits
    
    
            Show all changes
          
          
            3 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      
    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
        
          
          
            102 changes: 102 additions & 0 deletions
          
          102 
        
  components/quickbooks/actions/create-ap-aging-report/create-ap-aging-report.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,102 @@ | ||
| import quickbooks from "../../quickbooks.app.mjs"; | ||
| import { AP_AGING_REPORT_COLUMNS } from "../../common/constants.mjs"; | ||
| 
     | 
||
| export default { | ||
| key: "quickbooks-create-ap-aging-report", | ||
| name: "Create AP Aging Detail Report", | ||
| description: "Creates an AP aging report in Quickbooks Online. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/apagingdetail#query-a-report)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| quickbooks, | ||
| shipvia: { | ||
| type: "string", | ||
| label: "Ship Via", | ||
| description: "Filter by the shipping method", | ||
| optional: true, | ||
| }, | ||
| termIds: { | ||
| propDefinition: [ | ||
| quickbooks, | ||
| "termIds", | ||
| ], | ||
| }, | ||
| startDueDate: { | ||
| type: "string", | ||
| label: "Start Due Date", | ||
| description: "The range of dates over which receivables are due, in the format `YYYY-MM-DD`. `start_duedate` must be less than `end_duedate`. If not specified, all data is returned.", | ||
| optional: true, | ||
| }, | ||
| endDueDate: { | ||
| type: "string", | ||
| label: "End Due Date", | ||
| description: "The range of dates over which receivables are due, in the format `YYYY-MM-DD`. `start_duedate` must be less than `end_duedate`. If not specified, all data is returned.", | ||
| optional: true, | ||
| }, | ||
| accountingMethod: { | ||
| propDefinition: [ | ||
| quickbooks, | ||
| "accountingMethod", | ||
| ], | ||
| }, | ||
| reportDate: { | ||
| type: "string", | ||
| label: "Report Date", | ||
| description: "Start date to use for the report, in the format `YYYY-MM-DD`", | ||
| optional: true, | ||
| }, | ||
| numPeriods: { | ||
| type: "integer", | ||
| label: "Num Periods", | ||
| description: "The number of periods to be shown in the report", | ||
| optional: true, | ||
| }, | ||
| vendorIds: { | ||
| propDefinition: [ | ||
| quickbooks, | ||
| "vendorIds", | ||
| ], | ||
| }, | ||
| pastDue: { | ||
| type: "integer", | ||
| label: "Past Due", | ||
| description: "Filters report contents based on minimum days past due", | ||
| optional: true, | ||
| }, | ||
| agingPeriod: { | ||
| type: "integer", | ||
| label: "Aging Period", | ||
| description: "The number of days in the aging period", | ||
| optional: true, | ||
| }, | ||
                
      
                  michelle0927 marked this conversation as resolved.
               
          
            Show resolved
            Hide resolved
         | 
||
| columns: { | ||
| propDefinition: [ | ||
| quickbooks, | ||
| "columns", | ||
| ], | ||
| options: AP_AGING_REPORT_COLUMNS, | ||
| }, | ||
                
      
                  michelle0927 marked this conversation as resolved.
               
          
            Show resolved
            Hide resolved
         | 
||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.quickbooks.getApAgingReport({ | ||
| $, | ||
| params: { | ||
| shipvia: this.shipvia, | ||
| term: this.termIds, | ||
| start_duedate: this.startDueDate, | ||
| end_duedate: this.endDueDate, | ||
| accounting_method: this.accountingMethod, | ||
| report_date: this.reportDate, | ||
| num_periods: this.numPeriods, | ||
| vendor: this.vendorIds, | ||
| past_due: this.pastDue, | ||
| aging_period: this.agingPeriod, | ||
| columns: this.columns, | ||
| }, | ||
| }); | ||
| if (response) { | ||
| $.export("summary", "Successfully created AP Aging Detail Report"); | ||
| } | ||
| return response; | ||
| }, | ||
                
      
                  michelle0927 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
    
  
  
    
              
              
  
    
      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
    
  
  
    
              
              
        
          
          
            144 changes: 144 additions & 0 deletions
          
          144 
        
  components/quickbooks/actions/create-pl-report/create-pl-report.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,144 @@ | ||
| import quickbooks from "../../quickbooks.app.mjs"; | ||
| import { | ||
| DATE_MACRO_OPTIONS, PAYMENT_METHOD_OPTIONS, ACCOUNT_TYPE_OPTIONS, PROFIT_LOSS_REPORT_COLUMNS, | ||
| } from "../../common/constants.mjs"; | ||
| 
     | 
||
| export default { | ||
| key: "quickbooks-create-pl-report", | ||
| name: "Create Profit and Loss Detail Report", | ||
| description: "Creates a profit and loss report in Quickbooks Online. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/profitandloss#query-a-report)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| quickbooks, | ||
| customerIds: { | ||
| propDefinition: [ | ||
| quickbooks, | ||
| "customer", | ||
| ], | ||
| type: "string[]", | ||
| label: "Customer Ids", | ||
| description: "Filters report contents to include information for specified customers", | ||
| optional: true, | ||
| }, | ||
| accountIds: { | ||
| propDefinition: [ | ||
| quickbooks, | ||
| "accountIds", | ||
| ], | ||
| }, | ||
| accountingMethod: { | ||
| propDefinition: [ | ||
| quickbooks, | ||
| "accountingMethod", | ||
| ], | ||
| }, | ||
| dateMacro: { | ||
| type: "string", | ||
| label: "Date Macro", | ||
| description: "Predefined date range. Use if you want the report to cover a standard report date range; otherwise, use the `start_date` and `end_date` to cover an explicit report date range", | ||
| options: DATE_MACRO_OPTIONS, | ||
| optional: true, | ||
| }, | ||
| startDate: { | ||
| type: "string", | ||
| label: "Start Date", | ||
| description: "The start date of the report, in the format `YYYY-MM-DD`. `start_date` must be less than `end_date`", | ||
| optional: true, | ||
| }, | ||
| endDate: { | ||
| type: "string", | ||
| label: "End Date", | ||
| description: "The end date of the report, in the format `YYYY-MM-DD`. `start_date` must be less than `end_date`", | ||
| optional: true, | ||
| }, | ||
| adjustedGainLoss: { | ||
| type: "string", | ||
| label: "Adjusted Gain Loss", | ||
| description: "Specifies whether unrealized gain and losses are included in the report", | ||
| options: [ | ||
| "true", | ||
| "false", | ||
| ], | ||
| optional: true, | ||
| }, | ||
| classIds: { | ||
| propDefinition: [ | ||
| quickbooks, | ||
| "classIds", | ||
| ], | ||
| }, | ||
| paymentMethod: { | ||
| type: "string", | ||
| label: "Payment Method", | ||
| description: "Filters report contents based on payment method", | ||
| options: PAYMENT_METHOD_OPTIONS, | ||
| optional: true, | ||
| }, | ||
| employeeIds: { | ||
| propDefinition: [ | ||
| quickbooks, | ||
| "employeeIds", | ||
| ], | ||
| }, | ||
| departmentIds: { | ||
| propDefinition: [ | ||
| quickbooks, | ||
| "departmentIds", | ||
| ], | ||
| }, | ||
| vendorIds: { | ||
| propDefinition: [ | ||
| quickbooks, | ||
| "vendorIds", | ||
| ], | ||
| }, | ||
| accountType: { | ||
| type: "string", | ||
| label: "Account Type", | ||
| description: "Account type from which transactions are included in the report", | ||
| options: ACCOUNT_TYPE_OPTIONS, | ||
| optional: true, | ||
| }, | ||
| sortBy: { | ||
| type: "string", | ||
| label: "Sort By", | ||
| description: "The column type used in sorting report rows", | ||
| options: PROFIT_LOSS_REPORT_COLUMNS, | ||
| optional: true, | ||
| }, | ||
| columns: { | ||
| propDefinition: [ | ||
| quickbooks, | ||
| "columns", | ||
| ], | ||
| options: PROFIT_LOSS_REPORT_COLUMNS, | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.quickbooks.getProfitLossReport({ | ||
| $, | ||
| params: { | ||
| customer: this.customerIds, | ||
| account: this.accountIds, | ||
| accounting_method: this.accountingMethod, | ||
| date_macro: this.dateMacro, | ||
| start_date: this.startDate, | ||
| end_date: this.endDate, | ||
| adjusted_gain_loss: this.adjustedGainLoss, | ||
| class: this.classIds, | ||
| payment_method: this.paymentMethod, | ||
| employee: this.employeeIds, | ||
| department: this.departmentIds, | ||
| vendor: this.vendorIds, | ||
| account_type: this.accountType, | ||
| sort_by: this.sortBy, | ||
| columns: this.columns, | ||
                
      
                  michelle0927 marked this conversation as resolved.
               
          
            Show resolved
            Hide resolved
         | 
||
| }, | ||
| }); | ||
| if (response) { | ||
| $.export("summary", "Successfully created Profit and Loss Detail Report"); | ||
| } | ||
| return response; | ||
| }, | ||
                
      
                  michelle0927 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
    
  
  
    
              
              
  
    
      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
    
  
  
    
              
              
  
    
      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
    
  
  
    
              
              
  
    
      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
    
  
  
    
              
              
      
      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.