Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant into r-1804001-01
This commit is contained in:
39
app/views/origami/addorders/get_item_instance.json.jbuilder
Normal file
39
app/views/origami/addorders/get_item_instance.json.jbuilder
Normal file
@@ -0,0 +1,39 @@
|
||||
if(@id)
|
||||
menu_item = MenuItem.find(@id.menu_item_id)
|
||||
# Format for option json
|
||||
opt_format = []
|
||||
# Format for attributes json
|
||||
menu_item.item_options.each do|opt|
|
||||
menu_opt = MenuItemOption.find(opt)
|
||||
if opt_format.count == 0
|
||||
opt_format.push({ type: menu_opt.option_type, values: [menu_opt.name] })
|
||||
next
|
||||
end
|
||||
|
||||
opt_format.each do |of|
|
||||
if menu_opt.option_type.in? opt_format.map {|k| k[:type]}
|
||||
if menu_opt.option_type == of[:type]
|
||||
of[:values].push(menu_opt.name)
|
||||
end
|
||||
else
|
||||
new_opt = {type: menu_opt.option_type, values: [ menu_opt.name ] }
|
||||
opt_format.push(new_opt)
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
json.success true
|
||||
json.id @id.id
|
||||
json.name @id.item_instance_name
|
||||
json.code @id.item_instance_code
|
||||
|
||||
json.item_id @id.menu_item_id
|
||||
json.attributes @id.item_attributes
|
||||
json.price @id.price
|
||||
json.is_default @id.is_default
|
||||
|
||||
json.options opt_format
|
||||
else
|
||||
json.success false
|
||||
end
|
||||
@@ -106,6 +106,12 @@
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<button type="button" class="btn bg-default m-t-10 btn-lg btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/<%= @cashier_type %>/payment/others_payment';"> <i class="material-icons m-t--5">reply</i>Back </button>
|
||||
</div>
|
||||
<div id="sxModal">
|
||||
<div id="sxModal-Content"><h3>Card Tap</h3></div>
|
||||
<div class="m-r-20" align="right">
|
||||
<button type="button" class="btn btn-lg btn-link bg-red waves-effect btn_cancel">Cancel</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="sxModal">
|
||||
<div id="sxModal-Content"><h3>Card Tap</h3></div>
|
||||
@@ -348,7 +354,7 @@
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "<%=origami_payment_paymal_path%>",
|
||||
url: "<%=origami_payment_dinga_path%>",
|
||||
data: {payment_amount:payment_amount,membership_id:0,sale_id:sale_id,transaction_ref:data.transaction_ref,account_no:code},
|
||||
success: function(result){
|
||||
|
||||
|
||||
@@ -432,20 +432,12 @@
|
||||
<iframe id="receipt_pdf" src="" class="pdf-iframe" scrolling="no"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer ">
|
||||
<div class="row m-b-10 m-r-30">
|
||||
|
||||
<div class="col-md-5 m-r-20">
|
||||
<% if ENV["SERVER_MODE"] != "cloud" %>
|
||||
<button type="button" class="btn btn-link bg-red waves-effect print_receipt">Print</button>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="col-md-5 m-r-20">
|
||||
<button type="button" class="btn btn-link bg-blue waves-effect btn_pdf_close" data-dismiss="modal">CLOSE</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="mr-2 btn btn-link bg-red waves-effect print_receipt"> Print
|
||||
</button>
|
||||
<button type="button" class="btn btn-link bg-blue waves-effect btn_pdf_close" data-dismiss="modal">
|
||||
CLOSE
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1049,7 +1041,6 @@ var customer_name = "<%= @customer.name %>";
|
||||
url: "/origami/sale/"+sale_id+"/"+cashier_type+"/payment/print",
|
||||
data: params,
|
||||
success:function(result){
|
||||
console.log(result);
|
||||
// For Server Print - from jade
|
||||
if ($("#server_mode").val() == "cloud") {
|
||||
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<% if(@server_mode != 'cloud') %>
|
||||
<%= f.input :printer_name, :as => :select, :collection => Printer::PrinterWorker.printers, include_blank: false %>
|
||||
<% else %>
|
||||
<%= f.input :printer_name %>
|
||||
<%= f.input :printer_name, :as => :select, :collection => [] %>
|
||||
<% end %>
|
||||
<%= f.input :brand_name %>
|
||||
<%= f.input :printer_type %>
|
||||
|
||||
@@ -7,7 +7,11 @@
|
||||
|
||||
<div class="form-inputs p-l-15">
|
||||
<%= f.input :name %>
|
||||
<%= f.input :role, :collection => Lookup.collection_of("employee_roles"),:class=>'form-group' %>
|
||||
<% if current_user.role == "administrator" %>
|
||||
<%= f.input :role, :collection => Lookup.collection_of("employee_roles"),:class=>'form-group' %>
|
||||
<% else %>
|
||||
<%= f.input :role, :collection => Lookup.collection_of("employee_roles").select{|r| r[1] != "administrator"},:class=>'form-group' %>
|
||||
<% end %>
|
||||
<%= f.input :emp_id, :label => "Employee Numberic ID (*Unique)" %>
|
||||
<%= f.input :password %>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user