This commit is contained in:
Zoey
2019-06-26 11:42:51 +06:30
parent 56b8115ac9
commit 79d8eb94ef
17 changed files with 306 additions and 78 deletions

View File

@@ -201,7 +201,14 @@
<% else %>
<div class="col-md-4 hidden" id="credit">0</div>
<% end %>
<% if @other == 0.0 && @ppamount == 0.0 && @visacount == 0.0 && @jcbcount == 0.0 && @mastercount == 0.0 && @unionpaycount == 0.0 && @alipaycount == 0.0 && @paymalcount == 0.0 && @junctionpaycount == 0.0 && @dingacount == 0.0 && @giftvouchercount == 0.0 %>
<% if @kbz_pay_amount > 0.0 %>
<div class="row payment other-payment-color" id="card_payment" >
<div class="col-md-8">Other Payments (KBZ Pay)</div>
<div class="col-md-4" id="others">
<%= number_with_precision(@kbz_pay_amount, precision: precision.to_i) rescue number_with_precision(0, precision: precision.to_i) %>
</div>
</div>
<% elsif @other == 0.0 && @ppamount == 0.0 && @visacount == 0.0 && @jcbcount == 0.0 && @mastercount == 0.0 && @unionpaycount == 0.0 && @alipaycount == 0.0 && @paymalcount == 0.0 && @junctionpaycount == 0.0 && @dingacount == 0.0 && @giftvouchercount == 0.0 %>
<div class="row payment other-payment-color" id="card_payment" >
<div class="col-md-8">Other Payments</div>
<div class="col-md-4" id="others">
@@ -400,6 +407,10 @@
<button type="button" class="btn btn-block btn-default waves-effect" id='back'>
<i class="material-icons">reply</i>
Back
</button>
<button type="button" class="btn btn-block btn-default waves-effect" id='refresh'>
<!-- <i class="material-icons">reply</i> -->
Refresh
</button>
<!-- -->
<% if current_login_employee.role == "cashier" %>
@@ -782,6 +793,10 @@ $(document).ready(function(){
});
$("#refresh").on('click', function(){
window.location.reload();
})
if(localStorage.getItem("cash") == null || localStorage.getItem("cash") == 'null'){
}
@@ -867,6 +882,11 @@ $(document).ready(function(){
var cash = $('#cash').text();
var credit = $('#credit').text();
var card = $('#card').text();
var kbz_amt = "<%= @kbz_pay_amount %>";
var is_kbz = false;
if (kbz_amt > 0) {
is_kbz = true
}
var tax_type = localStorage.getItem("tax_type") ? localStorage.getItem("tax_type") : 'all';
if (credit <= 0 && (!location.pathname.includes("credit_payment"))) {
@@ -884,7 +904,7 @@ $(document).ready(function(){
$.ajax({type: "POST",
url: url,
data: "cash="+ cash + "&sale_id=" + sale_id + "&type=" + cashier_type + "&tax_type=" + tax_type,
data: "cash="+ cash + "&sale_id=" + sale_id + "&type=" + cashier_type + "&tax_type=" + tax_type + "&is_kbz=" + is_kbz,
success:function(result){
/* start delete receipt no in first bill*/
if(($("#receipt_no").html()!=undefined) && ($("#receipt_no").html()!="")){