Merge branch 'r-1804001-01' of bitbucket.org:code2lab/sxrestaurant into sqa-1804-001

This commit is contained in:
Aung Myo
2018-05-14 17:34:40 +06:30
21 changed files with 81 additions and 43 deletions

0
app/controllers/crm/customers_controller.rb Executable file → Normal file
View File

0
app/controllers/origami/customers_controller.rb Executable file → Normal file
View File

View File

@@ -456,28 +456,27 @@ class Sale < ApplicationRecord
sale_tax.save
end
else
sale_tax = SaleTax.new(:sale => sale)
sale_tax.tax_name = tax.name
sale_tax.tax_rate = tax.rate
sale_tax = SaleTax.new(:sale => sale)
sale_tax.tax_name = tax.name
sale_tax.tax_rate = tax.rate
# substract , to give after discount
total_tax = total_taxable - total_discount
#include or execulive
if tax.inclusive
rate = tax.rate
divided_value = (100 + rate)/rate
sale_tax.tax_payable_amount = total_tax / divided_value
else
sale_tax.tax_payable_amount = total_tax * tax.rate / 100
total_tax_amount = total_tax_amount + sale_tax.tax_payable_amount
end
#new taxable amount is standard rule for step by step
if shop.calc_tax_order
total_taxable = total_taxable + sale_tax.tax_payable_amount
end
sale_tax.inclusive = tax.inclusive
sale_tax.save
# substract , to give after discount
total_tax = total_taxable - total_discount
#include or execulive
if tax.inclusive
rate = tax.rate
divided_value = (100 + rate)/rate
sale_tax.tax_payable_amount = total_tax / divided_value
else
sale_tax.tax_payable_amount = total_tax * tax.rate / 100
total_tax_amount = total_tax_amount + sale_tax.tax_payable_amount
end
#new taxable amount is standard rule for step by step
if shop.calc_tax_order
total_taxable = total_taxable + sale_tax.tax_payable_amount
end
sale_tax.inclusive = tax.inclusive
sale_tax.save
end
end
# end
@@ -2682,7 +2681,7 @@ end
end
def self.all_receipts
query = Sale.select("sale_payments.created_at as receipt_close_time,
query = Sale.select("sales.*,sale_payments.created_at as receipt_close_time,
case when (sale_audits.action='SALEPAYMENT') then sale_audits.remark else 0 end as remark,
case when (sale_taxes.tax_name='Service Charges') then sale_taxes.tax_payable_amount else 0 end as service_charges,
SUM(case when (sale_payments.payment_method='mpu') then sale_payments.payment_amount else 0 end) as mpu_amount,

0
app/views/crm/customers/_card_read_form.html.erb Executable file → Normal file
View File

0
app/views/crm/customers/_crm_customer.json.jbuilder Executable file → Normal file
View File

0
app/views/crm/customers/_form.html.erb Executable file → Normal file
View File

0
app/views/crm/customers/_new_form.html.erb Executable file → Normal file
View File

0
app/views/crm/customers/edit.html.erb Executable file → Normal file
View File

0
app/views/crm/customers/edit.json.jbuilder Executable file → Normal file
View File

0
app/views/crm/customers/index.html.erb Executable file → Normal file
View File

0
app/views/crm/customers/index.json.jbuilder Executable file → Normal file
View File

0
app/views/crm/customers/new.html.erb Executable file → Normal file
View File

0
app/views/crm/customers/show.html.erb Executable file → Normal file
View File

0
app/views/crm/customers/show.json.jbuilder Executable file → Normal file
View File

0
app/views/origami/customers/index.html.erb Executable file → Normal file
View File

View File

@@ -113,6 +113,12 @@
</div>
</div>
</div>
<div id="sxModal">
<div id="sxModal-Content"><h3>Card Tap</h3></div>
<div class="m-r-20" align="right">
<button type="button" class="btn btn-lg btn-link bg-red waves-effect btn_cancel">Cancel</button>
</div>
</div>
</div>
<!-- customer light box -->
@@ -256,6 +262,7 @@
getCardNo();
$("#sxModal").hide();
customer_mamber_card_no = $("#paypar_account_no").val();
if(sale_id != 0 && customer_mamber_card_no != 0){
$.ajax({
type: "POST",
@@ -429,7 +436,7 @@
});
}
$("#sxModal .btn_cancel").on('click',function(){
$(".btn_cancel").on('click',function(){
$("#sxModal").hide();
});
</script>

View File

@@ -108,6 +108,13 @@
<button type="button" class="btn bg-default m-t-10 btn-lg btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/<%= @cashier_type %>/payment/others_payment';"> <i class="material-icons m-t--5">reply</i>Back </button>
</div>
</div>
<div id="sxModal">
<div id="sxModal-Content"><h3>Card Tap</h3></div>
<div class="m-r-20" align="right">
<button type="button" class="btn btn-lg btn-link bg-red waves-effect btn_cancel">Cancel</button>
</div>
</div>
</div>
<!-- customer light box -->

View File

@@ -213,7 +213,6 @@
<!-- Column Three -->
<div class="col-lg-1 col-md-1 col-sm-1">
<button type="button" class="btn btn-default btn-block" id='back'><i class="material-icons">reply</i>Back</button>
<% if @sale.sale_status != 'void' && @sale.sale_status != 'waste' && @sale.sale_status != 'spoile' %>
<% if current_login_employee.role == "cashier" %>
<a class="btn btn-block bg-blue waves-effect access_modal" data-toggle="modal" data-type="void"> Void</a>
@@ -224,6 +223,30 @@
<button type="button" id="re-print" class="btn bg-blue btn-block">Re.Print</button>
</div>
</div>
<div class="modal fade" id="voidModal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="voidModalLabel">Please Enter Reason for Void</h4>
</div>
<div class="modal-body">
<input type="textarea" name="remark" class="form-control col-md-12 remark" id="remark">
</div>
<div class="modal-footer ">
<div class="row p-r-20">
<div class="col-md-5">
<button type="button" class="btn btn-link bg-red waves-effect " id="void" active="true">VOID</button>
</div>
<div class="col-md-5">
<button type="button" class="btn btn-link bg-blue waves-effect" data-dismiss="modal">CLOSE</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="AccessCodeModal" tabindex="-1" role="dialog">
@@ -344,7 +367,6 @@ $(document).on('click', '.access_modal', function(event){
if (isConfirm) {
var sale_id = $('#sale_id').val();
var ajax_url = "/origami/sale/" + sale_id +'/'+'cashier'+ '/void';
// var ajax_url = "/origami/sale/" + sale_id + '/void';
$.ajax({
type: 'POST',
url: ajax_url,