</div> </div> </div> </div> <div class="btngroup" align=right> <?php if ($bill['status'] != STATUS_CLOSED || isset($_SESSION["admin"]) && $_SESSION["admin"]) { ?> <input type=submit name="Submit" value="<?php echo $_L['BTN_update']; ?> " class="button"/> <?php $transcount = get_transactionsCount_byBillID($id); if ($transcount > 0 && !empty($checkin) && !empty($checkout)) { ?> <input type=submit name="Submit" value="<?php echo $_L['INV_addroomchg']; ?> " onclick="return confirmAddRoomCharges();" class="button"/> <?php } if ($transcount <= 0 && !empty($checkin) && !empty($checkout)) { ?> <input type=submit name="Submit" value="<?php echo $_L['INV_addroomchg']; ?> " class="button" /> <?php
/** * @ingroup INVOICE_MANAGEMENT * Delete prorated invoice * @param $billid [in] bill id */ function delete_billing($billid) { global $conn; if (!$billid) { return; } if (!$conn) { $conn = connect_Hotel_db(HOST, USER, PASS, DB, PORT); } $resid = get_ReservationID_By_BillID($billid); $bid = get_book_id($resid); $rcptCount = get_receiptsCount_byBillID($billid); $transCount = get_transactionsCount_byBillID($billid); //echo "reservation id ".$resid."<br/>"; //echo "booking id ".$bid."<br/>"; //echo "receipt count ".$rcptCount."<br/>"; //echo "trans count ".$transCount."<br/>"; $sql = ""; $sql .= "DELETE b,bk,rc,rv,tr FROM bills b "; $sql .= "LEFT JOIN booking bk ON b.bill_id = bk.bill_id "; $sql .= "LEFT JOIN receipts rc ON b.bill_id = rc.bill_id "; $sql .= "LEFT JOIN reservation rv ON b.bill_id = rv.bill_id "; $sql .= "LEFT JOIN transactions tr ON b.bill_id = tr.bill_id "; $sql .= "WHERE b.bill_id=" . $billid; $stmt = $conn->prepare($sql); $res = $stmt->execute(); $sql2 = "DELETE FROM reservation_details WHERE reservation_id='" . $resid . "'"; $stmt = $conn->prepare($sql2); $res = $stmt->execute(); }