Merge branch 'adminbsb_ui_changes' of bitbucket.org:code2lab/sxrestaurant

This commit is contained in:
phyusin
2018-03-14 09:16:14 +06:30
110 changed files with 1354 additions and 786 deletions

View File

@@ -90,6 +90,21 @@
<label><%= t("views.right_panel.detail.date_of_birth") %></label>
<%= f.text_field :date_of_birth, :value=>"01-01-1990",:class=>"datepicker form-control col-md-12"%>
</div>
<div class="form-group">
<label><%= t("views.right_panel.detail.customer_photo") %></label>
<div class="panel padding-10">
<div class="menu-item-img">
<% if f.object.image_path? %>
<p><%= f.object.name %></p>
<%= image_tag f.object.image_path.url, :class => "img-thumbnail" %>
<% else %>
<%= image_tag "/image/menu_images/default.png", :class => "img-thumbnail" %>
<% end %>
</div>
<%= f.file_field :image_path, :class => "img-thumbnail" %>
</div>
</div>
<div class="form-group">
<label><%= t("views.right_panel.detail.select_customer_type") %></label>
@@ -164,6 +179,7 @@
</div>
</div>
<script type="text/javascript">
$(function() {
// Read Card Reader
$("#paypar_account_no").on('focus', function(e){

View File

@@ -164,8 +164,8 @@
<td align="right"><%= @summ_sale.total_receipt %></td>
</tr>
<tr>
<td><%= t("views.right_panel.detail.net") %> <%= t :sale %> : </td>
<td align="right"><%= number_with_precision( @summ_sale.total_amount, precision: precision.to_i ,delimiter: delimiter) rescue number_with_precision(0, precision: precision.to_i ,delimiter: delimiter) %></td>
<td><%= t("views.right_panel.detail.sale") %> <%= t :revenue %> : </td>
<td align="right"><%= number_with_precision( @summ_sale.total_amount, precision: precision.to_i ,delimiter: delimiter) %></td>
</tr>
<tr>
<td><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.discount") %> : </td>
@@ -176,8 +176,8 @@
<td align="right"><%= number_with_precision( @summ_sale.total_tax , precision: precision.to_i ,delimiter: delimiter) rescue number_with_precision(0, precision: precision.to_i ,delimiter: delimiter) %></td>
</tr>
<tr>
<td><%= t("views.right_panel.detail.gross_sale") %> : </td>
<td align="right"><%= number_with_precision( @summ_sale.grand_total , precision: precision.to_i ,delimiter: delimiter) rescue number_with_precision(0, precision: precision.to_i ,delimiter: delimiter) %></td>
<td><%= t("views.right_panel.detail.total_sale") %> : </td>
<td align="right"><%= number_with_precision( @summ_sale.grand_total , precision: precision.to_i ,delimiter: delimiter)%></td>
</tr>
</table>
<table class="table">
@@ -186,7 +186,11 @@
<% if !@sale_data[0].empty? %>
<% if payment.payment_method != 'mpu' && payment.payment_method != 'visa' && payment.payment_method != 'master' && payment.payment_method != 'jcb' && payment.payment_method != 'unionpay' %>
<tr>
<td><%= payment.payment_method.to_s.capitalize %> Sale : </td>
<% if payment.payment_method == 'paypar' %>
<td>Redeem Sale : </td>
<% else %>
<td><%= payment.payment_method.to_s.capitalize %> Sale : </td>
<% end %>
<td align="right">
<% @sale_data.each do |data| %>
<% pay_mth = payment.payment_method %>
@@ -201,7 +205,7 @@
<% total_card = @sale_data.select { |hash| hash["card"]!=nil }.first %>
<% if !total_card.nil? %>
<tr>
<td><%= t("views.right_panel.detail.card_sale") %> : </td>
<td><%= t("views.right_panel.detail.other_payment") %> : </td>
<td align="right">
<%= number_with_precision(total_card["card"], precision: precision.to_i ,delimiter: delimiter) rescue number_with_precision(0, precision: precision.to_i ,delimiter: delimiter) %>
</td>
@@ -215,8 +219,8 @@
</div>
<% if current_user.role == 'administrator' || current_user.role == 'manager' %>
</div>
<% end %>
<% end %>
<% end %>
<% end %>
<% if current_user.role == 'administrator' || current_user.role == 'manager' %>
<div class="row">

View File

@@ -27,6 +27,11 @@
<img src="<%= asset_path('SX-Logo-small.png') %>" width="40" height="40" alt="Logo" />
<span class="navbar-brand-txt">SX Restaurant</span>
</a>
<% if @payment_method_setting_nav.present? %>
<span class="navbar-brand m-0">/ &nbsp;
<span id="otherPayment"></span>&nbsp; Payment
</span>
<% end %>
</div>
<!-- Start Shop Info -->
@@ -78,6 +83,11 @@
</nav>
<script type="text/javascript">
if((document.getElementById("otherPayment")!=undefined) && (document.getElementById("otherPayment")!=null) && (document.getElementById("otherPayment")!="")){
var otherPayment = location.href.split('/')[location.href.split('/').length -1 ];
document.getElementById("otherPayment").innerHTML = otherPayment;
}
$(function(){
$('.delete').click(function(){
var method = $(this).attr('data-method');

View File

@@ -57,119 +57,180 @@
<!-- #END# Page Loader -->
<div class="container">
<div class="row">
<div class="col-lg-12_ col-md-12 col-sm-12 col-xs-12 text-center">
<div class="row">
<div class="col-lg-12_ col-md-12 col-sm-12 col-xs-12 text-center">
<img src="/image/SX-logo.png" width="150px" height="150px">
<p>
<small>Version - 1.0.1</small>
</p>
</div>
</div>
<div class="row bg-white">
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 p-t-20 p-l-10 p-r-10 p-b-50 bg-white">
<p>
<small>Version - 1.0.1</small>
</p>
</div>
</div>
<div class="row bg-white">
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6 p-t-20 p-l-10 p-r-10 p-b-50 bg-white">
<div class="row justify-content-center form-group">
<input type="text" class="form-control col-4" id="emp_id" placeholder="Employee ID">
</div>
<input type="text" class="form-control col-4" id="emp_id" placeholder="Employee ID">
</div>
<div class="row">
<div class="col-1 col-black">
<span>Supervisor</span>
<br>
<div class="card padding-10">
<div class="card-content">
<div class='col-md-12'>
<div class='row bottom'>
<div class="pin_pad " data-value="1">1</div>
<div class="pin_pad left" data-value="2">2</div>
<div class="pin_pad left" data-value="3">3</div>
</div>
<div class="col-11">
<hr />
<div class='row bottom'>
<div class="pin_pad" data-value="4">4</div>
<div class="pin_pad left" data-value="5">5</div>
<div class="pin_pad left" data-value="6">6</div>
</div>
</div>
<div class='row bottom'>
<div class="pin_pad" data-value="7">7</div>
<div class="pin_pad left" data-value="8">8</div>
<div class="pin_pad left" data-value="9">9</div>
</div>
<div class='row bottom'>
<!-- <div class="pin_pad bg-grey" data-value="CLR">CLR</div>
<div class="pin_pad left" data-value="0">0</div>
<div class="pin_pad left bg-indigo" data-value="ENT">ENT</div> -->
<div class="pin_pad bg-blue-grey" data-value="BAC">BACK</div>
<div class="pin_pad left" data-value="0">0</div>
<div class="pin_pad bg-grey left" data-value="CLR">CLR</div>
</div>
</div>
</div>
</div>
<div class="row m-b-15">
</div>
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6 p-t-20 p-l-10 p-r-10 p-b-50 bg-white">
<ul class="nav nav-tabs" role="tablist">
<% @employees.each do |employee| %>
<%if employee.role == "manager" %>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#manager" role="tab"><b>Manager</b></a>
<% break %>
</li>
<% end %>
<% end %>
<% @employees.each do |employee| %>
<%if employee.role == "supervisor" %>
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 empBtn" data-formid="#form_<%= employee.emp_id %>" >
<form id="form_<%= employee.emp_id %>" action="<%= emp_login_path(employee.emp_id) %>" method="PATCH">
</form>
<div class="card emp-body">
<div class="body bg-teal">
<%= employee.name%>
</div>
</div>
</div>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#supervisor" role="tab"><b>Supervisor</b></a>
<% break %>
</li>
<% end %>
<% end %>
</div>
<div class="row">
<div class="col-1 col-black">
<span>Cashier</span>
</div>
<div class="col-11">
<hr />
</div>
</div>
<div class="row m-b-15">
<% @employees.each do |employee| %>
<%if employee.role == "cashier" %>
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 empBtn" data-formid="#form_<%= employee.emp_id %>" >
<form id="form_<%= employee.emp_id %>" action="<%= emp_login_path(employee.emp_id) %>" method="PATCH">
</form>
<div class="card emp-body">
<div class="body bg-teal">
<%= employee.name%>
</div>
</div>
</div>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#cashier" role="tab"><b>Cashier</b></a>
<% break %>
</li>
<% end %>
<% end %>
</div>
<div class="row">
<div class="col-1 col-black">
<span>Accountant</span>
</div>
<div class="col-11">
<hr />
</div>
</div>
<div class="row m-b-15">
<% @employees.each do |employee| %>
<%if employee.role == "account" %>
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 empBtn" data-formid="#form_<%= employee.emp_id %>" >
<form id="form_<%= employee.emp_id %>" action="<%= emp_login_path(employee.emp_id) %>" method="PATCH">
</form>
<div class="card emp-body">
<div class="body bg-teal">
<%= employee.name%>
</div>
</div>
</div>
<% end %>
<% end %>
</div>
<%if employee.role == "account" %>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#account" role="tab"><b>Accountant</b></a>
<% break %>
</li>
<% end %>
<% end %>
<div class="row">
<div class="col-1 col-black">
<span>Waiter</span>
</div>
<div class="col-11">
<hr />
</div>
</div>
<div class="row m-b-15">
<% @employees.each do |employee| %>
<%if employee.role == "waiter" %>
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 empBtn" data-formid="#form_<%= employee.emp_id %>" >
<form id="form_<%= employee.emp_id %>" action="<%= emp_login_path(employee.emp_id) %>" method="PATCH">
</form>
<div class="card emp-body">
<div class="body bg-teal">
<%= employee.name%>
</div>
</div>
</div>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#waiter" role="tab"><b>Waiter</b></a>
<% break %>
</li>
<% end %>
<% end %>
</div>
</ul>
<div class="tab-content" style="max-height:650px; overflow:auto">
<div class="tab-pane" id="manager" role="tabpanel" style="max-height:; overflow:auto">
<% @employees.each do |employee| %>
<%if employee.role == "manager" %>
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4 empBtn" data-formid="#form_<%= employee.emp_id %>" style="float: left;">
<form id="form_<%= employee.emp_id %>" action="<%= emp_login_path(employee.emp_id) %>" method="PATCH">
</form>
<div class="login_dashboard p-card">
<i class="material-icons md-48" style="font-size: 100px;">person</i>
<div class="p-name"><b><%= employee.name%></b>
</div>
</div>
</div>
<% end %>
<% end %>
</div>
<div class="tab-pane" id="supervisor" role="tabpanel" style="max-height:; overflow:auto">
<% @employees.each do |employee| %>
<%if employee.role == "supervisor" %>
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4 empBtn" data-formid="#form_<%= employee.emp_id %>" style="float: left;">
<form id="form_<%= employee.emp_id %>" action="<%= emp_login_path(employee.emp_id) %>" method="PATCH">
</form>
<div class="login_dashboard p-card">
<i class="material-icons md-48" style="font-size: 100px;">person</i>
<div class="p-name"><b><%= employee.name%></b>
</div>
</div>
</div>
<% end %>
<% end %>
</div>
<div class="tab-pane" id="cashier" role="tabpanel" style="max-height:; overflow:auto">
<% @employees.each do |employee| %>
<%if employee.role == "cashier" %>
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4 empBtn" data-formid="#form_<%= employee.emp_id %>" style="float: left;">
<form id="form_<%= employee.emp_id %>" action="<%= emp_login_path(employee.emp_id) %>" method="PATCH">
</form>
<div class="login_dashboard p-card">
<i class="material-icons md-48" style="font-size: 100px;">person</i>
<div class="p-name"><b><%= employee.name%></b>
</div>
</div>
</div>
<% end %>
<% end %>
</div>
<div class="tab-pane" id="account" role="tabpanel" style="max-height:; overflow:auto">
<% @employees.each do |employee| %>
<%if employee.role == "account" %>
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4 empBtn" data-formid="#form_<%= employee.emp_id %>" style="float: left;">
<form id="form_<%= employee.emp_id %>" action="<%= emp_login_path(employee.emp_id) %>" method="PATCH">
</form>
<div class="login_dashboard p-card">
<i class="material-icons md-48" style="font-size: 100px;">person</i>
<div class="p-name"><b><%= employee.name%></b>
</div>
</div>
</div>
<% end %>
<% end %>
</div>
<div class="tab-pane" id="waiter" role="tabpanel" style="max-height:; overflow:auto">
<% @employees.each do |employee| %>
<%if employee.role == "waiter" %>
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4 empBtn" data-formid="#form_<%= employee.emp_id %>" style="float: left;">
<form id="form_<%= employee.emp_id %>" action="<%= emp_login_path(employee.emp_id) %>" method="PATCH">
</form>
<div class="login_dashboard p-card">
<i class="material-icons md-48" style="font-size: 100px;">person</i>
<div class="p-name"><b><%= employee.name%></b>
</div>
</div>
</div>
<% end %>
<% end %>
</div>
</div>
</div>
<!-- <div class="col-xs-12 col-sm-12 col-md-2 col-lg-2"> </div> -->
</div>
@@ -177,7 +238,9 @@
</body>
</html>
<script>
<script>
$(document).ready(function () {
// for Notificaiotn message
var placementFrom = $("#noti").attr('data-placement-from');
@@ -197,6 +260,36 @@
$(item).submit();
});
$('ul.nav.nav-tabs li a').click(function() {
var bb = $('.nav-item').children()[0];
$(bb).removeClass('active_tab');
$(this).parent().addClass('active_tab').siblings().removeClass('active_tab');
});
$("#emp_id").focus();
$(".pin_pad").click(function (event) {
event.preventDefault();
var value = $(this).data("value");
if (value == "CLR") {
$("#emp_id").val("");
} else if (value == "BAC") {
window.location.href = "/"
} else {
var old_value = $("#emp_id").val();
$("#emp_id").val(old_value + value);
}
if((old_value + value).length == 3){
if($.isNumeric(old_value + value)){
if((old_value + value).length === 3){
window.location.href = '/auth/'+(old_value + value);
}else{
alert("Please Enter Numeric Number");
}
}
}
});
$('#emp_id').keyup(function(e) {
e.preventDefault();
var txtVal = this.value;
@@ -212,6 +305,11 @@
}
});
var aa = $('.nav-item').children().attr('href').replace('#','');
$('#'+aa).addClass('active');
var bb = $('.nav-item').children()[0];
$(bb).parent().addClass('active_tab').siblings().removeClass('active_tab');
});
function showNotification(colorName, text, placementFrom, placementAlign, animateEnter, animateExit) {

View File

@@ -41,65 +41,69 @@
<% if !@summ_sale.nil? %>
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
<div class="card">
<div class="body">
<h6><%= t :sale %></h6>
<table class="table">
<tr>
<td><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.receipt") %> : </td>
<td align="right"><%= @summ_sale.total_receipt %></td>
</tr>
<tr>
<td><%= t("views.right_panel.detail.total") %> <%= t :sale %> : </td>
<td align="right"><%= number_with_precision( @summ_sale.total_amount, precision: precision.to_i ,delimiter: delimiter) %></td>
</tr>
<tr>
<td><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.discount") %> : </td>
<td align="right"><%= number_with_precision( @summ_sale.total_discount, precision: precision.to_i ,delimiter: delimiter) %></td>
</tr>
<tr>
<td><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.tax") %> : </td>
<td align="right"><%= number_with_precision( @summ_sale.total_tax , precision: precision.to_i ,delimiter: delimiter)%></td>
</tr>
<tr>
<td><%= t("views.right_panel.detail.grand_total") %> : </td>
<td align="right"><%= number_with_precision( @summ_sale.grand_total , precision: precision.to_i ,delimiter: delimiter)%></td>
</tr>
</table>
<table class="table">
<% if !(@total_payment_methods.nil?) %>
<% @total_payment_methods.each do |payment| %>
<% if !@sale_data[0].empty? %>
<% if payment.payment_method != 'mpu' && payment.payment_method != 'visa' && payment.payment_method != 'master' && payment.payment_method != 'jcb' %>
<tr>
<td><%= payment.payment_method.to_s.capitalize %> Sale : </td>
<td align="right">
<% @sale_data.each do |data| %>
<% pay_mth = payment.payment_method %>
<%= data[""+pay_mth+""] %>
<% end %>
</td>
</tr>
<% end %>
<% end %>
<% end %>
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
<div class="card">
<div class="body">
<h6><%= t :sale %></h6>
<table class="table">
<tr>
<td><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.receipt") %> : </td>
<td align="right"><%= @summ_sale.total_receipt %></td>
</tr>
<tr>
<td><%= t("views.right_panel.detail.sale") %> <%= t :revenue %> : </td>
<td align="right"><%= number_with_precision( @summ_sale.total_amount, precision: precision.to_i ,delimiter: delimiter) %></td>
</tr>
<tr>
<td><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.discount") %> : </td>
<td align="right"><%= number_with_precision( @summ_sale.total_discount, precision: precision.to_i ,delimiter: delimiter) %></td>
</tr>
<tr>
<td><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.tax") %> : </td>
<td align="right"><%= number_with_precision( @summ_sale.total_tax , precision: precision.to_i ,delimiter: delimiter)%></td>
</tr>
<tr>
<td><%= t("views.right_panel.detail.total") %> <%= t :sale %> : </td>
<td align="right"><%= number_with_precision( @summ_sale.grand_total , precision: precision.to_i ,delimiter: delimiter)%></td>
</tr>
</table>
<table class="table">
<% if !(@total_payment_methods.nil?) %>
<% @total_payment_methods.each do |payment| %>
<% if !@sale_data[0].empty? %>
<% if payment.payment_method != 'mpu' && payment.payment_method != 'visa' && payment.payment_method != 'master' && payment.payment_method != 'jcb' %>
<tr>
<% if payment.payment_method == 'paypar' %>
<td>Redeem Sale : </td>
<% else %>
<td><%= payment.payment_method.to_s.capitalize %> Sale : </td>
<% end %>
<td align="right">
<% @sale_data.each do |data| %>
<% pay_mth = payment.payment_method %>
<%= data[""+pay_mth+""] %>
<% end %>
</td>
</tr>
<% end %>
<% end %>
<% end %>
<% total_card = @sale_data.select { |hash| hash["card"]!=nil }.first %>
<% if !total_card.nil? %>
<tr>
<td><%= t("views.right_panel.detail.card_sale") %> : </td>
<td align="right">
<%= total_card["card"].to_f %>
</td>
</tr>
<% end %>
<% total_card = @sale_data.select { |hash| hash["card"]!=nil }.first %>
<% if !total_card.nil? %>
<tr>
<td><%= t("views.right_panel.detail.other_payment") %> : </td>
<td align="right">
<%= total_card["card"].to_f %>
</td>
</tr>
<% end %>
<% end %>
</table>
<% end %>
</table>
</div>
</div>
</div>
</div>
<% end %>
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
<div class="card">

View File

@@ -12,7 +12,6 @@
</span>
</ol>
</div> -->
<h5>JCB Payment</h5>
<div class="row">
<div class="col-lg-5 col-md-5 col-sm-3">
<span class="hidden" id="membership_id"><%= @membership_id%></span>
@@ -51,7 +50,8 @@
<div class="row">
<div class="form-group col-lg-12 col-md-12 col-sm-12">
<label>Reference Number</label>
<input type="text" name="valid_amount" id="valid_amount" class="form-control col-lg-7 col-md-7 col-sm-7" value="" data-value="<%=@sale_id %>" data-member-value="">
<input type="text" name="reference_no" id="reference_no" class="form-control col-lg-7 col-md-7 col-sm-7" value="" data-value="<%=@sale_id %>" data-member-value="">
<br><span id="reference_no_Err" style="color:red;"></span>
</div>
<hr>
</div>
@@ -194,53 +194,60 @@ $(document).on('click', '.cashier_number', function(event){
$('#jcb_pay').on('click',function(){
var amount = $('#amount').text();
var reference_no = $('#reference_no').val();
var sale_id = "<%= @sale_id %>";
var receipt_no = "<%= @receipt_no %>";
var bank_integration = "<%= @bank_integration %>";
if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){
$(this).off("click");
//start member discount 5% by pay card
// var sub_total = $('#sub-total').text();
// var member_id = $('#membership_id').text();
// var member_discount = $('#member_discount').text();
// if (member_id && member_discount) {
// $.ajax({
// type: "POST",
// url: "/origami/" + sale_id + "/member_discount",
// data: {'sale_id':sale_id, 'sub_total':sub_total,'is_card':true },
// success:function(result){
// }
// });
// }
//end member discount
if(bank_integration == '1'){
pay_withBank("SALE", "jcb", amount, sale_id, receipt_no,cashier_type);
$("#reference_no_Err").html("");
if(reference_no.length > 0){
if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){
$(this).off("click");
//start member discount 5% by pay card
// var sub_total = $('#sub-total').text();
// var member_id = $('#membership_id').text();
// var member_discount = $('#member_discount').text();
// if (member_id && member_discount) {
// $.ajax({
// type: "POST",
// url: "/origami/" + sale_id + "/member_discount",
// data: {'sale_id':sale_id, 'sub_total':sub_total,'is_card':true },
// success:function(result){
// }
// });
// }
//end member discount
if(bank_integration == '1'){
$("#reference_no").val("");
pay_withBank("SALE", "jcb", amount, sale_id, receipt_no);
}else{
$.ajax({type: "POST",
url: "<%= origami_payment_jcb_path %>",
data: "amount="+ amount + "&sale_id="+ sale_id,
success:function(result){
if(result){
swal({
title: "Information!",
text: "Payment Successfully",
html: true,
closeOnConfirm: false,
closeOnCancel: false,
allowOutsideClick: false
}, function () {
window.location.href = '/origami/sale/'+ sale_id + "/"+cashier_type+"/payment";
});
}
}
});
}
}else{
$.ajax({type: "POST",
url: "<%= origami_payment_jcb_path %>",
data: "amount="+ amount + "&sale_id="+ sale_id,
success:function(result){
if(result){
swal({
title: "Information!",
text: "Payment Successfully",
html: true,
closeOnConfirm: false,
closeOnCancel: false,
allowOutsideClick: false
}, function () {
window.location.href = '/origami/sale/'+ sale_id + "/"+cashier_type+"/payment";
});
}
}
});
if (amount>0) {
swal ( "Oops" , "Paid Amount is over!" , "error" );
}else{
swal ( "Oops" , "Enter Amount!" , "error" );
}
}
}else{
if (amount>0) {
swal ( "Oops" , "Paid Amount is over!" , "error" );
}else{
swal ( "Oops" , "Enter Amount!" , "error" );
}
$("#reference_no_Err").html("can't be blank");
}
})
</script>

View File

@@ -12,7 +12,6 @@
</span>
</ol>
</div> -->
<h5>Master Payment</h5>
<div class="row">
<div class="col-lg-5 col-md-5 col-sm-3">
<span class="hidden" id="membership_id"><%= @membership_id%></span>
@@ -52,7 +51,8 @@
<div class="row">
<div class="form-group col-lg-12 col-md-12 col-sm-12">
<label>Reference Number</label>
<input type="text" name="valid_amount" id="valid_amount" class="form-control col-lg-7 col-md-7 col-sm-7" value="" data-value="<%=@sale_id %>" data-member-value="">
<input type="text" name="reference_no" id="reference_no" class="form-control col-lg-7 col-md-7 col-sm-7" value="" data-value="<%=@sale_id %>" data-member-value="">
<br><span id="reference_no_Err" style="color:red;"></span>
</div>
<hr>
</div>
@@ -192,10 +192,14 @@
});
$('#master_pay').on('click',function(){
var amount = $('#amount').text();
var reference_no = $('#reference_no').val();
var sale_id = "<%= @sale_id %>";
var receipt_no = "<%= @receipt_no %>";
var bank_integration = "<%= @bank_integration %>";
if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){
$("#reference_no_Err").html("");
if(reference_no.length > 0){
if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){
$(this).off("click");
//start member discount 5% by pay card
// var sub_total = $('#sub-total').text();
@@ -214,31 +218,34 @@
if(bank_integration == '1'){
pay_withBank("SALE", "master", amount, sale_id, receipt_no,cashier_type);
}else{
$.ajax({type: "POST",
url: "<%= origami_payment_master_path %>",
data: "amount="+ amount + "&sale_id="+ sale_id,
success:function(result){
if(result){
swal({
title: "Information!",
text: "Payment Successfully",
html: true,
closeOnConfirm: false,
closeOnCancel: false,
allowOutsideClick: false
}, function () {
window.location.href = '/origami/sale/'+ sale_id + "/"+cashier_type+"/payment";
});
$.ajax({type: "POST",
url: "<%= origami_payment_master_path %>",
data: "amount="+ amount + "&sale_id="+ sale_id,
success:function(result){
if(result){
swal({
title: "Information!",
text: "Payment Successfully",
html: true,
closeOnConfirm: false,
closeOnCancel: false,
allowOutsideClick: false
}, function () {
window.location.href = '/origami/sale/'+ sale_id + "/"+cashier_type+"/payment";
});
}
}
}
});
});
}
}else{
if (amount>0) {
swal ( "Oops" , "Paid Amount is over!" , "error" );
}else{
swal ( "Oops" , "Enter Amount!" , "error" );
}
}
}else{
if (amount>0) {
swal ( "Oops" , "Paid Amount is over!" , "error" );
}else{
swal ( "Oops" , "Enter Amount!" , "error" );
}
$("#reference_no_Err").html("can't be blank");
}
})
</script>

View File

@@ -12,7 +12,6 @@
</span>
</ol>
</div> -->
<h5>MPU Payment</h5>
<div class="row">
<div class="col-lg-5 col-md-5 col-sm-5">
<span class="hidden" id="membership_id"><%= @membership_id%></span>
@@ -52,7 +51,8 @@
<div class="row">
<div class="form-group col-lg-12 col-md-12 col-sm-12">
<label>Reference Number</label>
<input type="text" name="valid_amount" id="valid_amount" class="form-control col-lg-7 col-md-7 col-sm-7" value="" data-value="<%=@sale_id %>" data-member-value="">
<input type="text" name="reference_no" id="reference_no" class="form-control col-lg-7 col-md-7 col-sm-7" value="" data-value="<%=@sale_id %>" data-member-value="">
<br><span id="reference_no_Err" style="color:red;"></span>
</div>
<hr>
</div>
@@ -197,26 +197,29 @@
$('#mpu_pay').on('click',function(){
var amount = $('#amount').text();
var reference_no = $('#reference_no').val();
var sale_id = "<%= @sale_id %>";
var receipt_no = "<%= @receipt_no %>";
var bank_integration = "<%= @bank_integration %>";
var cashier_type = "<%= @cashier_type %>";
if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){
$(this).off("click");
//start member discount 5% by pay card
// var sub_total = $('#sub-total').text();
// var member_id = $('#membership_id').text();
// var member_discount = $('#member_discount').text();
// if (member_id && member_discount) {
// $.ajax({
// type: "POST",
// url: "/origami/" + sale_id + "/member_discount",
// data: {'sale_id':sale_id, 'sub_total':sub_total,'is_card':true },
// success:function(result){
// }
// });
// }
//end member discount
$("#reference_no_Err").html("");
if(reference_no.length > 0){
if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){
$(this).off("click");
//start member discount 5% by pay card
// var sub_total = $('#sub-total').text();
// var member_id = $('#membership_id').text();
// var member_discount = $('#member_discount').text();
// if (member_id && member_discount) {
// $.ajax({
// type: "POST",
// url: "/origami/" + sale_id + "/member_discount",
// data: {'sale_id':sale_id, 'sub_total':sub_total,'is_card':true },
// success:function(result){
// }
// });
// }
//end member discount
if(bank_integration == '1'){
pay_withBank("SALE", "mpu", amount, sale_id, receipt_no,cashier_type);
}else{
@@ -241,12 +244,15 @@
}
}else{
if (amount>0) {
swal ( "Oops" , "Paid Amount is over!" , "error" );
}else{
swal ( "Oops" , "Enter Amount!" , "error" );
}
}
})
if (amount>0) {
swal ( "Oops" , "Paid Amount is over!" , "error" );
}else{
swal ( "Oops" , "Enter Amount!" , "error" );
}
}
}else{
$("#reference_no_Err").html("can't be blank");
}
})
</script>

View File

@@ -9,7 +9,6 @@
</span>
</ol>
</div> -->
<h5>Reedem Payment</h5>
<div class="row">
<div class="col-lg-5 col-md-5 col-sm-5">
<div class="card m-l-10 m-t-10" style="padding:0px 20px;">

View File

@@ -12,7 +12,6 @@
</span>
</ol>
</div> -->
<h5>UNIONPAY Payment</h5>
<div class="row">
<div class="col-lg-5 col-md-5 col-sm-5">
<span class="hidden" id="membership_id"><%= @membership_id%></span>
@@ -52,7 +51,8 @@
<div class="row">
<div class="form-group col-lg-12 col-md-12 col-sm-12">
<label>Reference Number</label>
<input type="text" name="valid_amount" id="valid_amount" class="form-control col-lg-7 col-md-7 col-sm-7" value="" data-value="<%=@sale_id %>" data-member-value="">
<input type="text" name="reference_no" id="reference_no" class="form-control col-lg-7 col-md-7 col-sm-7" value="" data-value="<%=@sale_id %>" data-member-value="">
<br><span id="reference_no_Err" style="color:red;"></span>
</div>
<hr>
</div>
@@ -196,10 +196,14 @@
});
$('#unionpay_pay').on('click',function(){
var amount = $('#amount').text();
var reference_no = $('#reference_no').val();
var sale_id = "<%= @sale_id %>";
var receipt_no = "<%= @receipt_no %>";
if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){
$(this).off("click");
$("#reference_no_Err").html("");
if(reference_no.length > 0){
if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){
$(this).off("click");
//start member discount 5% by pay card
// var sub_total = $('#sub-total').text();
// var member_id = $('#membership_id').text();
@@ -219,31 +223,34 @@
pay_withBank("SALE", "unionpay", amount, sale_id, receipt_no, cashier_type);
}
else{
$.ajax({type: "POST",
url: "<%= origami_payment_unionpay_path %>",
data: "amount="+ amount + "&sale_id="+ sale_id,
success:function(result){
if(result){
swal({
title: "Information!",
text: "Payment Successfully",
html: true,
closeOnConfirm: false,
closeOnCancel: false,
allowOutsideClick: false
}, function () {
window.location.href = '/origami/sale/'+ sale_id + "/"+cashier_type+"/payment";
});
$.ajax({type: "POST",
url: "<%= origami_payment_unionpay_path %>",
data: "amount="+ amount + "&sale_id="+ sale_id,
success:function(result){
if(result){
swal({
title: "Information!",
text: "Payment Successfully",
html: true,
closeOnConfirm: false,
closeOnCancel: false,
allowOutsideClick: false
}, function () {
window.location.href = '/origami/sale/'+ sale_id + "/"+cashier_type+"/payment";
});
}
}
}
});
});
}
}else{
if (amount>0) {
swal ( "Oops" , "Paid Amount is over!" , "error" );
}else{
swal ( "Oops" , "Enter Amount!" , "error" );
}
}
}else{
if (amount>0) {
swal ( "Oops" , "Paid Amount is over!" , "error" );
}else{
swal ( "Oops" , "Enter Amount!" , "error" );
}
$("#reference_no_Err").html("can't be blank");
}
})
</script>

View File

@@ -12,7 +12,6 @@
</span>
</ol>
</div> -->
<h5>VISA Payment</h5>
<div class="row">
<div class="col-lg-5 col-md-5 col-sm-5">
<span class="hidden" id="membership_id"><%= @membership_id%></span>
@@ -52,7 +51,8 @@
<div class="row">
<div class="form-group col-lg-12 col-md-12 col-sm-12">
<label>Reference Number</label>
<input type="text" name="valid_amount" id="valid_amount" class="form-control col-lg-7 col-md-7 col-sm-7" value="" data-value="<%=@sale_id %>" data-member-value="">
<input type="text" name="reference_no" id="reference_no" class="form-control col-lg-7 col-md-7 col-sm-7" value="" data-value="<%=@sale_id %>" data-member-value="">
<br><span id="reference_no_Err" style="color:red;"></span>
</div>
<hr>
</div>
@@ -195,11 +195,14 @@
});
$('#visa_pay').on('click',function(){
var amount = $('#amount').text();
var reference_no = $('#reference_no').val();
var sale_id = "<%= @sale_id %>";
var receipt_no = "<%= @receipt_no %>";
console.log(amount);
console.log($("#validamount").attr("value"));
if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){
$("#reference_no_Err").html("");
if(reference_no.length > 0){
if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){
$(this).off("click");
//start member discount 5% by pay card
// var sub_total = $('#sub-total').text();
@@ -236,15 +239,18 @@
window.location.href = '/origami/sale/'+ sale_id + "/"+cashier_type+"/payment";
});
}
}
});
}
});
}
}else{
if (amount>0) {
swal ( "Oops" , "Paid Amount is over!" , "error" );
}else{
swal ( "Oops" , "Enter Amount!" , "error" );
if (amount>0) {
swal ( "Oops" , "Paid Amount is over!" , "error" );
}else{
swal ( "Oops" , "Enter Amount!" , "error" );
}
}
}else{
$("#reference_no_Err").html("can't be blank");
}
})
});
</script>

View File

@@ -1,11 +1,27 @@
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-9 col-lg-9">
<div class="col-xs-12 col-sm-12 col-md-8 col-lg-8">
<div class="card">
<div class="body">
<%= simple_form_for([:settings, @commissioner]) do |f| %>
<%= f.error_notification %>
<div class="form-inputs">
<div class="form-group p-l-15">
<%= f.input :name %>
<label>Commissioner Image</label>
<div class="panel padding-10">
<div class="form-group">
<div class="menu-item-img">
<% if f.object.image_path? %>
<p><%= f.object.name %></p>
<%= image_tag f.object.image_path.url, :class => "img-thumbnail" %>
<% else %>
<%= image_tag "/image/menu_images/default.png", :class => "img-thumbnail" %>
<% end %>
</div>
<%= f.file_field :image_path, :class => "img-thumbnail" %>
</div>
</div>
<%= f.label :emp_id, 'Employee' %>
<%= f.collection_select :emp_id, Employee.all.order('name asc'), :id, :name, {prompt: 'Select an Employee'}, {class: "form-control"} %>
@@ -29,7 +45,7 @@
</div>
</div>
</div>
<div class="col-xs-12 col-sm-12 col-md-3 col-lg-3">
<div class="col-xs-12 col-sm-12 col-md-4 col-lg-4">
<div class="card">
<div class="body">
<h5><i class="material-icons md-18">view_headline <%= t("views.right_panel.header.page_detail") %></i></h5>

View File

@@ -33,6 +33,10 @@
<td style="width:20%"><%= t("views.right_panel.detail.name") %></td>
<td><%= @commissioner.name %></td>
</tr>
<tr>
<td style="width:20%"><%= t("views.right_panel.detail.commissioner_photo") %></td>
<td><%= image_tag @commissioner.image_path, :size => '200x200'%></td>
</tr>
<tr>
<td style="width:20%"><%= t("views.right_panel.detail.employee") %> <%= t("views.right_panel.detail.name") %></td>
<td><%= @commissioner.employee.name rescue '-' %></td>

View File

@@ -12,6 +12,22 @@
<%= f.input :password %>
</div>
<div class="form-inputs p-l-15">
<label>Employee Image</label>
<div class="panel padding-10">
<div class="form-group">
<div class="menu-item-img">
<% if f.object.image_path? %>
<p><%= f.object.name %></p>
<%= image_tag f.object.image_path.url, :class => "img-thumbnail" %>
<% else %>
<%= image_tag "/image/menu_images/default.png", :class => "img-thumbnail" %>
<% end %>
</div>
<%= f.file_field :image_path, :class => "img-thumbnail" %>
</div>
</div>
</div>
<div class="form-actions p-l-15">
<%= f.submit t('views.btn.submit'),:class => 'btn btn-primary btn-lg waves-effect' %>

View File

@@ -44,6 +44,10 @@
<th><%= t("views.right_panel.detail.updated_at") %></th>
<td><%= @employee.updated_at.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") %></td>
</tr>
<tr>
<th><%= t("views.right_panel.detail.employee_photo") %></th>
<td><%= image_tag @employee.image_path, :size => '200x200'%></td>
</tr>
<tr>
<th></th>
<td>

View File

@@ -12,7 +12,7 @@
<%= f.input :unit_price %>
<%= f.input :description %>
<%= f.input :information %>
<%= f.input:taxable %>
<%= f.input :taxable %>
</div>
<label>Product Image</label>

View File

@@ -1,68 +1,111 @@
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-8 col-lg-8">
<%= simple_form_for([:settings,@settings_shop]) do |f| %>
<%= f.error_notification %>
<div class="form-inputs p-l-10">
<%= f.input :name ,:input_html=>{:class=>"col-md-10"},:required=>true%>
<%= f.input :address %>
<%= f.input :city %>
<%= f.input :township %>
<%= f.input :state %>
<%= f.input :phone_no %>
<%= f.input :reservation_no %>
<%= f.input :license %>
<%= f.input :license_data %>
<%= f.input :base_currency %>
<%= f.input :cloud_token %>
<%= f.input :cloud_url %>
<%= f.input :owner_token %>
<%= f.input :id_prefix %>
<%= f.input :is_rounding_adj %>
<%= f.input :quick_sale_summary %>
<%= f.input :calc_tax_order %>
<%= f.input :show_account_info %>
<div class="card">
<div class="body">
<%= simple_form_for([:settings,@settings_shop], :html => { :multipart => true }) do |f| %>
<%= f.error_notification %>
<div class="form-group p-l-15">
<%= f.input :name ,:input_html=>{:class=>"col-md-10"},:required=>true%>
<%= f.input :address %>
<%= f.input :city %>
<%= f.input :township %>
<%= f.input :state %>
<%= f.input :phone_no %>
<%= f.input :reservation_no %>
<%= f.input :license %>
<%= f.input :license_data %>
<%= f.input :base_currency %>
<%= f.input :cloud_token %>
<%= f.input :cloud_url %>
<%= f.input :owner_token %>
<%= f.input :id_prefix %>
<%= f.input :is_rounding_adj %>
<%= f.input :quick_sale_summary %>
<%= f.input :calc_tax_order %>
<%= f.input :show_account_info %>
</div>
</div>
<div class="form-actions">
<%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %>
</div>
<% end %>
</div>
<div class="col-xs-12 col-sm-12 col-md-4 col-lg-4">
<div class="card">
<div class="body">
<h5><i class="material-icons md-18">view_headline <%= t("views.right_panel.header.page_detail") %></i></h5>
<p>
1) address - to write shop's address <br>
2) city - to write city <br>
3) township - to write township <br>
4) state - to write state <br>
5) phone_no - to write shop's phone_no <br>
6) reservation_no - to write shop's reservation_no <br>
7) license - to write license <br>
8) license_data - to write license data <br>
9) base_currency - to write base currency <br>
10)cloud_token - to write cloud token <br>
11)cloud_url - to write cloud url <br>
12)owner_token - to write shop's owner token <br>
13)id_prefix - to write id prefix <br>
14)is_rounding_adj - to check for calculate rounding adj of shop <br>
15)quick_sale_summary - to check for view Quick Sale Summary <br>
16)calc_tax_order - to check for tax calculation of shop <br>
</p>
<h5><i class="material-icons md-18">list <%= t("views.right_panel.header.button_lists") %></i> </h5>
<p>
1) <%= t("views.right_panel.button.submit") %> - <%= t("views.right_panel.detail.submit_btn_txt") %> <%= t("views.right_panel.detail.shop_txt") %> <br>
</p>
<h5><i class="material-icons md-18">list <%= t("views.right_panel.header.link_lists") %></i> </h5>
<p>
1) <%= t("views.right_panel.button.home") %> - <%= t("views.right_panel.detail.home_txt") %> <br>
2) <%= t("views.right_panel.button.back") %> - <%= t("views.right_panel.detail.back_txt") %> <%= t("views.right_panel.detail.shop_txt") %> <br>
</p>
<label>Shop Logo</label>
<div class="panel padding-10">
<div class="form-group">
<div class="menu-item-img">
<% if f.object.logo? %>
<p><%= f.object.name %></p>
<%= image_tag f.object.logo.url, :class => "img-thumbnail" %>
<% else %>
<%= image_tag "/image/menu_images/default.png", :class => "img-thumbnail" %>
<% end %>
</div>
<%= f.file_field :logo, :class => "img-thumbnail" %>
</div>
</div>
<label>Shop Images</label>
<div class="panel padding-10">
<div class="form-group">
<div class="menu-item-img">
<%= f.fields_for :display_images do |p| %>
<div class="field">
<%= p.label :image %><br>
<%= image_tag p.object.image, :class => "img-thumbnail" %>
<%= p.file_field :image, :multiple => true, name: "display_images[image][]" %>
<%= link_to "Destroy", settings_shop_display_image_path(p.object), method: :delete %>
</div>
<% end %>
</div>
</div>
</div>
<!-- <%= f.fields_for :display_images do |p| %>
<div class="field">
<%= p.label :image %><br>
<%= p.file_field :image, :multiple => true, name: "display_images[image][]" %>
</div>
<% end %> -->
<div class="form-actions p-l-15">
<%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %>
</div>
<% end %>
</div>
</div>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-12 col-md-4 col-lg-4">
<div class="card">
<div class="body">
<h5><i class="material-icons md-18">view_headline <%= t("views.right_panel.header.page_detail") %></i></h5>
<p>
1) address - to write shop's address <br>
2) city - to write city <br>
3) township - to write township <br>
4) state - to write state <br>
5) phone_no - to write shop's phone_no <br>
6) reservation_no - to write shop's reservation_no <br>
7) license - to write license <br>
8) license_data - to write license data <br>
9) base_currency - to write base currency <br>
10)cloud_token - to write cloud token <br>
11)cloud_url - to write cloud url <br>
12)owner_token - to write shop's owner token <br>
13)id_prefix - to write id prefix <br>
14)is_rounding_adj - to check for calculate rounding adj of shop <br>
15)quick_sale_summary - to check for view Quick Sale Summary <br>
16)calc_tax_order - to check for tax calculation of shop <br>
</p>
<h5><i class="material-icons md-18">list <%= t("views.right_panel.header.button_lists") %></i> </h5>
<p>
1) <%= t("views.right_panel.button.submit") %> - <%= t("views.right_panel.detail.submit_btn_txt") %> <%= t("views.right_panel.detail.shop_txt") %> <br>
</p>
<h5><i class="material-icons md-18">list <%= t("views.right_panel.header.link_lists") %></i> </h5>
<p>
1) <%= t("views.right_panel.button.home") %> - <%= t("views.right_panel.detail.home_txt") %> <br>
2) <%= t("views.right_panel.button.back") %> - <%= t("views.right_panel.detail.back_txt") %> <%= t("views.right_panel.detail.shop_txt") %> <br>
</p>
</div>
</div>
</div>
</div>

View File

@@ -96,8 +96,18 @@
<td><%= @settings_shop.calc_tax_order %></td>
</tr>
<tr>
<td style="width:20%">Shop Image</td>
<td><%= image_tag @settings_shop.logo, :size => '200x200'%></td>
</tr>
<tr>
<td style="width:20%">Shop Images</td>
<td>
<% @display_images.each do |p| %>
<%= image_tag p.image , :size => '200x200'%><br>
<% end %>
</td>
</tr>
<tr>
<td><%= link_to t("views.btn.edit"), edit_settings_shop_path(@settings_shop),:class => 'btn btn-primary btn-sm waves-effect' %>
</td>
</tr>