Skip to content

Commit

Permalink
fix catalog for invoice (#75)
Browse files Browse the repository at this point in the history
* fix catalog for invoice

* fix SubTotalLineDetail typing

* add DefinitionId back to custom_field

* remove value from custom_field
  • Loading branch information
keyn4 authored Oct 17, 2023
1 parent 58f3164 commit 099e8d4
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions tap_quickbooks/quickbooks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,14 @@ def field_to_property_schema(field, mdata): # pylint:disable=too-many-branches
"type": ["null", "array"]
}

ref_type = {
"type": object_type["type"],
"properties": {
"value": string_type,
"name": string_type,
}
}

qb_types = {
"number": number_type,
"string": string_type,
Expand All @@ -124,7 +132,8 @@ def field_to_property_schema(field, mdata): # pylint:disable=too-many-branches
"object_reference": string_type,
"email": string_type,
"address": string_type,
"metadata": string_type
"metadata": string_type,
"ref_type": ref_type
}

qb_types["custom_field"] = {
Expand All @@ -148,18 +157,21 @@ def field_to_property_schema(field, mdata): # pylint:disable=too-many-branches
"SalesItemLineDetail": {
"type": object_type["type"],
"properties": {
"ItemRef": qb_types["object_reference"],
"ClassRef": qb_types["object_reference"],
"ItemAccountRef": qb_types["object_reference"],
"TaxCodeRef": qb_types["object_reference"],
"ItemRef": qb_types["ref_type"],
"ClassRef": qb_types["ref_type"],
"ItemAccountRef": qb_types["ref_type"],
"TaxCodeRef": qb_types["ref_type"],
"Qty": number_type,
"UnitPrice": number_type,
"ServiceDate": qb_types["datetime"],
"Description" : string_type
}
},
"SubTotalLineDetail": {
"type": object_type["type"]
"type": object_type["type"],
"properties": {
"ItemRef": qb_types["ref_type"]
}
},
"DiscountLineDetail": {
"type": object_type["type"],
Expand Down

0 comments on commit 099e8d4

Please sign in to comment.