Skip to content

Commit

Permalink
Add class in vendor payment (#415)
Browse files Browse the repository at this point in the history
  • Loading branch information
NileshPant1999 authored Aug 9, 2023
1 parent da69a4e commit 2dc9d9e
Showing 1 changed file with 4 additions and 3 deletions.
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

0 comments on commit 2dc9d9e

Please sign in to comment.