fixed conflit

This commit is contained in:
NyanLinHtut
2019-09-11 13:30:45 +06:30
28 changed files with 262 additions and 132 deletions

View File

@@ -47,7 +47,7 @@ GEM
minitest (~> 5.1)
tzinfo (~> 1.1)
aescrypt (1.0.0)
airbrussh (1.3.2)
airbrussh (1.3.3)
sshkit (>= 1.6.1, != 1.7.0)
arel (8.0.0)
axlsx (2.0.1)
@@ -62,7 +62,7 @@ GEM
builder (3.2.3)
byebug (11.0.1)
cancancan (1.17.0)
capistrano (3.11.0)
capistrano (3.11.1)
airbrussh (>= 1.0.0)
i18n
rake (>= 10.0.0)
@@ -99,8 +99,8 @@ GEM
factory_girl_rails (4.9.0)
factory_girl (~> 4.9.0)
railties (>= 3.0.0)
faker (2.1.0)
i18n (>= 0.7)
faker (2.2.2)
i18n (~> 1.6.0)
ffi (1.11.1)
filterrific (5.2.1)
font-awesome-rails (4.7.0.5)
@@ -148,9 +148,9 @@ GEM
material_icons (2.2.1)
railties (>= 3.2)
method_source (0.9.2)
mime-types (3.2.2)
mime-types (3.3)
mime-types-data (~> 3.2015)
mime-types-data (3.2019.0331)
mime-types-data (3.2019.0904)
mini_magick (4.9.5)
mini_mime (1.0.2)
mini_portile2 (2.4.0)
@@ -163,8 +163,8 @@ GEM
net-scp (2.0.0)
net-ssh (>= 2.6.5, < 6.0.0)
net-ssh (5.2.0)
nio4r (2.4.0)
nokogiri (1.10.3)
nio4r (2.5.1)
nokogiri (1.10.4)
mini_portile2 (~> 2.4.0)
pdf-core (0.7.0)
pdfjs_viewer-rails (0.3.1)
@@ -183,7 +183,7 @@ GEM
puma (3.12.1)
rack (2.0.7)
rack-cors (1.0.3)
rack-protection (2.0.5)
rack-protection (2.0.7)
rack
rack-test (1.1.0)
rack (>= 1.0, < 3)
@@ -202,7 +202,7 @@ GEM
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.1.0)
rails-html-sanitizer (1.2.0)
loofah (~> 2.2, >= 2.2.2)
railties (5.1.7)
actionpack (= 5.1.7)
@@ -251,9 +251,8 @@ GEM
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
sassc (2.0.1)
sassc (2.2.0)
ffi (~> 1.9)
rake
schema_to_scaffold (0.8.0)
activesupport (>= 3.2.1)
shoulda-matchers (3.1.3)

View File

@@ -298,13 +298,6 @@ select.form-control {
/* Discount */
.discount-item-row {
cursor: pointer;
}
tr.discount-item-row:hover {
background-color: #e3e3e3 !important;
}
.required abbr{
color: red !important;
}

View File

@@ -5,6 +5,7 @@ class Crm::CustomersController < BaseCrmController
# GET /crm/customers
# GET /crm/customers.json
def index
@no_need_validation =false
filter = params[:filter]
filter_card_no = params[:filter_card_no]
type = params[:type]
@@ -39,12 +40,14 @@ class Crm::CustomersController < BaseCrmController
@crm_customers.tax_profiles = ["1", "2"]
@crm_customers.save
@crm_customers = Customer.search(filter)
flash[:notice]='Customer was successfully created.'
flash[:member_notice]='Customer was successfully created.'
else
flash[:error]=response["message"]
flash[:member_error]=response["message"]
end
else
if response["status"] ==true
@crm_customers.each do |customer|
if !response["customer_data"].nil?
if customer.contact_no != response["customer_data"]["phone"]
@customer_update_phone_email_membertype =true
end
@@ -57,6 +60,17 @@ class Crm::CustomersController < BaseCrmController
if customer.membership_type.to_i != response["customer_data"]["member_group_id"]
@customer_update_phone_email_membertype =true
end
else
flash[:member_error]=response["message"]
end
end
else
if response["message"] =='No internet connection '
flash[:member_error]=response["message"]
else
flash[:member_error]="Need to press sync button "
end
end
end
end
@@ -190,14 +204,18 @@ class Crm::CustomersController < BaseCrmController
},
:timeout => 10
)
rescue HTTParty::Error
response = {"status" => false, "message" => "No internet connection "}
rescue Net::OpenTimeout
response = { status: false }
response = {"status" => false, "message" => "No internet connection "}
rescue OpenURI::HTTPError
response = { status: false}
response = {"status" => false, "message" => "No internet connection "}
rescue SocketError
response = { status: false}
response = {"status" => false, "message" => "No internet connection "}
end
customer = Customer.find(@crm_customer.customer_id)
Rails.logger.debug "--------Sync Member response -------"
@@ -222,6 +240,9 @@ class Crm::CustomersController < BaseCrmController
customer.destroy
format.html { redirect_to crm_customers_path }
flash[:member_error] ='Member cannot created.Invalid Account.'
else
format.html { redirect_to crm_customers_path }
flash[:member_error] =response["message"]
end
format.html { redirect_to crm_customers_path }
flash[:member_error] =response["message"]
@@ -286,16 +307,16 @@ class Crm::CustomersController < BaseCrmController
)
rescue HTTParty::Error
response = {"status" => false, "message" => "Can't open membership server "}
response = {"status" => false, "message" => "No internet connection "}
rescue Net::OpenTimeout
response = {"status" => false, "message" => "Can't open membership server "}
response = {"status" => false, "message" => "No internet connection "}
rescue OpenURI::HTTPError
response = {"status" => false, "message" => "Can't open membership server "}
response = {"status" => false, "message" => "No internet connection "}
rescue SocketError
response = {"status" => false, "message" => "Can't open membership server "}
response = {"status" => false, "message" => "No internet connection "}
end
Rails.logger.debug "--------------Create Member---------"
Rails.logger.debug response.to_json
@@ -332,6 +353,9 @@ class Crm::CustomersController < BaseCrmController
format.html { redirect_to crm_customers_path }
flash[:member_error]='Member cannot created.Invalid Account.'
end
else
format.html { redirect_to crm_customers_path }
flash[:member_error]=response["message"]
end
if params[:sale_id]
format.html { redirect_to '/origami/'+params[:sale_id]+'/'+params[:type]+'/customers/'+params[:page] }
@@ -431,14 +455,17 @@ class Crm::CustomersController < BaseCrmController
},
:timeout => 10
)
rescue HTTParty::Error
response = {"status" => false, "message" => "No internet connection "}
rescue Net::OpenTimeout
response = { status: false }
response = {"status" => false, "message" => "No internet connection "}
rescue OpenURI::HTTPError
response = { status: false}
response = {"status" => false, "message" => "No internet connection "}
rescue SocketError
response = { status: false}
response = {"status" => false, "message" => "No internet connection "}
end
customer = Customer.find(@crm_customer.customer_id)
Rails.logger.debug "--------Update Member response -------"
@@ -493,14 +520,17 @@ class Crm::CustomersController < BaseCrmController
},
:timeout => 10
)
rescue HTTParty::Error
response = {"status" => false, "message" => "No internet connection "}
rescue Net::OpenTimeout
response = { status: false }
response = {"status" => false, "message" => "No internet connection "}
rescue OpenURI::HTTPError
response = { status: false}
response = {"status" => false, "message" => "No internet connection "}
rescue SocketError
response = { status: false}
response = {"status" => false, "message" => "No internet connection "}
end
Rails.logger.debug "--------Update Member response -------"
Rails.logger.debug response.to_json

View File

@@ -3,6 +3,8 @@ class Origami::DiscountsController < BaseOrigamiController
#discount page show from origami index with selected order
def index
# get printer info
@print_settings = PrintSetting.get_precision_delimiter()
@webview = false
if check_mobile
@webview = true

View File

@@ -17,7 +17,8 @@ class Origami::HomeController < BaseOrigamiController
# origami table detail
def show
# get printer info
@print_settings = PrintSetting.get_precision_delimiter()
@webview = check_mobile
@tables = Table.unscoped.all.active.order('status desc')

View File

@@ -8,7 +8,6 @@ class Origami::VoidController < BaseOrigamiController
access_code = params[:access_code]
if Sale.exists?(sale_id)
sale = Sale.find_by_sale_id(sale_id)
if sale.discount_type == "member_discount"
sale.update_attributes(total_discount: 0)
sale.compute_by_sale_items(sale_id, sale.sale_items,0,order_source)

View File

@@ -59,6 +59,7 @@ class Reports::HourlySaleitemController < BaseReportController
# @hourly_total_qty = @sale_data.group_by {|s| s.date_format }.collect{|key,qty| {"date" => key , "total_qty" => qty.sum{|d| d.qty.to_i}}}
@hourly_total_qty = @sale_data.group_by(&:date_format).map { |k,v|{"date" => k , "total_qty" => v.count }}
puts @hourly_total_qty.to_json
respond_to do |format|
format.html
format.xls

View File

@@ -54,7 +54,6 @@ class Reports::SaleitemController < BaseReportController
@shift_data = sh
end
end
respond_to do |format|
format.html
format.xls
@@ -64,7 +63,7 @@ class Reports::SaleitemController < BaseReportController
def show
from, to, report_type = get_date_range_from_params
@sale_data = Sale.get_by_shift_sale_by_item(from,to,Sale::SALE_STATUS_COMPLETED)
sale_data = @sale_data
date_arr = Array.new
@sale_data.each do |sale|
local_opening_date = sale.opening_date.nil? ? '-' : sale.opening_date.utc.getlocal.strftime("%e %b %I:%M%p")

View File

@@ -30,9 +30,6 @@ class Settings::EmployeesController < ApplicationController
# POST /employees
# POST /employees.json
def create
puts "puts ssssssssssssssssssssssssss"
puts employee_params.to_json
@employee = Employee.new(employee_params)
respond_to do |format|

View File

@@ -64,6 +64,8 @@ class AssignedOrderItem < ApplicationRecord
private
def generate_custom_id
if self.assigned_order_item_id.nil?
self.assigned_order_item_id = SeedGenerator.generate_id(self.class.name, "AOI")
end
end
end

View File

@@ -122,6 +122,8 @@ class Booking < ApplicationRecord
private
def generate_custom_id
if self.booking_id.nil?
self.booking_id = SeedGenerator.generate_id(self.class.name, "BKI")
end
end
end

View File

@@ -325,16 +325,16 @@ class Customer < ApplicationRecord
:timeout => 10
)
rescue HTTParty::Error
response = {status: false, message: "Server Error"}
response = {"status" => false, "message" => "No internet connection "}
rescue Net::OpenTimeout
response = { status: false , message: "Server Time out"}
response = {"status" => false, "message" => "No internet connection "}
rescue OpenURI::HTTPError
response = { status: false, message: "Can't connect server"}
response = {"status" => false, "message" => "No internet connection "}
rescue SocketError
response = { status: false, message: "Can't connect server"}
response = {"status" => false, "message" => "No internet connection "}
end
Rails.logger.debug "--------Search Paypar Account No response -------"
Rails.logger.debug response.to_json

View File

@@ -557,8 +557,10 @@ class Order < ApplicationRecord
private
def generate_custom_id
if self.order_id.nil?
self.order_id = SeedGenerator.generate_id(self.class.name, "ODR")
end
end
def set_order_date
self.date = Time.now.utc

View File

@@ -97,6 +97,8 @@ class OrderItem < ApplicationRecord
private
def generate_custom_id
if self.order_items_id.nil?
self.order_items_id = SeedGenerator.generate_id(self.class.name, "ODI")
end
end
end

View File

@@ -452,6 +452,7 @@ class Sale < ApplicationRecord
self.total_amount = subtotal_price
self.total_discount = total_discount
self.grand_total = (self.total_amount - self.total_discount) + self.total_tax
self.grand_total_round
#compute rounding adjustment
adjust_rounding
@@ -460,7 +461,8 @@ class Sale < ApplicationRecord
end
#compute - invoice total
def compute_by_sale_items(sale_id, sale_itemss, total_discount,discount_type=nil,order_source=nil,tax_type=nil)
def compute_by_sale_items(sale_id, sale_itemss, total_discount,discount_type=nil,order_source=nil,tax_type=nil,type=nil)
shop = Shop.first
sale = Sale.find(sale_id)
sales_items = sale_itemss
@@ -478,12 +480,16 @@ class Sale < ApplicationRecord
total_taxable = total_taxable + item.taxable_price
end
end
compute_tax(sale, total_taxable, total_discount, order_source, tax_type)
sale.total_amount = subtotal_price
sale.total_discount = total_discount
if type =="foc"
sale.grand_total = 0
else
sale.grand_total = (sale.total_amount - sale.total_discount) + sale.total_tax
sale.grand_total_round
end
if discount_type == "member_discount"
sale.discount_type = discount_type
end
@@ -519,6 +525,7 @@ class Sale < ApplicationRecord
self.total_amount = subtotal_price
self.total_discount = total_discount
self.grand_total = (self.total_amount - self.total_discount) + self.total_tax
self.grand_total_round
#compute rounding adjustment
adjust_rounding
@@ -2948,9 +2955,19 @@ end
# End hourly sale item report
#not to show decimal in grand total
def grand_total_round
print_settings = PrintSetting.get_precision_delimiter()
if !print_settings.nil?
self.grand_total =self.grand_total.round(print_settings.precision.to_i)
end
end
private
def generate_custom_id
if self.sale_id.nil?
self.sale_id = SeedGenerator.generate_id(self.class.name, "SAL")
end
end
end

View File

@@ -176,6 +176,8 @@ class SaleAudit < ApplicationRecord
private
def generate_custom_id
if self.sale_audit_id.nil?
self.sale_audit_id = SeedGenerator.generate_id(self.class.name, "SAI")
end
end
end

View File

@@ -85,9 +85,11 @@ class SaleItem < ApplicationRecord
# sale_item.is_taxable = 1
# sale_item.sale_id = sale_id
# sale_item.save
if type != "foc"
sale = Sale.find(sale_id)
sale.compute_by_sale_items(sale.id, sale.sale_items, sale.total_discount)
end
end
def self.get_order_items_details(sale_id)
order_details = SaleItem.select("sales.total_tax as tax_amount, sales.grand_total as grand_total_amount , sales.total_discount as discount_amount,sales.receipt_date as receipt_date,
@@ -223,6 +225,8 @@ class SaleItem < ApplicationRecord
private
def generate_custom_id
if self.sale_item_id.nil?
self.sale_item_id = SeedGenerator.generate_id(self.class.name, "SLI")
end
end
end

View File

@@ -34,7 +34,9 @@ class SaleOrder < ApplicationRecord
private
def generate_sale_order_id
# self.class.name
saleOrderId = SeedGenerator.generate_id(self.class.name, 'SOI')
self.sale_order_id = saleOrderId
if self.sale_order_id.nil?
self.sale_order_id = SeedGenerator.generate_id(self.class.name, 'SOI')
end
end
end

View File

@@ -82,7 +82,6 @@ class SalePayment < ApplicationRecord
amount_due = amount_due - payment.payment_amount
end
end
if (amount_due >= 0)
payment_status = false
membership_data = nil
@@ -395,7 +394,6 @@ class SalePayment < ApplicationRecord
self.payment_status = "paid"
payment_status = self.save!
if !payment_for
sale_update_payment_status(self.received_amount,status)
end
@@ -420,6 +418,8 @@ class SalePayment < ApplicationRecord
sale_items.each do|item|
SaleItem.update_existing_item(item.qty, item, self.sale.sale_id, "foc", item.unit_price, item.price)
end
sale = Sale.find(self.sale.sale_id)
sale.compute_by_sale_items(sale.id, sale.sale_items, sale.total_discount,'','','',"foc")
self.payment_method = "foc"
self.payment_amount = self.received_amount
@@ -661,7 +661,6 @@ class SalePayment < ApplicationRecord
method_status = true
end
end
if (self.sale.grand_total <= all_received_amount) && method_status
if is_credit == 0
self.sale.payment_status = "paid"
@@ -1065,6 +1064,8 @@ class SalePayment < ApplicationRecord
private
def generate_custom_id
if self.sale_payment_id.nil?
self.sale_payment_id = SeedGenerator.generate_id(self.class.name, "SPI")
end
end
end

View File

@@ -34,6 +34,8 @@ class SaleTax < ApplicationRecord
private
def generate_custom_id
if self.sale_tax_id.nil?
self.sale_tax_id = SeedGenerator.generate_id(self.class.name, "STI")
end
end
end

View File

@@ -29,7 +29,9 @@
</div>
</div>
<div class="row p-l-20 p-t-20">
<div id="oqs_loading_wrapper" style="display:none;">
<div id="oqs_loading"></div>
</div>
<div class="col-lg-8 col-md-8 col-sm-8 col-xs-8">
<%= form_tag crm_customers_path, :id => "filter_form", :method => :get do %>
<div class="row clearfix">
@@ -157,6 +159,7 @@
<script type="text/javascript">
$(document).ready(function () {
$("#oqs_loading_wrapper").show();
localStorage.setItem("member_card",false);
/*$('.datepicker').datepicker({
format : 'dd-mm-yyyy',
@@ -177,6 +180,7 @@
},100);
});
// QR Code Reader
$("#qr_code").on('click', function(e){
var code = "";
@@ -359,4 +363,8 @@
$("#sxModal .btn_cancel").on('click',function(){
$("#sxModal").hide();
});
$('#filter_form').submit(function() {
$("#oqs_loading_wrapper").show();
return true
});
</script>

View File

@@ -103,9 +103,9 @@
<li>
<a href="<%= reports_saleitem_index_path %>">Sale Items</a>
</li>
<li>
<!-- <li>
<a href="<%= reports_product_sale_index_path %>">Product Sale</a>
</li>
</li> -->
<% if order_reservation %>
<li>
<a href="<%= reports_order_reservation_index_path %>"><%= t("views.right_panel.detail.order_reservation") %></a>
@@ -289,9 +289,9 @@
<li>
<a href="<%= reports_hourly_saleitem_index_path %>">Hourly Sale Items</a>
</li>
<li>
<!-- <li>
<a href="<%= reports_product_sale_index_path %>">Product Sale</a>
</li>
</li> -->
<% if order_reservation %>
<li>
<a href="<%= reports_order_reservation_index_path %>"><%= t("views.right_panel.detail.order_reservation") %></a>

View File

@@ -2,6 +2,20 @@
<div id="loading_wrapper" style="display:none;">
<div id="loading"></div>
</div>
<% if !@print_settings.nil? %>
<% if @print_settings.precision.to_i > 0
precision = @print_settings.precision
else
precision = 0
end
#check delimiter
if @print_settings.delimiter
delimiter = ","
else
delimiter = ""
end
%>
<% end %>
<div class="row">
<!-- Column One -->
<div class="col-lg-6 col-md-6 col-sm-6">
@@ -50,6 +64,7 @@
<tr class="item-row" id=<%= sale_item.sale_item_id %> >
<td style="width:60%; text-align:left">
<span id="item-account-type" class="hidden"><%=sale_item.account_id%></span>
<span id="item-account-qty" class="hidden"><%=sale_item.qty%></span>
<span id="item-name-price"><%=sale_item.product_name%>@<%=sale_item.unit_price%></span>
</td>
<td style="width:20%; text-align:right">
@@ -71,7 +86,7 @@
<table class="table" id="order-charges-table" border="0">
<tr>
<td class="charges-name"><strong>Sub Total:</strong></td>
<td class="item-attr"><strong id="order-sub-total"><%=sub_total%></strong></td>
<td class="item-attr"><strong id="order-sub-total"><%= number_with_precision(sub_total, precision: precision.to_i ) rescue number_with_precision(0, precision: precision.to_i ) %></strong></td>
</tr>
<!-- <tr>
<td class="charges-name"><strong>Food:</strong></td>
@@ -88,15 +103,15 @@
<td class="charges-name"><strong>Discount:</strong></td>
<%end%>
<td class="item-attr">(<strong id="order-discount"><%=@sale_data.total_discount rescue 0%></strong>)</td>
<td class="item-attr">(<strong id="order-discount"><%= number_with_precision(@sale_data.total_discount, precision: precision.to_i ) rescue number_with_precision(0, precision: precision.to_i ) %></strong>)</td>
</tr>
<tr class="hidden">
<td class="charges-name"><strong>Tax:</strong></td>
<td class="item-attr"><strong id="order-Tax"><%=@sale_data.total_tax rescue 0%></strong></td>
<td class="item-attr"><strong id="order-Tax"><%= number_with_precision(@sale_data.total_tax, precision: precision.to_i ) rescue number_with_precision(0, precision: precision.to_i ) %></strong></td>
</tr>
<tr class="hidden">
<td class="charges-name"><strong>Grand Total:</strong></td>
<td class="item-attr"><strong id="order-grand-total"><%=@sale_data.grand_total rescue 0%></strong></td>
<td class="item-attr"><strong id="order-grand-total"><%= number_with_precision(@sale_data.grand_total, precision: precision.to_i ) rescue number_with_precision(0, precision: precision.to_i ) %></strong></td>
</tr>
</table>
</div>
@@ -316,8 +331,11 @@ var cashier_type = "<%= @cashier_type %>";
$(this).removeClass('selected-item');
}
else {
if(parseInt($(this).children().find("#item-account-qty").text()) >0 && parseInt($(this).children().find("#item-total-price").text()) >0){
$(this).addClass('selected-item');
}
}
});
// Select discount-item
@@ -326,14 +344,16 @@ var cashier_type = "<%= @cashier_type %>";
$(this).removeClass('selected-item');
}
else {
if(parseInt($(this).children().find("#item-account-qty").text()) >0 && parseInt($(this).children().find("#item-total-price").text()) >0){
$(this).addClass('selected-item');
}
}
});
// Select for account types
$(".accounts-type").on('click', function(e){
var account_id = $(this).attr('id').substr(8);
if($(this).hasClass('selected-account') == true){
$(this).removeClass('selected-account');
$(".item-row").each(function(i){
@@ -346,8 +366,13 @@ var cashier_type = "<%= @cashier_type %>";
$(this).addClass('selected-account');
$(".item-row").each(function(i){
if($(this).children().find("#item-account-type").text() == account_id){
if(parseInt($(this).children().find("#item-account-qty").text()) >0 && parseInt($(this).children().find("#item-total-price").text()) >0){
$(this).addClass("selected-item");
}
else{
console.log("discount item");
}
}
});
}
});
@@ -701,7 +726,7 @@ function calculate_overall_discount(type, amount){
}
}
$("#order-discount").text(total_discount);
$("#order-discount").text(total_discount.toFixed(<%= precision.to_i %>));
}
/* Calculate Items Discount*/
@@ -849,7 +874,7 @@ function calculate_item_discount(type, amount, sale_items, account_types){
// }
}
$("#order-sub-total").text(parseFloat(sub_total).toFixed(2));
$("#order-sub-total").text(parseFloat(sub_total).toFixed(<%= precision.to_i %>));
}else{
$("#discount-amountErr").html("Discount is greater than sub total!");
}

View File

@@ -2,6 +2,20 @@
<div id="loading_wrapper" style="display:none;">
<div id="loading"></div>
</div>
<% if !@print_settings.nil? %>
<% if @print_settings.precision.to_i > 0
precision = @print_settings.precision
else
precision = 0
end
#check delimiter
if @print_settings.delimiter
delimiter = ","
else
delimiter = ""
end
%>
<% end %>
<div class="row clearfix">
<!-- Column One -->
<div class="col-lg-6 col-md-6 col-sm-6">
@@ -350,7 +364,7 @@
<table class="table" id="order-charges-table" border="0">
<tr>
<td class="charges-name"><strong>Sub Total:</strong></td>
<td class="item-attr"><strong id="sub-total"><%= sub_total %></strong></td>
<td class="item-attr"><strong id="sub-total"><%= number_with_precision(sub_total, precision: precision.to_i ) rescue number_with_precision(0, precision: precision.to_i ) %></strong></td>
</tr>
<tr>
<%if @obj_sale != nil && @obj_sale.discount_type == 'member_discount'%>
@@ -359,7 +373,7 @@
<td class="charges-name"><strong>Discount:</strong></td>
<%end%>
<td class="item-attr"><strong id="order-discount">(<%= @obj_sale.total_discount rescue 0%>)</strong></td>
<td class="item-attr"><strong id="order-discount">(<%= number_with_precision(@obj_sale.total_discount, precision: precision.to_i ) rescue number_with_precision(0, precision: precision.to_i ) %>)</strong></td>
</tr>
<% if @status_sale == "sale" %>
<tr>
@@ -382,15 +396,15 @@
<button class="btn btn-link waves-effect bg-info change_tax">Change Tax</button>
<% end %>
</td>
<td class="item-attr"><strong id="order-Tax"><%= @obj_sale.total_tax rescue 0%></strong></td>
<td class="item-attr"><strong id="order-Tax"><%= number_with_precision(@obj_sale.total_tax, precision: precision.to_i ) rescue number_with_precision(0, precision: precision.to_i )%></strong></td>
</tr>
<tr>
<td class="charges-name"><strong>Rounding Adj:</strong></td>
<td class="item-attr"><strong id="order-round-adj"><%= @obj_sale.rounding_adjustment rescue 0%></strong></td>
<td class="item-attr"><strong id="order-round-adj"><%= number_with_precision(@obj_sale.rounding_adjustment, precision: precision.to_i ) rescue number_with_precision(0, precision: precision.to_i )%></strong></td>
</tr>
<tr>
<td class="charges-name"><strong>Grand Total:</strong></td>
<td class="item-attr"><strong id="order-grand-total"><%= @obj_sale.grand_total rescue 0%></strong></td>
<td class="item-attr"><strong id="order-grand-total"><%= number_with_precision(@obj_sale.grand_total, precision: precision.to_i ) rescue number_with_precision(0, precision: precision.to_i ) %></strong></td>
</tr>
<% end %>
<tr class="rebate_amount"></tr>

View File

@@ -95,7 +95,6 @@
total_qty += sale.total_item*(-1)
end %>
<!-- end all total qty -->
<% if sale.status_type == "foc" && sale.grand_total < 0
total_item_foc += sale.grand_total*(-1)
end %>
@@ -249,9 +248,21 @@
<td colspan="3">&nbsp;</td>
<td><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.item") %></td>
<td><span><%= total_qty%></span></td>
<td style="border-bottom:2px solid grey;"><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.amount") %></td>
<td style="border-bottom:2px solid grey;"><span><%= number_with_precision(grand_total , precision:precision.to_i,delimiter:delimiter)%></span></td>
<td><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.amount") %></td>
<td><span><%= number_with_precision(grand_total , precision:precision.to_i,delimiter:delimiter)%></span></td>
</tr>
<% if @type =="" || @type =="all" || @type.nil? %>
<tr class="foc_payment">
<td colspan="5">&nbsp;</td>
<td>Total FOC Amount</td>
<td><span><%= number_with_precision(@foc_data , precision:precision.to_i,delimiter:delimiter)%></span></td>
</tr>
<tr class="foc_payment" style="border-top:2px solid grey;border-bottom:2px solid grey;">
<td colspan="5">&nbsp;</td>
<td style="border-bottom:2px solid grey;"><%= t("views.right_panel.detail.net_amount") %></td>
<td style="border-bottom:2px solid grey;"><span><%= number_with_precision(grand_total -@foc_data , precision:precision.to_i,delimiter:delimiter)%></span></td>
</tr>
<% end %>
<% end %>
<% if @type == "other"%>
@@ -296,6 +307,7 @@
<script>
$(function(){
var check_arr = [];
var search = '<%= params[:period_type] %>';

View File

@@ -108,12 +108,7 @@
<% end %>
<tr>
<td>&nbsp;</td>
<% if !cate_arr.include?(sale.menu_category_id) %>
<td><%= sale.menu_category_name %></td>
<% cate_arr.push(sale.menu_category_id) %>
<% else %>
<td>&nbsp;</td>
<% end %>
<td><%= sale.item_code rescue '-' %></td>
<td><%= sale.product_name rescue '-' %></td>
<% if sale.status_type != "Discount" %>
@@ -143,13 +138,6 @@
sub_qty += sale.total_item
end %>
<% if count == value %>
<tr>
<td colspan="3">&nbsp;</td>
<td><b>Total <%= sale.account_name %> Qty </b> </td>
<td><b><%= sub_qty %></b></td>
<td><%= t("views.right_panel.detail.sub_total") %></td>
<td ><span class="underline"><%= number_with_precision(sub_total , precision:precision.to_i,delimiter:delimiter)%> </span></td>
</tr>
<% sub_total = 0.0%>
<% sub_qty = 0 %>
<% count = 0%>
@@ -238,6 +226,18 @@
<td style="border-bottom:2px solid grey;"><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.amount") %></td>
<td style="border-bottom:2px solid grey;"><span><%= number_with_precision(grand_total , precision:precision.to_i,delimiter:delimiter)%></span></td>
</tr>
<% if @type =="" || @type =="all" %>
<tr>
<td colspan="5">&nbsp;</td>
<td>Total FOC Amount</td>
<td><span><%= number_with_precision(@foc_data , precision:precision.to_i,delimiter:delimiter)%></span></td>
</tr>
<tr style="border-top:2px solid grey;border-bottom:2px solid grey;">
<td colspan="5">&nbsp;</td>
<td style="border-bottom:2px solid grey;"><%= t("views.right_panel.detail.net_amount") %></td>
<td style="border-bottom:2px solid grey;"><span><%= number_with_precision(grand_total -@foc_data , precision:precision.to_i,delimiter:delimiter)%></span></td>
</tr>
<% end %>
<% end %>
<% if @type == "other"%>
@@ -280,3 +280,16 @@
</div>
</body>
</html>
<script type="text/javascript">
$(function(){
var type =<%=@type %>;
console.log(type);
$('.foc_payment').hide();
if (type =="" || type =="all" ){
$('.foc_payment').show();
}
else{
$('.foc_payment').hide();
}
});
</script>

View File

@@ -21,11 +21,11 @@ class ActionController::Base
end
else
# check for license file
# if check_license
# current_license(ENV["SX_PROVISION_URL"])
# else
# redirect_to activate_path
# end
if check_license
current_license(ENV["SX_PROVISION_URL"])
else
redirect_to activate_path
end
end
end

View File

@@ -1,10 +1,11 @@
# application_path="#{File.expand_path("../..", __FILE__)}"
# directory application_path
# #environment ENV.fetch("RAILS_ENV") { "production" }
# environment "production"
# pidfile "#{application_path}/tmp/puma/pid"
# state_path "#{application_path}/tmp/puma/state"
# stdout_redirect "#{application_path}/log/puma.stdout.log", "#{application_path}/log/puma.stderr.log"
# port ENV.fetch("PORT") { 62158 }
# workers 2
# preload_app!
application_path="#{File.expand_path("../..", __FILE__)}"
directory application_path
#environment ENV.fetch("RAILS_ENV") { "production" }
environment "production"
pidfile "#{application_path}/tmp/puma/pid"
state_path "#{application_path}/tmp/puma/state"
stdout_redirect "#{application_path}/log/puma.stdout.log", "#{application_path}/log/puma.stderr.log"
port ENV.fetch("PORT") { 62158 }
workers 2
preload_app!
threads 1,1