Skip to content

Commit

Permalink
BTHAB-257: Fetch discount information for case client
Browse files Browse the repository at this point in the history
  • Loading branch information
olayiwola-compucorp committed Oct 16, 2023
1 parent 1816a85 commit d9a7756
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@
}).then(function (caseContacts) {
if (Array.isArray(caseContacts) && caseContacts.length > 0) {
$scope.salesOrder.client_id = caseContacts[0].contact_id ?? null;
if ($scope.salesOrder.client_id) {
handleClientChange();
}
}
});
}
Expand Down Expand Up @@ -230,7 +233,7 @@
const clientID = $scope.salesOrder.client_id;
crmApi4('Membership', 'get', {
select: ['membership_type_id.Product_Discounts.Product_Discount_Amount'],
where: [['contact_id', '=', clientID]]
where: [['contact_id', '=', clientID], ['status_id.is_current_member', '=', true]]
}).then(function (results) {
let discountPercentage = 0;
results.forEach((membership) => {
Expand Down

0 comments on commit d9a7756

Please sign in to comment.