Merge branch 'r-1902001-01' into foodcourt
This commit is contained in:
@@ -9,7 +9,9 @@
|
||||
</span>
|
||||
</ul>
|
||||
</div> -->
|
||||
|
||||
<div id="loading_wrapper" style="display:none;">
|
||||
<div id="loading"></div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12">
|
||||
@@ -657,13 +659,14 @@
|
||||
|
||||
swal({
|
||||
title: "Confirmation !",
|
||||
text: 'Are You Sure to assign this customer' + customer + '!',
|
||||
text: 'Are you sure to assign this customer' + customer + '!',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "green",
|
||||
confirmButtonText: "Yes!",
|
||||
cancelButtonClass: 'btn btn-danger',
|
||||
closeOnConfirm: false,
|
||||
closeOnConfirm: true,
|
||||
}, function () {
|
||||
$( "#loading_wrapper").show();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/origami/"+sale_id+"/"+cashier_type+"/customers/update_sale" ,
|
||||
|
||||
@@ -817,10 +817,8 @@
|
||||
if ($("#server_mode").val() != "cloud") { // first bill not used in cloud
|
||||
if (discount) {
|
||||
if(checkReceiptNoInFirstBillData(receipt_no,"")){
|
||||
$("button.change_tax").hide();
|
||||
$("#pay").show();
|
||||
}else{
|
||||
$("button.change_tax").show();
|
||||
$("#pay").hide();
|
||||
}
|
||||
}
|
||||
@@ -832,6 +830,7 @@
|
||||
var sale_id = this.id;
|
||||
window.location.href = '/origami/table/' + dining_id + "/table_invoice/" + sale_id;
|
||||
})
|
||||
|
||||
$(".tables").on('click', function () {
|
||||
localStorage.setItem('dinning_type','table');
|
||||
var customer_id = $(".customer-id").text();
|
||||
@@ -1157,32 +1156,35 @@
|
||||
})
|
||||
|
||||
$('#add_invoice').on('click', function () {
|
||||
$("#first_bill").prop('disabled',true);
|
||||
$("#pay").prop('disabled',true);
|
||||
var dining_id = "<%= @dining.id %>";
|
||||
var sale_id = $("#sale_id").val(); //<%= @obj_sale.sale_id rescue "" %>
|
||||
var ajax_url = "/origami/sale/append_order";
|
||||
// var tax_type = localStorage.getItem("tax_type");
|
||||
var tax_type = $("#check_tax").val();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: ajax_url,
|
||||
data: 'dining_id=' + dining_id + "&sale_id=" + sale_id + "&tax_type=" + tax_type,
|
||||
success: function (result) {
|
||||
swal({
|
||||
title: "Information!",
|
||||
text: "Invoice updated",
|
||||
html: true,
|
||||
closeOnConfirm: false,
|
||||
closeOnCancel: false,
|
||||
allowOutsideClick: false
|
||||
}, function () {
|
||||
$("#first_bill").removeAttr('disabled');
|
||||
$("#pay").removeAttr('disabled');
|
||||
window.location.reload();
|
||||
});
|
||||
}
|
||||
});
|
||||
$("#loading_wrapper").show();
|
||||
$("#add_invoice").prop('disable', true);
|
||||
$("#first_bill").prop('disabled',true);
|
||||
$("#pay").prop('disabled',true);
|
||||
var dining_id = "<%= @dining.id %>";
|
||||
var sale_id = $("#sale_id").val(); //<%= @obj_sale.sale_id rescue "" %>
|
||||
var ajax_url = "/origami/sale/append_order";
|
||||
// var tax_type = localStorage.getItem("tax_type");
|
||||
var tax_type = $("#check_tax").val();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: ajax_url,
|
||||
data: 'dining_id=' + dining_id + "&sale_id=" + sale_id + "&tax_type=" + tax_type,
|
||||
success: function (result) {
|
||||
swal({
|
||||
title: "Information!",
|
||||
text: "Invoice updated",
|
||||
html: true,
|
||||
closeOnConfirm: false,
|
||||
closeOnCancel: false,
|
||||
allowOutsideClick: false
|
||||
}, function () {
|
||||
$("#first_bill").removeAttr('disabled');
|
||||
$("#pay").removeAttr('disabled');
|
||||
window.location.reload();
|
||||
});
|
||||
$("#loading_wrapper").hide();
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
//show cusotmer rebate amount
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="<%= column_count = @payment_methods.length + 12 %>"> <%= t("views.right_panel.detail.from_date") %> : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - <%= t("views.right_panel.detail.to_date") %> : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%></th>
|
||||
<th colspan="<%= column_count = @payment_methods.length + 11 + @tax_profiles.length %>"> <%= t("views.right_panel.detail.from_date") %> : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - <%= t("views.right_panel.detail.to_date") %> : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%></th>
|
||||
</tr>
|
||||
<% @count = 1 %>
|
||||
<% @payment_methods.each_slice(10) do |slice| %>
|
||||
@@ -71,13 +71,11 @@
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th colspan="<%= @count + 1 %>" style='text-align:center;'>Income</th>
|
||||
<th colspan=4 style='text-align:center;'>Outgoing</th>
|
||||
<th style='text-align:center; cursor: help;' data-toggle="tooltip" data-placement="top" title="Gross Sales = (Income+Discount) - Void"><i class="material-icons md-18">live_help</i></th>
|
||||
<th colspan='4' style='text-align:center;'>Outgoing</th>
|
||||
<th colspan='<%= @tax_profiles.size %>' style='text-align:center;'>Tax</th>
|
||||
<th style='text-align:center; cursor: help;' data-toggle="tooltip" data-placement="top" title="Net Sales = Income - Tax"><i class="material-icons md-18">live_help</i></th>
|
||||
<th style='text-align:center; cursor: help;' data-toggle="tooltip" data-placement="top" title="Gross Sales = Income + Discount"><i class="material-icons md-18">live_help</i></th>
|
||||
<th style='text-align:center; cursor: help;' data-toggle="tooltip" data-placement="top" title="Total Sales = Gross Sales - Discount"><i class="material-icons md-18">live_help</i></th>
|
||||
<% if @tax.blank? %>
|
||||
<th style='text-align:center; cursor: help;' data-toggle="tooltip" data-placement="top" title="Tax = Total Sales / 21"><i class="material-icons md-18">live_help</i></th>
|
||||
<th style='text-align:center; cursor: help;' data-toggle="tooltip" data-placement="top" title="Net Sales = Total Sales - Tax"><i class="material-icons md-18">live_help</i></th>
|
||||
<% end %>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.sr") %></th>
|
||||
@@ -85,22 +83,21 @@
|
||||
<% @payment_methods.each do |method| %>
|
||||
<th style='text-align:center;' class="d-none d-sm-table-cell"><%= t("views.right_panel.detail.#{method.parameterize == 'paymal' ? 'card_sales' : method.parameterize}") %></th>
|
||||
<% end %>
|
||||
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.cash_sales") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.credit_sales") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.void_amount") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.foc_sales") %></th>
|
||||
|
||||
<th style='text-align:center;'>(<%= t("views.right_panel.detail.discount") %>)</th>
|
||||
<!-- <th style='text-align:center;'><%= t("views.right_panel.detail.grand_total") %> + <br/> <%= t("views.right_panel.detail.rnd_adj_sh") %></th> -->
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.rnd_adj_sh") %></th>
|
||||
<% if @tax_profiles.present? %>
|
||||
<% @tax_profiles.each do |name| %>
|
||||
<th style='text-align:center;'><%= t name %></th>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.net_sales") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.gross_sales") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.total_sales") %></th>
|
||||
<% if @tax.blank? %>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.tax") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.net_sales") %></th>
|
||||
<% end %>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<% unless @sale_data.blank? %>
|
||||
@@ -147,12 +144,16 @@
|
||||
<td style='text-align:right;'>(<%= number_format(sale[:total_discount], precision:precision,delimiter:delimiter) rescue '-'%>)</td>
|
||||
<!-- <td style='text-align:right;'><%= number_format(sale[:grand_total].to_f + sale[:rounding_adj].to_f , precision:precision.to_i,delimiter:delimiter) rescue '-'%></td> -->
|
||||
<td style='text-align:right;'><%= number_format(sale[:rounding_adj], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
|
||||
<% if @tax_profiles.present? %>
|
||||
<% @tax_profiles.each do |name| %>
|
||||
<td style='text-align:right;'><%= number_format(sale[name.parameterize.to_sym], precision:precision.to_i,delimiter:delimiter) rescue '-' %></td>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<td style='text-align:right;'><%= number_format(sale[:net_sale], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_format(sale[:gross_sale], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_format(sale[:total_sale], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<% if @tax.blank? %>
|
||||
<td style='text-align:right;'><%= number_format(sale[:tax], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_format(sale[:net_sale], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<% end %>
|
||||
|
||||
</tr>
|
||||
<% count = count + 1 %>
|
||||
@@ -171,33 +172,37 @@
|
||||
|
||||
<td style='text-align:right;'>(<%= number_format(discount, precision:precision.to_i,delimiter:delimiter) rescue '-'%>)</td>
|
||||
<td style='text-align:right;'><%= number_format(rounding_adj, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_format(gross_sale, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_format(total_sale, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<% if @tax.blank? %>
|
||||
<td style='text-align:right;'><%= number_format(tax, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_format(net_sale, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
|
||||
<% if @tax_profiles.present? %>
|
||||
<% @tax_profiles.each do |name| %>
|
||||
<td style='text-align:right;'><%= number_format(@sale_data.inject(0.0.to_d) { |sum, sale| sum + sale[name.parameterize.to_sym] }, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<td style='text-align:right;'><%= number_format(net_sale, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_format(gross_sale, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_format(total_sale, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
</tr>
|
||||
<tr style="font-weight:600;">
|
||||
<td colspan="<%= column_count %>"> </td>
|
||||
</tr>
|
||||
<% total_tax = 0 %>
|
||||
<% net = 0 %>
|
||||
<% unless @tax.blank? %>
|
||||
<% @tax.each do |tax|
|
||||
total_tax += tax.tax_amount.to_f %>
|
||||
<tr style="font-weight:600;">
|
||||
<td colspan="<%= colspan + 2 %>" style='text-align:right;'><%= tax.tax_name rescue '-'%></td>
|
||||
<td colspan="5" style='text-align:right;'><%= number_format(tax.tax_amount, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
</tr>
|
||||
<% if @tax_profiles.present? %>
|
||||
<% @tax_profiles.each do |name| %>
|
||||
<tr style="font-weight:600;">
|
||||
<td colspan="<%= colspan + 2 %>" style='text-align:right;'><%= t name rescue '-'%></td>
|
||||
<td colspan="5" style='text-align:right;'>
|
||||
<%= number_format(@sale_data.inject(0.0.to_d) { |sum, sale| sum + sale[name.parameterize.to_sym] }, precision:precision.to_i,delimiter:delimiter) rescue '-'%>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% net = grand_total %>
|
||||
<% net = net - rounding_adj%>
|
||||
<% net = net - total_tax %>
|
||||
<tr style="font-weight:600;">
|
||||
<td colspan="<%= colspan + 2 %>" style='text-align:right;'><%= t("views.right_panel.detail.net_amount") %></td>
|
||||
<td colspan="5" style='text-align:right;'><%= number_format(net, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td colspan="5" style='text-align:right;'><%= number_format(net, precision:precision.to_i,delimiter:delimiter) rescue '-' %></td>
|
||||
</tr>
|
||||
<% else %>
|
||||
<tr style="font-weight:600;">
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
<th></th>
|
||||
<th colspan="<%= @count + 1 %>" style='text-align:center;'>Income</th>
|
||||
<th colspan=4 style='text-align:center;'>Outgoing</th>
|
||||
<th colspan='<%= @tax_profiles.size %>' style='text-align:center;'>Tax</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.sr") %></th>
|
||||
@@ -38,13 +39,14 @@
|
||||
<th style='text-align:center;'>(<%= t("views.right_panel.detail.discount") %>)</th>
|
||||
<!-- <th style='text-align:center;'><%= t("views.right_panel.detail.grand_total") %> + <br/> <%= t("views.right_panel.detail.rnd_adj_sh") %></th> -->
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.rnd_adj_sh") %></th>
|
||||
<% if @tax_profiles.present? %>
|
||||
<% @tax_profiles.each do |name| %>
|
||||
<th style='text-align:center;'><%= t name %></th>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.net_sales") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.gross_sales") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.total_sales") %></th>
|
||||
<% if @tax.blank? %>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.tax") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.net_sales") %></th>
|
||||
<% end %>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<% unless @sale_data.blank? %>
|
||||
@@ -90,12 +92,16 @@
|
||||
<td style='text-align:right;'>(<%= number_format(sale[:total_discount], precision:precision,delimiter:delimiter) rescue '-'%>)</td>
|
||||
<!-- <td style='text-align:right;'><%= number_format(sale[:grand_total].to_f + sale[:rounding_adj].to_f , precision:precision.to_i,delimiter:delimiter) rescue '-'%></td> -->
|
||||
<td style='text-align:right;'><%= number_format(sale[:rounding_adj].to_f, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
|
||||
<% if @tax_profiles.present? %>
|
||||
<% @tax_profiles.each do |name| %>
|
||||
<td style='text-align:right;'><%= number_format(sale[name.parameterize.to_sym], precision:precision.to_i,delimiter:delimiter) rescue '-' %></td>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<td style='text-align:right;'><%= number_format(sale[:net_sale], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_format(sale[:gross_sale], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_format(sale[:total_sale], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<% if @tax.blank? %>
|
||||
<td style='text-align:right;'><%= number_format(sale[:tax], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_format(sale[:net_sale], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<% end %>
|
||||
|
||||
</tr>
|
||||
<% count = count + 1 %>
|
||||
@@ -114,12 +120,15 @@
|
||||
|
||||
<td style='text-align:right;'>(<%= number_format(discount, precision:precision.to_i,delimiter:delimiter) rescue '-'%>)</td>
|
||||
<td style='text-align:right;'><%= number_format(rounding_adj, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<% if @tax_profiles.present? %>
|
||||
<% @tax_profiles.each do |name| %>
|
||||
<td style='text-align:right;'><%= number_format(@sale_data.inject(0.0.to_d) { |sum, sale| sum + sale[name.parameterize.to_sym] }, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<td style='text-align:right;'><%= number_format(net_sale, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_format(gross_sale, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_format(total_sale, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<% if @tax.blank? %>
|
||||
<td style='text-align:right;'><%= number_format(tax, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_format(net_sale, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<% end %>
|
||||
|
||||
</tr>
|
||||
<tr style="font-weight:600;">
|
||||
@@ -127,20 +136,21 @@
|
||||
</tr>
|
||||
<% total_tax = 0 %>
|
||||
<% net = 0 %>
|
||||
<% unless @tax.blank? %>
|
||||
<% @tax.each do |tax|
|
||||
total_tax += tax.tax_amount.to_f %>
|
||||
<tr style="font-weight:600;">
|
||||
<td colspan="<%= colspan + 2 %>" style='text-align:right;'><%= tax.tax_name rescue '-'%></td>
|
||||
<td colspan="1" style='text-align:right;'><%= number_format(tax.tax_amount, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
</tr>
|
||||
<% if @tax_profiles.present? %>
|
||||
<% @tax_profiles.each do |name| %>
|
||||
<tr style="font-weight:600;">
|
||||
<td colspan="<%= colspan + 2 %>" style='text-align:right;'><%= t name rescue '-'%></td>
|
||||
<td colspan="4" style='text-align:right;'>
|
||||
<%= number_format(@sale_data.inject(0.0.to_d) { |sum, sale| sum + sale[name.parameterize.to_sym] }, precision:precision.to_i,delimiter:delimiter) rescue '-'%>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% net = grand_total %>
|
||||
<% net = net - rounding_adj%>
|
||||
<% net = net - total_tax %>
|
||||
<tr style="font-weight:600;">
|
||||
<td colspan="<%= colspan + 2 %>" style='text-align:right;'><%= t("views.right_panel.detail.net_amount") %></td>
|
||||
<td colspan="1" style='text-align:right;'><%= number_format(net, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td colspan="4" style='text-align:right;'><%= number_format(net, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
</tr>
|
||||
<% else %>
|
||||
<tr style="font-weight:600;">
|
||||
|
||||
Reference in New Issue
Block a user