Added: Webservice for booking management

This commit is contained in:
vishalsingh.qlo325
2024-08-26 12:46:33 +05:30
parent e13655ad99
commit bbbe380bf9
7 changed files with 3075 additions and 5 deletions

View File

@@ -122,7 +122,7 @@ abstract class HTMLTemplateCore
$width = 0;
$height = 0;
if (!empty($path_logo)) {
if (!empty($path_logo) && file_exists($path_logo)) {
list($width, $height) = getimagesize($path_logo);
}

View File

@@ -27,5 +27,6 @@ class WebserviceOrderCore extends PaymentModule
{
$this->displayName = $this->l('Order from API');
$this->validateOrderAmount = false;
$this->payment_type = OrderPayment::PAYMENT_TYPE_ONLINE;
}
}

View File

@@ -626,7 +626,21 @@ class WebserviceOutputBuilderCore
}
$output_details = '';
foreach ($objects_assoc as $object_assoc) {
if ($depth == 0 || $class_name === null) {
if (isset($association['single_entity']) && $association['single_entity']) {
unset($association['single_entity']);
unset($association['getter']);
unset($association['setter']);
foreach ($association as $associationKey => $resource) {
$field = array();
$field['sqlId'] = $associationKey;
$field['value'] = null;
if (!is_null($this->schemaToDisplay)) {
$field['synopsis_details'] = $this->getSynopsisDetails($resource);
}
$output_details .= $this->setIndent($depth - 1).$this->objectRender->renderField($field);
}
} elseif ($depth == 0 || $class_name === null) {
$value = null;
if (!empty($object_assoc)) {
$value = $object_assoc;
@@ -676,7 +690,30 @@ class WebserviceOutputBuilderCore
$output .= $this->setIndent($depth - 1).$this->objectRender->renderNodeHeader($resource_name, array(), $more_attr);
foreach ($fields_assoc as $field_name => $field) {
if (!is_array($this->fieldsToDisplay) || in_array($field_name, $this->fieldsToDisplay[$assoc_name])) {
if (isset($field['resource'])) {
$parent_details = array(
'object_id' => null,
'entity_name' => $field['resource'],
'entities_name' => $field_name,
);
$output_details = '';
$output_details = $this->renderFlatAssociation(
$object,
$depth,
$field_name,
$field['resource'],
$field['fields'],
$object_assoc,
$parent_details
);
if ($output_details != '') {
$output .= $this->setIndent($depth).$this->objectRender->renderNodeHeader($field_name, array());
$output .= $output_details;
$output .= $this->setIndent($depth).$this->objectRender->renderNodeFooter($field_name, array());
} else {
$output .= $this->setIndent($depth).$this->objectRender->renderNodeHeader($field_name, array());
}
} elseif (!is_array($this->fieldsToDisplay) || in_array($field_name, $this->fieldsToDisplay[$assoc_name])) {
if (isset($field['id']) && !isset($field['sqlId'])) {
$field['sqlId'] = 'id';
$field['value'] = isset($object_assoc['id']) ? $object_assoc['id'] : null;

View File

@@ -256,6 +256,7 @@ class WebserviceRequestCore
{
$resources = array(
'addresses' => array('description' => 'The Customer, Manufacturer and Customer addresses','class' => 'Address'),
'bookings' => array('description' => 'Booking', 'specific_management' => 'true'),
'carriers' => array('description' => 'The Carriers','class' => 'Carrier'),
'carts' => array('description' => 'Customer\'s carts', 'class' => 'Cart'),
'cart_rules' => array('description' => 'Cart rules management', 'class' => 'CartRule'),

File diff suppressed because it is too large Load Diff

View File

@@ -524,7 +524,7 @@ class HotelCartBookingData extends ObjectModel
}
}
if ($res && $objCart->updateQty((int)($roomsRequired * $num_days), $id_product)) {
if ($id_room) {
if ($roomsRequired == 1) {
return $obj_htl_cart_booking_data->id;
} else {
return true;

View File

@@ -51,7 +51,7 @@ class HotelReservationSystem extends Module
'feature_prices' => array('description' => 'Feature prices', 'class' => 'HotelRoomTypeFeaturePricing'),
'advance_payments' => array('description' => 'Room type advance payment', 'class' => 'HotelAdvancedPayment'),
'cart_bookings' => array('description' => 'Cart bookings', 'class' => 'HotelCartBookingData'),
'bookings' => array('description' => 'Order bookings', 'class' => 'HotelBookingDetail'),
'room_bookings' => array('description' => 'Room bookings', 'class' => 'HotelBookingDetail'),
'booking_extra_demands' => array('description' => 'Booking extra demands', 'class' => 'HotelBookingDemands'),
'extra_demands' => array('description' => 'Extra demands', 'class' => 'HotelRoomTypeGlobalDemand'),
'extra_services' => array('description' => 'Extra services', 'class' => 'Product', 'parameters_attribute' => 'webserviceRoomTypeServicesParameters'),