check changable tax on/off settings and customer tax profiles calculation

This commit is contained in:
phyusin
2018-08-02 14:13:05 +06:30
parent 5b94a4604b
commit 444ecb9c68
10 changed files with 184 additions and 105 deletions

View File

@@ -370,7 +370,7 @@
<% else %>
No Tax
<% end %></strong><br>
<%if !@webview %>
<%if !@webview && @changable_tax %>
<button class="btn btn-link waves-effect bg-info change_tax">Change Tax</button>
<% end %>
</td>
@@ -1103,10 +1103,11 @@
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");
$.ajax({
type: "POST",
url: ajax_url,
data: 'dining_id=' + dining_id + "&sale_id=" + sale_id,
data: 'dining_id=' + dining_id + "&sale_id=" + sale_id + "&tax_type=" + tax_type,
success: function (result) {
swal({
title: "Information!",

View File

@@ -118,7 +118,7 @@
<% else %>
No Tax
<% end %></strong><br>
<%if @sale_payment.nil? %>
<%if @sale_payment.nil? && @changable_tax %>
<button class="btn btn-link waves-effect bg-info change_tax">Change Tax</button>
<% end %>
</td>

View File

@@ -404,7 +404,7 @@
<% else %>
No Tax
<% end %></strong><br>
<%if !@webview %>
<%if !@webview && @changable_tax %>
<button class="btn btn-link waves-effect bg-info change_tax">Change Tax</button>
<% end %>
</td>
@@ -1167,10 +1167,11 @@ $('#add_invoice').on('click',function(){
var dining_id = "<%= @room.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");
$.ajax({
type: "POST",
url: ajax_url,
data: 'dining_id='+ dining_id + "&sale_id=" + sale_id,
data: 'dining_id='+ dining_id + "&sale_id=" + sale_id + "&tax_type=" + tax_type,
success:function(result){
swal({
title: "Information!",