comment for cable and add print seed

This commit is contained in:
Yan
2017-06-08 18:57:53 +06:30
parent 907764b3e4
commit 71e09ef452
4 changed files with 46 additions and 8 deletions

View File

@@ -21,6 +21,10 @@ $(document).ready(function(){
var zone_name=$(this).find(".orders-table").text();
var receipt_no=$(this).find(".orders-receipt-no").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 receipt_date="";
@@ -85,15 +89,26 @@ $(document).ready(function(){
// Bill Request
$('#request_bills').click(function() {
var order_id=$(".selected-item").find(".orders-id").text();
window.location.href = '/origami/request_bills/'+ order_id
var order_id=$(".selected-item").find(".orders-id").text();
if(order_id!=""){
window.location.href = '/origami/request_bills/'+ order_id
}
else {
alert("Please select an order!");
}
return false;
});
// Discount for Payment
$('#discount').click(function() {
var order_id=$(".selected-item").find(".orders-id").text();
window.location.href = '/origami/discount/'+ order_id
var order_id=$(".selected-item").find(".orders-id").text();
if(order_id!=""){
window.location.href = '/origami/discount/'+ order_id
}
else {
alert("Please select an order!");
}
return false;
});
@@ -122,8 +137,14 @@ $(document).ready(function(){
// Payment for Bill
$('#pay').click(function() {
var sale_id=$(".selected-item").find(".orders-id").text();
window.location.href = '/origami/sale/'+ sale_id + "/payment"
var sale_id=$(".selected-item").find(".orders-id").text();
if(order_id!=""){
window.location.href = '/origami/sale/'+ sale_id + "/payment"
}
else {
alert("Please select an order!");
}
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 */
function update_balance(){
var discount_type = $('#discount-type').val();

View File

@@ -48,7 +48,7 @@ class Order < ApplicationRecord
process_order_queue
#send order to broadcast job
send_order_broadcast
#send_order_broadcast
return true, booking

View File

@@ -218,7 +218,7 @@
<button type="button" id="request_bills" class="btn btn-primary btn-lg btn-block">Req.Bill</button>
<!-- Cashier Buttons -->
<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" class="btn btn-primary btn-lg btn-block" disabled>Re.Print</button>
</div>

View File

@@ -140,6 +140,9 @@ admin_employee = Employee.create({name: "Administrator", role: "Administrator",
food = Account.create({title: "Food", account_type: "0"})
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(
# {name: "Beauty In The Pot", address: "address", township: "Yangon", city: "Yangon", state: "Yangon",
# country: "Myanmar", phone_no: "09123456789", reservation_no: "bip000001", license: "license",