Qloapps / QloApps

QloApps is a Free and Open-source hotel management and reservation system to take a hotel business online. QloApps offers a Property Management System (PMS), a Booking Engine, and an attractive Hotel Website. Elevate hotel operations with QloApps to streamline processes and provide an enhanced experience for both hoteliers and guests.
https://qloapps.com
Open Software License 3.0
4.58k stars 512 forks source link

Error creating an order via API in QloApps: "Undefined index: avg_paid_unit_price_tax_excl" and "Undefined index: amount_tax_excl" #1313

Open DiegoNMedina opened 1 week ago

DiegoNMedina commented 1 week ago

Undefined Index Error: avg_paid_unit_price_tax_excl and amount_tax_excl in hotel-booking-cart-data.tpl.php

Description

Problem description:

While attempting to create an order via the QloApps API using a pre-configured cart, I encountered an error related to undefined indices in the file hotel-booking-cart-data.tpl.php. The error message is as follows:

Undefined index: avg_paid_unit_price_tax_excl (/var/www/html/cache/smarty/compile/36/88/7d/36887d61046a4b417fe6341a95db65c2dc9dde90_0.file.hotel-booking-cart-data.tpl.php, line 106) Undefined index: amount_tax_excl (/var/www/html/cache/smarty/compile/36/88/7d/36887d61046a4b417fe6341a95db65c2dc9dde90_0.file.hotel-booking-cart-data.tpl.php, line 162)

Steps to reproduce the issue:

  1. Set up a cart with a room using the QloApps API.
  2. Attempt to convert the cart into an order via the API.
  3. The system generates errors related to undefined indices (avg_paid_unit_price_tax_excl and amount_tax_excl).

Diagnosis:

Possible Cause:

Proposed Solution:

  1. Update the hotel-booking-cart-data.tpl.php template to check if the indices exist before accessing them.
  2. Ensure that the price and tax-related data are properly loaded into the cart before converting it to an order.
  3. Review if the information needs to be populated in a different table (like qlo_cart or qlo_order_detail) to avoid missing indices.

Relevant Logs:

Including the error logs for reference:

Undefined index: avg_paid_unit_price_tax_excl (/var/www/html/cache/smarty/compile/36/88/7d/36887d61046a4b417fe6341a95db65c2dc9dde90_0.file.hotel-booking-cart-data.tpl.php, line 106) Undefined index: amount_tax_excl (/var/www/html/cache/smarty/compile/36/88/7d/36887d61046a4b417fe6341a95db65c2dc9dde90_0.file.hotel-booking-cart-data.tpl.php, line 162)

Thank you for your attention, and I look forward to your assistance in resolving this issue.

aman-webkul commented 4 days ago

We have reviewed the issue you raised but were unable to reproduce at our end. To assist you further with the debugging, could you please confirm which version of QloApps you are using?