Fix price calculation in order confirmation email

This commit is contained in:
Amit sharma
2026-02-27 10:14:09 +05:30
parent 4199e40098
commit 2a86378bae
11 changed files with 321 additions and 159 deletions

View File

@@ -286,7 +286,7 @@ class HTMLTemplateOrderSlipCore extends HTMLTemplateInvoice
$order_detail = array_filter($this->order->products, function($v) {
return ((isset($v['is_booking_product']) && $v['is_booking_product'])
|| ((isset($v['product_auto_add']) && $v['product_auto_add'])
&& $v['selling_preference_type'] == Product::SELLING_PREFERENCE_WITH_ROOM_TYPE
&& Product::isSellableWithRoomType($v['selling_preference_type'])
&& $v['product_price_addition_type'] == ProductCore::PRICE_ADDITION_TYPE_WITH_ROOM)
);
});
@@ -347,10 +347,14 @@ class HTMLTemplateOrderSlipCore extends HTMLTemplateInvoice
// - 'total_amount'
$breakdown = array();
$order_detail = array_filter($this->order->products, function($v) {
return (!$v['is_booking_product'] && (
$v['selling_preference_type'] == Product::SELLING_PREFERENCE_STANDALONE
|| $v['selling_preference_type'] == Product::SELLING_PREFERENCE_HOTEL_STANDALONE
));
return (
!$v['is_booking_product']
&& empty($v['id_htl_booking'])
&& (
Product::isSellableAsStandalone($v['selling_preference_type'])
|| Product::isSellableWithHotel($v['selling_preference_type'])
)
);
});
$details = $this->order->getProductTaxesDetails($order_detail, false);