Merge branch 'r-1902001-01' into foodcourt

This commit is contained in:
Thein Lin Kyaw
2020-09-10 10:31:07 +06:30
184 changed files with 2672 additions and 1021 deletions

View File

@@ -57,7 +57,7 @@
<div class="col-sm-12 col-md-12 col-lg-12">
<%= f.input :name, :class => "form-control name", :required => true %>
<% flash.each do |test, msg| %>
<%
<%
str="[\"#{msg['name']}\"]"
str.gsub!('["', '')
str.gsub!('"]', '') %>
@@ -94,7 +94,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>
<div class="tab-pane" role="tabpanel" id="complete">
@@ -107,12 +107,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">
@@ -160,7 +160,7 @@
<option value="<%= ct.value %>">
<%= ct.name %></option>
<%end %>
</select>
</select>
</div>
</div>
@@ -185,7 +185,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>
@@ -201,7 +201,7 @@
<option value="<%= member.value %>">
<%= member.name %></option>
<%end %>
</select>
</select>
</div>
</div>
<div class="form-group">
@@ -212,7 +212,7 @@
<button type="submit" class="btn btn-primary" id="submit_customer"><%= t("views.btn.submit") %></button>
<button type="submit" class="btn btn-info" disabled id="update_customer"><%= t("views.btn.update") %></button>
<button type="button" class="btn btn-danger" id="reset"><%= t("views.btn.reset") %></button>
</div>
</div>
</div>
</div>
<div class="clearfix"></div>
@@ -259,13 +259,10 @@
console.log(paypar_account_no);
// Read Card Reader
$("#paypar_account_no").on('focus', function(e){
$("#paypar_account_no").on('focus', function(e){
if($(this).val() == ''){
$("#sxModal").show();
setTimeout(function(){
getCardNo();
$("#sxModal").hide();
},100);
getCardNo();
}
});
@@ -289,6 +286,7 @@
$("#paypar_account_no").val(cardNo);
$("#search").val(cardNo);
$("#type").val("card");
$("#filter_form").submit();
}else{
if($.inArray(cardNo, paypar_account_no) !== -1){
swal({
@@ -311,9 +309,10 @@
$("#sxModal").hide();
//$("#filter_form").submit();
}
$("#sxModal").hide();
}
$("#sxModal .btn_cancel").on('click',function(){
$("#sxModal").hide();
});
</script>
</script>

View File

@@ -1,9 +1,9 @@
<!-- <div class="page-header">
<ul class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item active"><%= t :crm %></li> -->
<!-- <li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li> -->
<!-- <li class="breadcrumb-item"><a href="<%= root_path %>">Home</a></li> -->
<!-- <span class="float-right">
<%= link_to 'Back', dashboard_path %>
</span>
@@ -161,24 +161,19 @@
$(document).ready(function () {
$("#oqs_loading_wrapper").show();
localStorage.setItem("member_card",false);
/*$('.datepicker').datepicker({
format : 'dd-mm-yyyy',
autoclose: true
});
$('.datepicker').attr('ReadOnly','true');
$('.datepicker').css('cursor','pointer');*/
// Read Card Reader
$("#member_acc_no").on('click', function(e){
localStorage.setItem("member_card",true);
var cardNo = "";
$("#sxModal").show();
<<<<<<< HEAD
setTimeout(function(){
getCardNo();
},100);
=======
getCardNo();
>>>>>>> r-1902001-01
});
// QR Code Reader
$("#qr_code").on('click', function(e){
var code = "";
@@ -238,88 +233,85 @@
/*customer UI tab btn*/
$(document).on('click',".customer_tr",function(){
// if(this.checked){
$(this).closest('tr').find('.checkbox_check').prop( "checked", true );
//$( "#checkbox_check" ).prop( "checked", true );
var sale_id = $("#sale_id").val() || 0;
var customer_id = $(this).attr('data-ref');
// if(this.checked){
$(this).closest('tr').find('.checkbox_check').prop( "checked", true );
//$( "#checkbox_check" ).prop( "checked", true );
var sale_id = $("#sale_id").val() || 0;
var customer_id = $(this).attr('data-ref');
if(sale_id != 0){
// var url = "/"+customer_id;
update_sale(customer_id,sale_id);
}else{
if(sale_id != 0){
// var url = "/"+customer_id;
update_sale(customer_id,sale_id);
}else{
var url = "customers/" + customer_id + "/edit";
}
var url = "customers/" + customer_id + "/edit";
}
$("#customer_tax_profiles").children().removeAttr("selected").css({'color':'#000','background':'none'});
$("#customer_tax_profiles").children().removeAttr("selected").css({'color':'#000','background':'none'});
$.ajax({
type: "GET",
url: url,
data: {},
dataType: "json",
success: function(data) {
// Selected for 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").css({'color':'#fff','background':'#215d9c'});
});
$.ajax({
type: "GET",
url: url,
data: {},
dataType: "json",
success: function(data) {
// Selected for 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").css({'color':'#fff','background':'#215d9c'});
});
$('#customer_id').val(data.id);
$('#customer_name').val(data.name);
$('#customer_company').val(data.company);
$('#customer_contact_no').val(data.contact_no);
$('#customer_email').val(data.email);
$('#customer_salutation').val(data.salutation);
$('#customer_nrc_no').val(data.nrc_no);
$('#customer_card_no').val(data.card_no);
$('#customer_type').val(data.customer_type);
$('#paypar_account_no').val(data.paypar_account_no);
$('#customer_address').val(data.address);
$('#customer_date_of_birth').val(data.date_of_birth);
if(data.image_path.url!=undefined && data.image_path.url!=null){
$('.menu-item-img .img-thumbnail').attr('src',data.image_path.url);
}
$('#customer_membership_type').val(data.membership_type);
$('.selectpicker > option[value="'+data.membership_type+'"]').attr('selected','selected');
if (data.gender == 'Male') {
$('.male').prop( "checked", true )
}else{
$('.female').prop( "checked", true )
}
$('#customer_id').val(data.id);
$('#customer_name').val(data.name);
$('#customer_company').val(data.company);
$('#customer_contact_no').val(data.contact_no);
$('#customer_email').val(data.email);
$('#customer_salutation').val(data.salutation);
$('#customer_nrc_no').val(data.nrc_no);
$('#customer_card_no').val(data.card_no);
$('#customer_type').val(data.customer_type);
$('#paypar_account_no').val(data.paypar_account_no);
$('#customer_address').val(data.address);
$('#customer_date_of_birth').val(data.date_of_birth);
if(data.image_path.url!=undefined && data.image_path.url!=null){
$('.menu-item-img .img-thumbnail').attr('src',data.image_path.url);
}
$('#customer_membership_type').val(data.membership_type);
$('.selectpicker > option[value="'+data.membership_type+'"]').attr('selected','selected');
if (data.gender == 'Male') {
$('.male').prop( "checked", true )
}else{
$('.female').prop( "checked", true )
}
if(data.salutation == 'Mr') {
$('.mr').prop( "checked", true )
}else if(data.salutation == 'Miss') {
$('.miss').prop( "checked", true )
}else if(data.salutation == 'Mrs'){
$('.mrs').prop( "checked", true )
}else{
$('.mdm').prop( "checked", true )
}
if(data.salutation == 'Mr') {
$('.mr').prop( "checked", true )
}else if(data.salutation == 'Miss') {
$('.miss').prop( "checked", true )
}else if(data.salutation == 'Mrs'){
$('.mrs').prop( "checked", true )
}else{
$('.mdm').prop( "checked", true )
}
$('.membership_authentication_code').val(data.membership_authentication_code);
$('.membership_authentication_code').val(data.membership_authentication_code);
$('#update_customer').removeAttr('disabled').val('');
$('#update_customer').attr('value', 'Update');
$('#submit_customer').attr('disabled','disabled');
$('#update_customer').removeAttr('disabled').val('');
$('#update_customer').attr('value', 'Update');
$('#submit_customer').attr('disabled','disabled');
$("#new_customer").attr('class', 'simple_form edit_customer');
var id = "edit_customer_"+customer_id;
$("#new_customer").attr('id', id);
$("#new_customer").attr('class', 'simple_form edit_customer');
var id = "edit_customer_"+customer_id;
$("#new_customer").attr('id', id);
$(".edit_customer").attr('id', id);
$(".edit_customer").attr('action', '/crm/customers/' + $('#customer_id').val());
$(".edit_customer").attr('action', '/crm/customers/' + $('#customer_id').val());
$(".patch_method").html('<input type="hidden" name="_method" value="patch">');
//$(".edit_customer").attr('method', 'PATCH');
}
});
// }else{
// }
$(".edit_customer").attr('id', id);
$(".edit_customer").attr('action', '/crm/customers/' + $('#customer_id').val());
$(".edit_customer").attr('action', '/crm/customers/' + $('#customer_id').val());
$(".patch_method").html('<input type="hidden" name="_method" value="patch">');
//$(".edit_customer").attr('method', 'PATCH');
}
});
})
function update_sale(customer_id,sale_id) {

View File

@@ -1,11 +1,21 @@
<% breadcrumb_add 'CRM', "", dashboard_path %>
<div class="container-fluid">
<div class="page-header">
<ul class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= root_path %>">Home</a></li>
<li class="breadcrumb-item active">CRM</li>
<!-- <li class="breadcrumb-item"><a href="<%= root_path %>">Home</a></li> -->
<span class="float-right">
<%= link_to 'Back', crm_customers_path %>
</span>
</ul>
</div>
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<!-- Column One -->
<!-- Nav tabs -->
<ul class="nav nav-tabs tab-nav-right" role="tablist">
<li role="presentation" class="active nav-item">
<a class="nav-link" data-toggle="tab" href="#customer" ><%= t :customer_details %></a>
</li>
@@ -60,10 +70,10 @@
<%else%>
<td>-</td>
<%end%>
</tr>
<tr><th colspan="9"></th></tr>
</tbody>
</table>
</div>
@@ -79,7 +89,7 @@
<!-- <th>Balance</th> -->
<th><%= t("views.right_panel.detail.status") %></th>
<th><%= t("views.right_panel.detail.from_account") %></th>
<th><%= t("views.right_panel.detail.receipt_no") %></th>
</tr>
</thead>
@@ -94,7 +104,7 @@
<td>(<%= transaction["withdraw"] %>)</td>
<% end %>
<td><%= transaction["status"] %></td>
<td><%= transaction["account_status"] %></td>
<td><%= transaction["account_status"] %></td>
<td><%= transaction["receipt_no"] %></td>
</tr>
<% end %>
@@ -126,7 +136,7 @@
<h5><%= t :order_details %></h5>
<div class="table-responsive">
<table class="table table-striped">
<table class="table table-striped">
<thead>
<tr>
<th><%= t("views.right_panel.detail.order_id") %></th>
@@ -150,13 +160,13 @@
</tbody>
</table>
</div>
</div>
<div class="tab-pane" id="sale" role="tabpanel" style="min-height:670px; max-height:670px; ">
<h5><%= t :sale_details %></h5>
<div class="table-responsive">
<table class="table table-striped">
<table class="table table-striped">
<thead>
<tr>
<th><%= t("views.right_panel.detail.sale_id") %></th>
@@ -195,19 +205,19 @@
<th colspan="4"><%= add_grand_total %></th>
</tr>
<% end %>
</tbody>
</table>
</div>
</div>
<div class="tab-pane" id="credit" role="tabpanel" style="min-height:670px; max-height:670px; ">
<h5><%= t :credit %> <%= t :details %></h5>
<table class="table table-responsive tbl_credit_lists">
<thead>
<th><%= t :credit %> <%= t :sale %> <%= t("views.right_panel.detail.date") %></th>
<th><%= t("views.right_panel.detail.receipt_no") %></th>
<th> <%= t :cashier %></th>
<th> <%= t :cashier %></th>
<th> <%= t("views.right_panel.detail.credit_amount") %> </th>
</thead>
<tbody>
@@ -230,4 +240,3 @@
</div>
</div>