merge with master
This commit is contained in:
@@ -30,15 +30,15 @@ $(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();
|
||||
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);
|
||||
|
||||
//for customer button
|
||||
if(unique_id.charAt(0) == 'S'){
|
||||
$("#customer").removeAttr('disabled');
|
||||
$("#customer").removeAttr('disabled');
|
||||
}else{
|
||||
$("#customer").attr('disabled','disabled');
|
||||
}
|
||||
@@ -56,10 +56,17 @@ $(document).ready(function(){
|
||||
|
||||
// AJAX call for order
|
||||
$.ajax({
|
||||
<<<<<<< HEAD
|
||||
type: "POST",
|
||||
url: "/origami/" + unique_id,
|
||||
data: { 'booking_id' : unique_id },
|
||||
success:function(result){
|
||||
=======
|
||||
type: "GET",
|
||||
url: "origami/" + unique_id,
|
||||
data: { 'id' : unique_id },
|
||||
success:function(result){
|
||||
>>>>>>> 5ee3ae257a59269b651dcc5c0232b95d7f41fb77
|
||||
for (i = 0; i < result.length; i++) {
|
||||
var data = JSON.stringify(result[i]);
|
||||
var parse_data = JSON.parse(data);
|
||||
@@ -89,7 +96,7 @@ $(document).ready(function(){
|
||||
$("#order-grand-total").text(grand_total_amount);
|
||||
|
||||
// Ordered Items
|
||||
var order_items_rows = "<tr>" +
|
||||
var order_items_rows = "<tr>" +
|
||||
"<td class='item-name'>" + parse_data.item_name + "</td>" +
|
||||
"<td class='item-attr'>" + parse_data.qty + "</td>" +
|
||||
"<td class='item-attr'>" + parse_data.qty*parse_data.price + "</td>" +
|
||||
@@ -105,9 +112,9 @@ $(document).ready(function(){
|
||||
$(this).addClass('selected-item');
|
||||
});
|
||||
|
||||
// Bill Request
|
||||
// Bill Request
|
||||
$('#request_bills').click(function() {
|
||||
var order_id=$(".selected-item").find(".orders-id").text();
|
||||
var order_id=$(".selected-item").find(".orders-id").text();
|
||||
if(order_id!=""){
|
||||
window.location.href = '/origami/' + order_id + '/request_bills'
|
||||
}
|
||||
@@ -117,16 +124,16 @@ $(document).ready(function(){
|
||||
return false;
|
||||
});
|
||||
|
||||
// Discount for Payment
|
||||
// Discount for Payment
|
||||
$('#discount').click(function() {
|
||||
var order_id=$(".selected-item").find(".orders-id").text();
|
||||
var order_id=$(".selected-item").find(".orders-id").text();
|
||||
if(order_id!=""){
|
||||
window.location.href = '/origami/' + order_id + '/discount'
|
||||
}
|
||||
else {
|
||||
alert("Please select an order!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
@@ -137,7 +144,7 @@ $(document).ready(function(){
|
||||
var sub_total = $('#order-sub-total').text();
|
||||
var grand_total = $('#order-grand-total').text();
|
||||
var discount_type = $('#discount-type').val();
|
||||
var discount_value = $('#discount-amount').val();
|
||||
var discount_value = $('#discount-amount').val();
|
||||
var discount_amount = discount_value;
|
||||
|
||||
if(sale_item_id == null){
|
||||
@@ -146,7 +153,7 @@ $(document).ready(function(){
|
||||
}
|
||||
|
||||
// For Percentage Discount
|
||||
if(discount_type == 1){
|
||||
if(discount_type == 1){
|
||||
discount_amount=(sub_total*discount_value)/100;
|
||||
}
|
||||
|
||||
@@ -167,8 +174,8 @@ $(document).ready(function(){
|
||||
}
|
||||
else {
|
||||
alert("Please select an order!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
@@ -185,7 +192,7 @@ $(document).ready(function(){
|
||||
original_value = $('#discount-amount').val();
|
||||
|
||||
var input_type = $(this).attr("data-type");
|
||||
|
||||
|
||||
switch (input_type) {
|
||||
case 'num':
|
||||
var input_value = $(this).attr("data-value");
|
||||
@@ -196,7 +203,7 @@ $(document).ready(function(){
|
||||
else{
|
||||
$('#discount-amount').val(original_value + '' + input_value);
|
||||
update_balance();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 'add':
|
||||
@@ -233,7 +240,7 @@ $(document).ready(function(){
|
||||
});
|
||||
|
||||
/* Button Control by Status */
|
||||
function control_button(order_status){
|
||||
function control_button(order_status){
|
||||
if(order_status=="billed"){
|
||||
$("#request_bills").prop('disabled', true);
|
||||
$("#discount").prop('disabled', false);
|
||||
@@ -243,11 +250,14 @@ function control_button(order_status){
|
||||
$("#request_bills").prop('disabled', false);
|
||||
$("#discount").prop('disabled', true);
|
||||
$("#pay-bill").prop('disabled', true);
|
||||
<<<<<<< HEAD
|
||||
}
|
||||
else {
|
||||
$("#request_bills").prop('disabled', true);
|
||||
$("#discount").prop('disabled', true);
|
||||
$("#pay-bill").prop('disabled', true);
|
||||
=======
|
||||
>>>>>>> 5ee3ae257a59269b651dcc5c0232b95d7f41fb77
|
||||
}
|
||||
}
|
||||
|
||||
@@ -264,9 +274,6 @@ function update_balance(){
|
||||
}
|
||||
|
||||
var total = (parseFloat(sub_total) + parseFloat(tax)) - discount_amount;
|
||||
$('#order-discount').text(discount_amount);
|
||||
$('#order-discount').text(discount_amount);
|
||||
$('#order-grand-total').text(total);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
3
app/assets/javascripts/origami/redeem_payments.coffee
Normal file
3
app/assets/javascripts/origami/redeem_payments.coffee
Normal file
@@ -0,0 +1,3 @@
|
||||
# Place all the behaviors and hooks related to the matching controller here.
|
||||
# All this logic will automatically be available in application.js.
|
||||
# You can use CoffeeScript in this file: http://coffeescript.org/
|
||||
@@ -7,6 +7,14 @@
|
||||
// min-height: 75rem;
|
||||
// padding-top: 4.5rem;
|
||||
// }
|
||||
.others-payment{
|
||||
line-height:100px;
|
||||
text-align:center;
|
||||
color:white;
|
||||
width:300px;
|
||||
height:100px;
|
||||
font-size:18px;
|
||||
}
|
||||
|
||||
.orders-table {
|
||||
cursor: pointer;
|
||||
@@ -17,11 +25,20 @@
|
||||
line-height:60px;
|
||||
text-align:center;
|
||||
background:#54A5AF;
|
||||
float:left;
|
||||
margin:2px;
|
||||
// float:left;
|
||||
// margin:2px;
|
||||
font-size:20px;
|
||||
color:white;
|
||||
// cursor:pointer;
|
||||
}
|
||||
|
||||
.pay{
|
||||
width: 98%;
|
||||
height:210px;
|
||||
line-height:210px;
|
||||
text-align:center;
|
||||
font-size:20px;
|
||||
color:white;
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
.cashier_number:hover{
|
||||
@@ -51,17 +68,17 @@
|
||||
}
|
||||
|
||||
.charges-name {
|
||||
width: 80%;
|
||||
width: 80%;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.item-name {
|
||||
width: 60%;
|
||||
width: 60%;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.item-attr {
|
||||
width: 20%;
|
||||
width: 20%;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
@@ -79,7 +96,13 @@
|
||||
background-color: #009900
|
||||
}
|
||||
|
||||
.left{
|
||||
margin-left:1px;
|
||||
}
|
||||
|
||||
.bottom{
|
||||
margin-bottom: 1px;
|
||||
}
|
||||
/*----- Reset -----*/
|
||||
|
||||
select.form-control {
|
||||
|
||||
3
app/assets/stylesheets/origami/redeem_payments.scss
Normal file
3
app/assets/stylesheets/origami/redeem_payments.scss
Normal file
@@ -0,0 +1,3 @@
|
||||
// Place all the styles related to the origami/redeem_payments controller here.
|
||||
// They will automatically be included in application.css.
|
||||
// You can use Sass (SCSS) here: http://sass-lang.com/
|
||||
Reference in New Issue
Block a user