From 97bb6ae2115c6477ae1570159b384fa270c51f03 Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Tue, 5 Dec 2017 16:28:21 +0630 Subject: [PATCH] update sale item xls --- app/assets/stylesheets/reset.css | 2 +- app/models/sale.rb | 2 +- app/models/sale_item.rb | 2 +- app/views/origami/payments/show.html.erb | 10 +++++----- app/views/reports/saleitem/index.xls.erb | 13 +------------ 5 files changed, 9 insertions(+), 20 deletions(-) diff --git a/app/assets/stylesheets/reset.css b/app/assets/stylesheets/reset.css index 02688d2e..ea0aaa4f 100644 --- a/app/assets/stylesheets/reset.css +++ b/app/assets/stylesheets/reset.css @@ -271,7 +271,7 @@ section.content { padding: .25rem .25rem !important; } .alert-dismissible .close { - padding: 0.2rem 0.24rem; + padding: 0.5rem 0.44rem; } /* End Reset Theme */ /* *************************************************** */ \ No newline at end of file diff --git a/app/models/sale.rb b/app/models/sale.rb index 01cd2a28..457278c0 100755 --- a/app/models/sale.rb +++ b/app/models/sale.rb @@ -659,7 +659,7 @@ def self.get_item_query() # "JOIN employee_accesses ea ON ea.`employee_id` = sales.cashier_id ") query = query.joins(" JOIN accounts acc ON acc.id = mi.account_id") # query = query.where("i.item_instance_code IS NOT NULL") - query = query.group("i.product_name").order("mi.account_id") + query = query.group("i.product_name").order("mi.account_id asc","mi.menu_category_id asc") end def self.get_other_charges() diff --git a/app/models/sale_item.rb b/app/models/sale_item.rb index e15c4b79..2cd728d4 100755 --- a/app/models/sale_item.rb +++ b/app/models/sale_item.rb @@ -97,7 +97,7 @@ class SaleItem < ApplicationRecord # Check for actual sale items sale_items.where("remark = 'Discount'").find_each do |si| if si.account_id == a.id - discount_account[:price] = (discount_account[:price].abs + si.price.abs) * (-1) + discount_account[:price] = (discount_account[:price].abs + si.price.abs) * (1) end end discount_accounts.push(discount_account) diff --git a/app/views/origami/payments/show.html.erb b/app/views/origami/payments/show.html.erb index 3400a4a1..830f1a37 100755 --- a/app/views/origami/payments/show.html.erb +++ b/app/views/origami/payments/show.html.erb @@ -379,21 +379,21 @@ return false; }); - $('#pay').click(function() { + $('#pay').click(function(event) { // $('#pay').text("Processing, Please wait!") - - $( "#loading_wrapper" ).show(); + $( "#loading_wrapper").show(); if($('#balance').text() > 0){ swal ( "Oops" , "Insufficient Amount!" , "error" ); - $( "#loading_wrapper" ).hide(); + $( "#loading_wrapper").hide(); }else{ + $(this).off("click"); var sale_id = $('#sale_id').text(); var item_row = $('.is_card'); if (item_row.length < 1) { calculate_member_discount(sale_id); } - + // payment var cash = $('#cash').text(); var credit = $('#credit').text(); diff --git a/app/views/reports/saleitem/index.xls.erb b/app/views/reports/saleitem/index.xls.erb index 284b78fc..6b4e358a 100755 --- a/app/views/reports/saleitem/index.xls.erb +++ b/app/views/reports/saleitem/index.xls.erb @@ -1,17 +1,6 @@ -
- <%= render :partial=>'shift_sale_report_filter', - :locals=>{ :period_type => true, :shift_name => true, :report_path =>reports_saleitem_index_path} %> - +