Pull from master

This commit is contained in:
San Wai Lwin
2018-04-19 10:49:25 +06:30
parent 70ec80a1d5
commit 0241d209ac
28 changed files with 529 additions and 220 deletions

View File

@@ -46,6 +46,8 @@
</div>
</div>
</div>
<p class="hidden" name="sale_id" id="sale_id" ><%=@sale_id %></p>
<p class="hidden" name="receipt_no" id="receipt_no" ><%=@sale_data.receipt_no %></p>
<!-- <% if @payparcount > 0 %>
<p class="">Last time rebate amount is <%= @payparcount %></p>
<% end %>
@@ -203,7 +205,7 @@
$.ajax({
type: "POST",
url: "<%=origami_payment_dinga_path%>",
data: {payment_amount:payment_amount,membership_id:membership_id,sale_id:sale_id,transaction_ref:""},
data: {payment_amount:payment_amount,membership_id:membership_id,sale_id:sale_id,transaction_ref:"",account_no:0},
success: function(result){
if(result.status == true){
swal({
@@ -239,6 +241,7 @@
var membership_id = '';
var membership_type = '';
var sale_id = $("#sale_id").text() || 0;
var receipt_no = $("#receipt_no").text() || 0;
var customer_mamber_card_no = 0;
$("#is_paymemberModal").hide();
@@ -247,7 +250,6 @@
getCardNo();
$("#sxModal").hide();
customer_mamber_card_no = $("#paypar_account_no").val();
if(sale_id != 0 && customer_mamber_card_no != 0){
$.ajax({
type: "POST",
@@ -255,6 +257,7 @@
data: { account_no : customer_mamber_card_no, amount : payment_amount, receipt_no : receipt_no},
dataType: "json",
success: function(data) {
console.log(data)
if (data.status == true) {
var valid_amount = parseFloat(data.old_balance_amount) - parseFloat(data.reload_amount);
$("#valid_amount").val(parseFloat(valid_amount));
@@ -262,8 +265,9 @@
$.ajax({
type: "POST",
url: "<%=origami_payment_dinga_path%>",
data: {payment_amount:payment_amount,membership_id:0,sale_id:sale_id,transaction_ref:data.transaction_ref},
data: {payment_amount:payment_amount,membership_id:0,sale_id:sale_id,transaction_ref:data.transaction_ref,account_no :customer_mamber_card_no},
success: function(result){
console.log(result)
if(result.status == true){
swal({
title: "Information!",
@@ -273,7 +277,7 @@
closeOnCancel: false,
allowOutsideClick: false
}, function () {
window.location.href = '/origami/sale/'+ sale_id + "/"+cashier_type+"/payment";
window.location.href = '/origami/sale/'+ sale_id + "/"+cashier_type+"/payment";
});
}else{
@@ -291,14 +295,14 @@
closeOnCancel: false,
allowOutsideClick: false
}, function () {
window.location.href = '/origami/sale/'+ sale_id +"/"+cashier_type + "/payment/others_payment/DINGA";
window.location.href = '/origami/sale/'+ sale_id +"/"+cashier_type + "/payment/others_payment/DINGA";
});
}
}
});
}
},100);
},100);
});
// Read NFC card no from java
@@ -321,9 +325,10 @@
var customer_name = '';
var membership_id = '';
var membership_type = '';
var receipt_no = $("#receipt_no").text() || 0;
setTimeout(function(){
code=getQRCode();
if(sale_id != 0 && code != ""){
code=getQRCode();
if(sale_id != 0 && code != ""){
$.ajax({
type: "POST",
url: "/origami/"+sale_id+"/send_account" ,
@@ -337,8 +342,9 @@
$.ajax({
type: "POST",
url: "<%=origami_payment_paymal_path%>",
data: {payment_amount:payment_amount,membership_id:0,sale_id:sale_id,transaction_ref:data.transaction_ref},
data: {payment_amount:payment_amount,membership_id:0,sale_id:sale_id,transaction_ref:data.transaction_ref,account_no:code},
success: function(result){
if(result.status == true){
swal({
title: "Information!",

View File

@@ -5,13 +5,13 @@
<div class="col-lg-4 col-md-4 col-sm-4" style="margin:0px 0px 0px -5px !important ">
<ul class="nav nav-tabs tab-col-teal" role="tablist">
<li class="nav-item active" data-color="#F44336" data-type="pending" style="background-color: #F44336;">
<a class="nav-link" data-toggle="tab" href="#pending" role="tab"><p class="num">4</p> <%= t :pending %></a>
<a class="nav-link" data-toggle="tab" href="#pending" role="tab"><p class="num">1</p> <%= t :pending %></a>
</li>
<li class="nav-item" data-color="#673AB7" data-type="processing" style="background-color: #673AB7;">
<a class="nav-link" data-toggle="tab" href="#processing" role="tab"><p class="num">4</p> <%= t :process %></a>
<a class="nav-link" data-toggle="tab" href="#processing" role="tab"><p class="num">2</p> <%= t :processing %></a>
</li>
<li class="nav-item" data-color="#009688" data-type="delivery" style="background-color: #009688;">
<a class="nav-link" data-toggle="tab" href="#delivery" role="tab"><p class="num">4</p> <%= t :delivery %></a>
<a class="nav-link" data-toggle="tab" href="#delivery" role="tab"><p class="num">3</p> <%= t :delivering %></a>
</li>
<li class="nav-item" data-color="#03A9F4" data-type="completed" style="background-color: #03A9F4;">
<a class="nav-link" data-toggle="tab" href="#completed" role="tab"><p class="num">4</p> <%= t :completed %></a>
@@ -27,9 +27,9 @@
<% i=1
@order.each do |order| %>
<% if order.status == 'new' %>
<tr class="custom-tr first-<%=i%>" style="" data-id="<%=order.order_reservation_id%>">
<tr class="custom-tr first-<%=i%>" style="" data-id="<%=order.order_reservation_id%>" data-sr-no="<%= i %>">
<td width ="5%" class="align-left">
<%=i%>
<%=i%>
</td>
<td width ="30%" class="align-center">
<%= order.requested_time.utc.getlocal.strftime("%I:%M %p") %>
@@ -38,7 +38,7 @@
<%=order.grand_total%>
</td>
<td width ="30%" class="align-center">
<span class="font-10 col-blue"><%=order.status%></span>
<span class="font-10 col-blue"><%= order.status %></span>
</td>
</tr>
<%i+=1%>
@@ -59,9 +59,9 @@
<% i=1
@order.each do |order| %>
<% if order.status == 'accepted' %>
<tr class="custom-tr " style="" data-id="<%=order.order_reservation_id%>">
<tr class="custom-tr second-<%=i%>" style="" data-id="<%=order.order_reservation_id%>" data-sr-no="<%= i %>">
<td width ="5%" class="align-left">
<%=i%>
<%=i%>
</td>
<td width ="30%" class="align-center">
<%= order.requested_time.utc.getlocal.strftime("%I:%M %p") %>
@@ -89,8 +89,8 @@
<tbody>
<% i=1
@order.each do |order| %>
<% if order.status == 'processed' %>
<tr class="custom-tr" style="" data-id="<%=order.order_reservation_id%>">
<% if order.status == 'send_to_kitchen' %>
<tr class="custom-tr third-<%=i%>" style="" data-id="<%=order.order_reservation_id%>" data-sr-no="<%= i %>">
<td width ="5%" class="align-left">
<%=i%>
</td>
@@ -113,15 +113,15 @@
</div>
</div>
<!--- Panel 3 - Orders -->
<div class="tab-pane dining" id="delivery" role="tabpanel">
<div class="tab-pane dining" id="completed" role="tabpanel">
<div class="card-block font-13">
<div id="menu-slimscroll" data-height="50">
<table class="table table-stripe custom-table">
<tbody>
<% i=1
@order.each do |order| %>
<% if order.status == 'completed' %>
<tr class="custom-tr" style="" data-id="<%=order.order_reservation_id%>">
<% if order.status == 'ready_to_delivery' %>
<tr class="custom-tr fourth-<%=i%>" style="" data-id="<%=order.order_reservation_id%>" data-sr-no="<%= i %>">
<td width ="5%" class="align-left">
<%=i%>
</td>
@@ -153,10 +153,10 @@
<table class="table">
<tr>
<td width ="70%" class="header-td align-left">
<b class="col-pink font-16">No.11</b>
<span class="font-13">(DELIVERY)</span>
<b class="col-pink font-16"><span id="sr_number"></span> </b>
<span class="font-13"><span id="delivery_info"></span></span>
</td>
<td width ="30%" class="header-td font-16 align-right"><b>0065 4321</b></td>
<td width ="30%" class="header-td font-16 align-right"><b><span id="contact_info">0065 4321</span></b></td>
</tr>
</table>
</div>
@@ -214,6 +214,9 @@
</td>
<td width ="30%" class="footer-td align-right col-blue" id="grand_total">0.00</td>
</tr>
<tr>
<td colspan="2" id="order_remark"></td>
</tr>
<tr>
<td width ="50%" class="footer-td align-left col-blue">
<button type="button" class="btn btn-lg bg-red waves-effect" id="cancel" data-value="cancel">
@@ -285,10 +288,10 @@
</div>
</div>
</div>
<p id="ref_no"></p>
<p id="callback_url"></p>
<p id="order_id"></p>
<p id="status"></p>
<p id="ref_no" class="hidden"></p>
<p id="callback_url" class="hidden"></p>
<p id="order_id" class="hidden"></p>
<p id="status" class="hidden"></p>
<script type="text/javascript">
jQuery(function(){
jQuery('.first-1').click();

View File

@@ -14,6 +14,8 @@
<div class="card m-l-10 m-t-10" style="padding:0px 20px;">
<div class="rebate-form">
<input type="hidden" name="receipt_no" id="receipt_no" value="<%= @receipt_no%>">
<p class="hidden" name="sale_id" id="sale_id" ><%=@sale_id %></p>
<p class="hidden" name="membership_id" id="membership_id" ><%=@membership_id %></p>
<div class="row">
<div class="form-group col-lg-12 col-md-12 col-sm-12">
<label class="">You can pay up to </label>
@@ -204,7 +206,7 @@
$.ajax({
type: "POST",
url: "<%=origami_payment_paymal_path%>",
data: {payment_amount:payment_amount,membership_id:membership_id,sale_id:sale_id,transaction_ref:""},
data: {payment_amount:payment_amount,membership_id:membership_id,sale_id:sale_id,transaction_ref:"",account_no:0},
success: function(result){
if(result.status == true){
swal({
@@ -237,6 +239,7 @@
var cardNo = "";
var sale_id = $("#sale_id").text() || 0;
var receipt_no = $("#receipt_no").val() || "";
var customer_mamber_card_no = 0;
var payment_amount = parseFloat($("#used_amount").text());
@@ -246,8 +249,10 @@
getCardNo();
$("#sxModal").hide();
customer_mamber_card_no = $("#paypar_account_no").val();
if(sale_id != 0 && customer_mamber_card_no != 0){
if (customer_mamber_card_no == 0) {
customer_mamber_card_no = $("#membership_id").text() || 0;
}
if(sale_id != 0 && customer_mamber_card_no !=0){
$.ajax({
type: "POST",
url: "/origami/"+sale_id+"/send_account" ,
@@ -261,7 +266,7 @@
$.ajax({
type: "POST",
url: "<%=origami_payment_paymal_path%>",
data: {payment_amount:payment_amount,membership_id:0,sale_id:sale_id,transaction_ref:data.transaction_ref},
data: {payment_amount:payment_amount,membership_id:0,sale_id:sale_id,transaction_ref:data.transaction_ref,account_no:customer_mamber_card_no},
success: function(result){
if(result.status == true){
swal({
@@ -296,8 +301,10 @@
}
});
}else{
swal("Opp","Please Check Member","warning")
}
},100);
},100);
});
// Read NFC card no from java
@@ -321,6 +328,7 @@
var payment_amount = parseFloat($("#used_amount").text());
setTimeout(function(){
code=getQRCode();
alert(code)
if(sale_id != 0 && code != ""){
$.ajax({
type: "POST",
@@ -335,8 +343,9 @@
$.ajax({
type: "POST",
url: "<%=origami_payment_paymal_path%>",
data: {payment_amount:payment_amount,membership_id:0,sale_id:sale_id,transaction_ref:data.transaction_ref},
data: {payment_amount:payment_amount,membership_id:0,sale_id:sale_id,transaction_ref:data.transaction_ref,account_no:code},
success: function(result){
alert(result)
if(result.status == true){
swal({
title: "Information!",

View File

@@ -168,15 +168,15 @@
<div class="col-md-4" id="credit"><%= number_with_precision(@credit, precision: precision.to_i ) rescue number_with_precision(0, precision: precision.to_i ) %></div>
</div>
<% 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 %>
<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"><%= number_with_precision(@other, precision: precision.to_i) rescue number_with_precision(0, precision: precision.to_i) %></div>
</div>
<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"><%= number_with_precision(@other, precision: precision.to_i) rescue number_with_precision(0, precision: precision.to_i) %></div>
</div>
<% else %>
<div class="row payment other-payment-color" id="card_payment" >
<div class="col-md-8">Other Payments</div>
<div class="col-md-4" id=""><%= number_with_precision(@other_payment, precision: precision.to_i) rescue number_with_precision(0, precision: precision.to_i) %></div>
</div>
<div class="row payment other-payment-color" id="card_payment" >
<div class="col-md-8">Other Payments</div>
<div class="col-md-4" id=""><%= number_with_precision(@other_payment, precision: precision.to_i) rescue number_with_precision(0, precision: precision.to_i) %></div>
</div>
<% end %>
</div>
<div class="card-block">
@@ -269,12 +269,11 @@
<div class="col-md-4" id="paymalcount"><%= number_with_precision(0, precision: precision.to_i ) %></div>
<% end %>
</div>
<!-- DINGA -->
<div class="row <%= @dingacount!=0.0 ? 'payment others-color' : 'hidden'%>">
<div class="col-md-5"></div>
<div class="col-md-3">DINGA</div>
<% if @paymalcount != 0.0 %>
<% if @dingacount != 0.0 %>
<div class="col-md-4 master is_card" id="dingacount"><%= number_with_precision(@dingacount, precision: precision.to_i ) rescue number_with_precision(0, precision: precision.to_i ) %></div>
<% else %>
<div class="col-md-4" id="dingacount"><%= number_with_precision(0, precision: precision.to_i ) %></div>
@@ -635,6 +634,8 @@ var customer_name = "<%= @customer.name %>";
if (credit <= 0) {
calculate_member_discount(sale_id);
}
$("#pdfModal").modal({show : true, backdrop : false, keyboard : false});
$.ajax({type: "POST",
url: "<%= origami_payment_cash_path %>",
@@ -655,13 +656,14 @@ var customer_name = "<%= @customer.name %>";
var msg = '';
}
$("#loading_wrapper" ).hide();
$("#loading_wrapper" ).hide();
//PDF lightbox data
var pdfPath = "/en/pdfjs/minimal?file=" + result.filename.substring(6);
$("#sale_receipt_no").val(result.receipt_no);
$("#filename").val(result.filename);
$("#printer_name").val(result.printer_name);
$("#receipt_pdf").attr("src", result.filename.substring(6));
$("#receipt_pdf").attr("src", pdfPath);
$("#pdfModal").modal({show : true, backdrop : false, keyboard : false});
$("#pdfModalLabel").text("Sale Completed");
$("#changed_amount").text("");