| @@ -998,9 +998,9 @@ | ||
| 998 | 998 | return false; |
| 999 | 999 | } |
| 1000 | 1000 | |
| 1001 | 1001 | // count injected rooms, if any |
| 1002 | - $tot_rooms = count($this->room_ids); | |
| 1002 | + $tot_rooms = (int) (($params['rooms_count'] ?? 0) ?: count($this->room_ids)); | |
| 1003 | 1003 | |
| 1004 | 1004 | // build options array for TACVBO |
| 1005 | 1005 | $options = [ |
| 1006 | 1006 | 'hash' => md5('vbo.e4j.vbo'), |
| @@ -1077,9 +1077,9 @@ | ||
| 1077 | 1077 | } |
| 1078 | 1078 | |
| 1079 | 1079 | // optional filter by room IDs will be applied on this flow |
| 1080 | 1080 | $found_rids = array_keys($website_rates); |
| 1081 | - $unwanted_rids = $tot_rooms ? array_diff($found_rids, $this->room_ids) : []; | |
| 1081 | + $unwanted_rids = $this->room_ids ? array_diff($found_rids, $this->room_ids) : []; | |
| 1082 | 1082 | foreach ($unwanted_rids as $rid) { |
| 1083 | 1083 | unset($website_rates[$rid]); |
| 1084 | 1084 | } |
| 1085 | 1085 | |
| @@ -1086,8 +1086,20 @@ | ||
| 1086 | 1086 | return $website_rates; |
| 1087 | 1087 | } |
| 1088 | 1088 | |
| 1089 | 1089 | /** |
| 1090 | + * Returns the fully booked linear array of room IDs. | |
| 1091 | + * | |
| 1092 | + * @return array | |
| 1093 | + * | |
| 1094 | + * @since 1.18.8 (J) - 1.8.8 (WP) | |
| 1095 | + */ | |
| 1096 | + public function getFullyBooked() | |
| 1097 | + { | |
| 1098 | + return (array) $this->fully_booked; | |
| 1099 | + } | |
| 1100 | + | |
| 1101 | + /** | |
| 1090 | 1102 | * Finds the available suggestions in case of no availability previously occurred |
| 1091 | 1103 | * while getting the rates. This method should be called after getRates() so that |
| 1092 | 1104 | * a valid errorCode to be analized will be available, unless code is forced. |
| 1093 | 1105 | * Suggestions can include closest booking dates and/or different room-guest parties. |
| @@ -1255,9 +1267,9 @@ | ||
| 1255 | 1267 | } |
| 1256 | 1268 | } |
| 1257 | 1269 | } |
| 1258 | 1270 | |
| 1259 | - if (!count($avroom_nights)) { | |
| 1271 | + if (!$avroom_nights) { | |
| 1260 | 1272 | // no rooms available at all, there's no way to do anything |
| 1261 | 1273 | return []; |
| 1262 | 1274 | } |
| 1263 | 1275 | |
| @@ -1473,9 +1485,9 @@ | ||
| 1473 | 1485 | } |
| 1474 | 1486 | |
| 1475 | 1487 | // apply nights/transfers ratio limit (unless disabled) |
| 1476 | 1488 | $nights_transfers_ratio = $this->getNightsTransfersRatio(); |
| 1477 | - if ($nights_transfers_ratio > 0 && $nights_transfers_ratio < 100) { | |
| 1489 | + if ($nights_transfers_ratio > 0 && $nights_transfers_ratio <= 100) { | |
| 1478 | 1490 | // count and apply limits |
| 1479 | 1491 | foreach ($split_stay_sols as $k => $split_stay_sol) { |
| 1480 | 1492 | // count nights and transfers |
| 1481 | 1493 | $split_stay_transfers = count($split_stay_sol) - 1; |
| @@ -1495,9 +1507,9 @@ | ||
| 1495 | 1507 | // split stays have been disabled |
| 1496 | 1508 | $split_stay_sols = []; |
| 1497 | 1509 | } |
| 1498 | 1510 | |
| 1499 | - if ($altered_sols && count($split_stay_sols)) { | |
| 1511 | + if ($altered_sols && $split_stay_sols) { | |
| 1500 | 1512 | // restore the array keys |
| 1501 | 1513 | $split_stay_sols = array_values($split_stay_sols); |
| 1502 | 1514 | } |
| 1503 | 1515 | |