update sale item xls

This commit is contained in:
Aung Myo
2017-12-05 16:28:21 +06:30
parent 7d701edaab
commit 97bb6ae211
5 changed files with 9 additions and 20 deletions

View File

@@ -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 */
/* *************************************************** */

View File

@@ -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()

View File

@@ -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)

View File

@@ -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();

View File

@@ -1,17 +1,6 @@
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item active"><%= t("views.right_panel.detail.sale_item_report") %></li>
<span class="float-right">
<%= link_to 'Back', dashboard_path %>
</span>
</ol>
</div>
<div class="row">
<div class="col-md-12">
<%= render :partial=>'shift_sale_report_filter',
:locals=>{ :period_type => true, :shift_name => true, :report_path =>reports_saleitem_index_path} %>
<hr />
<div class="text-right">