Skip to content
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

Add class in vendor payment #415

Merged
merged 4 commits into from
Aug 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions apps/netsuite/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -1895,7 +1895,7 @@ def __construct_vendor_payment_lineitems(vendor_payment_lineitems: List[VendorPa

def __construct_vendor_payment(self, vendor_payment: VendorPayment,
vendor_payment_lineitems: List[VendorPaymentLineitem],
department) -> Dict:
department, netsuite_class) -> Dict:
"""
Create a vendor payment
:return: constructed vendor payment
Expand Down Expand Up @@ -1956,7 +1956,7 @@ def __construct_vendor_payment(self, vendor_payment: VendorPayment,
},
'class': {
'name': None,
'internalId': vendor_payment.class_id,
'internalId': netsuite_class['internalId'] if (netsuite_class and 'internalId' in netsuite_class) else None,
'externalId': None,
'type': 'classification'
},
Expand Down Expand Up @@ -1994,9 +1994,10 @@ def post_vendor_payment(self, vendor_payment: VendorPayment,
Post vendor payments to NetSuite
"""
department = first_object['department']
netsuite_class = first_object['class']

vendor_payment_payload = self.__construct_vendor_payment(
vendor_payment, vendor_payment_lineitems, department
vendor_payment, vendor_payment_lineitems, department, netsuite_class
)
created_vendor_payment = self.connection.vendor_payments.post(vendor_payment_payload)
return created_vendor_payment
Loading