Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

Commit

Permalink
Fixed - Calculation of ad-hoc charges on p3 of booking wizard not wor…
Browse files Browse the repository at this point in the history
…king for item 3
  • Loading branch information
erawat committed Dec 17, 2013
1 parent 4697e49 commit 9ccae3e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CRM/Booking/Form/AddSubResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ function preProcess(){
while ($bao->fetch()) {
$items[$bao->id] = array();
CRM_Core_DAO::storeValues($bao, $items[$bao->id]);
$items[$bao->id]['name'] = preg_replace('/[^\p{L}\p{N}\s]/u', '_', $items[$bao->id]['name']);
}

$days = CRM_Booking_Utils_DateTime::getDays();
Expand Down Expand Up @@ -166,7 +167,7 @@ function setDefaultValues() {
$subResources['adhoc_charges'] = $addhocCharges;
$total = ($subTotal - $this->_discountAmount) + $addhocCharges['total'];
$subResources['total_price'] = $total;
// force JSON to encode empty array as object if there is empty array in $subResources
// force JSON to encode empty array as object if there is empty array in $subResources
$defaults['sub_resources'] = json_encode($subResources,JSON_FORCE_OBJECT);
$defaults['sub_total'] = $subTotal;
$defaults['adhoc_charge'] = $addhocCharges['total'];
Expand Down

0 comments on commit 9ccae3e

Please sign in to comment.