if (get_rate($ratesid, $rate)) { $description = $rate['description']; $code = $rate['ratecode']; $src = $rate['bookingsrc']; $occupancy = $rate['occupancy']; $ratetype = $rate['rate_type']; $minpax = $rate['minpax']; $maxpax = $rate['maxpax']; $minstay = $rate['minstay']; $maxstay = $rate['maxstay']; $currencycode = $rate['currency']; $date_started = $rate['date_started']; $date_stopped = $rate['date_stopped']; $minbook = $rate['minbook']; $rateitems = array(); $rcount = get_rateitems($ratesid, $rateitems); if ($ratetype == PROMORATE || $ratetype == AGENTRATE || $ratetype == CUSTOMERRATE) { // Get the customer id associated with the rate if ($ratetype == CUSTOMERRATE) { get_roomratetypes($ratesid, CUSTOMERRATE, $customerid); // print "Customerid ".$customerid."<br/>"; } // Get the agent id associated with the rate. if ($ratetype == AGENTRATE) { // get the travel agent id associated get_roomratetypes($ratesid, AGENTRATE, $agentid); } // get any already selected rooms/roomtypes get_roomratetypes($ratesid, ROOMRATE, $rooms); get_roomratetypes($ratesid, ROOMTYPERATE, $roomtypes); }
$totamt = $totamt + $newamt; $totsvc = $totsvc + $svc; $tottax = $tottax + $tax; } $newCheckinDate = $reserved_date; for ($dc = 0; $dc < $no_nights; $dc++) { modify_transaction(0, $bill_id, 1, $reserved_date, $newCheckinDate, $userid, $roomamt, $totsvc, $tottax, $roomamt, $totsvc, $tottax, 1, $ratesid, '', $totamt, $curr); $newCheckinDate = date("Y-m-d", strtotime('+1 day', strtotime($newCheckinDate))); } } else { if (isset($_POST['payinadvance']) && !$resdetailID && $resdetailcount > 0) { foreach ($details as $dt) { $rtid = $dt['ratesid']; $ratedetails = array(); if ($rtid) { get_rateitems($rtid, $ratedetails); } $curr = get_Currency_byRateID($rtid); //print_r($ratedetails); $roomamt = 0; $totamt = $roomamt; $totsvc = 0; $tottax = 0; $stdsvc = 0; $stdtax = 0; foreach ($ratedetails as $ratedetail) { $roomamt = $roomamt + $ratedetail['discountvalue']; $svc = 0; if (!$ratedetail['service']) { $svc = $svc + $ratedetail['discountvalue'] * SVCPCT / 100; }
/** * Get the rate summary detail for a specific rates id * * @ingroup RATE_MANAGEMENT * @param $ratesid [in] Rate id * @param $rate [in/out] Rate detail */ function get_ratebyratesid($ratesid, &$rate) { global $conn; global $_L; if (!$ratesid) { return 0; } if (!$conn) { $conn = connect_Hotel_db(HOST, USER, PASS, DB, PORT); } if (!$conn) { return 0; } $fullrate = array(); // print "get fullrate ".$ratesid."<br/>"; if (!get_rate($ratesid, $fullrate)) { return 0; } $rate = array(); $rate['rateid'] = $ratesid; $rate['name'] = $fullrate['description']; $rate['code'] = $fullrate['ratecode']; $rate['currency'] = $fullrate['currency']; $items = array(); get_rateitems($ratesid, $items); $rate['inclusions'] = ""; foreach ($items as $idx => $val) { $rate['inclusions'] .= $_L['RTS_product'] . " : " . get_itemname($items[$idx]['itemid']) . "<br/>"; $rate['inclusions'] .= $_L['RTS_valid'] . " : " . get_ratesperiodstring($items[$idx]['validperiod'], 1, 1, 1) . "<br/>"; $rate['inclusions'] .= $_L['RTS_ratetype'] . " : " . get_discounttypestring($items[$idx]['discounttype']) . "<br/>"; $rate['inclusions'] .= $_L['RTS_price'] . " : " . $rate['currency'] . " " . $items[$idx]['discountvalue'] . "<br/>"; if ($items[$idx]['discountvalue']) { if ($items[$idx]['service']) { $rate['inclusions'] .= $_L['RTS_including']; } else { $rate['inclusions'] .= $_L['RTS_excluding']; } $rate['inclusions'] .= " " . $_L['RTS_service'] . "<br/>"; if ($items[$idx]['tax']) { $rate['inclusions'] .= $_L['RTS_including']; } else { $rate['inclusions'] .= $_L['RTS_excluding']; } $rate['inclusions'] .= " " . $_L['RTS_tax'] . "<br/>"; } $rate['inclusions'] .= "<br/>"; $rate['price'] = $items[$idx]['discountvalue']; } $rate['requirements'] = $_L['RTS_occupancy'] . " " . get_occupancystring($fullrate['occupancy']) . "<br/>"; $rate['requirements'] .= $_L['RTS_commencing'] . " " . $fullrate['date_started'] . "<br/>"; $rate['requirements'] .= $_L['RTS_ending'] . " " . $fullrate['date_stopped'] . "<br/>"; $rate['requirements'] .= $_L['RTS_minnights'] . " " . $fullrate['minstay'] . "<br/>"; $rate['requirements'] .= $_L['RTS_maxnights'] . " " . $fullrate['maxstay'] . "<br/>"; $rate['requirements'] .= $_L['RTS_minpax'] . " " . $fullrate['minpax'] . "<br/>"; $rate['requirements'] .= $_L['RTS_maxpax'] . " " . $fullrate['maxpax'] . "<br/>"; $rate['requirements'] .= $_L['RTS_minbook'] . " " . $fullrate['minbook'] . "<br/>"; }