Merge branch 'adminbsb_material_ui'

This commit is contained in:
Aung Myo
2018-04-26 13:35:41 +06:30
9 changed files with 42 additions and 30 deletions

View File

@@ -457,9 +457,10 @@ $(function() {
var items = $('.selected-set');
if (items.length >= min_qty) {
if ($('#server_mode').val() != "cloud") {
item = get_set_item(items);
customer_display_view(item,"set_add");
}
var option = []
attribute_arr = []
@@ -786,8 +787,10 @@ $(function() {
$('.add_to_order').attr('data-options',JSON.stringify(option_arr));
$('.add_to_order').attr('data-opt',JSON.stringify(option_arr));
var item_data = $(this);
item = get_item(item_data,"add_to_order");
customer_display_view(item,"add");
if ($('#server_mode').val() != "cloud") {
item = get_item(item_data,"add_to_order");
customer_display_view(item,"add");
}
show_item_detail(item_data,"add_to_order");
calculate_sub_total();
@@ -796,8 +799,10 @@ $(function() {
// click plus icon for add
$(document).on('click', '.add_icon', function(event){
var item_data = $(this);
item = get_item(item_data,"add_icon");
customer_display_view(item,"add");
if ($('#server_mode').val() != "cloud") {
item = get_item(item_data,"add_icon");
customer_display_view(item,"add");
}
show_item_detail(item_data,"add_icon");
calculate_sub_total();
}); //End Add Icon Click
@@ -922,7 +927,9 @@ console.log(d_option)
window.location.href = "/origami/room/" + table_id
}
}
customer_display_view(null,"reload");
if ($('#server_mode').val() != "cloud") {
customer_display_view(null,"reload");
}
}
});
// }else{

View File

@@ -86,11 +86,12 @@ def create
# saleObj = Sale.find(sale_id)
sale_payment = SalePayment.new
status, @sale = sale_payment.process_payment(saleObj, @user, cash, "dinga",account_no)
if status == true
status, @sale,@membership_data = sale_payment.process_payment(saleObj, @user, cash, "dinga",account_no)
if status == true && @membership_data["status"] == true
@out = true, "Success!"
else
@out =false, "Please try again payment!"
@out =false, @membership_data["message"]
end
end
end

View File

@@ -88,11 +88,11 @@ def create
# saleObj = Sale.find(sale_id)
sale_payment = SalePayment.new
status, @sale = sale_payment.process_payment(saleObj, @user, cash, "paymal",account_no)
if status == true
status, @sale,@membership_data = sale_payment.process_payment(saleObj, @user, cash, "paymal",account_no)
if status == true && @membership_data["status"] == true
@out = true, "Success!"
else
@out =false, "Please try again payment!"
@out =false, @membership_data["message"]
end
end
end

View File

@@ -20,7 +20,7 @@ authorize_resource :class => false
payment_type = params[:payment_type]
@sale_data = Sale.get_shift_sales_by_receipt_no(@shift_sale_range,@shift,from,to,payment_type)
@sale_taxes = Sale.get_separate_tax(@shift_sale_range,@shift,from,to,payment_type)
@tax_profiles = TaxProfile.order('order_by asc')
@tax_profiles = TaxProfile.order('order_by asc').limit(2)
@from = from
@to = to
# get printer info

View File

@@ -23,6 +23,7 @@ class SalePayment < ApplicationRecord
if (amount_due >= 0)
payment_status = false
membership_data = nil
#route to payment type
case payment_method
when "cash"
@@ -52,11 +53,11 @@ class SalePayment < ApplicationRecord
when "foc"
payment_status = foc_payment
when "paymal"
payment_status = paymal_payment
payment_status,membership_data = paymal_payment
when "JunctionPay"
payment_status = junction_pay_payment
when "dinga"
payment_status = dinga_payment
payment_status,membership_data = dinga_payment
else
puts "it was something else"
end
@@ -73,7 +74,7 @@ class SalePayment < ApplicationRecord
end
end
return true, self.save
return true, self.save,membership_data
else
#record an payment in sale-audit
# remark = "No outstanding Amount - Grand Total [#{invoice.grand_total}] | Due [#{amount_due}] | Paid [#{invoice.amount_received}]"
@@ -430,7 +431,7 @@ class SalePayment < ApplicationRecord
sale_update_payment_status(0)
end
return payment_status
return payment_status,membership_data
end
def junction_pay_payment
@@ -480,7 +481,7 @@ class SalePayment < ApplicationRecord
sale_update_payment_status(0)
end
return payment_status
return payment_status,membership_data
end

View File

@@ -490,11 +490,13 @@
</div>
</div>
<% end %>
<style type="text/css">
.fadeInRight{
-webkit-animation-duration: 350ms !important;
}
</style>
<input type="hidden" name="server_mode" value="<%=ENV["SERVER_MODE"]%>" id="server_mode">
<style type="text/css">
.fadeInRight{
-webkit-animation-duration: 350ms !important;
}
</style>
<script>
jQuery(function(){
id = "<%=@menu[0].id%>";

View File

@@ -203,6 +203,7 @@
<% end %>
</div>
<button type="button" data-href="<%=origami_second_display_index_path%>" target="_blank" id="second_view" class="btn action-btn bg-blue waves-effect second_view hidden" style="height: 45px">Customer View</button>
<input type="hidden" name="server_mode" value="<%=ENV["SERVER_MODE"]%>" id="server_mode">
<script>
$(".cashier_view").on('click', function() {
@@ -210,7 +211,9 @@
});
$(".qs_view").on('click', function() {
document.getElementById('second_view').click();
if ($('#server_mode').val() != "cloud") {
document.getElementById('second_view').click();
}
window.location.href = '/origami/quick_service';
});

View File

@@ -287,7 +287,7 @@
});
}else{
swal ( "Information" , result.message);
swal ( "Opps",result.message ,"warning" );
}
}
});
@@ -364,7 +364,7 @@
});
}else{
swal ( "Information" , result.message);
swal ( "Opps",result.message ,"warning" );
}
}
});

View File

@@ -281,7 +281,7 @@
});
}else{
swal ( "Information" , result.message);
swal ( "Opps",result.message ,"warning" );
}
}
});
@@ -328,7 +328,6 @@
var payment_amount = parseFloat($("#used_amount").text());
setTimeout(function(){
code=getQRCode();
alert(code)
if(sale_id != 0 && code != ""){
$.ajax({
type: "POST",
@@ -345,7 +344,6 @@
url: "<%=origami_payment_paymal_path%>",
data: {payment_amount:payment_amount,membership_id:0,sale_id:sale_id,transaction_ref:data.transaction_ref,account_no:code},
success: function(result){
alert(result)
if(result.status == true){
swal({
title: "Information!",
@@ -359,7 +357,7 @@
});
}else{
swal ( "Information" , result.message);
swal ( "Opps",result.message ,"warning" );
}
}
});