Merge branch 'discount'
This commit is contained in:
@@ -21,6 +21,10 @@ $(document).ready(function(){
|
|||||||
var zone_name=$(this).find(".orders-table").text();
|
var zone_name=$(this).find(".orders-table").text();
|
||||||
var receipt_no=$(this).find(".orders-receipt-no").text();
|
var receipt_no=$(this).find(".orders-receipt-no").text();
|
||||||
var unique_id=$(this).find(".orders-id").text();
|
var unique_id=$(this).find(".orders-id").text();
|
||||||
|
var order_status=$(this).find(".orders-order-status").text().trim();
|
||||||
|
|
||||||
|
// Enable/Disable Button
|
||||||
|
control_button(order_status);
|
||||||
|
|
||||||
var cashier="";
|
var cashier="";
|
||||||
var receipt_date="";
|
var receipt_date="";
|
||||||
@@ -85,15 +89,26 @@ $(document).ready(function(){
|
|||||||
|
|
||||||
// Bill Request
|
// Bill Request
|
||||||
$('#request_bills').click(function() {
|
$('#request_bills').click(function() {
|
||||||
var order_id=$(".selected-item").find(".orders-id").text();
|
var order_id=$(".selected-item").find(".orders-id").text();
|
||||||
window.location.href = '/origami/request_bills/'+ order_id
|
if(order_id!=""){
|
||||||
|
window.location.href = '/origami/request_bills/'+ order_id
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
alert("Please select an order!");
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
// Discount for Payment
|
// Discount for Payment
|
||||||
$('#discount').click(function() {
|
$('#discount').click(function() {
|
||||||
var order_id=$(".selected-item").find(".orders-id").text();
|
var order_id=$(".selected-item").find(".orders-id").text();
|
||||||
window.location.href = '/origami/discount/'+ order_id
|
if(order_id!=""){
|
||||||
|
window.location.href = '/origami/discount/'+ order_id
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
alert("Please select an order!");
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -122,8 +137,14 @@ $(document).ready(function(){
|
|||||||
|
|
||||||
// Payment for Bill
|
// Payment for Bill
|
||||||
$('#pay').click(function() {
|
$('#pay').click(function() {
|
||||||
var sale_id=$(".selected-item").find(".orders-id").text();
|
var sale_id=$(".selected-item").find(".orders-id").text();
|
||||||
window.location.href = '/origami/sale/'+ sale_id + "/payment"
|
if(order_id!=""){
|
||||||
|
window.location.href = '/origami/sale/'+ sale_id + "/payment"
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
alert("Please select an order!");
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -174,6 +195,20 @@ $(document).on('click', '.cashier_number', function(event){
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/* Button Control by Status */
|
||||||
|
function control_button(order_status){
|
||||||
|
if(order_status=="billed"){
|
||||||
|
$("#request_bills").prop('disabled', true);
|
||||||
|
$("#discount").prop('disabled', false);
|
||||||
|
$("#pay").prop('disabled', false);
|
||||||
|
}
|
||||||
|
else if(order_status=="new") {
|
||||||
|
$("#request_bills").prop('disabled', false);
|
||||||
|
$("#discount").prop('disabled', true);
|
||||||
|
$("#pay").prop('disabled', true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* For Receipt - Update Balance */
|
/* For Receipt - Update Balance */
|
||||||
function update_balance(){
|
function update_balance(){
|
||||||
var discount_type = $('#discount-type').val();
|
var discount_type = $('#discount-type').val();
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ class Order < ApplicationRecord
|
|||||||
process_order_queue
|
process_order_queue
|
||||||
|
|
||||||
#send order to broadcast job
|
#send order to broadcast job
|
||||||
send_order_broadcast
|
#send_order_broadcast
|
||||||
|
|
||||||
return true, booking
|
return true, booking
|
||||||
|
|
||||||
|
|||||||
@@ -218,7 +218,7 @@
|
|||||||
<button type="button" id="request_bills" class="btn btn-primary btn-lg btn-block">Req.Bill</button>
|
<button type="button" id="request_bills" class="btn btn-primary btn-lg btn-block">Req.Bill</button>
|
||||||
<!-- Cashier Buttons -->
|
<!-- Cashier Buttons -->
|
||||||
<button type="button" id="discount" class="btn btn-primary btn-lg btn-block">Discount</button>
|
<button type="button" id="discount" class="btn btn-primary btn-lg btn-block">Discount</button>
|
||||||
<button type="button" class="btn btn-primary btn-lg btn-block">Tax</button>
|
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Tax</button>
|
||||||
<button type="button" id="pay" class="btn btn-primary btn-lg btn-block" >Pay</button>
|
<button type="button" id="pay" class="btn btn-primary btn-lg btn-block" >Pay</button>
|
||||||
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Re.Print</button>
|
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Re.Print</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -140,6 +140,9 @@ admin_employee = Employee.create({name: "Administrator", role: "Administrator",
|
|||||||
food = Account.create({title: "Food", account_type: "0"})
|
food = Account.create({title: "Food", account_type: "0"})
|
||||||
beverage = Account.create({title: "Beverage", account_type: "1"})
|
beverage = Account.create({title: "Beverage", account_type: "1"})
|
||||||
|
|
||||||
|
order_station1=PrintSetting.create({name: "OrderItemPdf", unique_code: "OrderItemPdf", printer_name: "EPSON-TM-T82-S-A"})
|
||||||
|
order_station2=PrintSetting.create({name: "Order Summary", unique_code: "OrderSummaryPdf", printer_name: "EPSON-TM-T82-S-A"})
|
||||||
|
|
||||||
# shop = Shop.create(
|
# shop = Shop.create(
|
||||||
# {name: "Beauty In The Pot", address: "address", township: "Yangon", city: "Yangon", state: "Yangon",
|
# {name: "Beauty In The Pot", address: "address", township: "Yangon", city: "Yangon", state: "Yangon",
|
||||||
# country: "Myanmar", phone_no: "09123456789", reservation_no: "bip000001", license: "license",
|
# country: "Myanmar", phone_no: "09123456789", reservation_no: "bip000001", license: "license",
|
||||||
|
|||||||
Reference in New Issue
Block a user