update seed generator and remove hard-coded customer id

This commit is contained in:
Thein Lin Kyaw
2019-12-20 10:35:31 +06:30
parent 92e467d512
commit d87ffee65b
32 changed files with 184 additions and 153 deletions

View File

@@ -267,11 +267,11 @@
</tr>
</table>
<% if type && modify_order%>
<input type="hidden" name="customer_id" id="customer_id" value="CUS-000000000001">
<input type="hidden" name="customer_id" id="customer_id" value="<%= walkin.customer_id %>">
<button type="button" class="btn btn-primary action-btn create col-md-11" id="create_pay_order" disabled="disabled" style="padding-top:15px !important;padding-bottom:15px !important;">Update Order & Pay</button>
<%elsif !modify_order && type%>
<input type="hidden" name="customer_id" id="customer_id" value="CUS-000000000001">
<input type="hidden" name="customer_id" id="customer_id" value="<%= walkin.customer_id %>">
<% if current_user.role != "waiter"%>
<% if @quick_service_only %>

View File

@@ -22,7 +22,7 @@
<div class="input-append col-md-7 form-group pull-left">
<input type="text" name="filter" style="margin-right:10px" id="search" placeholder="Search" class="form-control input-sm col-md-9">
<input type="hidden" name="type" id="type" value="">
<button type="submit" class="btn btn-primary btn-sm">Search</button>
<button type="submit" class="btn btn-primary btn-sm">Search</button>
</div>
<% end %>
<button id="member_acc_no" class="btn btn-success btn-sm"><span class="fa fa-credit-card"></span> Member Card</button> -->
@@ -72,7 +72,7 @@
</thead>
<tbody>
<% if @crm_customers.count > 0 %>
<% if @crm_customers.count > 0 %>
<% @i = 0 %>
<% @crm_customers.each do |crm_customer| %>
@@ -80,7 +80,7 @@
<td>
<input type="radio" style="width:20px;" name="checkbox" class="checkbox_check" ></td>
<td>
<% if crm_customer.customer_id != "CUS-000000000001" && crm_customer.customer_id != "CUS-000000000002" %>
<% if crm_customer.customer_id != "" && crm_customer.customer_id != "" %>
<%= @i += 1 %>
<%else%>
-
@@ -156,7 +156,7 @@
<%= simple_form_for @crm_customer,:url => crm_customers_path, :method => :post do |f| %>
<span class="patch_method"></span>
<%= f.error_notification %>
<%= f.hidden_field :id, :class => "form-control col-md-6 " %>
<%= f.hidden_field :id, :class => "form-control col-md-6 " %>
<div class="tab-content">
<div class="tab-pane active" role="tabpanel" id="step1">
<div class="form-group">
@@ -225,7 +225,7 @@
<div class="form-group">
<div class="col-sm-12 col-md-12 col-lg-12" align="right">
<button type="button" class="btn btn-md bg-blue btn-info-full next-step">Next</button>
</div>
</div>
</div>
</div> <!-- .end-of-step1 -->
<div class="tab-pane" role="tabpanel" id="complete">
@@ -238,12 +238,12 @@
<% if f.object.image_path? %>
<p><%= f.object.name %></p>
<%= image_tag f.object.image_path.url, :class => "img-thumbnail" %>
<% else %>
<% else %>
<%= image_tag "/image/menu_images/default.png", :class => "img-thumbnail" %>
<% end %>
<% end %>
</div>
<%= f.file_field :image_path, :class => "img-thumbnail" %>
</div>
</div>
</div>
</div>
<div class="form-group">
@@ -291,7 +291,7 @@
<option value="<%= ct.value %>">
<%= ct.name %></option>
<%end %>
</select>
</select>
</div>
</div>
@@ -316,7 +316,7 @@
<div class="form-group">
<div class="col-sm-12 col-md-12 col-lg-12">
<label class="control-label"><%= t("views.right_panel.detail.paypar_account_no") %>:</label>
<div class="-group">
<div class="-group">
<input type="text" class="form-control" id="paypar_account_no" name="customer[paypar_account_no]" readonly/>
<div class="input-group-addon"><span class="fa fa-credit-card"></span></div>
</div>
@@ -332,7 +332,7 @@
<option value="<%= member.value %>">
<%= member.name %></option>
<%end %>
</select>
</select>
</div>
</div>
<div class="form-group">
@@ -363,7 +363,7 @@
</div>
<script type="text/javascript">
var cashier_type = "<%= @cashier_type %>";
var page = "<%= @page %>";
var page = "<%= @page %>";
var paypar_account_no = [];
$(function() {
paypar_account_no = JSON.parse('<%= @paypar_accountno.to_json.html_safe %>', function (key, value) {
@@ -391,14 +391,14 @@
$('.datepicker').css('cursor','pointer');*/
// Read Card Reader
$("#paypar_account_no").on('focus', function(e){
if($(this).val() == ''){
$("#paypar_account_no").on('focus', function(e){
if($(this).val() == ''){
$("#sxModal").show();
setTimeout(function(){
getCardNo();
$("#sxModal").hide();
},100);
}
},100);
}
});
$(document).ready(function () {
@@ -406,20 +406,20 @@
});
// Read Card Reader
$("#member_acc_no").on('click', function(e){
$("#member_acc_no").on('click', function(e){
localStorage.setItem("member_card",true);
var cardNo = "";
var cardNo = "";
var customer_id = '';
var customer_name = '';
var sale_id = $("#sale_id").val() || 0;
var customer_mamber_card_no = 0;
$("#sxModal").show();
$("#sxModal").show();
setTimeout(function(){
getCardNo();
$("#sxModal").hide();
$("#sxModal").hide();
customer_mamber_card_no = $("#search").val();
if(sale_id != 0 && customer_mamber_card_no != 0){
if(sale_id != 0 && customer_mamber_card_no != 0){
$.ajax({
type: "POST",
url: "/origami/"+sale_id+"/get_customer" ,
@@ -442,7 +442,7 @@
}
}
});
});
}
},100);
});
@@ -450,12 +450,12 @@
/*new customer UI func:*/
//Initialize tooltips
$('.nav-tabs > li a[title]').tooltip();
//Wizard
$('a[data-toggle="tab"]').on('show.bs.tab', function (e) {
var $target = $(e.target);
if ($target.parent().hasClass('disabled')) {
return false;
}
@@ -522,21 +522,21 @@
}
// QR Code Reader
$("#qr_code").on('click', function(e){
var code = "";
$("#qr_code").on('click', function(e){
var code = "";
var customer_id = '';
var customer_name = '';
var sale_id = $("#sale_id").val() || 0;
var customer_mamber_card_no = 0;
setTimeout(function(){
code=getQRCode();
code=getQRCode();
setQRCode(code);
}, 100);
customer_mamber_card_no = $("#search").val();
if(sale_id != 0 && customer_mamber_card_no != 0){
if(sale_id != 0 && customer_mamber_card_no != 0){
$.ajax({
type: "POST",
url: "/origami/"+sale_id+"/get_customer" ,
@@ -558,8 +558,8 @@
update_sale(customer_id, customer_name,sale_id);
}
}
});
}
});
}
});
// Read qrcode from java
@@ -595,12 +595,12 @@
data: {},
dataType: "json",
success: function(data) {
var taxes = JSON.stringify(data.tax_profiles);
var parse_taxes = JSON.parse(taxes);
var taxes = JSON.stringify(data.tax_profiles);
var parse_taxes = JSON.parse(taxes);
$.each(parse_taxes, function(i, value){
$("#customer_tax_profiles option[value='" + value + "']").attr("selected","selected");
});
$('#customer_id').val(data.id);
$('#customer_name').val(data.name);
$('#customer_company').val(data.company);
@@ -701,7 +701,7 @@
location.reload();
}
}
});
});
});
}
@@ -724,9 +724,9 @@
window.location.href = '/origami/room/'+id;
}
}
}
});
$("#sxModal .btn_cancel").on('click',function(){
@@ -734,4 +734,3 @@
});
</script>

View File

@@ -1686,9 +1686,8 @@ $(document).ready(function(){
$("#customer_name").on("click",function(){
//start customer modal popup
if((cashier_type=='quick_service' || cashier_type=='food_court') && (customer_id!=undefined) && (customer_id!=null) && (customer_id!="")){
// if((customer_id == 'CUS-000000000001') && (customer_name == 'WALK-IN')){
$("#is_memberModal").modal({show : true, backdrop: false, keyboard : false});
// }
$("#is_memberModal").modal({show : true, backdrop: false, keyboard : false});
}
});