Merge branch 'r-1902001-01-dev' of gitlab.com:code2lab/SXRestaurant into r-1902001-01-dev
This commit is contained in:
14
Gemfile.lock
14
Gemfile.lock
@@ -157,6 +157,15 @@ GEM
|
|||||||
minitest (5.12.0)
|
minitest (5.12.0)
|
||||||
momentjs-rails (2.20.1)
|
momentjs-rails (2.20.1)
|
||||||
railties (>= 3.1)
|
railties (>= 3.1)
|
||||||
|
monetize (1.9.2)
|
||||||
|
money (~> 6.12)
|
||||||
|
money (6.13.4)
|
||||||
|
i18n (>= 0.6.4, <= 2)
|
||||||
|
money-rails (1.13.2)
|
||||||
|
activesupport (>= 3.0)
|
||||||
|
monetize (~> 1.9.0)
|
||||||
|
money (~> 6.13.2)
|
||||||
|
railties (>= 3.0)
|
||||||
multi_xml (0.6.0)
|
multi_xml (0.6.0)
|
||||||
mysql2 (0.5.2)
|
mysql2 (0.5.2)
|
||||||
nested_form (0.3.2)
|
nested_form (0.3.2)
|
||||||
@@ -340,7 +349,12 @@ DEPENDENCIES
|
|||||||
material_icons
|
material_icons
|
||||||
mini_magick
|
mini_magick
|
||||||
momentjs-rails
|
momentjs-rails
|
||||||
|
<<<<<<< HEAD
|
||||||
mysql2
|
mysql2
|
||||||
|
=======
|
||||||
|
money-rails (~> 1.12)
|
||||||
|
mysql2 (>= 0.3.18, < 0.5)
|
||||||
|
>>>>>>> ec9e4fb7ebe54e215a0bb8ac6c58b49fa9e20712
|
||||||
nested_form
|
nested_form
|
||||||
pdfjs_viewer-rails
|
pdfjs_viewer-rails
|
||||||
pg
|
pg
|
||||||
|
|||||||
@@ -113,9 +113,9 @@
|
|||||||
<td><%= sale.item_code %></td>
|
<td><%= sale.item_code %></td>
|
||||||
<td><%= sale.product_name %></td>
|
<td><%= sale.product_name %></td>
|
||||||
<td><%= sale.total_item.to_i %></td>
|
<td><%= sale.total_item.to_i %></td>
|
||||||
<td><%= sale.unit_price.to_i %></td>
|
<td><%= number_with_precision(sale.unit_price.to_i, precision:precision.to_i,delimiter:delimiter) %></td>
|
||||||
<td><%= sale.grand_total.to_i %></td>
|
<td><%= number_with_precision(sale.grand_total.to_i, precision:precision.to_i,delimiter:delimiter) %></td>
|
||||||
<td><%= sale.date_format %></td>
|
<!-- <td><%= sale.date_format %></td> -->
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
<!-- new tr -->
|
<!-- new tr -->
|
||||||
@@ -133,7 +133,7 @@
|
|||||||
<td style="text-align:right"> <strong>Grand Total: </strong></td>
|
<td style="text-align:right"> <strong>Grand Total: </strong></td>
|
||||||
<td >
|
<td >
|
||||||
<span class="underline" style="text-align:right">
|
<span class="underline" style="text-align:right">
|
||||||
<strong><%= grand_total.to_i %></strong>
|
<strong><%= number_with_precision(grand_total.to_i, precision:precision.to_i,delimiter:delimiter) %></strong>
|
||||||
<% grand_total = 0 %>
|
<% grand_total = 0 %>
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
@@ -43,6 +43,18 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
<% 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
|
||||||
|
%>
|
||||||
<% grand_total = 0 %>
|
<% grand_total = 0 %>
|
||||||
<% @sale_data.each do |result| %>
|
<% @sale_data.each do |result| %>
|
||||||
<% table_name=nil
|
<% table_name=nil
|
||||||
@@ -58,7 +70,7 @@
|
|||||||
<td><%= table_type %> - <%= table_name %></td>
|
<td><%= table_type %> - <%= table_name %></td>
|
||||||
<td><%= result.receipt_no rescue '-' %> </td>
|
<td><%= result.receipt_no rescue '-' %> </td>
|
||||||
<td><%= result.cashier_name rescue '-' %></td>
|
<td><%= result.cashier_name rescue '-' %></td>
|
||||||
<td><%=result.grand_total%></td>
|
<td><%= number_with_precision(result.grand_total, precision:precision.to_i,delimiter:delimiter) %></td>
|
||||||
<!-- <td> </td> -->
|
<!-- <td> </td> -->
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
@@ -84,8 +96,8 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
</td>
|
</td>
|
||||||
<td><%= item.qty rescue '-' %></td>
|
<td><%= item.qty rescue '-' %></td>
|
||||||
<td><%= item.unit_price rescue '-' %></td>
|
<td><%= number_with_precision(item.unit_price, precision:precision.to_i,delimiter:delimiter) rescue '-' %></td>
|
||||||
<td><%= item.price rescue '-' %></td>
|
<td><%= number_with_precision(item.price, precision:precision.to_i,delimiter:delimiter) rescue '-' %></td>
|
||||||
<td><%=l item.created_at.utc.getlocal, :format => :short rescue '-' %> </td>
|
<td><%=l item.created_at.utc.getlocal, :format => :short rescue '-' %> </td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
@@ -108,7 +120,7 @@
|
|||||||
<td> </td>
|
<td> </td>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
<td><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.amount") %></td>
|
<td><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.amount") %></td>
|
||||||
<td><%= result.total_amount %></td>
|
<td><%= number_with_precision(result.total_amount, precision:precision.to_i,delimiter:delimiter) %></td>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
@@ -120,7 +132,7 @@
|
|||||||
<td><%= t("views.right_panel.detail.total") %>
|
<td><%= t("views.right_panel.detail.total") %>
|
||||||
<%= t("views.right_panel.detail.discount") %>
|
<%= t("views.right_panel.detail.discount") %>
|
||||||
<%= t("views.right_panel.detail.amount") %></td>
|
<%= t("views.right_panel.detail.amount") %></td>
|
||||||
<td> - <%= result.total_discount %> </td>
|
<td> - <%= number_with_precision(result.total_discount, precision:precision.to_i,delimiter:delimiter) %> </td>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
@@ -130,7 +142,7 @@
|
|||||||
<td> </td>
|
<td> </td>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
<td>Tax Amount </td>
|
<td>Tax Amount </td>
|
||||||
<td><%= result.total_tax %> </td>
|
<td><%= number_with_precision(result.total_tax, precision:precision.to_i,delimiter:delimiter) %> </td>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
@@ -142,7 +154,7 @@
|
|||||||
<td> </td>
|
<td> </td>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
<td>Payment <%= rec.payment_method.upcase %></td>
|
<td>Payment <%= rec.payment_method.upcase %></td>
|
||||||
<td><%= rec.payment_amount %> ( <%= rec.payment_status %> )</td>
|
<td><%= number_with_precision(rec.payment_amount, precision:precision.to_i,delimiter:delimiter) %> ( <%= rec.payment_status %> )</td>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
@@ -162,7 +174,7 @@
|
|||||||
<td> </td>
|
<td> </td>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
<td><%= t("views.right_panel.detail.change") %> <%= t("views.right_panel.detail.amount") %></td>
|
<td><%= t("views.right_panel.detail.change") %> <%= t("views.right_panel.detail.amount") %></td>
|
||||||
<td><%= result.amount_changed %></td>
|
<td><%= number_with_precision(result.amount_changed, precision:precision.to_i,delimiter:delimiter) %></td>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
@@ -184,7 +196,7 @@
|
|||||||
<td> </td>
|
<td> </td>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
<td><b>Total Nett</b> - <b><%= grand_total %></b></td>
|
<td><b>Total Nett</b> - <b><%= number_with_precision(grand_total, precision:precision.to_i,delimiter:delimiter) %></b></td>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|||||||
@@ -45,6 +45,18 @@
|
|||||||
|
|
||||||
|
|
||||||
<tbody>
|
<tbody>
|
||||||
|
<% 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
|
||||||
|
%>
|
||||||
<% receipt_arr = Array.new %>
|
<% receipt_arr = Array.new %>
|
||||||
<% menu_cat_arr = Array.new %>
|
<% menu_cat_arr = Array.new %>
|
||||||
<% footer_arr = Array.new %>
|
<% footer_arr = Array.new %>
|
||||||
@@ -65,10 +77,10 @@
|
|||||||
<td> </td>
|
<td> </td>
|
||||||
<% end %>
|
<% end %>
|
||||||
<td><%= sale.product_name %></td>
|
<td><%= sale.product_name %></td>
|
||||||
<td><%= sale.product_code %></td>
|
<td><%= sale.product_code.to_i %></td>
|
||||||
<td><%= sale.qty.to_i %></td>
|
<td><%= sale.qty.to_i %></td>
|
||||||
<td><%= sale.unit_price %></td>
|
<td><%= number_with_precision(sale.unit_price, precision:precision.to_i,delimiter:delimiter) %></td>
|
||||||
<td><%= sale.price %></td>
|
<td><%= number_with_precision(sale.price, precision:precision.to_i,delimiter:delimiter) %></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
@@ -79,13 +91,13 @@
|
|||||||
<td colspan="2" style="text-align:right"> <strong>Total Qty: </strong></td>
|
<td colspan="2" style="text-align:right"> <strong>Total Qty: </strong></td>
|
||||||
<td>
|
<td>
|
||||||
<span class="underline" style="text-align:right">
|
<span class="underline" style="text-align:right">
|
||||||
<strong><%= waste_and_spoil_item_count %></strong>
|
<strong><%= number_with_precision(waste_and_spoil_item_count, precision:precision.to_i,delimiter:delimiter) %></strong>
|
||||||
<% waste_and_spoil_item_count = 0%>
|
<% waste_and_spoil_item_count = 0%>
|
||||||
</span></td>
|
</span></td>
|
||||||
<td style="text-align:right"> <strong>Grand Total: </strong></td>
|
<td style="text-align:right"> <strong>Grand Total: </strong></td>
|
||||||
<td >
|
<td >
|
||||||
<span class="underline" style="text-align:right">
|
<span class="underline" style="text-align:right">
|
||||||
<strong><%= grand_total %></strong>
|
<strong><%= number_with_precision(grand_total, precision:precision.to_i,delimiter:delimiter) %></strong>
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
Reference in New Issue
Block a user