Merge branch 'adminbsb_material_ui'

This commit is contained in:
Aung Myo
2018-03-28 11:16:39 +06:30
6 changed files with 27 additions and 19 deletions

View File

@@ -17,8 +17,7 @@ class Reports::SaleitemController < BaseReportController
end end
@type = params[:sale_type] @type = params[:sale_type]
@sale_data, @other_charges,@discount_data , @cash_data , @card_data , @credit_data , @foc_data , @grand_total , @change_amount = Sale.get_by_shift_items(shift_sale_range,shift, from, to, Sale::SALE_STATUS_COMPLETED,@type) @sale_data, @other_charges,@discount_data , @cash_data , @card_data , @credit_data , @foc_data , @grand_total , @change_amount = Sale.get_by_shift_items(shift_sale_range,shift, from, to, Sale::SALE_STATUS_COMPLETED,@type)
puts @other_charges.to_json
puts "oooooooooooooooooooooooo"
@sale_taxes = Sale.get_separate_tax(shift_sale_range,shift,from,to,nil) @sale_taxes = Sale.get_separate_tax(shift_sale_range,shift,from,to,nil)
@account_cate_count = Hash.new {|hash, key| hash[key] = 0} @account_cate_count = Hash.new {|hash, key| hash[key] = 0}

View File

@@ -726,9 +726,9 @@
// For Server Print - from jade // For Server Print - from jade
if ($("#server_mode").val() == "cloud") { if ($("#server_mode").val() == "cloud") {
code2lab.printFile(result.filepath, result.printer_url); code2lab.printFile(result.filepath.substr(6), result.printer_url);
} }
// console.log(result); // console.log(result);
// code2lab.printBill(result.filepath, result.printer_model, result.printer_url); // code2lab.printBill(result.filepath, result.printer_model, result.printer_url);
location.reload(); location.reload();
@@ -776,7 +776,7 @@
createReceiptNoInFirstBillData(receipt_no,type); createReceiptNoInFirstBillData(receipt_no,type);
// For Server Print - from jade // For Server Print - from jade
if ($("#server_mode").val() == "cloud") { if ($("#server_mode").val() == "cloud") {
code2lab.printFile(result.filepath, result.printer_url); code2lab.printFile(result.filepath.substr(6), result.printer_url);
} }
location.reload(); location.reload();
} }
@@ -942,7 +942,7 @@
success: function (result) { success: function (result) {
// For Server Print - from jade // For Server Print - from jade
if ($("#server_mode").val() == "cloud") { if ($("#server_mode").val() == "cloud") {
code2lab.printFile(result.filepath, result.printer_url); code2lab.printFile(result.filepath.substr(6), result.printer_url);
} }
window.location.href = '/origami/'; window.location.href = '/origami/';
} }

View File

@@ -725,7 +725,7 @@ var customer_name = "<%= @customer.name %>";
customer_display_view(null,"reload"); customer_display_view(null,"reload");
// For Server Print - from jade // For Server Print - from jade
if ($("#server_mode").val() == "cloud") { if ($("#server_mode").val() == "cloud") {
code2lab.printFile(result.filepath, result.printer_url); code2lab.printFile(result.filepath.substr(6), result.printer_url);
} }
if (cashier_type=="cashier") { if (cashier_type=="cashier") {
window.location.href = '/origami'; window.location.href = '/origami';
@@ -939,7 +939,7 @@ var customer_name = "<%= @customer.name %>";
}, function () { }, function () {
// For Server Print - from jade // For Server Print - from jade
if ($("#server_mode").val() == "cloud") { if ($("#server_mode").val() == "cloud") {
code2lab.printFile(result.filepath, result.printer_url); code2lab.printFile(result.filepath.substr(6), result.printer_url);
} }
if (cashier_type=="cashier") { if (cashier_type=="cashier") {
window.location.href = '/origami'; window.location.href = '/origami';
@@ -1018,7 +1018,7 @@ var customer_name = "<%= @customer.name %>";
console.log(result); console.log(result);
// For Server Print - from jade // For Server Print - from jade
if ($("#server_mode").val() == "cloud") { if ($("#server_mode").val() == "cloud") {
code2lab.printFile(result.filepath, result.printer_url); code2lab.printFile(result.filepath.substr(6), result.printer_url);
} }
if (cashier_type=="cashier") { if (cashier_type=="cashier") {
window.location.href = '/origami'; window.location.href = '/origami';

View File

@@ -705,7 +705,7 @@ $("#first_bill").on('click', function(){
createReceiptNoInFirstBillData(receipt_no,""); createReceiptNoInFirstBillData(receipt_no,"");
// For Server Print - from jade // For Server Print - from jade
if ($("#server_mode").val() == "cloud") { if ($("#server_mode").val() == "cloud") {
code2lab.printFile(result.filepath, result.printer_url); code2lab.printFile(result.filepath.substr(6), result.printer_url);
} }
location.reload(); location.reload();
} }
@@ -739,7 +739,7 @@ $(".choose_payment").on('click', function () {
// For Server Print - from jade // For Server Print - from jade
if ($("#server_mode").val() == "cloud") { if ($("#server_mode").val() == "cloud") {
code2lab.printFile(result.filepath, result.printer_url); code2lab.printFile(result.filepath.substr(6), result.printer_url);
} }
location.reload(); location.reload();

View File

@@ -22,7 +22,7 @@
<div class="col-lg-2 col-md-2 col-sm-2"> <div class="col-lg-2 col-md-2 col-sm-2">
<label class="font-14">Select Type</label> <label class="font-14">Select Type</label>
<select name="sale_type" id="sel_sale_type" class="form-control"> <select name="sale_type" id="sel_sale_type" class="form-control">
<option value="">Select Typess</option> <option value="">Select Type</option>
<option value="revenue" selected>Revenue Only</option> <option value="revenue" selected>Revenue Only</option>
<option value="all">All Type</option> <option value="all">All Type</option>
<option value="discount">Discount Only</option> <option value="discount">Discount Only</option>

View File

@@ -77,16 +77,18 @@
<% unless @sale_data.blank? %> <% unless @sale_data.blank? %>
<% @sale_data.each do |sale| %> <% @sale_data.each do |sale| %>
<!-- all total qty sum --> <!-- all total qty sum -->
<!--
<% if sale.status_type != "Discount" && sale.status_type != "foc" <% if sale.status_type != "Discount" && sale.status_type != "foc"
total_qty += sale.total_item total_qty += sale.total_item
end %> end %>
<% if sale.status_type == "foc" && sale.price > 0 <% if sale.status_type == "foc" && sale.price > 0
total_qty += sale.total_item total_qty += sale.total_item
end %> end %>
--> <% if sale.status_type == "Discount"
total_qty += sale.total_item*(-1)
end %>
<!-- end all total qty --> <!-- end all total qty -->
<!--
<% if sale.status_type == "foc" && sale.grand_total < 0 <% if sale.status_type == "foc" && sale.grand_total < 0
total_item_foc += sale.grand_total*(-1) total_item_foc += sale.grand_total*(-1)
end %> end %>
@@ -94,7 +96,7 @@
<% if sale.status_type == "Discount" && sale.grand_total < 0 <% if sale.status_type == "Discount" && sale.grand_total < 0
total_item_dis += sale.grand_total*(-1) total_item_dis += sale.grand_total*(-1)
end %> end %>
-->
<% if !acc_arr.include?(sale.account_id) %> <% if !acc_arr.include?(sale.account_id) %>
<tr> <tr>
<td><b><%= sale.account_name %></b></td> <td><b><%= sale.account_name %></b></td>
@@ -121,7 +123,12 @@
<% end %> <% end %>
<td><%= sale.item_code rescue '-' %></td> <td><%= sale.item_code rescue '-' %></td>
<td><%= sale.product_name rescue '-' %></td> <td><%= sale.product_name rescue '-' %></td>
<td><%= sale.total_item rescue '-' %></td> <% if sale.status_type != "Discount" %>
<td><%= sale.total_item rescue '-' %></td>
<%else%>
<td><%= sale.total_item*(-1) rescue '-' %></td>
<% end %>
<td><%= number_with_precision(sale.unit_price , precision:precision.to_i,delimiter:delimiter) rescue '-'%></td> <td><%= number_with_precision(sale.unit_price , precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
<td><%= number_with_precision(sale.grand_total , precision:precision.to_i,delimiter:delimiter) rescue '-'%></td> <td><%= number_with_precision(sale.grand_total , precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
</tr> </tr>
@@ -132,10 +139,12 @@
<% count = count + 1 %> <% count = count + 1 %>
<% sub_total += sale.grand_total %> <% sub_total += sale.grand_total %>
<% #sub_qty += sale.total_item %> <% #sub_qty += sale.total_item %>
<% if sale.status_type!="Discount" && (!sale.product_name.include? "FOC") <% if sale.status_type !="Discount" && (!sale.product_name.include? "FOC")
sub_qty += sale.total_item sub_qty += sale.total_item
end %> end %>
<% if sale.status_type =="Discount"
sub_qty += sale.total_item*(-1)
end %>
<% if count == value %> <% if count == value %>
<tr> <tr>
<td colspan="3">&nbsp;</td> <td colspan="3">&nbsp;</td>