Skip to content

Commit 773067b

Browse files
Bill LeoutsakosBill Leoutsakos
authored andcommitted
fix(quickbooks): require current purchase payment type
1 parent a7ce54f commit 773067b

3 files changed

Lines changed: 13 additions & 2 deletions

File tree

apps/docs/content/docs/en/integrations/quickbooks.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { BlockInfoCard } from "@/components/ui/block-info-card"
1313
{/* MANUAL-CONTENT-START:intro */}
1414
Connect one QuickBooks Online company per credential. During OAuth, choose the company that the workflow should access; Sim binds that company to the credential automatically, so you do not enter a realm ID or API host.
1515

16-
Master Data and Sales transaction reads support **List** and **By ID** modes. List actions return at most one page. Use `nextStartPosition` in another workflow step when `hasMore` is true. Sim does not paginate, retry, or fetch related records automatically.
16+
Master Data, Sales, and Purchasing transaction reads support **List** and **By ID** modes. List actions return at most one page. Use `nextStartPosition` in another workflow step when `hasMore` is true. Sim does not paginate, retry, or fetch related records automatically.
1717

1818
QuickBooks updates are sparse: provide the record ID, its current `SyncToken`, and only the fields you want to change. Use the latest `SyncToken` returned by a read or mutation. Voiding keeps the transaction in QuickBooks with a zeroed financial effect; it is not deletion and requires explicit confirmation. Create actions accept an optional `requestId` that QuickBooks uses for idempotency when the same request may be submitted again.
1919

apps/sim/blocks/blocks/quickbooks.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,6 @@ export const QuickBooksBlock: BlockConfig<QuickBooksResponse> = {
766766
],
767767
condition: { field: 'operation', value: 'quickbooks_update_purchase' },
768768
required: { field: 'operation', value: 'quickbooks_update_purchase' },
769-
value: () => 'cash',
770769
},
771770
{
772771
id: 'paymentAccountId',

apps/sim/tools/quickbooks/purchasing.test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,18 @@ describe('QuickBooks purchasing block', () => {
484484
expect(operationIds).toContain('quickbooks_read_purchasing_transactions')
485485
})
486486

487+
it('requires the existing Purchase payment type without fabricating a default', () => {
488+
const currentPaymentType = QuickBooksBlock.subBlocks.find(
489+
(subBlock) => subBlock.id === 'currentPurchasePaymentType'
490+
)
491+
492+
expect(currentPaymentType?.required).toEqual({
493+
field: 'operation',
494+
value: 'quickbooks_update_purchase',
495+
})
496+
expect(currentPaymentType?.value).toBeUndefined()
497+
})
498+
487499
it('keeps every subblock ID unique and purchasing updates header-only', () => {
488500
const ids = QuickBooksBlock.subBlocks.map((subBlock) => subBlock.id)
489501
expect(new Set(ids).size).toBe(ids.length)

0 commit comments

Comments
 (0)