Merge branch 'r-1902001-01-dev' of gitlab.com:code2lab/SXRestaurant into r-1902001-01-dev
This commit is contained in:
11
README.md
11
README.md
@@ -82,6 +82,17 @@ For ReceiptBillA5Pdf
|
||||
For ReceiptBillAltName options
|
||||
1) settings/lookups => { type:print_settings, name:ReceiptBillAltName, value:1 }
|
||||
|
||||
For Using Star Printer
|
||||
*** Need to change these print settings
|
||||
1) settings/print_settings => OrderItemStarPdf
|
||||
2) settings/print_settings => ReceiptBillStarPdf
|
||||
3) settings/print_settings => SaleItemsStarPdf
|
||||
*** Other print settings aren't need to change.
|
||||
|
||||
For Sale Items Summary Include at CloseCashierPrint
|
||||
1) settings/print_settings
|
||||
a) Check => Shift Sale Items
|
||||
|
||||
For Bank Integration setting
|
||||
1) rake db:migrate for card_sale_trans, card_settle_trans
|
||||
2) settings/lookups => { type:bank_integration, name: Bank Integration, value:1 }
|
||||
|
||||
BIN
app/assets/images/online_order_icon.png
Normal file
BIN
app/assets/images/online_order_icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 376 B |
BIN
app/assets/images/user_icon.png
Normal file
BIN
app/assets/images/user_icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 819 B |
@@ -37,7 +37,7 @@ $(document).on('turbolinks:load', function() {
|
||||
// oqs_id = $(this).find(".oqs-id").text();
|
||||
$("#oqs_active").attr('data-id',$('.oqs_click').val());
|
||||
var url = 'oqs/get_items/'+$('.oqs_click').val();
|
||||
|
||||
|
||||
show_details(url,null);
|
||||
}
|
||||
|
||||
@@ -49,11 +49,11 @@ $(document).on('turbolinks:load', function() {
|
||||
$(".tables").on("click", function(){
|
||||
|
||||
active = $(this).hasClass('selected-table');
|
||||
if (active) {
|
||||
if (active) {
|
||||
$(this).removeClass('bg-blue');
|
||||
$(this).addClass('green');
|
||||
$(this).removeClass('selected-table');
|
||||
}else{
|
||||
}else{
|
||||
$(this).removeClass('green');
|
||||
$(this).addClass('bg-blue');
|
||||
$(this).addClass('selected-table');
|
||||
@@ -63,7 +63,7 @@ $(document).on('turbolinks:load', function() {
|
||||
var table_id =[];
|
||||
for (i = 0; i < list.length; i++) {
|
||||
table_id.push(list[i].value);
|
||||
}
|
||||
}
|
||||
console.log(table_id)
|
||||
$('#table').val(table_id);
|
||||
|
||||
@@ -75,7 +75,7 @@ $(document).on('turbolinks:load', function() {
|
||||
}else{
|
||||
var table = null
|
||||
}
|
||||
|
||||
|
||||
if (oqs_id > 0 || status != "All" || table != null) {
|
||||
$(".oqs_click").removeClass('oqs_active');
|
||||
$(".queue_station").removeClass('queue_station_box');
|
||||
@@ -86,7 +86,7 @@ $(document).on('turbolinks:load', function() {
|
||||
// oqs_id = $(this).find(".oqs-id").text();
|
||||
$("#oqs_active").attr('data-id',oqs_id);
|
||||
var url = 'oqs/get_items/'+oqs_id;
|
||||
|
||||
|
||||
show_details(url,table,status);
|
||||
}else{
|
||||
$("#completed").removeClass('hide')
|
||||
@@ -95,7 +95,7 @@ $(document).on('turbolinks:load', function() {
|
||||
});
|
||||
|
||||
// $(".oqs_click").on("click", function(){
|
||||
$(document).on('change', '.oqs_click', function(event){
|
||||
$(document).on('change', '.oqs_click', function(event){
|
||||
oqs_id = $(this).val();
|
||||
status = $("#status").val();
|
||||
var table_id = $('#table_id').val();
|
||||
@@ -104,7 +104,7 @@ $(document).on('turbolinks:load', function() {
|
||||
}else{
|
||||
var table = null
|
||||
}
|
||||
|
||||
|
||||
if (oqs_id > 0 || status != "All" || table_id != null) {
|
||||
$(".oqs_click").removeClass('oqs_active');
|
||||
$(".queue_station").removeClass('queue_station_box');
|
||||
@@ -115,7 +115,7 @@ $(document).on('turbolinks:load', function() {
|
||||
// oqs_id = $(this).find(".oqs-id").text();
|
||||
$("#oqs_active").attr('data-id',oqs_id);
|
||||
var url = 'oqs/get_items/'+oqs_id;
|
||||
|
||||
|
||||
show_details(url,table,status);
|
||||
}else{
|
||||
$("#completed").removeClass('hide')
|
||||
@@ -124,7 +124,7 @@ $(document).on('turbolinks:load', function() {
|
||||
}); //End Click
|
||||
|
||||
// $(".status_click").on("click", function(){
|
||||
$(document).on('change', '.status_click', function(event){
|
||||
$(document).on('change', '.status_click', function(event){
|
||||
oqs_id = $("#oqs_id").val();
|
||||
status = $(this).val();
|
||||
var table_id = $('#table_id').val();
|
||||
@@ -144,7 +144,7 @@ $(document).on('turbolinks:load', function() {
|
||||
// oqs_id = $(this).find(".oqs-id").text();
|
||||
$("#oqs_active").attr('data-id',oqs_id);
|
||||
var url = 'oqs/get_items/'+oqs_id;
|
||||
|
||||
|
||||
show_details(url,table,status);
|
||||
}else{
|
||||
$("#completed").removeClass('hide')
|
||||
@@ -152,17 +152,17 @@ $(document).on('turbolinks:load', function() {
|
||||
}
|
||||
|
||||
}); //End Click
|
||||
|
||||
function show_details(url,table_id,status){
|
||||
|
||||
function show_details(url,table_id,status){
|
||||
console.log(table_id)
|
||||
var oqs_append = $('.oqs_append');
|
||||
oqs_append.empty();
|
||||
var filter = $('.filter').text();
|
||||
|
||||
|
||||
//Start Ajax
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: url,
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: url,
|
||||
data: {'filter':filter,'table_id':table_id,'status':status},
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
@@ -175,7 +175,7 @@ $(document).on('turbolinks:load', function() {
|
||||
var options = data[field]["options"];
|
||||
}
|
||||
|
||||
var date = new Date(data[field]["created_at"]);
|
||||
var date = new Date(data[field]["created_at"]);
|
||||
// var show_date = date.getDate() + "-" + (date.getMonth()+1) + "-" + date.getFullYear() + ' ' + date.getHours()+ ':' + date.getMinutes();
|
||||
var show_date =date.getHours()+ ':' + date.getMinutes() +' '+(date.getHours() >= 12 ? 'PM' : 'AM');
|
||||
var set_menu_items = data[field]["set_menu_items"];
|
||||
@@ -193,7 +193,7 @@ $(document).on('turbolinks:load', function() {
|
||||
table_type = data[field]["table_type"] +'-'+data[field]["zone"]
|
||||
}else{
|
||||
table_type = "No Table"
|
||||
|
||||
|
||||
}
|
||||
var delivery_status = ''
|
||||
if (data[field]["delivery_status"] == true) {
|
||||
@@ -235,24 +235,24 @@ $(document).on('turbolinks:load', function() {
|
||||
+'</span>'
|
||||
+'</div>'
|
||||
|
||||
+'</div>';
|
||||
|
||||
+'</div>';
|
||||
|
||||
$('.oqs_append').append(row);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
//end Ajax
|
||||
//end Ajax
|
||||
}
|
||||
|
||||
$(document).on('click', '.queue_station', function(event){
|
||||
$(document).on('click', '.queue_station', function(event){
|
||||
$('#print_order_item').removeAttr("disabled","");
|
||||
$('#print_order_summary').removeAttr("disabled","");
|
||||
var orderNo = $(this).attr('data-order-no');
|
||||
var orderNo = $(this).attr('data-order-no');
|
||||
var orderZone=$(this).children().children().children('.order-zone').text().trim();
|
||||
var orderZoneType=$(this).children().children().children('.order-zone-type').text().trim();
|
||||
// var orderItem=$(this).children().children().children('.order-item').text();
|
||||
var assigned_item_id = $(this).children().find(".assigned-order-item").text();
|
||||
var orderQty = $(this).children().children().children('.order-qty').text();
|
||||
var orderQty = $(this).children().children().children('.order-qty').text();
|
||||
var orderBy = $(this).children().children().children().children('.order-by').text();
|
||||
var orderAt = $(this).children().children().children().children('.order-at').text();
|
||||
var orderCustomer = $(this).children().children('.order-customer').text();
|
||||
@@ -272,10 +272,10 @@ $(document).on('turbolinks:load', function() {
|
||||
data: { 'status' : order_status },
|
||||
success: function(res){
|
||||
// console.log(res);
|
||||
for (i = 0; i < res["items"].length; i++) {
|
||||
var data = JSON.stringify(res["items"][i]);
|
||||
var parse_data = JSON.parse(data);
|
||||
var assigned_order_items = [];
|
||||
for (i = 0; i < res["items"].length; i++) {
|
||||
var data = JSON.stringify(res["items"][i]);
|
||||
var parse_data = JSON.parse(data);
|
||||
var assigned_order_items = [];
|
||||
var assigned_order_item_id = '';
|
||||
if(res["assigned_order_items"]!= undefined && res["assigned_order_items"]!=''){
|
||||
assigned_order_items = JSON.parse(JSON.stringify(res["assigned_order_items"]));
|
||||
@@ -286,7 +286,7 @@ $(document).on('turbolinks:load', function() {
|
||||
});
|
||||
}
|
||||
// console.log(assigned_order_item_id);
|
||||
|
||||
|
||||
var set_menu_items = parse_data.set_menu_items;
|
||||
var set_instance_items = "";
|
||||
if(set_menu_items!=null){
|
||||
@@ -309,16 +309,16 @@ $(document).on('turbolinks:load', function() {
|
||||
"<td class='order-qty' style='width:20%; text-align:right'>" + parse_data.qty + "</td>" +
|
||||
"</tr>";
|
||||
}
|
||||
|
||||
|
||||
}else{
|
||||
var order_item_row = "<tr>" +
|
||||
"<td class='order-items' style='width:80%; text-align:left'>" + parse_data.item_name + set_instance_items + "</td>" +
|
||||
"<td class='order-qty' style='width:20%; text-align:right'>" + parse_data.qty + "</td>" +
|
||||
"</tr>";
|
||||
}
|
||||
|
||||
|
||||
$("#oqs-order-details-table").children("tbody").append(order_item_row);
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -329,21 +329,21 @@ $(document).on('turbolinks:load', function() {
|
||||
$(this).addClass('selected-item');
|
||||
});
|
||||
|
||||
$(document).on('click', '.order-item-edit', function(event){
|
||||
$(document).on('click', '.order-item-edit', function(event){
|
||||
var _self = $(this); // To know in ajax return
|
||||
var assigned_item_id=$(this).attr('id').substr(5);
|
||||
window.location.href = '/oqs/'+ assigned_item_id + "/edit/oqs";
|
||||
});
|
||||
|
||||
// complete for queue item
|
||||
|
||||
$(document).on('click', '.order-complete', function(event){
|
||||
|
||||
$(document).on('click', '.order-complete', function(event){
|
||||
//e.preventDefault();
|
||||
var _self = $(this); // To know in ajax return
|
||||
var assigned_item_id=$(this).attr('id').substr(15);
|
||||
var params = { 'id':assigned_item_id };
|
||||
|
||||
// Call update_delivery_status() for changed delivery and move to delivery
|
||||
|
||||
// Call update_delivery_status() for changed delivery and move to delivery
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: '/oqs/update_delivery',
|
||||
@@ -383,7 +383,7 @@ $(document).on('turbolinks:load', function() {
|
||||
}
|
||||
else {
|
||||
window.location.href = "/origami/room/" + table_id
|
||||
}
|
||||
}
|
||||
});
|
||||
// Page reload
|
||||
location.reload();
|
||||
@@ -392,7 +392,7 @@ $(document).on('turbolinks:load', function() {
|
||||
});
|
||||
|
||||
// Print Order Item
|
||||
$(document).on('click', '#print_order_item', function(event){
|
||||
$(document).on('click', '#print_order_item', function(event){
|
||||
$(this).attr("disabled","disabled");
|
||||
var assigned_item_id = $('.selected-item').children('.card-block').children('.assigned-order-item').text();
|
||||
var options = $('.selected-item').children('.card-block').find('.item-options').text();
|
||||
|
||||
@@ -2323,7 +2323,7 @@
|
||||
@media (max-width: 767px) {
|
||||
.navbar > .container .navbar-brand,
|
||||
.navbar > .container-fluid .navbar-brand {
|
||||
margin-left: 35px;
|
||||
margin-left: 15px;
|
||||
width: 73%; }
|
||||
.navbar .navbar-header {
|
||||
display: inline-block;
|
||||
@@ -8054,4 +8054,3 @@ html.ie11 .dropdown-menu ul.menu li a {
|
||||
|
||||
html.ie11 .bs-searchbox .form-control {
|
||||
width: 90%; }
|
||||
|
||||
|
||||
@@ -69,11 +69,11 @@
|
||||
z-index: 1100;
|
||||
}
|
||||
|
||||
#sxModal-Content {
|
||||
#sxModal-Content {
|
||||
position: relative;
|
||||
left: 42%;
|
||||
top: 30%;
|
||||
background-color: #32ad1a;
|
||||
background-color: #32ad1a;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
width: 200px;
|
||||
@@ -92,7 +92,7 @@
|
||||
#videoElement {
|
||||
width: 480px;
|
||||
height: 375px;
|
||||
|
||||
|
||||
}
|
||||
|
||||
.cashier_number{
|
||||
@@ -243,7 +243,7 @@ i.logout_icon{
|
||||
span.round-tab:hover{
|
||||
color: white;
|
||||
border: 1px solid #fff;
|
||||
background-color:#2196F3;
|
||||
background-color:#2196F3;
|
||||
}
|
||||
.wizard .nav-tabs > li {
|
||||
width: 25%;
|
||||
@@ -268,4 +268,79 @@ i.logout_icon{
|
||||
font-size: 14px;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
/*customer modal UI */
|
||||
/*customer modal UI */
|
||||
|
||||
@media screen and (max-width: 785px) {
|
||||
section.content{
|
||||
margin: 80px 15px 0 225px;
|
||||
}
|
||||
|
||||
.mbl_view{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.navbar-brand-txt{
|
||||
margin-top: -15px;
|
||||
}
|
||||
|
||||
.toggle_mbl {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.toggle_mbl img{
|
||||
width: 24px;
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
|
||||
.toggle_mbl a:hover, a:focus{
|
||||
background-color: unset;
|
||||
}
|
||||
|
||||
.col-mbl-view{
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.info-box .icon{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.mbl_product_div{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.sidebar .menu{
|
||||
top: 10px;
|
||||
}
|
||||
|
||||
.page-header{
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.ls-closed .bars:after, .ls-closed .bars:before{
|
||||
top: 14px;
|
||||
}
|
||||
|
||||
.mbl_card{
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.mbl_lbl{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.mbl-style{
|
||||
padding: 10px 10px;
|
||||
}
|
||||
|
||||
.m-auto{
|
||||
width: 33%;
|
||||
}
|
||||
|
||||
.online_order{
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.mbl-right-btn{
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,4 +120,79 @@ i.logout_icon{
|
||||
|
||||
.table-width{
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 785px) {
|
||||
section.content{
|
||||
margin: 80px 15px 0 225px;
|
||||
}
|
||||
|
||||
.mbl_view{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.navbar-brand-txt{
|
||||
margin-top: -15px;
|
||||
}
|
||||
|
||||
.toggle_mbl {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.toggle_mbl img{
|
||||
width: 24px;
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
|
||||
.toggle_mbl a:hover, a:focus{
|
||||
background-color: unset;
|
||||
}
|
||||
|
||||
.col-mbl-view{
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.info-box .icon{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.mbl_product_div{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.sidebar .menu{
|
||||
top: 10px;
|
||||
}
|
||||
|
||||
.page-header{
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.ls-closed .bars:after, .ls-closed .bars:before{
|
||||
top: 14px;
|
||||
}
|
||||
|
||||
.mbl_card{
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.mbl_lbl{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.mbl-style{
|
||||
padding: 10px 10px;
|
||||
}
|
||||
|
||||
.m-auto{
|
||||
width: 33%;
|
||||
}
|
||||
|
||||
.online_order{
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.mbl-right-btn{
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,9 +119,108 @@ i.logout_icon{
|
||||
margin-right: 15px;
|
||||
color:#fff !important;
|
||||
# background-color: green !important;
|
||||
}
|
||||
}
|
||||
|
||||
.payment-btn-box {
|
||||
width: 130px;
|
||||
width: 130px;
|
||||
height: 50px;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 785px) {
|
||||
#setting{ display: none;}
|
||||
.menu-up{ display: none;}
|
||||
.card-btn{padding: 0px 35px;}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 785px) {
|
||||
section.content{
|
||||
margin: 80px 15px 0 225px;
|
||||
}
|
||||
|
||||
.mbl_view{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.navbar-brand-txt{
|
||||
margin-top: -15px;
|
||||
}
|
||||
|
||||
.toggle_mbl {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.toggle_mbl img{
|
||||
width: 24px;
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
|
||||
.toggle_mbl a:hover, a:focus{
|
||||
background-color: unset;
|
||||
}
|
||||
|
||||
.col-mbl-view{
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.info-box .icon{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.mbl_product_div{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.sidebar .menu{
|
||||
top: 10px;
|
||||
}
|
||||
|
||||
.page-header{
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.ls-closed .bars:after, .ls-closed .bars:before{
|
||||
top: 14px;
|
||||
}
|
||||
|
||||
.mbl_card{
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.mbl_lbl{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.mbl-style{
|
||||
padding: 10px 10px;
|
||||
}
|
||||
|
||||
.m-auto{
|
||||
width: 33%;
|
||||
}
|
||||
|
||||
.online_order{
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.mbl-right-btn{
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.mbl-table{
|
||||
display: block;
|
||||
overflow: scroll;
|
||||
}
|
||||
|
||||
.mbl-table-card{
|
||||
overflow: scroll;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.p-l-15{
|
||||
padding: 0px 10px;
|
||||
}
|
||||
|
||||
#order_by{
|
||||
width: 100% !important;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -279,4 +279,79 @@ tr.discount-item-row:hover {
|
||||
i.logout_icon{
|
||||
position: relative;
|
||||
top: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 785px) {
|
||||
section.content{
|
||||
margin: 80px 15px 0 225px;
|
||||
}
|
||||
|
||||
.mbl_view{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.navbar-brand-txt{
|
||||
margin-top: -15px;
|
||||
}
|
||||
|
||||
.toggle_mbl {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.toggle_mbl img{
|
||||
width: 24px;
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
|
||||
.toggle_mbl a:hover, a:focus{
|
||||
background-color: unset;
|
||||
}
|
||||
|
||||
.col-mbl-view{
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.info-box .icon{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.mbl_product_div{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.sidebar .menu{
|
||||
top: 10px;
|
||||
}
|
||||
|
||||
.page-header{
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.ls-closed .bars:after, .ls-closed .bars:before{
|
||||
top: 14px;
|
||||
}
|
||||
|
||||
.mbl_card{
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.mbl_lbl{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.mbl-style{
|
||||
padding: 10px 10px;
|
||||
}
|
||||
|
||||
.m-auto{
|
||||
width: 33%;
|
||||
}
|
||||
|
||||
.online_order{
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.mbl-right-btn{
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
display: block;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
color: #000;
|
||||
color: #000;
|
||||
margin-top: -5px;
|
||||
}
|
||||
|
||||
@@ -117,4 +117,14 @@
|
||||
|
||||
.box {
|
||||
margin : 0 -60px 0 -60px;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 785px) {
|
||||
.login_pwd{width: 90%;}
|
||||
.login_ent{width: 10%;}
|
||||
// .card-btn{padding: 0px 35px;}
|
||||
// .nav-tabs{padding: 0px 44px;}
|
||||
.box{margin: unset;}
|
||||
.mbl-btn-usrgp{width: 48%;}
|
||||
|
||||
}
|
||||
|
||||
@@ -62,8 +62,8 @@ select.form-control {
|
||||
|
||||
/*
|
||||
.order-info {
|
||||
min-height:300px;
|
||||
max-height:500px;
|
||||
min-height:300px;
|
||||
max-height:500px;
|
||||
overflow:auto
|
||||
}
|
||||
*/
|
||||
@@ -222,7 +222,7 @@ select.form-control {
|
||||
margin-right: 15px;
|
||||
color:#fff !important;
|
||||
# background-color: green !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* Reciept Style */
|
||||
#order-charges-table td {
|
||||
@@ -336,11 +336,11 @@ tr.discount-item-row:hover {
|
||||
z-index: 1100;
|
||||
}
|
||||
|
||||
#sxModal-Content {
|
||||
#sxModal-Content {
|
||||
position: relative;
|
||||
left: 42%;
|
||||
top: 30%;
|
||||
background-color: #32ad1a;
|
||||
background-color: #32ad1a;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
width: 200px;
|
||||
@@ -373,7 +373,7 @@ tr.discount-item-row:hover {
|
||||
opacity: 1;
|
||||
filter: alpha(opacity=100); /* ie */
|
||||
-moz-opacity: 1; /* mozilla */
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* For Payment Page */
|
||||
@@ -465,7 +465,7 @@ iframe {
|
||||
}
|
||||
|
||||
.tax-btn-box {
|
||||
width: 230px;
|
||||
width: 230px;
|
||||
height: 80px;
|
||||
}
|
||||
|
||||
@@ -518,12 +518,12 @@ nav.pagination .page a:hover,
|
||||
opacity: 1;
|
||||
z-index: 101;
|
||||
filter: alpha(opacity=100); /* ie */
|
||||
-moz-opacity: 1; /* mozilla */
|
||||
-moz-opacity: 1; /* mozilla */
|
||||
}
|
||||
.existing_invoice{
|
||||
background-color:#ffab51;
|
||||
color:#fff;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -628,7 +628,7 @@ nav.pagination .page a:hover,
|
||||
span.round-tab:hover{
|
||||
color: white;
|
||||
border: 1px solid #fff;
|
||||
background-color:#2196F3;
|
||||
background-color:#2196F3;
|
||||
}
|
||||
.wizard .nav-tabs > li {
|
||||
width: 25%;
|
||||
@@ -656,6 +656,81 @@ nav.pagination .page a:hover,
|
||||
/*customer modal UI */
|
||||
|
||||
.payment-btn-box {
|
||||
width: 130px;
|
||||
width: 130px;
|
||||
height: 50px;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 785px) {
|
||||
section.content{
|
||||
margin: 80px 15px 0 225px;
|
||||
}
|
||||
|
||||
.mbl_view{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.navbar-brand-txt{
|
||||
margin-top: -15px;
|
||||
}
|
||||
|
||||
.toggle_mbl {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.toggle_mbl img{
|
||||
width: 24px;
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
|
||||
.toggle_mbl a:hover, a:focus{
|
||||
background-color: unset;
|
||||
}
|
||||
|
||||
.col-mbl-view{
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.info-box .icon{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.mbl_product_div{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.sidebar .menu{
|
||||
top: 10px;
|
||||
}
|
||||
|
||||
.page-header{
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.ls-closed .bars:after, .ls-closed .bars:before{
|
||||
top: 14px;
|
||||
}
|
||||
|
||||
.mbl_card{
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.mbl_lbl{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.mbl-style{
|
||||
padding: 10px 10px;
|
||||
}
|
||||
|
||||
.m-auto{
|
||||
width: 33%;
|
||||
}
|
||||
|
||||
.online_order{
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.mbl-right-btn{
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,8 +47,12 @@ class Api::OrdersController < Api::ApiController
|
||||
# end
|
||||
|
||||
@shop = Shop.first
|
||||
puts "Hello world"
|
||||
puts @shop.to_json
|
||||
return @shop.to_json
|
||||
end
|
||||
|
||||
|
||||
# Description
|
||||
# This API allow new order creation
|
||||
# Input Params
|
||||
|
||||
@@ -5,12 +5,14 @@ class Oqs::PrintController < ApplicationController
|
||||
# if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
|
||||
order_slim_pdf = Lookup.collection_of("print_settings") #print_settings with name:OrderSlimPdf
|
||||
printer = PrintSetting.all
|
||||
unique_code="OrderItemPdf"
|
||||
unique_code="OrderItemStarPdf"
|
||||
if !order_slim_pdf.empty?
|
||||
if !printer.empty?
|
||||
printer.each do |printer_setting|
|
||||
if printer_setting.unique_code == 'OrderItemPdf'
|
||||
if printer_setting.unique_code == 'OrderItemPdf'
|
||||
unique_code="OrderItemPdf"
|
||||
elsif printer_setting.unique_code == 'OrderItemStarPdf'
|
||||
unique_code="OrderItemStarPdf"
|
||||
elsif printer_setting.unique_code == 'OrderItemSlimPdf'
|
||||
unique_code="OrderItemSlimPdf"
|
||||
elsif printer_setting.unique_code == 'OrderSetItemPdf'
|
||||
@@ -18,17 +20,17 @@ class Oqs::PrintController < ApplicationController
|
||||
elsif printer_setting.unique_code == 'OrderItemCustomisePdf'
|
||||
unique_code="OrderItemCustomisePdf"
|
||||
elsif printer_setting.unique_code == 'OrderSetItemCustomisePdf'
|
||||
unique_code="OrderSetItemCustomisePdf"
|
||||
unique_code="OrderSetItemCustomisePdf"
|
||||
elsif printer_setting.unique_code == 'OrderItemSlimCustomisePdf'
|
||||
unique_code="OrderItemSlimCustomisePdf"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
assigned_item_id = params[:id]
|
||||
options = params[:options]
|
||||
assigned_item = AssignedOrderItem.find(assigned_item_id)
|
||||
assigned_item = AssignedOrderItem.find(assigned_item_id)
|
||||
assigned_items = AssignedOrderItem.where("item_code='" + assigned_item.item_code + "' AND " + "order_id='" + assigned_item.order_id + "'")
|
||||
|
||||
# order queue stations
|
||||
@@ -38,28 +40,28 @@ class Oqs::PrintController < ApplicationController
|
||||
# Check Printed
|
||||
print_status = assigned_item.print_status == true ? " (Re-Print)" : ""
|
||||
|
||||
# print when complete click
|
||||
# print when complete click
|
||||
print_settings = PrintSetting.find_by_unique_code(unique_code)
|
||||
order_queue_printer = Printer::OrderQueuePrinter.new(print_settings)
|
||||
filename, receipt_no, cashier_printer = order_queue_printer.print_order_item(print_settings,oqs, assigned_item.order_id, order_item.order_items_id, print_status, "", options )
|
||||
|
||||
|
||||
# update print status for completed same order items
|
||||
assigned_items.each do |ai|
|
||||
ai.print_status=true
|
||||
ai.save
|
||||
ai.save
|
||||
end
|
||||
|
||||
# filename, receipt_no, cashier_printer = printer.print_receipt_bill(print_settings,cashier_terminal,sale_items,sale_data,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info, shop_detail, "Frt",current_balance,nil,other_amount)
|
||||
# filename, receipt_no, cashier_printer = printer.print_receipt_bill(print_settings,cashier_terminal,sale_items,sale_data,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info, shop_detail, "Frt",current_balance,nil,other_amount)
|
||||
if ENV["SERVER_MODE"] == "cloud"
|
||||
result = {
|
||||
:filepath => filename,
|
||||
:printer_model => print_settings.brand_name,
|
||||
:printer_url => print_settings.api_settings
|
||||
result = {
|
||||
:filepath => filename,
|
||||
:printer_model => print_settings.brand_name,
|
||||
:printer_url => print_settings.api_settings
|
||||
}
|
||||
# Mobile Print
|
||||
render :json => result.to_json
|
||||
render :json => result.to_json
|
||||
end
|
||||
# end
|
||||
# end
|
||||
end
|
||||
|
||||
# Print Order Details with booking id
|
||||
@@ -71,7 +73,7 @@ class Oqs::PrintController < ApplicationController
|
||||
if !order_slim_pdf.empty?
|
||||
if !printer.empty?
|
||||
printer.each do |printer_setting|
|
||||
if printer_setting.unique_code == 'OrderSummaryPdf'
|
||||
if printer_setting.unique_code == 'OrderSummaryPdf'
|
||||
unique_code="OrderSummaryPdf"
|
||||
elsif printer_setting.unique_code == 'OrderSummarySlimPdf'
|
||||
unique_code="OrderSummarySlimPdf"
|
||||
@@ -80,17 +82,17 @@ class Oqs::PrintController < ApplicationController
|
||||
elsif printer_setting.unique_code == 'OrderSummaryCustomisePdf'
|
||||
unique_code="OrderSummaryCustomisePdf"
|
||||
elsif printer_setting.unique_code == 'OrderSummarySetCustomisePdf'
|
||||
unique_code="OrderSummarySetCustomisePdf"
|
||||
unique_code="OrderSummarySetCustomisePdf"
|
||||
elsif printer_setting.unique_code == 'OrderSummarySlimCustomisePdf'
|
||||
unique_code="OrderSummarySlimCustomisePdf"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
assigned_item_id = params[:id]
|
||||
table_name = params[:table_name]
|
||||
assigned_item = AssignedOrderItem.find(assigned_item_id)
|
||||
assigned_item = AssignedOrderItem.find(assigned_item_id)
|
||||
assigned_items = AssignedOrderItem.where("item_code='" + assigned_item.item_code + "' AND " + "order_id='" + assigned_item.order_id + "'");
|
||||
|
||||
# order queue stations
|
||||
@@ -105,8 +107,8 @@ class Oqs::PrintController < ApplicationController
|
||||
|
||||
# Get Booking ID
|
||||
booking_id = BookingOrder.where("order_id='#{assigned_item.order_id}'").pluck(:booking_id)[0]
|
||||
|
||||
# print when complete click
|
||||
|
||||
# print when complete click
|
||||
print_settings = PrintSetting.find_by_unique_code(unique_code)
|
||||
order_queue_printer = Printer::OrderQueuePrinter.new(print_settings)
|
||||
filename, receipt_no, cashier_printer = order_queue_printer.print_booking_summary(print_settings,oqs, booking_id, print_status)
|
||||
@@ -114,20 +116,20 @@ class Oqs::PrintController < ApplicationController
|
||||
# update print status for completed same order items
|
||||
assigned_items.each do |ai|
|
||||
ai.print_status = true
|
||||
ai.save
|
||||
ai.save
|
||||
end
|
||||
|
||||
# filename, receipt_no, cashier_printer = printer.print_receipt_bill(print_settings,cashier_terminal,sale_items,sale_data,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info, shop_detail, "Frt",current_balance,nil,other_amount)
|
||||
# filename, receipt_no, cashier_printer = printer.print_receipt_bill(print_settings,cashier_terminal,sale_items,sale_data,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info, shop_detail, "Frt",current_balance,nil,other_amount)
|
||||
if ENV["SERVER_MODE"] == "cloud"
|
||||
result = {
|
||||
:filepath => filename,
|
||||
:printer_model => print_settings.brand_name,
|
||||
:printer_url => print_settings.api_settings
|
||||
result = {
|
||||
:filepath => filename,
|
||||
:printer_model => print_settings.brand_name,
|
||||
:printer_url => print_settings.api_settings
|
||||
}
|
||||
# Mobile Print
|
||||
render :json => result.to_json
|
||||
render :json => result.to_json
|
||||
end
|
||||
# end
|
||||
# end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class Reports::DailysaleController < BaseReportController
|
||||
authorize_resource :class => false
|
||||
|
||||
|
||||
def index
|
||||
from, to = get_date_range_from_params
|
||||
@sale_data = Sale.daily_sales_list(from,to)
|
||||
@@ -16,9 +16,9 @@ class Reports::DailysaleController < BaseReportController
|
||||
format.xls
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def show
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
class Reports::SaleitemController < BaseReportController
|
||||
authorize_resource :class => false
|
||||
def index
|
||||
|
||||
|
||||
@account = Account.all
|
||||
from, to = get_date_range_from_params
|
||||
|
||||
@@ -13,7 +13,7 @@ class Reports::SaleitemController < BaseReportController
|
||||
shift_sale_range = Sale.get_by_shift_sale_by_item(from,to,Sale::SALE_STATUS_COMPLETED)
|
||||
|
||||
shift_sale = ShiftSale.find(params[:shift_name])
|
||||
if to.blank?
|
||||
if to.blank?
|
||||
shift = ShiftSale.where('shift_started_at = ? and shift_closed_at is NULL ',shift_sale.shift_started_at)
|
||||
else
|
||||
if shift_sale.shift_closed_at.blank?
|
||||
@@ -43,7 +43,7 @@ class Reports::SaleitemController < BaseReportController
|
||||
|
||||
@from = from
|
||||
@to = to
|
||||
|
||||
|
||||
# get printer info
|
||||
@print_settings = PrintSetting.get_precision_delimiter()
|
||||
|
||||
@@ -80,38 +80,61 @@ class Reports::SaleitemController < BaseReportController
|
||||
# @sale_data.each {|acc| @totalByAccount[acc.account_id] += acc.grand_total}
|
||||
|
||||
out = {:status => 'ok', :message => date_arr}
|
||||
|
||||
|
||||
respond_to do |format|
|
||||
format.json { render json: out }
|
||||
end
|
||||
end
|
||||
|
||||
def print_sale_items
|
||||
type = params[:type]
|
||||
account = params[:account]
|
||||
from_date = to_date = '-'
|
||||
if !params[:from].nil?
|
||||
from_date = Date.parse(params[:from])
|
||||
end
|
||||
if !params[:to].nil?
|
||||
to_date = Date.parse(params[:to])
|
||||
end
|
||||
from, to = get_date_range_from_params
|
||||
|
||||
shift = params[:shift_name]
|
||||
shift_name = "All Shifts"
|
||||
if shift.to_i > 0
|
||||
shift_name = params[:shift_from].to_s+" - ".to_s+params[:shift_to].to_s
|
||||
end
|
||||
shift_sale_range = ''
|
||||
|
||||
period_name = get_period_name(params[:period])
|
||||
shift = ''
|
||||
shift_name = 'All Shift'
|
||||
if params[:shift_name].to_i != 0
|
||||
|
||||
shift_sale_range = Sale.get_by_shift_sale_by_item(from,to,Sale::SALE_STATUS_COMPLETED)
|
||||
|
||||
shift_sale = ShiftSale.find(params[:shift_name])
|
||||
if to.blank?
|
||||
shift = ShiftSale.where('shift_started_at = ? and shift_closed_at is NULL ',shift_sale.shift_started_at)
|
||||
else
|
||||
if shift_sale.shift_closed_at.blank?
|
||||
shift = ShiftSale.where('shift_started_at = ? and shift_closed_at is NULL',shift_sale.shift_started_at)
|
||||
else
|
||||
shift = ShiftSale.where('shift_started_at = ? and shift_closed_at = ? ',shift_sale.shift_started_at, shift_sale.shift_closed_at)
|
||||
end
|
||||
end
|
||||
|
||||
sh_name = "#{shift_sale.shift_started_at.utc.getlocal.strftime('%d %B %l:%M%p')} - #{shift_sale.shift_closed_at.utc.getlocal.strftime('%d %B %l:%M%p')}"
|
||||
employee = Employee.find(shift_sale.employee_id)
|
||||
shift_name = employee.nil? ? sh_name : "#{sh_name} (#{employee.name})"
|
||||
end
|
||||
|
||||
shop_details = shop_detail
|
||||
account_type = params[:account_type]
|
||||
@type = params[:period_type]
|
||||
period_name = get_period_name(params[:period])
|
||||
@sale_data, @other_charges,@product, @discount_data , @cash_data , @card_data , @credit_data , @foc_data , @grand_total , @change_amount = Sale.get_by_shift_items(shift_sale_range,shift, from, to, Sale::SALE_STATUS_COMPLETED,@type,account_type)
|
||||
|
||||
|
||||
# get printer info
|
||||
print_settings = PrintSetting.find_by_unique_code('CloseCashierPdf') # SaleItemsPdf
|
||||
printer = Printer::CashierStationPrinter.new(print_settings)
|
||||
print_settings = PrintSetting.find_by_unique_code('SaleItemsPdf') # SaleItemsPdf
|
||||
print_settings_star = PrintSetting.find_by_unique_code('SaleItemsStarPdf')
|
||||
|
||||
if print_settings.nil?
|
||||
if !print_settings_star.nil?
|
||||
printer = Printer::CashierStationPrinter.new(print_settings_star)
|
||||
printer.print_sale_items_report(print_settings_star, shop_details, period_name, @type, account_type, from, to, shift_name, @sale_data)
|
||||
end
|
||||
else
|
||||
printer = Printer::CashierStationPrinter.new(print_settings)
|
||||
printer.print_sale_items_report(print_settings, shop_details, period_name, @type, account_type, from, to, shift_name, @sale_data)
|
||||
end
|
||||
|
||||
|
||||
printer.print_sale_items_report(print_settings, shop_details, period_name, type, account, from_date, to_date, shift_name, params[:sale_items], params[:menu_cate_count])
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to '/en/reports/saleitem/', notice: 'Printing Completed.'}
|
||||
@@ -131,31 +154,31 @@ class Reports::SaleitemController < BaseReportController
|
||||
|
||||
when PERIOD["this_week"]
|
||||
period_name = "This Week"
|
||||
|
||||
|
||||
when PERIOD["last_week"]
|
||||
period_name = "Last Week"
|
||||
|
||||
|
||||
when PERIOD["last_7"]
|
||||
period_name = "Last 7 days"
|
||||
|
||||
|
||||
when PERIOD["this_month"]
|
||||
period_name = "This Month"
|
||||
|
||||
|
||||
when PERIOD["last_month"]
|
||||
period_name = "Last Month"
|
||||
|
||||
|
||||
when PERIOD["last_30"]
|
||||
period_name = "Last 30 Days"
|
||||
|
||||
|
||||
when PERIOD["this_year"]
|
||||
period_name = "This Year"
|
||||
|
||||
|
||||
when PERIOD["last_year"]
|
||||
period_name = "Last Year"
|
||||
|
||||
|
||||
end
|
||||
end
|
||||
return period_name
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
@@ -52,14 +52,11 @@ class Reports::ShiftsaleController < BaseReportController
|
||||
shift_id = params[:id]
|
||||
@shift = ShiftSale.find_by_id(shift_id)
|
||||
shift_obj = ShiftSale.where('id =?',shift_id)
|
||||
puts "shift obj!!!!!"
|
||||
puts shift_obj.to_json
|
||||
|
||||
|
||||
if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
|
||||
|
||||
close_cashier_pdf = Lookup.collection_of("print_settings")
|
||||
puts "close !!!!"
|
||||
puts close_cashier_pdf
|
||||
|
||||
unique_code = "CloseCashierPdf"
|
||||
|
||||
|
||||
@@ -5,9 +5,14 @@ class PrintSetting < ApplicationRecord
|
||||
def self.get_precision_delimiter
|
||||
setting = PrintSetting.find_by_unique_code("CloseCashierPdf")
|
||||
if setting.nil?
|
||||
setting = PrintSetting.find_by_unique_code("CloseCashierCustomisePdf")
|
||||
star_setting = PrintSetting.find_by_unique_code("CloseCashierStarPdf")
|
||||
if star_setting.nil?
|
||||
setting = PrintSetting.find_by_unique_code("CloseCashierCustomisePdf")
|
||||
else
|
||||
return star_setting
|
||||
end
|
||||
end
|
||||
return setting
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
@@ -37,7 +37,7 @@ class Printer::CashierStationPrinter < Printer::PrinterWorker
|
||||
# pdf.render_file filename
|
||||
# self.print(filename, cashier_terminal.printer_name)
|
||||
# end
|
||||
|
||||
|
||||
def print_close_cashier(printer_settings,cashier_terminal,shift_sale, sale_items,shop_details,sale_taxes,other_payment,amount,discount,member_discount,total_dinein,total_takeway,total_other_charges,total_waste,total_spoile,total_credit_payments)
|
||||
|
||||
if !sale_items.blank? or !sale_items.nil?
|
||||
@@ -81,10 +81,15 @@ class Printer::CashierStationPrinter < Printer::PrinterWorker
|
||||
end
|
||||
end
|
||||
|
||||
def print_sale_items_report(print_settings, shop_details, period_name, type, account, from_date, to_date, shift_name, sale_items, menu_cate_count)
|
||||
def print_sale_items_report(print_settings, shop_details, period_name, type, account, from_date, to_date, shift_name, sale_items)
|
||||
filename = "tmp/reports_sale_items.pdf"
|
||||
|
||||
pdf = SaleItemsPdf.new(print_settings, shop_details, period_name, type, account, from_date, to_date, shift_name, sale_items, nil, menu_cate_count, nil)
|
||||
if print_settings.unique_code == "SaleItemsPdf"
|
||||
pdf = SaleItemsPdf.new(print_settings, shop_details, period_name, type, account, from_date, to_date, shift_name, sale_items, nil, nil, nil)
|
||||
end
|
||||
if print_settings.unique_code == "SaleItemsStarPdf"
|
||||
pdf = SaleItemsStarPdf.new(print_settings, shop_details, period_name, type, account, from_date, to_date, shift_name, sale_items, nil, nil, nil)
|
||||
end
|
||||
|
||||
pdf.render_file filename
|
||||
|
||||
|
||||
@@ -879,7 +879,6 @@ def self.daily_sales_list(from,to)
|
||||
|
||||
total_sale.each do |sale|
|
||||
grand_total = sale.grand_total
|
||||
amount_received = sale.amount_received
|
||||
old_grand_total = sale.old_grand_total
|
||||
total_discount = sale.total_discount
|
||||
void_amount = sale.void_amount
|
||||
@@ -952,7 +951,6 @@ def self.get_by_shiftsales(from,to,shift)
|
||||
end
|
||||
|
||||
shift_sale_data[shift_sale.id] = {
|
||||
:shift_id => shift_sale.id,
|
||||
:cashier_terminal_name => shift_sale.cashier_terminal.name,
|
||||
:employee_name => shift_sale.employee.name,
|
||||
:shift_started_at => shift_sale.shift_started_at,
|
||||
@@ -961,7 +959,8 @@ def self.get_by_shiftsales(from,to,shift)
|
||||
:credit_sales => shift_sale.credit_sales,
|
||||
:other_sales => shift_sale.other_sales.to_f,
|
||||
:foc_sales => foc,
|
||||
:grand_total => shift_sale.grand_total
|
||||
:grand_total => shift_sale.grand_total,
|
||||
:shift_id => shift_sale.id
|
||||
}
|
||||
end
|
||||
|
||||
@@ -1127,15 +1126,6 @@ def self.get_by_shift_items(shift_sale_range, shift, from, to, status,type,accou
|
||||
return query,other_charges, product, discount_query , total_cash_amount , total_card_amount , total_credit_amount , total_foc_amount , total_grand_total , change_amount
|
||||
end
|
||||
|
||||
def self.get_shift_sale_items(sh_id)
|
||||
query = Sale.select("sales.shift_sale_id as shift_sale_id, i.account_id as account_id, acc.title as account_name, i.item_instance_code as item_code, i.menu_category_name, i.menu_category_code as menu_category_id, i.product_name as product_name, i.unit_price, i.price as price, i.qty as qty, SUM(i.qty) as total_item, SUM(i.qty * i.unit_price) as grand_total, i.status as status_type, i.remark as remark")
|
||||
.joins("JOIN sale_items i on i.sale_id = sales.sale_id")
|
||||
.joins("JOIN accounts acc on acc.id = i.account_id")
|
||||
.where("sales.shift_sale_id=?", sh_id)
|
||||
.group("acc.title,i.account_id,i.menu_category_code,i.item_instance_code,i.product_name,i.unit_price")
|
||||
.order("acc.title desc, i.account_id desc, i.menu_category_code desc, i.unit_price asc")
|
||||
end
|
||||
|
||||
def self.get_product_sale()
|
||||
query = Sale.select("i.account_id as account_id, " +
|
||||
"SUM(i.qty * i.unit_price) as grand_total,SUM(i.qty) as total_item," +
|
||||
@@ -2544,6 +2534,15 @@ end
|
||||
end
|
||||
end
|
||||
|
||||
def self.get_shift_sale_items(sh_id)
|
||||
query = Sale.select("sales.shift_sale_id as shift_sale_id, i.account_id as account_id, acc.title as account_name, i.item_instance_code as item_code, i.menu_category_name, i.menu_category_code as menu_category_id, i.product_name as product_name, i.unit_price, i.price as price, i.qty as qty, SUM(i.qty) as total_item, SUM(i.qty * i.unit_price) as grand_total, i.status as status_type, i.remark as remark")
|
||||
.joins("JOIN sale_items i on i.sale_id = sales.sale_id")
|
||||
.joins("JOIN accounts acc on acc.id = i.account_id")
|
||||
.where("sales.shift_sale_id=?", sh_id)
|
||||
.group("acc.title,i.account_id,i.menu_category_code,i.item_instance_code,i.product_name,i.unit_price")
|
||||
.order("acc.title desc, i.account_id desc, i.menu_category_code desc, i.unit_price asc")
|
||||
end
|
||||
|
||||
def self.pending_sale(type)
|
||||
query = Sale.all
|
||||
query = query.joins("join sale_orders as sale_orders on sale_orders.sale_id = sales.sale_id")
|
||||
|
||||
@@ -11,9 +11,9 @@ class MoveTableStarPdf < Prawn::Document
|
||||
self.qty_width = 40
|
||||
self.total_width = 40 # No Need for item
|
||||
self.item_width = self.page_width - (self.qty_width - self.margin)
|
||||
self.item_height = 15
|
||||
self.item_height = 15
|
||||
self.item_description_width = self.page_width - (self.price_width + self.qty_width + self.total_width)
|
||||
self.label_width=90
|
||||
self.label_width=90
|
||||
|
||||
super(:margin => [self.margin, self.margin, self.margin, self.margin], :page_size => [self.page_width, self.page_height])
|
||||
|
||||
@@ -85,7 +85,7 @@ class MoveTableStarPdf < Prawn::Document
|
||||
move_down 5
|
||||
|
||||
order_items.each do|odi|
|
||||
# check for item not to show
|
||||
# check for item not to show
|
||||
# if odi.price != 0
|
||||
y_position = cursor
|
||||
|
||||
@@ -103,15 +103,15 @@ class MoveTableStarPdf < Prawn::Document
|
||||
bounding_box([0,y_position], :width => self.item_width) do
|
||||
text "#{odi.item_code} - #{odi.item_name}", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
|
||||
|
||||
if !(odi.alt_name).empty?
|
||||
move_down 4
|
||||
# font("public/fonts/NotoSansCJKtc-Regular.ttf") do
|
||||
text "(#{odi.alt_name})", :size => self.item_font_size,:align => :left, :inline_format => true
|
||||
# end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -2,19 +2,19 @@ class ReceiptBillStarPdf < Prawn::Document
|
||||
include ActionView::Helpers::NumberHelper
|
||||
|
||||
attr_accessor :label_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:total_width,:item_description_width, :description_width, :price_num_width, :line_move
|
||||
|
||||
|
||||
def initialize(printer_settings, sale_items, sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info = nil,rebate_amount = nil,shop_details, printed_status,current_balance,card_data,other_charges_amount,latest_order_no,card_balance_amount)
|
||||
self.page_width = printer_settings.page_width
|
||||
self.page_height = printer_settings.page_height
|
||||
self.header_font_size = printer_settings.header_font_size.to_i
|
||||
self.item_font_size = printer_settings.item_font_size.to_i
|
||||
self.margin = 0
|
||||
self.price_width = 50
|
||||
self.qty_width = 23
|
||||
self.total_width = 50
|
||||
self.item_width = self.page_width - ((self.qty_width + self.price_width + self.total_width))
|
||||
self.price_width = 60
|
||||
self.qty_width = 20
|
||||
self.total_width = 40
|
||||
self.item_width = 73
|
||||
self.item_height = 15
|
||||
self.item_description_width = (self.page_width-20) / 2
|
||||
self.item_description_width = (self.page_width-30) / 2
|
||||
self.label_width = 90
|
||||
|
||||
self.description_width = 140
|
||||
@@ -101,7 +101,7 @@ class ReceiptBillStarPdf < Prawn::Document
|
||||
if shop_details.note && !shop_details.note.nil?
|
||||
shop_note(shop_details)
|
||||
end
|
||||
|
||||
|
||||
footer(printed_status)
|
||||
end
|
||||
|
||||
@@ -129,7 +129,7 @@ class ReceiptBillStarPdf < Prawn::Document
|
||||
text "OrderNo : #{ latest_order_no }", :size => self.header_font_size,:align => :left
|
||||
end
|
||||
move_down line_move
|
||||
|
||||
|
||||
# move_down 2
|
||||
y_position = cursor
|
||||
bounding_box([0,y_position], :width =>self.description_width + self.price_num_width, :height => self.item_height) do
|
||||
@@ -146,7 +146,7 @@ class ReceiptBillStarPdf < Prawn::Document
|
||||
y_position = cursor
|
||||
bounding_box([0, y_position], :width =>self.label_width, :height => self.item_height) do
|
||||
text "W: #{sale_data.requested_by}" , :size => self.item_font_size, :align => :left
|
||||
end
|
||||
end
|
||||
bounding_box([self.label_width - 2,y_position], :width =>self.label_width, :height => self.item_height) do
|
||||
text "C: #{sale_data.cashier_name}", :size => self.item_font_size,:align => :right
|
||||
end
|
||||
@@ -164,7 +164,7 @@ class ReceiptBillStarPdf < Prawn::Document
|
||||
end
|
||||
|
||||
# bounding_box([self.item_description_width,y_position], :width =>self.label_width+5) do
|
||||
# text "(#{ sale_data.bookings[0].checkin_at.utc.getlocal.strftime('%I:%M %p') }
|
||||
# text "(#{ sale_data.bookings[0].checkin_at.utc.getlocal.strftime('%I:%M %p') }
|
||||
# - #{ sale_data.bookings[0].checkin_at.utc.getlocal.strftime('%I:%M %p') })" ,
|
||||
# :size => self.item_font_size,:align => :right
|
||||
# end
|
||||
@@ -201,7 +201,7 @@ class ReceiptBillStarPdf < Prawn::Document
|
||||
end
|
||||
|
||||
def add_line_item_row(sale_items,precision,delimiter)
|
||||
|
||||
|
||||
if precision.to_i > 0
|
||||
item_name_width = (self.item_width+self.price_width)
|
||||
item_qty_front_width = (self.item_width+self.price_width) + 2
|
||||
@@ -222,14 +222,14 @@ class ReceiptBillStarPdf < Prawn::Document
|
||||
total_qty = 0.0
|
||||
show_price = Lookup.find_by_lookup_type("show_price")
|
||||
sale_items.each do |item|
|
||||
# check for item not to show
|
||||
|
||||
# check for item not to show
|
||||
|
||||
if item.status != 'Discount' && item.qty > 0
|
||||
if !show_price.nil? && show_price.value.to_i > 0 && item.price == 0
|
||||
total_qty += item.qty
|
||||
total_qty += item.qty
|
||||
else
|
||||
if item.price != 0
|
||||
total_qty += item.qty
|
||||
total_qty += item.qty
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -246,9 +246,9 @@ class ReceiptBillStarPdf < Prawn::Document
|
||||
qty = item.qty
|
||||
total_price = item.price #item.qty*item.unit_price - comment for room charges
|
||||
price = item.unit_price
|
||||
|
||||
|
||||
# end
|
||||
|
||||
|
||||
|
||||
if !show_price.nil? && show_price.value.to_i>0
|
||||
item_row(item,precision,delimiter,product_name,price,qty ,total_price)
|
||||
@@ -257,7 +257,7 @@ class ReceiptBillStarPdf < Prawn::Document
|
||||
item_row(item,precision,delimiter,product_name,price,qty ,total_price)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
stroke_horizontal_rule
|
||||
@@ -291,10 +291,10 @@ class ReceiptBillStarPdf < Prawn::Document
|
||||
bounding_box([0,y_position], :width =>self.item_width) do
|
||||
text "#{product_name}", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
# text_box "#{product_name}", :at =>[0,y_position], :width => self.item_width, :size => self.item_font_size
|
||||
text_box "#{number_with_precision(price, :precision => precision.to_i, :delimiter => delimiter)}", :at =>[self.item_width,y_position], :width => self.price_width, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix
|
||||
text_box "#{number_with_precision(qty, :precision => precision.to_i)}", :at =>[item_qty_front_width,y_position], :width => item_qty_end_width, :size => self.item_font_size, :align => :center, :overflow => :shrink_to_fix
|
||||
text_box "#{number_with_precision(total_price, :precision => precision.to_i, :delimiter => delimiter)}", :at =>[item_total_front_width,y_position], :width =>item_total_end_width, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix
|
||||
# text_box "#{product_name}", :at =>[0,y_position], :width => self.item_width, :size => self.item_font_size
|
||||
text_box "#{number_with_precision(price, :precision => precision.to_i, :delimiter => delimiter)}", :at =>[self.item_width,y_position], :width => self.price_width, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix
|
||||
text_box "#{number_with_precision(qty, :precision => precision.to_i)}", :at =>[item_qty_front_width,y_position], :width => item_qty_end_width, :size => self.item_font_size, :align => :center, :overflow => :shrink_to_fix
|
||||
text_box "#{number_with_precision(total_price, :precision => precision.to_i, :delimiter => delimiter)}", :at =>[item_total_front_width,y_position], :width =>item_total_end_width, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix
|
||||
|
||||
if show_alt_name
|
||||
if !(item.product_alt_name).empty?
|
||||
@@ -367,7 +367,7 @@ class ReceiptBillStarPdf < Prawn::Document
|
||||
end
|
||||
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
|
||||
text "#{sale_data.rounding_adjustment}", :size => self.item_font_size,:align => :right
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
move_down line_move
|
||||
@@ -380,11 +380,11 @@ class ReceiptBillStarPdf < Prawn::Document
|
||||
text "#{number_with_precision(sale_data.grand_total, :precision => precision.to_i, :delimiter => delimiter)}" , :style => :bold, :size => self.header_font_size,:align => :right
|
||||
end
|
||||
move_down line_move
|
||||
|
||||
sale_payment(sale_data,precision,delimiter)
|
||||
|
||||
sale_payment(sale_data,precision,delimiter)
|
||||
end
|
||||
|
||||
def sale_payment(sale_data,precision,delimiter)
|
||||
def sale_payment(sale_data,precision,delimiter)
|
||||
stroke_horizontal_rule
|
||||
#move_down line_move
|
||||
sql = "SELECT SUM(payment_amount)
|
||||
@@ -416,13 +416,13 @@ class ReceiptBillStarPdf < Prawn::Document
|
||||
text "#{payment.payment_method.capitalize} Payment", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
|
||||
text "#{number_with_precision(payment.payment_amount, :precision => precision.to_i, :delimiter => delimiter)}" , :size => self.item_font_size,:align => :right
|
||||
end
|
||||
move_down line_move
|
||||
end
|
||||
if sale_data.amount_received > 0
|
||||
if sale_data.amount_received > 0
|
||||
y_position = cursor
|
||||
move_down line_move
|
||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
|
||||
@@ -437,7 +437,7 @@ class ReceiptBillStarPdf < Prawn::Document
|
||||
|
||||
# show member information
|
||||
def member_info(member_info,customer_name,rebate_amount,sale_data,precision,delimiter,current_balance)
|
||||
if rebate_amount != nil
|
||||
if rebate_amount != nil
|
||||
if rebate_amount["status"] == true
|
||||
stroke_horizontal_rule
|
||||
total = 0
|
||||
@@ -466,8 +466,8 @@ class ReceiptBillStarPdf < Prawn::Document
|
||||
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
|
||||
text "#{number_with_precision(res["deposit"], :precision => precision.to_i, :delimiter => delimiter)}" , :size => self.item_font_size,:align => :right
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
# Total Rebate Amount if birthday
|
||||
if res["receipt_no"]== sale_data.receipt_no && res["account_status"]== "RebatebonusAccount" && res["status"]== "Rebate"
|
||||
rebate_balance = rebate_balance + res["deposit"]
|
||||
@@ -479,7 +479,7 @@ class ReceiptBillStarPdf < Prawn::Document
|
||||
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
|
||||
text "#{number_with_precision(res["deposit"], :precision => precision.to_i, :delimiter => delimiter)}" , :size => self.item_font_size,:align => :right
|
||||
end
|
||||
end
|
||||
end
|
||||
#end Total rebate if birthday
|
||||
end
|
||||
|
||||
@@ -502,7 +502,7 @@ class ReceiptBillStarPdf < Prawn::Document
|
||||
text "#{number_with_precision(current_balance, :precision => precision.to_i, :delimiter => delimiter)}", :size => self.item_font_size,:align => :right
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@@ -512,7 +512,7 @@ class ReceiptBillStarPdf < Prawn::Document
|
||||
|
||||
if res["accountable_type"] == "RebateAccount" || res["accountable_type"] == "RebatebonusAccount"
|
||||
total_balance = total_balance + res["balance"]
|
||||
|
||||
|
||||
end
|
||||
end
|
||||
move_down line_move
|
||||
@@ -524,7 +524,7 @@ class ReceiptBillStarPdf < Prawn::Document
|
||||
text "#{number_with_precision(total_balance, :precision => precision.to_i, :delimiter => delimiter)}" , :size => self.item_font_size,:align => :right
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
def customer(customer_name)
|
||||
@@ -554,7 +554,7 @@ class ReceiptBillStarPdf < Prawn::Document
|
||||
end
|
||||
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
|
||||
text "(" + "#{ number_with_precision(ipa[:price], :precision => precision.to_i, :delimiter => delimiter) }" + ")" , :size => self.item_font_size,:align => :right
|
||||
end
|
||||
end
|
||||
move_down line_move
|
||||
end
|
||||
end
|
||||
@@ -571,7 +571,7 @@ class ReceiptBillStarPdf < Prawn::Document
|
||||
bounding_box([self.label_width,y_position], :width =>self.item_description_width) do
|
||||
text "#{number_with_precision(ipa[:price], :precision => precision.to_i, :delimiter => delimiter)}" , :size => self.item_font_size,:align => :right
|
||||
end
|
||||
move_down line_move
|
||||
move_down line_move
|
||||
end
|
||||
end
|
||||
|
||||
@@ -583,7 +583,7 @@ class ReceiptBillStarPdf < Prawn::Document
|
||||
bounding_box([self.label_width,y_position], :width =>self.item_description_width) do
|
||||
text "#{number_with_precision(other_amount, :precision => precision.to_i, :delimiter => delimiter)}" , :size => self.item_font_size,:align => :right
|
||||
end
|
||||
move_down line_move
|
||||
move_down line_move
|
||||
end
|
||||
|
||||
#individual payment per person
|
||||
@@ -623,17 +623,17 @@ class ReceiptBillStarPdf < Prawn::Document
|
||||
JOIN sale_audits sa
|
||||
ON SUBSTRING_INDEX(sa.remark,'||',1)=sale_payment_id
|
||||
where sa.sale_id='#{sale_data.sale_id}')) = 0
|
||||
THEN payment_method!='creditnote' ELSE 1 END) AND sale_id = ?", sale_data.sale_id).each do |payment|
|
||||
THEN payment_method!='creditnote' ELSE 1 END) AND sale_id = ?", sale_data.sale_id).each do |payment|
|
||||
if payment.payment_method == "creditnote"
|
||||
|
||||
y_position = cursor
|
||||
stroke_horizontal_rule
|
||||
|
||||
|
||||
bounding_box([self.label_width,y_position], :width =>self.item_description_width) do
|
||||
move_down 70
|
||||
stroke_horizontal_rule
|
||||
end
|
||||
|
||||
|
||||
bounding_box([self.label_width,y_position], :width =>self.item_description_width) do
|
||||
move_down 73
|
||||
text "Approved By" , :size => self.item_font_size,:align => :center
|
||||
@@ -650,7 +650,7 @@ class ReceiptBillStarPdf < Prawn::Document
|
||||
move_down 70
|
||||
stroke_horizontal_rule
|
||||
end
|
||||
|
||||
|
||||
if sale_data.payment_status == "foc"
|
||||
bounding_box([self.label_width,y_position], :width =>self.item_description_width) do
|
||||
move_down 73
|
||||
@@ -661,9 +661,9 @@ class ReceiptBillStarPdf < Prawn::Document
|
||||
move_down 73
|
||||
text "Approved By" , :size => self.item_font_size,:align => :center
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
def shop_note(shop)
|
||||
@@ -673,8 +673,8 @@ class ReceiptBillStarPdf < Prawn::Document
|
||||
|
||||
move_down line_move
|
||||
y_position = cursor
|
||||
|
||||
text "#{shop.note}", :size => self.item_font_size, :align => :left
|
||||
|
||||
text "#{shop.note}", :size => self.item_font_size, :align => :left
|
||||
|
||||
move_down line_move
|
||||
end
|
||||
@@ -688,10 +688,10 @@ class ReceiptBillStarPdf < Prawn::Document
|
||||
y_position = cursor
|
||||
bounding_box([0, y_position], :width =>self.label_width) do
|
||||
text "#{printed_status}",:style => :bold, :size => header_font_size,:align => :left
|
||||
end
|
||||
end
|
||||
bounding_box([self.item_description_width,y_position], :width =>self.item_description_width+20, :height => self.item_height) do
|
||||
text "Thank You! See you Again", :left_margin => -5, :size => self.item_font_size,:align => :left
|
||||
end
|
||||
end
|
||||
|
||||
move_down line_move
|
||||
end
|
||||
@@ -729,7 +729,7 @@ class ReceiptBillStarPdf < Prawn::Document
|
||||
y_position = cursor
|
||||
bounding_box([0, y_position], :width =>self.label_width) do
|
||||
text "Card Balance: ",:style => :bold, :size => header_font_size,:align => :left
|
||||
end
|
||||
end
|
||||
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
|
||||
text "#{card_balance_amount}" , :size => self.item_font_size,:align => :right
|
||||
end
|
||||
@@ -753,4 +753,4 @@ class ReceiptBillStarPdf < Prawn::Document
|
||||
end
|
||||
return status
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -105,7 +105,7 @@ class SaleItemsPdf < Prawn::Document
|
||||
text "From Date : ", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
bounding_box([@label_name_width,y_position], :width => @label_item_width, :height => self.item_height) do
|
||||
text "#{ from_date}" , :size => self.item_font_size,:align => :left
|
||||
text "#{ from_date.utc.getlocal.strftime("%d-%m-%Y")}" , :size => self.item_font_size,:align => :left
|
||||
end
|
||||
|
||||
y_position = cursor
|
||||
@@ -113,14 +113,14 @@ class SaleItemsPdf < Prawn::Document
|
||||
text "To Date : ", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
bounding_box([@label_name_width,y_position], :width => @label_item_width, :height => self.item_height) do
|
||||
text "#{ to_date}" , :size => self.item_font_size,:align => :left
|
||||
text "#{ to_date.utc.getlocal.strftime("%d-%m-%Y")}" , :size => self.item_font_size,:align => :left
|
||||
end
|
||||
|
||||
y_position = cursor
|
||||
bounding_box([0,y_position], :width =>@label_name_width, :height => self.item_height) do
|
||||
text "Shift : ", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
bounding_box([@label_name_width,y_position], :width => @label_item_width, :height => self.item_height) do
|
||||
bounding_box([@label_name_width,y_position], :width => @label_item_width) do
|
||||
text "#{shift}" , :size => self.item_font_size,:align => :left
|
||||
end
|
||||
|
||||
@@ -148,10 +148,10 @@ class SaleItemsPdf < Prawn::Document
|
||||
arr = Array.new
|
||||
|
||||
unless sale_items.nil?
|
||||
JSON.parse(sale_items).each do |item|
|
||||
sale_items.each do |item|
|
||||
|
||||
if !arr.include?(item['menu_category_id'])
|
||||
|
||||
|
||||
unless total_qty == 0 and sub_total == 0
|
||||
total_details('Sub Total', total_qty, sub_total)
|
||||
end
|
||||
@@ -193,7 +193,7 @@ class SaleItemsPdf < Prawn::Document
|
||||
text_box "#{item['total_item'].to_i}", :at =>[item_label_qty_front_width,y_position], :width => item_label_qty_end_width, :height =>self.item_height, :size => self.item_font_size, :align => :center, :overflow => :shrink_to_fix
|
||||
text_box "#{item['grand_total'].to_i}", :at =>[item_label_total_front_width,y_position], :width => item_label_total_end_width, :height =>self.item_height, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix
|
||||
}
|
||||
|
||||
|
||||
if item['total_item'].to_i > 0
|
||||
total_qty += item['total_item'].to_i
|
||||
total_items += item['total_item'].to_i
|
||||
@@ -209,7 +209,7 @@ class SaleItemsPdf < Prawn::Document
|
||||
move_down 5
|
||||
total_details('Total Amount', total_items, total_amount)
|
||||
move_down 10
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def total_details(col_name, total_qty, sub_total)
|
||||
@@ -230,4 +230,4 @@ class SaleItemsPdf < Prawn::Document
|
||||
}
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
233
app/pdf/sale_items_star_pdf.rb
Normal file
233
app/pdf/sale_items_star_pdf.rb
Normal file
@@ -0,0 +1,233 @@
|
||||
class SaleItemsStarPdf < Prawn::Document
|
||||
include ActionView::Helpers::NumberHelper
|
||||
attr_accessor :label_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:total_width,:item_description_width,:text_width
|
||||
|
||||
def initialize(printer_settings, shop_details, period, type, account, from_date, to_date, shift, sale_items, acc_cate_count, menu_cate_count, total_by_acc)
|
||||
self.page_width = printer_settings.page_width #PrintSetting.where("name = ?","Close Cashier").first.page_width
|
||||
self.page_height = printer_settings.page_height
|
||||
self.header_font_size = printer_settings.header_font_size.to_i
|
||||
self.item_font_size = printer_settings.item_font_size.to_i
|
||||
self.margin = 5
|
||||
self.price_width = 60
|
||||
self.qty_width = 20
|
||||
self.total_width = 40
|
||||
self.item_width = self.page_width - ((self.price_width + self.qty_width + self.total_width))
|
||||
self.item_height = 15
|
||||
self.item_description_width = (self.page_width-20) / 2
|
||||
@label_name_width = 50
|
||||
@label_item_width = self.page_width-@label_name_width
|
||||
self.label_width = 100
|
||||
|
||||
self.text_width = (self.page_width - 80) - self.price_width / 3
|
||||
# @item_width = self.page_width.to_i / 2
|
||||
# @qty_width = @item_width.to_i / 3
|
||||
# @double = @qty_width * 1.3
|
||||
# @half_qty = @qty_width / 2
|
||||
#setting page margin and width
|
||||
super(:margin => [printer_settings.heading_space, self.margin, self.margin, self.margin], :page_size => [self.page_width, self.page_height])
|
||||
|
||||
# db font setup
|
||||
if printer_settings.font != ""
|
||||
font_families.update("#{printer_settings.font}" => {
|
||||
:normal => "public/fonts/#{printer_settings.font}.ttf",
|
||||
:italic => "public/fonts/#{printer_settings.font}.ttf",
|
||||
:bold => "public/fonts/#{printer_settings.font}.ttf",
|
||||
:bold_italic => "public/fonts/#{printer_settings.font}.ttf"
|
||||
})
|
||||
|
||||
font "#{printer_settings.font}"
|
||||
fallback_fonts ["Courier", "Helvetica", "Times-Roman"]
|
||||
end
|
||||
# font "public/fonts/Zawgyi-One.ttf"
|
||||
# font "public/fonts/padauk.ttf"
|
||||
|
||||
#precision checked
|
||||
if printer_settings.precision.to_i > 2
|
||||
printer_settings.precision = 2
|
||||
end
|
||||
#check delimiter
|
||||
if printer_settings.delimiter
|
||||
delimiter = ","
|
||||
else
|
||||
delimiter = ""
|
||||
end
|
||||
|
||||
header( shop_details)
|
||||
|
||||
stroke_horizontal_rule
|
||||
|
||||
sale_details(period, type, account, from_date, to_date, shift)
|
||||
|
||||
sale_items_detail(sale_items, acc_cate_count, menu_cate_count, total_by_acc)
|
||||
end
|
||||
|
||||
def header (shop_details)
|
||||
move_down 7
|
||||
text "#{shop_details.name}", :left_margin => -10, :size => self.header_font_size,:align => :center
|
||||
move_down 5
|
||||
text "#{shop_details.address}", :size => self.item_font_size,:align => :center
|
||||
# move_down self.item_height
|
||||
move_down 5
|
||||
text "#{shop_details.phone_no}", :size => self.item_font_size,:align => :center
|
||||
move_down 5
|
||||
|
||||
stroke_horizontal_rule
|
||||
end
|
||||
|
||||
def sale_details(period, type, account, from_date, to_date, shift)
|
||||
move_down 7
|
||||
y_position = cursor
|
||||
bounding_box([0,y_position], :width =>@label_name_width, :height => self.item_height) do
|
||||
text "Period : ", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
bounding_box([@label_name_width,y_position], :width => @label_item_width, :height => self.item_height) do
|
||||
text "#{period}" , :size => self.item_font_size,:align => :left
|
||||
end
|
||||
|
||||
y_position = cursor
|
||||
bounding_box([0,y_position], :width =>@label_name_width, :height => self.item_height) do
|
||||
text "Type : ", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
bounding_box([@label_name_width,y_position], :width => @label_item_width, :height => self.item_height) do
|
||||
text "#{type}" , :size => self.item_font_size,:align => :left
|
||||
end
|
||||
|
||||
y_position = cursor
|
||||
bounding_box([0,y_position], :width =>@label_name_width, :height => self.item_height) do
|
||||
text "Account : ", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
bounding_box([@label_name_width,y_position], :width => @label_item_width, :height => self.item_height) do
|
||||
text "#{account}" , :size => self.item_font_size,:align => :left
|
||||
end
|
||||
|
||||
y_position = cursor
|
||||
bounding_box([0,y_position], :width =>@label_name_width, :height => self.item_height) do
|
||||
text "From Date : ", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
bounding_box([@label_name_width,y_position], :width => @label_item_width, :height => self.item_height) do
|
||||
text "#{ from_date.utc.getlocal.strftime("%d-%m-%Y")}" , :size => self.item_font_size,:align => :left
|
||||
end
|
||||
|
||||
y_position = cursor
|
||||
bounding_box([0,y_position], :width =>@label_name_width, :height => self.item_height) do
|
||||
text "To Date : ", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
bounding_box([@label_name_width,y_position], :width => @label_item_width, :height => self.item_height) do
|
||||
text "#{ to_date.utc.getlocal.strftime("%d-%m-%Y")}" , :size => self.item_font_size,:align => :left
|
||||
end
|
||||
|
||||
y_position = cursor
|
||||
bounding_box([0,y_position], :width =>@label_name_width, :height => self.item_height) do
|
||||
text "Shift : ", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
bounding_box([@label_name_width,y_position], :width => @label_item_width) do
|
||||
text "#{shift}" , :size => self.item_font_size,:align => :left
|
||||
end
|
||||
|
||||
move_down 10
|
||||
end
|
||||
|
||||
def sale_items_detail(sale_items, acc_cate_count, menu_cate_count, total_by_acc)
|
||||
self.item_width = 73
|
||||
self.price_width = 35
|
||||
item_label_qty_front_width = (self.item_width+self.price_width) + 2
|
||||
item_label_qty_end_width = 32
|
||||
item_label_total_front_width = (self.item_width+self.price_width) + 2
|
||||
item_label_total_end_width = 64
|
||||
|
||||
y_position = cursor
|
||||
bounding_box([0,y_position], :width =>self.page_width - 10, :height => 20) do
|
||||
text "Sale Items Summary", :size => self.header_font_size, :align => :center
|
||||
end
|
||||
|
||||
total_items = 0
|
||||
total_amount = 0
|
||||
total_qty = 0
|
||||
sub_total = 0
|
||||
|
||||
arr = Array.new
|
||||
|
||||
unless sale_items.nil?
|
||||
sale_items.each do |item|
|
||||
|
||||
if !arr.include?(item['menu_category_id'])
|
||||
|
||||
unless total_qty == 0 and sub_total == 0
|
||||
total_details('Sub Total', total_qty, sub_total)
|
||||
end
|
||||
|
||||
total_qty = 0
|
||||
sub_total = 0
|
||||
|
||||
move_down 10
|
||||
|
||||
y_position = cursor
|
||||
bounding_box([0,y_position], :width =>self.page_width - 10, :height => 20) do
|
||||
text "#{item['menu_category_name']}", :size => self.header_font_size, :align => :left
|
||||
end
|
||||
|
||||
# write_stroke_dash
|
||||
# dash(1, :space => 1, :phase => 1)
|
||||
# stroke_horizontal_rule
|
||||
# move_down 2
|
||||
y_position = cursor
|
||||
pad_top(15) {
|
||||
text_box "Items", :at =>[0,y_position], :width => self.item_width, :height =>self.item_height, :size => self.item_font_size, :overflow => :shrink_to_fix
|
||||
text_box "Price", :at =>[(self.item_width),y_position], :width => self.price_width, :height =>self.item_height, :size => self.item_font_size, :align => :left, :overflow => :shrink_to_fix
|
||||
text_box "Qty", :at =>[item_label_qty_front_width,y_position], :width => item_label_qty_end_width, :height =>self.item_height, :size => self.item_font_size, :align => :center, :overflow => :shrink_to_fix
|
||||
text_box "Total", :at =>[item_label_total_front_width,y_position], :width => item_label_total_end_width, :height =>self.item_height, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix
|
||||
}
|
||||
move_down 2
|
||||
stroke_horizontal_rule
|
||||
end
|
||||
|
||||
|
||||
move_down 3
|
||||
|
||||
y_position = cursor
|
||||
pad_top(15) {
|
||||
bounding_box([0,y_position], :width =>self.item_width) do
|
||||
text "#{item['product_name']}", :size => self.item_font_size, :align => :left#, :overflow => :shrink_to_fix
|
||||
end
|
||||
text_box "#{item['unit_price'].to_i}", :at =>[(self.item_width),y_position], :width => self.price_width, :height =>self.item_height, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix
|
||||
text_box "#{item['total_item'].to_i}", :at =>[item_label_qty_front_width,y_position], :width => item_label_qty_end_width, :height =>self.item_height, :size => self.item_font_size, :align => :center, :overflow => :shrink_to_fix
|
||||
text_box "#{item['grand_total'].to_i}", :at =>[item_label_total_front_width,y_position], :width => item_label_total_end_width, :height =>self.item_height, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix
|
||||
}
|
||||
|
||||
if item['total_item'].to_i > 0
|
||||
total_qty += item['total_item'].to_i
|
||||
total_items += item['total_item'].to_i
|
||||
end
|
||||
|
||||
sub_total += item['grand_total'].to_i
|
||||
total_amount += item['grand_total'].to_i
|
||||
arr.push(item['menu_category_id'])
|
||||
end
|
||||
|
||||
# stroke_horizontal_rule
|
||||
total_details('Sub Total', total_qty, sub_total)
|
||||
move_down 5
|
||||
total_details('Total Amount', total_items, total_amount)
|
||||
move_down 10
|
||||
end
|
||||
end
|
||||
|
||||
def total_details(col_name, total_qty, sub_total)
|
||||
self.item_width = 73
|
||||
self.price_width = 35
|
||||
item_label_qty_front_width = (self.item_width+self.price_width) + 2
|
||||
item_label_qty_end_width = 32
|
||||
item_label_total_front_width = (self.item_width+self.price_width) + 2
|
||||
item_label_total_end_width = 64
|
||||
|
||||
move_down 5
|
||||
stroke_horizontal_rule
|
||||
y_position = cursor
|
||||
pad_top(15) {
|
||||
text_box "#{col_name}", :at =>[0,y_position], :width => self.item_width, :height =>self.item_height, :size => self.item_font_size, :overflow => :shrink_to_fix
|
||||
text_box "#{total_qty.to_i}", :at =>[item_label_qty_front_width,y_position], :width => item_label_qty_end_width, :height =>self.item_height, :size => self.item_font_size, :align => :center, :overflow => :shrink_to_fix
|
||||
text_box "#{sub_total.to_i}", :at =>[item_label_total_front_width,y_position], :width => item_label_total_end_width, :height =>self.item_height, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix
|
||||
}
|
||||
end
|
||||
|
||||
end
|
||||
@@ -14,10 +14,10 @@
|
||||
else
|
||||
delimiter = ""
|
||||
end
|
||||
%>
|
||||
%>
|
||||
<!-- Widgets -->
|
||||
<div class="row clearfix">
|
||||
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
|
||||
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12 col-mbl-view">
|
||||
<div class="info-box bg-cyan hover-expand-effect">
|
||||
<div class="icon">
|
||||
<i class="material-icons">help</i>
|
||||
@@ -30,7 +30,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
|
||||
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12 col-mbl-view">
|
||||
<div class="info-box bg-pink hover-expand-effect">
|
||||
<div class="icon">
|
||||
<i class="material-icons">attach_money</i>
|
||||
@@ -44,7 +44,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
|
||||
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12 col-mbl-view">
|
||||
<div class="info-box bg-light-green hover-expand-effect">
|
||||
<div class="icon">
|
||||
<i class="material-icons">person_add</i>
|
||||
@@ -57,7 +57,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
|
||||
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12 col-mbl-view">
|
||||
<div class="info-box bg-orange hover-expand-effect">
|
||||
<div class="icon">
|
||||
<i class="material-icons">credit_card</i>
|
||||
@@ -99,27 +99,27 @@
|
||||
to_time = ''
|
||||
end
|
||||
%>
|
||||
<div class="col-lg-3 col-md-3 col-sm-3">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.from") %></label>
|
||||
<div class="col-lg-3 col-md-3 col-sm-3 col-mbl-view mbl-style">
|
||||
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.from") %></label>
|
||||
<input data-behaviour='datepicker' class="form-control datepicker" name="from" id="from" type="text" value="<%= from_date %>" placeholder="From date" style="height: 35px;">
|
||||
<span id="fromErr" style="color:red;"></span>
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-3 col-sm-3">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.to") %></label>
|
||||
<div class="col-lg-3 col-md-3 col-sm-3 col-mbl-view mbl-style">
|
||||
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.to") %></label>
|
||||
<input data-behaviour='datepicker' class="form-control datepicker" name="to" id="to" type="text" value="<%= to_date %>" placeholder="To date" style="height: 35px;">
|
||||
<span id="toErr" style="color:red;"></span>
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.from_time") %></label>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
|
||||
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.from_time") %></label>
|
||||
<input data-behaviour='timepicker' class="form-control timepicker" name="from_time" id="from_time" type="text" value="<%= from_time %>" placeholder="From Time" style="height: 35px;">
|
||||
<span id="from_timeErr" style="color:red;"></span>
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.to_time") %></label>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
|
||||
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.to_time") %></label>
|
||||
<input data-behaviour='timepicker' class="form-control timepicker" name="to_time" id="to_time" type="text" value="<%= to_time %>" placeholder="To time" style="height: 35px;">
|
||||
<span id="to_timeErr" style="color:red;"></span>
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 toggle_mbl">
|
||||
<label></label><br>
|
||||
<input type="button" value="Generate" class='btn btn-primary btn_generate'>
|
||||
</div>
|
||||
@@ -131,26 +131,29 @@
|
||||
<div class="row">
|
||||
<% if current_user.role == 'administrator' || current_user.role == 'manager' || current_user.role == 'account' %>
|
||||
<div class="col-xs-8 col-sm-8 col-md-8 col-lg-8">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
|
||||
<div class="card">
|
||||
<div class="body">
|
||||
<h4><i class="material-icons md-24">dashboard</i><%= (t :top) + " " + (t :products) %></h4>
|
||||
<!-- <canvas id="top_products" class="col-md-12"></canvas> -->
|
||||
<%= pie_chart @top_products %>
|
||||
<% isMobile = request.user_agent %>
|
||||
<% if !isMobile.include? "Mobile" %>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 ">
|
||||
<div class="card">
|
||||
<div class="body">
|
||||
<h4><i class="material-icons md-24">dashboard</i><%= (t :top) + " " + (t :products) %></h4>
|
||||
<!-- <canvas id="top_products" class="col-md-12"></canvas> -->
|
||||
<%= pie_chart @top_products %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 ">
|
||||
<div class="card">
|
||||
<div class="body">
|
||||
<h4><i class="material-icons md-24">dashboard</i><%= (t :bottom) + " " + (t :products) %></h4>
|
||||
<!-- <canvas id="top_products" class="col-md-12"></canvas> -->
|
||||
<%= pie_chart @bottom_products %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
|
||||
<div class="card">
|
||||
<div class="body">
|
||||
<h4><i class="material-icons md-24">dashboard</i><%= (t :bottom) + " " + (t :products) %></h4>
|
||||
<!-- <canvas id="top_products" class="col-md-12"></canvas> -->
|
||||
<%= pie_chart @bottom_products %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<!-- <div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
|
||||
<div class="card">
|
||||
@@ -231,9 +234,9 @@
|
||||
<tr>
|
||||
<% if payment.payment_method == 'paypar' %>
|
||||
<td>Redeem Sale : </td>
|
||||
<% else %>
|
||||
<% else %>
|
||||
<td><%= payment.payment_method.to_s.capitalize %> Sale : </td>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<td align="right">
|
||||
<% @sale_data.each do |data| %>
|
||||
<% pay_mth = payment.payment_method %>
|
||||
@@ -254,7 +257,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
|
||||
<% end %>
|
||||
</table>
|
||||
</div>
|
||||
@@ -329,7 +332,7 @@
|
||||
<td align="right" width="60px"><%= @total_order.total_order %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
|
||||
<% if !@total_accounts.nil? %>
|
||||
<% @total_accounts.each do |account| %>
|
||||
<tr>
|
||||
@@ -346,7 +349,7 @@
|
||||
<% if !@top_items.nil? %>
|
||||
<tr>
|
||||
<td width="40px"><%= t :top %> <%= t("views.right_panel.detail.item") %> : </td>
|
||||
<td align="right" width="60px"><%= @top_items.item_name %>
|
||||
<td align="right" width="60px"><%= @top_items.item_name %>
|
||||
<br>(<%= @top_items.item_total_price %>)</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
@@ -359,19 +362,41 @@
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% if current_user.role == 'administrator' || current_user.role == 'manager' || current_user.role == 'account' %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% if isMobile.include? "Mobile" %>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 ">
|
||||
<div class="card">
|
||||
<div class="body">
|
||||
<h4><i class="material-icons md-24">dashboard</i><%= (t :top) + " " + (t :products) %></h4>
|
||||
<!-- <canvas id="top_products" class="col-md-12"></canvas> -->
|
||||
<%= pie_chart @top_products %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 ">
|
||||
<div class="card">
|
||||
<div class="body">
|
||||
<h4><i class="material-icons md-24">dashboard</i><%= (t :bottom) + " " + (t :products) %></h4>
|
||||
<!-- <canvas id="top_products" class="col-md-12"></canvas> -->
|
||||
<%= pie_chart @bottom_products %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
var from = '<%= @from.strftime('%d-%m-%Y') rescue '' %>';
|
||||
var to = '<%= @to.strftime('%d-%m-%Y') rescue '' %>';
|
||||
|
||||
|
||||
if((from!=undefined) && (from != null) && (from != '')){
|
||||
$('#from').val(from);
|
||||
}
|
||||
@@ -434,4 +459,4 @@
|
||||
if(status && t_status) status = true;
|
||||
return status;
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
|
||||
@@ -154,7 +154,7 @@
|
||||
$(".collapse.in").each(function () {
|
||||
$(this).siblings(".panel-heading").find(".glyphicon").addClass("glyphicon-minus").removeClass("glyphicon-plus");
|
||||
});
|
||||
|
||||
|
||||
// Toggle plus minus icon on show hide of collapse element
|
||||
$(".collapse").on('show.bs.collapse', function () {
|
||||
$(this).parent().find(".glyphicon").removeClass("glyphicon-plus").addClass("glyphicon-minus");
|
||||
@@ -164,11 +164,3 @@
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -18,19 +18,19 @@
|
||||
<%if current_login_employee.role !="waiter" %>
|
||||
<a href="javascript:void(0);" class="bars"></a>
|
||||
<% if current_login_employee.role == "administrator" || current_login_employee.role == "manager" || current_login_employee.role == "account" %>
|
||||
<a class="navbar-brand" href="<%=dashboard_path%>" style="margin-left: 20px;">
|
||||
<a class="navbar-brand mbl_view" href="<%=dashboard_path%>" style="margin-left: 20px;">
|
||||
<% elsif current_login_employee.role == "supervisor" || current_login_employee.role == "cashier" || current_login_employee.role == "waiter" %>
|
||||
<a class="navbar-brand" href="<%=origami_dashboard_path%>" style="margin-left: 20px;">
|
||||
<a class="navbar-brand mbl_view" href="<%=origami_dashboard_path%>" style="margin-left: 20px;">
|
||||
<%else%>
|
||||
<a class="navbar-brand" href="" style="margin-left: 20px;">
|
||||
<a class="navbar-brand mbl_view" href="" style="margin-left: 20px;">
|
||||
<% end %>
|
||||
<% else %>
|
||||
<a class="navbar-brand m-0" href="<%= origami_dashboard_path%>">
|
||||
<a class="navbar-brand m-0 mbl_view" href="<%= origami_dashboard_path%>">
|
||||
<%end%>
|
||||
<img src="<%= asset_path('SX-Logo-small.png') %>" width="40" height="40" alt="Logo" />
|
||||
<span class="navbar-brand-txt">SX Restaurant</span>
|
||||
</a>
|
||||
|
||||
|
||||
<span class="navbar-brand m-0">
|
||||
<span id="others_payment"></span>
|
||||
</span>
|
||||
@@ -40,11 +40,17 @@
|
||||
<span class="navbar-brand navbar-brand-txt"><%= shop_detail.name %></span>
|
||||
</div>
|
||||
<!-- End Shop Info -->
|
||||
|
||||
|
||||
<div class="navbar-right m-auto">
|
||||
<% if order_reservation %>
|
||||
<div class="online_order">
|
||||
<span class="navbar-brand navbar-brand-txt header-default-color"><%= t :order_reservation %></span>
|
||||
<span class="navbar-brand navbar-brand-txt header-default-color">
|
||||
<% if request.user_agent.include? "Mobile" %>
|
||||
<img src="/assets/online_order_icon.png" alt="<%= t :order_reservation %>" />
|
||||
<% else %>
|
||||
<%= t :order_reservation %>
|
||||
<% end %>
|
||||
</span>
|
||||
<span class="order_no"></span>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -52,7 +58,7 @@
|
||||
|
||||
<!-- Start Quick Access for Cashier -->
|
||||
<!-- <div class="navbar-right m-auto">
|
||||
<a href="#" class="dropdown-toggle waves-block col-white" data-toggle="dropdown" aria-haspopup="true" aria-expanded="flase">
|
||||
<a href="#" class="dropdown-toggle waves-block col-white" data-toggle="dropdown" aria-haspopup="true" aria-expanded="flase">
|
||||
<span><%= t :cashier %></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
@@ -62,7 +68,7 @@
|
||||
<i class="material-icons font-7 logout_icon shopinfo">monetization_on</i>
|
||||
<span class="font-15 shopinfo dinein" ><%= t :dine_in %></span>
|
||||
</a>
|
||||
</p>
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="waves-effect waves-block p-l-20 m-b-5">
|
||||
@@ -70,7 +76,7 @@
|
||||
<i class="material-icons font-7 logout_icon shopinfo">restaurant_menu</i>
|
||||
<span class="font-15 shopinfo quick_service" ><%= t :quick_service %></span>
|
||||
</a>
|
||||
</p>
|
||||
</p>
|
||||
</li>
|
||||
<% if order_reservation %>
|
||||
<li>
|
||||
@@ -80,7 +86,7 @@
|
||||
<span class="font-15 col-black online_order" ><%= t :order_reservation %></span>
|
||||
<span class="order_no"></span>
|
||||
</a>
|
||||
</p>
|
||||
</p>
|
||||
</li>
|
||||
<% end %>
|
||||
<li>
|
||||
@@ -89,7 +95,7 @@
|
||||
<i class="material-icons font-7 logout_icon shopinfo">book</i>
|
||||
<span class="font-15 col-black reservation" ><%= t :reservation %></span>
|
||||
</a>
|
||||
</p>
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="waves-effect waves-block p-l-20 m-b-5">
|
||||
@@ -97,17 +103,23 @@
|
||||
<i class="material-icons font-7 logout_icon shopinfo">restaurant</i>
|
||||
<span class="font-15 col-black foodcourt" ><%= t :foodcourt %></span>
|
||||
</a>
|
||||
</p>
|
||||
</p>
|
||||
</li>
|
||||
</ul>
|
||||
</div> -->
|
||||
<!-- End Quick Access for Cashier -->
|
||||
|
||||
|
||||
<!-- Start Delete confirrm text !-->
|
||||
<div class="navbar-right">
|
||||
<a href="javascript:void(0);" class="dropdown-toggle waves-block" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
|
||||
<div class="navbar-right toggle_mbl">
|
||||
<a href="javascript:void(0);" class="dropdown-toggle waves-block" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
|
||||
<% if current_login_employee %>
|
||||
<span><%= current_login_employee.name %></span>
|
||||
<span>
|
||||
<% if request.user_agent.include? "Mobile" %>
|
||||
<img src="/assets/user_icon.png" alt="<%= current_login_employee.name %>" />
|
||||
<% else %>
|
||||
<%= current_login_employee.name %>
|
||||
<% end %>
|
||||
</span>
|
||||
<% end %>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
@@ -118,14 +130,14 @@
|
||||
<i class="material-icons font-7 logout_icon shopinfo">info</i>
|
||||
<span class="font-15 shopinfo" >Shop Info</span>
|
||||
</a>
|
||||
</p>
|
||||
</p>
|
||||
</li>
|
||||
<% end %>
|
||||
<li>
|
||||
<p class="waves-effect waves-block p-l-30 m-b-5 team_viewer">
|
||||
<i class="material-icons font-7 logout_icon shopinfo">touch_app</i>
|
||||
<span class="font-15 shopinfo" >Team Viewer</span>
|
||||
</p>
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<!-- <p class="delete waves-effect waves-block p-l-30 m-b-5" data-ref="<%=logout_path%>" data-method="delete">
|
||||
@@ -140,7 +152,7 @@
|
||||
<h6>Are you sure you want to Logout ?</h6>
|
||||
<!-- <h6>This action can't be undo. </h6> -->
|
||||
</span>
|
||||
</li>
|
||||
</li>
|
||||
</ul>
|
||||
<!-- NO Need for color Change
|
||||
<a href="javascript:void(0);" class="js-right-sidebar" data-close="true">
|
||||
@@ -156,7 +168,7 @@
|
||||
var method = $(this).attr('data-method');
|
||||
var url = $(this).attr('data-ref');
|
||||
var html_text = $(this).siblings( "#delete_text" ).html();
|
||||
//var page = url.substring(url.lastIndexOf('/') + 1);
|
||||
//var page = url.substring(url.lastIndexOf('/') + 1);
|
||||
swal({
|
||||
title: "Confirmation",
|
||||
text: html_text,
|
||||
@@ -168,11 +180,11 @@
|
||||
if (isConfirm) {
|
||||
$.ajax({
|
||||
type: method,
|
||||
url: url ,
|
||||
success: function(data) {
|
||||
url: url ,
|
||||
success: function(data) {
|
||||
location.href = data.url;
|
||||
}
|
||||
});
|
||||
});
|
||||
} else {
|
||||
swal("Cancelled", "Your imaginary file is safe :)", "error");
|
||||
}
|
||||
@@ -203,6 +215,6 @@
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
<aside id="leftsidebar" class="sidebar">
|
||||
<!-- User Info -->
|
||||
<!-- <div class="user-info">
|
||||
<div class="image">
|
||||
<div class="image">
|
||||
<img src="public/image/user.png" width="48" height="48" alt="User" />
|
||||
</div>
|
||||
<div class="info-container">
|
||||
<div class="name" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
current_login_employee.name
|
||||
current_login_employee.name
|
||||
</div>
|
||||
<div class="email">john.doe@example.com</div>
|
||||
<div class="btn-group user-helper-dropdown">
|
||||
@@ -21,7 +21,7 @@
|
||||
<li role="seperator" class="divider"></li>
|
||||
<li><a href="javascript:void(0);"><i class="material-icons">input</i>Sign Out</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<!-- #User Info -->
|
||||
@@ -42,7 +42,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<% if can? :menage, OrderQueueStation %>
|
||||
<li>
|
||||
<li class="menu-up">
|
||||
<a href="<%= oqs_root_path %>">
|
||||
<i class="material-icons">room_service</i>
|
||||
<span><%= t :oqs %></span>
|
||||
@@ -50,8 +50,8 @@
|
||||
</li>
|
||||
<% end %>
|
||||
<% if can? :index, :home %>
|
||||
<% if current_login_employee.role != "kitchen" %>
|
||||
<li>
|
||||
<% if current_login_employee.role != "kitchen" %>
|
||||
<li class="menu-up">
|
||||
<a href="<%= origami_dashboard_path %>">
|
||||
<i class="material-icons">monetization_on</i>
|
||||
<span><%= t :origami %></span>
|
||||
@@ -60,27 +60,27 @@
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if can? :menage, Customer %>
|
||||
<li>
|
||||
<li class="menu-up">
|
||||
<a href="javascript:void(0);" class="menu-toggle">
|
||||
<i class="material-icons">widgets</i>
|
||||
<span><%= t :crm %></span>
|
||||
</a>
|
||||
<ul class="ml-menu">
|
||||
|
||||
|
||||
<li>
|
||||
<a href="<%= crm_customers_path %>"><%= t :customer %></a>
|
||||
</li>
|
||||
|
||||
|
||||
<% if can? :menage, DiningQueue %>
|
||||
<li>
|
||||
<a href="<%= crm_dining_queues_path %>"><%= t :queue %></a>
|
||||
</li>
|
||||
<% end %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if can? :menage, Inventory %>
|
||||
<li>
|
||||
<li class="menu-up">
|
||||
<a href="<%= inventory_path %>">
|
||||
<i class="material-icons">store</i>
|
||||
<span><%= t :inventory %></span>
|
||||
@@ -88,66 +88,9 @@
|
||||
</li>
|
||||
<%end%>
|
||||
<li class="header"><%= t :backend %></li>
|
||||
<li>
|
||||
<a href="javascript:void(0);" class="menu-toggle">
|
||||
<i class="material-icons">widgets</i>
|
||||
<span><%= t :transactions %></span>
|
||||
</a>
|
||||
<ul class="ml-menu">
|
||||
<% if can? :menage, Booking %>
|
||||
<li>
|
||||
<a href="<%= transactions_bookings_path %>"><%= t :bookings %></a>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if can? :menage, Order %>
|
||||
<li>
|
||||
<a href="<%= transactions_orders_path %>"><%= t :orders %></a>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if can? :menage, Sale %>
|
||||
<li>
|
||||
<a href="<%= transactions_sales_path %>"><%= t :sale %></a>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if can? :menage, Sale %>
|
||||
<li>
|
||||
<a href="<%= transactions_credit_notes_path %>"><%= (t :credit) %></a>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if can? :menage, Sale %>
|
||||
<li>
|
||||
<a href="<%= transactions_shift_sales_path %>"><%= (t :shiftsale) %></a>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if can? :menage, Survey %>
|
||||
<li>
|
||||
<a href="<%= transactions_surveys_path %>"><%= t("views.right_panel.detail.survey") %></a>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if can? :manage, OrderReservation %>
|
||||
<% if order_reservation %>
|
||||
<li>
|
||||
<a href="<%= transactions_order_reservations_path %>"><%= t("views.right_panel.detail.order_reservation") %></a>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if can? :manage, Sale %>
|
||||
<% if bank_integration %>
|
||||
<li>
|
||||
<a href="<%= transactions_card_sale_trans_path %>"><%= t :cb_payments %></a>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if can? :manage, Sale %>
|
||||
<% if bank_integration %>
|
||||
<li>
|
||||
<a href="<%= transactions_card_settle_trans_path %>"><%= t :cb_settlement %></a>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</ul>
|
||||
</li>
|
||||
<% if can? :index, :dailysale %>
|
||||
<% device = request.user_agent %>
|
||||
<% if device.include? 'Mobile' %>
|
||||
<% if can? :index, :dailysale %>
|
||||
<li>
|
||||
<a href="javascript:void(0);" class="menu-toggle">
|
||||
<i class="material-icons">assessment</i>
|
||||
@@ -207,8 +150,193 @@
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</li>
|
||||
</li>
|
||||
<%end%>
|
||||
|
||||
<li>
|
||||
<a href="javascript:void(0);" class="menu-toggle">
|
||||
<i class="material-icons">widgets</i>
|
||||
<span><%= t :transactions %></span>
|
||||
</a>
|
||||
<ul class="ml-menu">
|
||||
<% if can? :menage, Booking %>
|
||||
<li>
|
||||
<a href="<%= transactions_bookings_path %>"><%= t :bookings %></a>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if can? :menage, Order %>
|
||||
<li>
|
||||
<a href="<%= transactions_orders_path %>"><%= t :orders %></a>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if can? :menage, Sale %>
|
||||
<li>
|
||||
<a href="<%= transactions_sales_path %>"><%= t :sale %></a>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if can? :menage, Sale %>
|
||||
<li>
|
||||
<a href="<%= transactions_credit_notes_path %>"><%= (t :credit) %></a>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if can? :menage, Sale %>
|
||||
<li>
|
||||
<a href="<%= transactions_shift_sales_path %>"><%= (t :shiftsale) %></a>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if can? :menage, Survey %>
|
||||
<li>
|
||||
<a href="<%= transactions_surveys_path %>"><%= t("views.right_panel.detail.survey") %></a>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if can? :manage, OrderReservation %>
|
||||
<% if order_reservation %>
|
||||
<li>
|
||||
<a href="<%= transactions_order_reservations_path %>"><%= t("views.right_panel.detail.order_reservation") %></a>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if can? :manage, Sale %>
|
||||
<% if bank_integration %>
|
||||
<li>
|
||||
<a href="<%= transactions_card_sale_trans_path %>"><%= t :cb_payments %></a>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if can? :manage, Sale %>
|
||||
<% if bank_integration %>
|
||||
<li>
|
||||
<a href="<%= transactions_card_settle_trans_path %>"><%= t :cb_settlement %></a>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<%else%>
|
||||
<li id="left-menu">
|
||||
<a href="javascript:void(0);" class="menu-toggle">
|
||||
<i class="material-icons">widgets</i>
|
||||
<span><%= t :transactions %></span>
|
||||
</a>
|
||||
<ul class="ml-menu">
|
||||
<% if can? :menage, Booking %>
|
||||
<li>
|
||||
<a href="<%= transactions_bookings_path %>"><%= t :bookings %></a>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if can? :menage, Order %>
|
||||
<li>
|
||||
<a href="<%= transactions_orders_path %>"><%= t :orders %></a>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if can? :menage, Sale %>
|
||||
<li>
|
||||
<a href="<%= transactions_sales_path %>"><%= t :sale %></a>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if can? :menage, Sale %>
|
||||
<li>
|
||||
<a href="<%= transactions_credit_notes_path %>"><%= (t :credit) %></a>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if can? :menage, Sale %>
|
||||
<li>
|
||||
<a href="<%= transactions_shift_sales_path %>"><%= (t :shiftsale) %></a>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if can? :menage, Survey %>
|
||||
<li>
|
||||
<a href="<%= transactions_surveys_path %>"><%= t("views.right_panel.detail.survey") %></a>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if can? :manage, OrderReservation %>
|
||||
<% if order_reservation %>
|
||||
<li>
|
||||
<a href="<%= transactions_order_reservations_path %>"><%= t("views.right_panel.detail.order_reservation") %></a>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if can? :manage, Sale %>
|
||||
<% if bank_integration %>
|
||||
<li>
|
||||
<a href="<%= transactions_card_sale_trans_path %>"><%= t :cb_payments %></a>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if can? :manage, Sale %>
|
||||
<% if bank_integration %>
|
||||
<li>
|
||||
<a href="<%= transactions_card_settle_trans_path %>"><%= t :cb_settlement %></a>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</ul>
|
||||
</li>
|
||||
<% if can? :index, :dailysale %>
|
||||
<li>
|
||||
<a href="javascript:void(0);" class="menu-toggle">
|
||||
<i class="material-icons">assessment</i>
|
||||
<span><%= t :reports %></span>
|
||||
</a>
|
||||
<ul class="ml-menu">
|
||||
<li>
|
||||
<a href="<%= reports_dailysale_index_path %>">Daily Sales</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<%= reports_saleitem_index_path %>">Sale Items</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<%= reports_product_sale_index_path %>">Product Sale</a>
|
||||
</li>
|
||||
<% if order_reservation %>
|
||||
<li>
|
||||
<a href="<%= reports_order_reservation_index_path %>"><%= t("views.right_panel.detail.order_reservation") %></a>
|
||||
</li>
|
||||
<% end %>
|
||||
<li>
|
||||
<a href="<%= reports_receipt_no_index_path %>">Receipt</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<%= reports_receipt_no_detail_index_path %>">Receipt Detail</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<%= reports_shiftsale_index_path %>">Shift Sales</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<%= reports_credit_payment_index_path %>">Credit Sales</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<%= reports_void_sale_index_path %>">Void Sales</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<%= reports_waste_and_spoilage_index_path %>">Wastes & Spoilages</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<%= reports_payment_method_index_path %>">Payment Method</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<%= reports_commission_index_path %>">Commission</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<%= reports_induty_index_path %>">Induty</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<%= reports_stock_check_index_path %>">Stock Check</a>
|
||||
</li>
|
||||
<% if bank_integration %>
|
||||
<li>
|
||||
<a href="<%= reports_card_sale_tran_index_path %>">CB Payments</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<%= reports_card_settle_tran_index_path %>">CB Settlement</a>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<div id="setting" >
|
||||
<li class="header"><%= t :settings %></li>
|
||||
<% if can? :menage, Zone %>
|
||||
<li>
|
||||
@@ -232,7 +360,7 @@
|
||||
<i class="material-icons col-indigo">donut_large</i>
|
||||
<span><%= t :oqs %></span>
|
||||
</a>
|
||||
</li>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if can? :menage, Employee %>
|
||||
<li>
|
||||
@@ -256,7 +384,7 @@
|
||||
<i class="material-icons col-pupple">donut_large</i>
|
||||
<span><%= t :printer %></span>
|
||||
</a>
|
||||
</li>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if can? :menage, TaxProfile %>
|
||||
<li>
|
||||
@@ -312,8 +440,11 @@
|
||||
</a>
|
||||
</li>
|
||||
<% end %>
|
||||
</div>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- #Menu -->
|
||||
<!-- Footer -->
|
||||
<div class="legal">
|
||||
@@ -326,4 +457,4 @@
|
||||
</div>
|
||||
<!-- #Footer -->
|
||||
</aside>
|
||||
<!-- #END# Left Sidebar
|
||||
<!-- #END# Left Sidebar
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
<!-- <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js" integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4" crossorigin="anonymous"></script> -->
|
||||
<%= javascript_include_tag 'login', 'data-turbolinks-track': 'reload' %>
|
||||
<%= javascript_include_tag 'login', 'data-turbolinks-track': 'reload' %>
|
||||
</head>
|
||||
|
||||
<body class="login-page">
|
||||
@@ -57,8 +57,8 @@
|
||||
</div>
|
||||
<!-- #END# Page Loader -->
|
||||
<% flash.each do |type, message| %>
|
||||
<%
|
||||
if type == "notice"
|
||||
<%
|
||||
if type == "notice"
|
||||
color = "alert-success"
|
||||
elsif type == "error"
|
||||
color = "alert-danger"
|
||||
@@ -67,22 +67,22 @@
|
||||
else
|
||||
color = "bg-black"
|
||||
end %>
|
||||
|
||||
|
||||
<p id="noti" class="hidden noti" data-placement-from="top" data-message="<%=message%>" data-placement-align="center"
|
||||
data-animate-enter="" data-animate-exit="" data-color-name="<%=color%>" >
|
||||
</p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<div class="login-box">
|
||||
<div class="logo text-center">
|
||||
<img src="/image/SX-logo.png" width="150px" height="150px">
|
||||
<p>
|
||||
<small>Version - 1.0.1</small>
|
||||
</p>
|
||||
</p>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-12_ col-md-12 col-sm-12 col-xs-12 text-center">
|
||||
<div class="current-shop-name">
|
||||
<span><%= shop_detail.name %></span>
|
||||
<span><%= shop_detail.name %></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -90,13 +90,13 @@
|
||||
<div class="card padding-10">
|
||||
<div class="card-header m-l-">
|
||||
<div class="row clearfix">
|
||||
<div class="col-lg-10 col-md-10 col-sm-10 col-xs-10">
|
||||
<div class="col-lg-10 col-md-10 col-sm-10 col-xs-10 login_pwd">
|
||||
<%= f.input :emp_id, as: :hidden, required: false, class: "form-control" %>
|
||||
|
||||
<%= f.input :password, label: "Access PIN", required: false, class: "form-control" %>
|
||||
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-10">
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-10 login_ent">
|
||||
<br>
|
||||
<span class="input-group-addon enter m-t-25 m-l--25" data-value="ENT" style="cursor: pointer;padding:0.1rem !important;">
|
||||
<i class="material-icons">send</i>
|
||||
@@ -126,10 +126,16 @@
|
||||
<!-- <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> -->
|
||||
<% if request.user_agent.include? 'Mobile' %>
|
||||
<div class="pin_pad bg-blue-grey" data-value="CLR">CLR</div>
|
||||
<div class="pin_pad left" data-value="0">0</div>
|
||||
<div class="pin_pad bg-grey left" data-value="ENT">ENTER</div>
|
||||
<% else %>
|
||||
<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 class="pin_pad bg-blue-grey" data-value="CLR">CLR</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -139,7 +145,7 @@
|
||||
$("#login_form_password").focus();
|
||||
|
||||
$(".pin_pad").click(function (event) {
|
||||
event.preventDefault();
|
||||
event.preventDefault();
|
||||
var value = $(this).data("value");
|
||||
|
||||
if (value == "CLR") {
|
||||
@@ -154,12 +160,12 @@
|
||||
}
|
||||
});
|
||||
$(".enter").click(function (event) {
|
||||
event.preventDefault();
|
||||
event.preventDefault();
|
||||
var value = $(this).data("value");
|
||||
|
||||
if (value == "ENT") {
|
||||
$("#new_login_form").submit();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
function showNotification(colorName, text, placementFrom, placementAlign, animateEnter, animateExit) {
|
||||
@@ -199,5 +205,3 @@
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
|
||||
@@ -15,10 +15,10 @@
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" type="text/css"> -->
|
||||
|
||||
<%= stylesheet_link_tag 'login', media: 'all', 'data-turbolinks-track': 'reload' %>
|
||||
|
||||
|
||||
<!-- <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js" integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4" crossorigin="anonymous"></script> -->
|
||||
<%= javascript_include_tag 'login', 'data-turbolinks-track': 'reload' %>
|
||||
<%= javascript_include_tag 'login', 'data-turbolinks-track': 'reload' %>
|
||||
</head>
|
||||
|
||||
<body class="login_dashboard">
|
||||
@@ -39,8 +39,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<% flash.each do |type, message| %>
|
||||
<%
|
||||
if type == "notice"
|
||||
<%
|
||||
if type == "notice"
|
||||
color = "alert-success"
|
||||
elsif type == "error"
|
||||
color = "alert-danger"
|
||||
@@ -49,11 +49,11 @@
|
||||
else
|
||||
color = "bg-black"
|
||||
end %>
|
||||
|
||||
|
||||
<p id="noti" class="hidden noti" data-placement-from="top" data-message="<%=message%>" data-placement-align="center"
|
||||
data-animate-enter="" data-animate-exit="" data-color-name="<%=color%>" >
|
||||
</p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<!-- #END# Page Loader -->
|
||||
<div class="container">
|
||||
@@ -62,25 +62,25 @@
|
||||
<img src="/image/SX-logo.png" width="150px" height="150px">
|
||||
<p>
|
||||
<small>Version - 1.0.1</small>
|
||||
</p>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-12_ col-md-12 col-sm-12 col-xs-12 text-center">
|
||||
<div class="current-shop-name">
|
||||
<span><%= shop_detail.name %></span>
|
||||
<span><%= shop_detail.name %></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row bg-white box">
|
||||
<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">
|
||||
<div class="row bg-white box">
|
||||
<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>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
<div class="card padding-10">
|
||||
<div class="card-content">
|
||||
<div class="card-content card-btn">
|
||||
<div class='col-md-12'>
|
||||
<div class='row bottom'>
|
||||
<div class="pin_pad " data-value="1">1</div>
|
||||
@@ -103,14 +103,14 @@
|
||||
<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 class="pin_pad bg-grey left" data-value="CLR">CLR</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</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">
|
||||
</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">
|
||||
<% @roles.each do |role| %>
|
||||
<%if role != "administrator" %>
|
||||
@@ -119,8 +119,8 @@
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
</ul>
|
||||
|
||||
</ul>
|
||||
|
||||
<div class="tab-content" style="max-height:650px; overflow:auto">
|
||||
|
||||
@@ -129,7 +129,7 @@
|
||||
<div class="tab-pane" id="<%=role%>" role="tabpanel" style="max-height:; overflow:auto">
|
||||
<% @employees.each do |employee| %>
|
||||
<%if employee.role == role %>
|
||||
<div class="col-xs-3 col-sm-3 col-md-3 col-lg-3 empBtn" data-formid="#form_<%= employee.emp_id %>" style="float: left;">
|
||||
<div class="col-xs-3 col-sm-3 col-md-3 col-lg-3 empBtn mbl-btn-usrgp" 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>
|
||||
<%if employee.image_path.present? %>
|
||||
@@ -138,20 +138,20 @@
|
||||
<div class="p-name"><b><%= employee.name%></b>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<% else %>
|
||||
<div class="login_dashboard p-card">
|
||||
<i class="material-icons style_icon">person</i>
|
||||
<div class="p-name"><b><%= employee.name%></b>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="col-xs-12 col-sm-12 col-md-2 col-lg-2"> </div> -->
|
||||
</div>
|
||||
@@ -159,7 +159,7 @@
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<script>
|
||||
<script>
|
||||
|
||||
|
||||
$(document).ready(function () {
|
||||
@@ -172,7 +172,7 @@
|
||||
var text = $("#noti").attr('data-message');
|
||||
|
||||
if (text != null || colorName != null){
|
||||
showNotification(colorName, text, placementFrom, placementAlign, animateEnter, animateExit);
|
||||
showNotification(colorName, text, placementFrom, placementAlign, animateEnter, animateExit);
|
||||
}
|
||||
|
||||
$(".empBtn").click(function (event) {
|
||||
@@ -181,15 +181,15 @@
|
||||
$(item).submit();
|
||||
});
|
||||
|
||||
$('ul.nav.nav-tabs li a').click(function() {
|
||||
var bb = $('.nav-item').children()[0];
|
||||
$('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();
|
||||
event.preventDefault();
|
||||
var value = $(this).data("value");
|
||||
|
||||
if (value == "CLR") {
|
||||
@@ -213,11 +213,11 @@
|
||||
|
||||
$('#emp_id').keyup(function(e) {
|
||||
e.preventDefault();
|
||||
var txtVal = this.value;
|
||||
|
||||
var txtVal = this.value;
|
||||
|
||||
if(txtVal!=''){
|
||||
if ($.isNumeric(txtVal)) {
|
||||
if( txtVal.length === 3 ) {
|
||||
if ($.isNumeric(txtVal)) {
|
||||
if( txtVal.length === 3 ) {
|
||||
window.location.href = '/auth/'+txtVal;
|
||||
}
|
||||
}else{
|
||||
@@ -228,10 +228,10 @@
|
||||
|
||||
var aa = $('.nav-item').children().attr('href').replace('#','');
|
||||
$('#'+aa).addClass('active');
|
||||
var bb = $('.nav-item').children()[0];
|
||||
var bb = $('.nav-item').children()[0];
|
||||
$(bb).parent().addClass('active_tab').siblings().removeClass('active_tab');
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
function showNotification(colorName, text, placementFrom, placementAlign, animateEnter, animateExit) {
|
||||
if (colorName === null || colorName === '') { colorName = 'bg-black'; }
|
||||
@@ -268,6 +268,3 @@
|
||||
}
|
||||
//end Notificaiotn message
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -2,15 +2,15 @@
|
||||
<%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %>
|
||||
<% if period_type != false %>
|
||||
<div class="row">
|
||||
|
||||
|
||||
<% if defined? @payment_method %>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.select_payments") %></label>
|
||||
<%= select_tag "payment_type", options_for_select(@payment_method, :selected => params[:payment_type]), :class => "form-control" %>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
|
||||
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.select_payments") %></label>
|
||||
<%= select_tag "payment_type", options_for_select(@payment_method, :selected => params[:payment_type]), :class => "form-control" %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.select_period") %></label>
|
||||
<% end %>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
|
||||
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.select_period") %></label>
|
||||
<select name="period" id="sel_period" class="form-control">
|
||||
<option value=""><%= t("views.right_panel.detail.select_period") %></option>
|
||||
<option value="0">Today</option>
|
||||
@@ -26,10 +26,10 @@
|
||||
</select>
|
||||
</div>
|
||||
<% if not defined? payments %>
|
||||
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.select_payments") %></label>
|
||||
|
||||
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 mbl-style">
|
||||
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.select_payments") %></label>
|
||||
|
||||
<select name="payment_type" id="payment_type" class="form-control">
|
||||
<% @payments.each do |pm| %>
|
||||
<option class="<%=pm[1].downcase%>" value="<%=pm[1].downcase%>"><%=pm[0]%></option>
|
||||
@@ -38,52 +38,52 @@
|
||||
<option value="<%=pm.payment_method%>" class="<%=pm.payment_method%>" > <%=pm.payment_method%></option>
|
||||
<%end %>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
|
||||
<!-- <label class="">Select Shift Period</label> -->
|
||||
<label class="font-14"><%= t("views.right_panel.detail.from") %></label>
|
||||
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.from") %></label>
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="from" id="from" type="text" placeholder="From date" style="height: 32px;">
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.to") %></label>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
|
||||
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.to") %></label>
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="to" id="to" type="text" placeholder="To date" style="height: 32px;">
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.all_shift") %></label>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 mbl-style">
|
||||
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.all_shift") %></label>
|
||||
<select class="form-control select" name="shift_name" id="shift_name" >
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 mbl-right-btn mbl-style">
|
||||
<br>
|
||||
<input type="submit" value="Generate Report" class='btn btn-primary'>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$('#custom_excel').hide();
|
||||
|
||||
|
||||
$('#custom_excel').click(function(){
|
||||
var url = $('#custom_excel').attr('data-url');
|
||||
$('#frm_report').attr('action',url)
|
||||
$('#frm_report').submit();
|
||||
// window.location = url;
|
||||
});
|
||||
|
||||
|
||||
var item = $('#item').val();
|
||||
var payment_type = $('#payment_type');
|
||||
|
||||
|
||||
if(item == 'order'){
|
||||
$('#cashier').hide();
|
||||
$('#waiter').show();
|
||||
if(payment_type){
|
||||
$('#payment_type').hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(item == 'sale'){
|
||||
$('#waiter').hide();
|
||||
@@ -91,7 +91,7 @@
|
||||
}
|
||||
else{
|
||||
$('#waiter').hide();
|
||||
$('#cashier').show();
|
||||
$('#cashier').show();
|
||||
$("#item").val('sale');
|
||||
}
|
||||
});
|
||||
@@ -109,7 +109,7 @@
|
||||
$("#to").val("<%=params[:to] rescue '-'%>");
|
||||
$("#sel_period").val(<%=params[:period] rescue '-'%>);
|
||||
$("#sel_sale_type").val(<%=params[:sale_type] rescue '-'%>);
|
||||
|
||||
|
||||
$(".<%=params[:payment_type]%>").attr('selected','selected')
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@
|
||||
|
||||
if(item == 'sale'){
|
||||
$('#waiter').hide();
|
||||
$('#cashier').show();
|
||||
$('#cashier').show();
|
||||
if(payment_type){
|
||||
$('#payment_type').show();
|
||||
}
|
||||
|
||||
@@ -16,10 +16,10 @@
|
||||
|
||||
<div class="text-right">
|
||||
<a href="javascript:export_to('<%=reports_card_sale_tran_index_path%>.xls')" class = "btn btn-info wave-effects"><%= t("views.btn.exp_to_excel") %></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="margin-top-20">
|
||||
<div class="card" style="width:112%;">
|
||||
<div class="margin-top-20 mbl-table">
|
||||
<div class="card mbl-table-card" style="width:112%;">
|
||||
<table class="table table-striped" border="0">
|
||||
<thead>
|
||||
|
||||
@@ -28,12 +28,12 @@
|
||||
</tr>
|
||||
<% if @shift_from %>
|
||||
<tr>
|
||||
<% if @shift_data.employee %>
|
||||
<% if @shift_data.employee %>
|
||||
<% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<th colspan="9"><%= t("views.right_panel.detail.shift_name") %> = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )</th>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<tr>
|
||||
<th><%= t("views.right_panel.detail.req_date") %></th>
|
||||
@@ -63,7 +63,7 @@
|
||||
UnionPay
|
||||
<% else %>
|
||||
<%= cardSale.app %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td><%= cardSale.sale.customer.name rescue '-' %></td>
|
||||
<td><%= cardSale.sale.cashier_name rescue '-' %></td>
|
||||
@@ -72,18 +72,18 @@
|
||||
TID : <%= cardSale.terminal_id %>
|
||||
<br>
|
||||
<% end %>
|
||||
<% if cardSale.merchant_id != '' %>
|
||||
<% if cardSale.merchant_id != '' %>
|
||||
MID : <%= cardSale.merchant_id %>
|
||||
<br>
|
||||
<% end %>
|
||||
<% if cardSale.batch_no != '' %>
|
||||
<% if cardSale.batch_no != '' %>
|
||||
Batch : <%= cardSale.batch_no %>
|
||||
<br>
|
||||
<% end %>
|
||||
<% if cardSale.trace != '' %>
|
||||
<% if cardSale.trace != '' %>
|
||||
Trace : <%= cardSale.trace %>
|
||||
<% end %>
|
||||
</td>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% else %>
|
||||
@@ -102,20 +102,20 @@
|
||||
var check_arr = [];
|
||||
search_by_period();
|
||||
$('#sel_period').change(function(){
|
||||
|
||||
|
||||
search_by_period();
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
function search_by_period(){
|
||||
var period = $('#sel_period').val();
|
||||
var period_type = 0;
|
||||
var from = "";
|
||||
var to = "";
|
||||
|
||||
show_shift_name(period,period_type,from,to,'shift_item');
|
||||
}
|
||||
|
||||
show_shift_name(period,period_type,from,to,'shift_item');
|
||||
}
|
||||
|
||||
// OK button is clicked
|
||||
$('#from').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
|
||||
new_date = new Date(date) ;
|
||||
@@ -130,50 +130,50 @@
|
||||
to = new_date.getDate() + "-" + month + "-" + new_date.getFullYear();
|
||||
$('#to').val(to)
|
||||
search_by_date();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function search_by_date(){
|
||||
|
||||
|
||||
from = $("#from").val();
|
||||
to = $("#to").val();
|
||||
|
||||
var period = 0;
|
||||
var period_type = 1;
|
||||
var period_type = 1;
|
||||
|
||||
if(to != '' && from != ''){
|
||||
shift_name = from + ',' + to;
|
||||
|
||||
check_arr.push(to);
|
||||
|
||||
|
||||
if(check_arr.length == 1){
|
||||
show_shift_name(period,period_type,from,to,'shift_item');
|
||||
show_shift_name(period,period_type,from,to,'shift_item');
|
||||
}
|
||||
if(check_arr.length == 3){
|
||||
check_arr = [];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
function show_shift_name(period,period_type,from,to,shift_item){
|
||||
var shift = $('#shift_name');
|
||||
|
||||
|
||||
shift.empty();
|
||||
|
||||
|
||||
var str = '';
|
||||
var param_shift = '';
|
||||
var param_shift = '';
|
||||
var param_shift = '<%= params[:shift_name] rescue '-'%>';
|
||||
if (from == '' && to == '') {
|
||||
from = $("#from").val();
|
||||
to = $("#to").val();
|
||||
}
|
||||
url = '<%= reports_get_shift_by_date_path %>';
|
||||
|
||||
|
||||
$.get(url, {period :period, period_type :period_type, from :from, to :to, report_type :shift_item} , function(data){
|
||||
|
||||
str = '<option value="0">--- All Shift ---</option>';
|
||||
$(data.message).each(function(index){
|
||||
|
||||
$(data.message).each(function(index){
|
||||
|
||||
var local_date = data.message[index].local_opening_date + ' - ' + data.message[index].local_closing_date;
|
||||
var sh_date = data.message[index].opening_date + ' - ' + data.message[index].closing_date;
|
||||
var shift_id = data.message[index].shift_id ;
|
||||
@@ -182,18 +182,18 @@
|
||||
selected = 'selected = "selected"';
|
||||
}
|
||||
else{
|
||||
selected = '';
|
||||
}
|
||||
selected = '';
|
||||
}
|
||||
}else{
|
||||
selected = '';
|
||||
}
|
||||
selected = '';
|
||||
}
|
||||
str += '<option value="'+ shift_id +'" '+ selected +'>' + local_date + '</option>';
|
||||
|
||||
|
||||
// console.log(sh_date)
|
||||
})
|
||||
})
|
||||
shift.append(str);
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
|
||||
@@ -2,15 +2,15 @@
|
||||
<%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %>
|
||||
<% if period_type != false %>
|
||||
<div class="row">
|
||||
|
||||
|
||||
<% if defined? @payment_method %>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.select_payments") %></label>
|
||||
<%= select_tag "payment_type", options_for_select(@payment_method, :selected => params[:payment_type]), :class => "form-control" %>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
|
||||
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.select_payments") %></label>
|
||||
<%= select_tag "payment_type", options_for_select(@payment_method, :selected => params[:payment_type]), :class => "form-control" %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.select_period") %></label>
|
||||
<% end %>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
|
||||
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.select_period") %></label>
|
||||
<select name="period" id="sel_period" class="form-control">
|
||||
<option value=""><%= t("views.right_panel.detail.select_period") %></option>
|
||||
<option value="0">Today</option>
|
||||
@@ -26,10 +26,10 @@
|
||||
</select>
|
||||
</div>
|
||||
<% if not defined? payments %>
|
||||
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 mbl-style">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.select_payments") %></label>
|
||||
|
||||
|
||||
<select name="payment_type" id="payment_type" class="form-control">
|
||||
<% @payments.each do |pm| %>
|
||||
<option class="<%=pm[1].downcase%>" value="<%=pm[1].downcase%>"><%=pm[0]%></option>
|
||||
@@ -38,52 +38,52 @@
|
||||
<option value="<%=pm.payment_method%>" class="<%=pm.payment_method%>" > <%=pm.payment_method%></option>
|
||||
<%end %>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
|
||||
<!-- <label class="">Select Shift Period</label> -->
|
||||
<label class="font-14"><%= t("views.right_panel.detail.from") %></label>
|
||||
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.from") %></label>
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="from" id="from" type="text" placeholder="From date" style="height: 32px;">
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.to") %></label>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
|
||||
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.to") %></label>
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="to" id="to" type="text" placeholder="To date" style="height: 32px;">
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.all_shift") %></label>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 mbl-style">
|
||||
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.all_shift") %></label>
|
||||
<select class="form-control select" name="shift_name" id="shift_name" >
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 mbl-right-btn mbl-style">
|
||||
<br>
|
||||
<input type="submit" value="Generate Report" class='btn btn-primary'>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$('#custom_excel').hide();
|
||||
|
||||
|
||||
$('#custom_excel').click(function(){
|
||||
var url = $('#custom_excel').attr('data-url');
|
||||
$('#frm_report').attr('action',url)
|
||||
$('#frm_report').submit();
|
||||
// window.location = url;
|
||||
});
|
||||
|
||||
|
||||
var item = $('#item').val();
|
||||
var payment_type = $('#payment_type');
|
||||
|
||||
|
||||
if(item == 'order'){
|
||||
$('#cashier').hide();
|
||||
$('#waiter').show();
|
||||
if(payment_type){
|
||||
$('#payment_type').hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(item == 'sale'){
|
||||
$('#waiter').hide();
|
||||
@@ -91,7 +91,7 @@
|
||||
}
|
||||
else{
|
||||
$('#waiter').hide();
|
||||
$('#cashier').show();
|
||||
$('#cashier').show();
|
||||
$("#item").val('sale');
|
||||
}
|
||||
});
|
||||
@@ -109,7 +109,7 @@
|
||||
$("#to").val("<%=params[:to] rescue '-'%>");
|
||||
$("#sel_period").val(<%=params[:period] rescue '-'%>);
|
||||
$("#sel_sale_type").val(<%=params[:sale_type] rescue '-'%>);
|
||||
|
||||
|
||||
$(".<%=params[:payment_type]%>").attr('selected','selected')
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@
|
||||
|
||||
if(item == 'sale'){
|
||||
$('#waiter').hide();
|
||||
$('#cashier').show();
|
||||
$('#cashier').show();
|
||||
if(payment_type){
|
||||
$('#payment_type').show();
|
||||
}
|
||||
|
||||
@@ -16,10 +16,10 @@
|
||||
|
||||
<div class="text-right">
|
||||
<a href="javascript:export_to('<%=reports_card_settle_tran_index_path%>.xls')" class = "btn btn-info wave-effects"><%= t("views.btn.exp_to_excel") %></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="margin-top-20">
|
||||
<div class="card">
|
||||
<div class="margin-top-20 mbl-table">
|
||||
<div class="card mbl-table-card">
|
||||
<table class="table table-striped" border="0">
|
||||
<thead>
|
||||
|
||||
@@ -28,12 +28,12 @@
|
||||
</tr>
|
||||
<% if @shift_from %>
|
||||
<tr>
|
||||
<% if @shift_data.employee %>
|
||||
<% if @shift_data.employee %>
|
||||
<% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<th colspan="9"><%= t("views.right_panel.detail.shift_name") %> = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )</th>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<tr>
|
||||
<th><%= t("views.right_panel.detail.shift_sale_id") %></th>
|
||||
@@ -81,20 +81,20 @@
|
||||
var check_arr = [];
|
||||
search_by_period();
|
||||
$('#sel_period').change(function(){
|
||||
|
||||
|
||||
search_by_period();
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
function search_by_period(){
|
||||
var period = $('#sel_period').val();
|
||||
var period_type = 0;
|
||||
var from = "";
|
||||
var to = "";
|
||||
|
||||
show_shift_name(period,period_type,from,to,'shift_item');
|
||||
}
|
||||
|
||||
show_shift_name(period,period_type,from,to,'shift_item');
|
||||
}
|
||||
|
||||
// OK button is clicked
|
||||
$('#from').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
|
||||
new_date = new Date(date) ;
|
||||
@@ -109,50 +109,50 @@
|
||||
to = new_date.getDate() + "-" + month + "-" + new_date.getFullYear();
|
||||
$('#to').val(to)
|
||||
search_by_date();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function search_by_date(){
|
||||
|
||||
|
||||
from = $("#from").val();
|
||||
to = $("#to").val();
|
||||
|
||||
var period = 0;
|
||||
var period_type = 1;
|
||||
var period_type = 1;
|
||||
|
||||
if(to != '' && from != ''){
|
||||
shift_name = from + ',' + to;
|
||||
|
||||
check_arr.push(to);
|
||||
|
||||
|
||||
if(check_arr.length == 1){
|
||||
show_shift_name(period,period_type,from,to,'shift_item');
|
||||
show_shift_name(period,period_type,from,to,'shift_item');
|
||||
}
|
||||
if(check_arr.length == 3){
|
||||
check_arr = [];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
function show_shift_name(period,period_type,from,to,shift_item){
|
||||
var shift = $('#shift_name');
|
||||
|
||||
|
||||
shift.empty();
|
||||
|
||||
|
||||
var str = '';
|
||||
var param_shift = '';
|
||||
var param_shift = '';
|
||||
var param_shift = '<%= params[:shift_name] rescue '-'%>';
|
||||
if (from == '' && to == '') {
|
||||
from = $("#from").val();
|
||||
to = $("#to").val();
|
||||
}
|
||||
url = '<%= reports_get_shift_by_date_path %>';
|
||||
|
||||
|
||||
$.get(url, {period :period, period_type :period_type, from :from, to :to, report_type :shift_item} , function(data){
|
||||
|
||||
str = '<option value="0">--- All Shift ---</option>';
|
||||
$(data.message).each(function(index){
|
||||
|
||||
$(data.message).each(function(index){
|
||||
|
||||
var local_date = data.message[index].local_opening_date + ' - ' + data.message[index].local_closing_date;
|
||||
var sh_date = data.message[index].opening_date + ' - ' + data.message[index].closing_date;
|
||||
var shift_id = data.message[index].shift_id ;
|
||||
@@ -161,18 +161,18 @@
|
||||
selected = 'selected = "selected"';
|
||||
}
|
||||
else{
|
||||
selected = '';
|
||||
}
|
||||
selected = '';
|
||||
}
|
||||
}else{
|
||||
selected = '';
|
||||
}
|
||||
selected = '';
|
||||
}
|
||||
str += '<option value="'+ shift_id +'" '+ selected +'>' + local_date + '</option>';
|
||||
|
||||
|
||||
// console.log(sh_date)
|
||||
})
|
||||
})
|
||||
shift.append(str);
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
|
||||
@@ -11,17 +11,17 @@
|
||||
<input class="form-control" name="daterange" id="daterange" type="text" placeholder="Date Range" readonly="true">
|
||||
<% end %>
|
||||
</div> -->
|
||||
<div class="col-lg-3 col-md-3 col-sm-3">
|
||||
<div class="col-lg-3 col-md-3 col-sm-3 col-mbl-view mbl-style">
|
||||
<!-- <label class="">Select Shift Period</label> -->
|
||||
<label class="font-14"><%= t("views.right_panel.detail.from") %></label>
|
||||
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.from") %></label>
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="from" id="from" type="text" placeholder="From date" style="height: 34px;">
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-3 col-sm-3">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.to") %></label>
|
||||
<div class="col-lg-3 col-md-3 col-sm-3 col-mbl-view mbl-style">
|
||||
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.to") %></label>
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="to" id="to" type="text" placeholder="To date" style="height: 34px;">
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14"><%= t :commissioner %></label>
|
||||
<label class="font-14 mbl_lbl"><%= t :commissioner %></label>
|
||||
<select class="form-control" name="commissioner" id="commissioner" style="height: 37px;">
|
||||
<option value=""></option>
|
||||
<% @commissioner.each do |c| %>
|
||||
@@ -33,7 +33,7 @@
|
||||
<% end %>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 margin-top-20">
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 margin-top-20 mbl-right-btn mbl-style">
|
||||
<br>
|
||||
<input type="submit" value="Generate Report" class='btn btn-info wave-effects'>
|
||||
</div>
|
||||
@@ -89,4 +89,4 @@
|
||||
});
|
||||
|
||||
</script>
|
||||
-->
|
||||
-->
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
<%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %>
|
||||
<% if period_type != false %>
|
||||
<div class="row">
|
||||
<div class="form-group col-md-2">
|
||||
<label class="font-20"><%= t("views.right_panel.detail.select_period") %></label>
|
||||
<div class="form-group col-md-2 mbl-style">
|
||||
<label class="font-20 mbl_lbl"><%= t("views.right_panel.detail.select_period") %></label>
|
||||
<select name="period" id="sel_period" class="form-control">
|
||||
<option value=""><%= t("views.right_panel.detail.select_period") %></option>
|
||||
<option value="0">Today</option>
|
||||
@@ -19,60 +19,60 @@
|
||||
</select>
|
||||
</div>
|
||||
<% if defined? filter_for_credit %>
|
||||
<div class="form-group col-md-2">
|
||||
<label class="font-20">Select Paid/ Unpaid</label>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 col-mbl-view mbl-style">
|
||||
<label class="font-14">Select Paid/ Unpaid</label>
|
||||
<%= select_tag "filter_check", options_for_select(@filter_for_credit, :selected => params[:filter_check]), :class => "form-control", :style => "height: 37px;" %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.order_source") %></label>
|
||||
<%= select_tag "order_source", options_for_select(@sources, :selected => params[:order_source]), :class => "form-control" %>
|
||||
</div>
|
||||
<div class="form-group col-md-2">
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 col-mbl-view mbl-style">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.order_source") %></label>
|
||||
<%= select_tag "order_source", options_for_select(@sources, :selected => params[:order_source]), :class => "form-control" %>
|
||||
</div>
|
||||
<div class="form-group col-md-2 col-mbl-view mbl-style">
|
||||
<!-- <label class="">Select Shift Period</label> -->
|
||||
<label class="font-20">From</label>
|
||||
<label class="font-20 mbl_lbl">From</label>
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="from" id="from" type="text" placeholder="From date" style="height: 34px;">
|
||||
</div>
|
||||
<div class="form-group col-md-2">
|
||||
<label class="font-20">To</label>
|
||||
<div class="form-group col-md-2 col-mbl-view mbl-style">
|
||||
<label class="font-20 mbl_lbl">To</label>
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="to" id="to" type="text" placeholder="To date" style="height: 34px;">
|
||||
</div>
|
||||
<div class="form-group col-md-2">
|
||||
<label class="font-20">All Shift</label>
|
||||
<div class="form-group col-md-2 mbl-style">
|
||||
<label class="font-20 mbl_lbl">All Shift</label>
|
||||
<select class="form-control select" name="shift_name" id="shift_name" style="height: 37px;">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row clearfix">
|
||||
<div class="form-group col-md-12" align="right">
|
||||
<div class="form-group col-md-12 mbl-style mbl-right-btn" align="right">
|
||||
<br>
|
||||
<input type="submit" value="Generate Report" class='btn btn-primary'>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$('#custom_excel').hide();
|
||||
|
||||
|
||||
$('#custom_excel').click(function(){
|
||||
var url = $('#custom_excel').attr('data-url');
|
||||
$('#frm_report').attr('action',url)
|
||||
$('#frm_report').submit();
|
||||
// window.location = url;
|
||||
});
|
||||
|
||||
|
||||
var item = $('#item').val();
|
||||
var payment_type = $('#payment_type');
|
||||
|
||||
|
||||
if(item == 'order'){
|
||||
$('#cashier').hide();
|
||||
$('#waiter').show();
|
||||
if(payment_type){
|
||||
$('#payment_type').hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(item == 'sale'){
|
||||
$('#waiter').hide();
|
||||
@@ -80,7 +80,7 @@
|
||||
}
|
||||
else{
|
||||
$('#waiter').hide();
|
||||
$('#cashier').show();
|
||||
$('#cashier').show();
|
||||
$("#item").val('sale');
|
||||
}
|
||||
});
|
||||
@@ -117,7 +117,7 @@
|
||||
|
||||
if(item == 'sale'){
|
||||
$('#waiter').hide();
|
||||
$('#cashier').show();
|
||||
$('#cashier').show();
|
||||
if(payment_type){
|
||||
$('#payment_type').show();
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<div class="p-l-15">
|
||||
|
||||
|
||||
<%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %>
|
||||
<% if period_type != false %>
|
||||
<div class="row">
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.select_period") %></label>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl mbl-style">
|
||||
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.select_period") %></label>
|
||||
<select name="period" id="sel_period" class="form-control">
|
||||
<option value=""><%= t("views.right_panel.detail.select_period") %></option>
|
||||
<option value="0">Today</option>
|
||||
@@ -21,20 +21,20 @@
|
||||
</div>
|
||||
<input type="hidden" name="report_type" value="daily_sale" id="sel_sale_type">
|
||||
|
||||
<div class="col-lg-3 col-md-3 col-sm-3">
|
||||
<div class="col-lg-3 col-md-3 col-sm-3 col-mbl-view mbl-style">
|
||||
<!-- <label class="">Select Shift Period</label> -->
|
||||
<label class="font-14"><%= t("views.right_panel.detail.from") %></label>
|
||||
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.from") %></label>
|
||||
<input data-behaviour='datepicker' class="form-control datepicker" name="from" id="from" type="text" placeholder="From date" style="height: 35px;">
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-3 col-sm-3">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.to") %></label>
|
||||
<div class="col-lg-3 col-md-3 col-sm-3 col-mbl-view mbl-style">
|
||||
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.to") %></label>
|
||||
<input data-behaviour='datepicker' class="form-control datepicker" name="to" id="to" type="text" placeholder="To date" style="height: 35px;">
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 margin-top-20">
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 margin-top-20 mbl-right-btn mbl-style">
|
||||
<label></label><br>
|
||||
<input type="submit" value="Generate Report" class='btn btn-primary'>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="row">
|
||||
@@ -44,11 +44,11 @@
|
||||
<% end %>
|
||||
|
||||
<% if defined? menu_types %>
|
||||
<%= select_tag "menu_type", options_for_select(@menu_types, :selected => params[:menu_type]), :class => "form-control" %>
|
||||
<%= select_tag "menu_type", options_for_select(@menu_types, :selected => params[:menu_type]), :class => "form-control" %>
|
||||
<% end %>
|
||||
|
||||
<% if defined? payments %>
|
||||
<%= select_tag "payment_type", options_for_select(@payments, :selected => params[:payment_type]), :class => "form-control" %>
|
||||
<%= select_tag "payment_type", options_for_select(@payments, :selected => params[:payment_type]), :class => "form-control" %>
|
||||
<% end %>
|
||||
|
||||
<% if defined? shift_name %>
|
||||
@@ -63,31 +63,31 @@
|
||||
<% if defined? singer %>
|
||||
<%= select_tag "singer", options_from_collection_for_select(singer,"id","name"),:prompt => "All Vocal List", :class => "form-control" %>
|
||||
<% end %>
|
||||
|
||||
<% if defined? bsm %>
|
||||
|
||||
<% if defined? bsm %>
|
||||
<%= select_tag "singer", options_from_collection_for_select(bsm,"id","name"),:prompt => "All BSM List", :class => "form-control" %>
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
|
||||
<% if defined? guest_role %>
|
||||
<%= select_tag "guest_role", options_from_collection_for_select(@guest_role,"id","name"),:prompt => "Vocal/BSM List", :class => "form-control" %>
|
||||
<% end %>
|
||||
|
||||
|
||||
<% if defined? list_by_payment_type %> <!-- for report detail by credit and foc -->
|
||||
<%= select_tag "payment_type_list", options_for_select(@payment_list, :selected => params[:payment_type_list]), :class => "form-control" %>
|
||||
<% end %>
|
||||
|
||||
<% if defined? products %>
|
||||
<%= select_tag "product", options_from_collection_for_select(@products,"id","name"),:prompt => "All Products", :class => "form-control" %>
|
||||
<%= select_tag "payment_type_list", options_for_select(@payment_list, :selected => params[:payment_type_list]), :class => "form-control" %>
|
||||
<% end %>
|
||||
|
||||
<% if defined? items %>
|
||||
<%= select_tag "item", options_for_select(@items, :selected => params[:item_type]), :class => "form-control" %>
|
||||
<% if defined? products %>
|
||||
<%= select_tag "product", options_from_collection_for_select(@products,"id","name"),:prompt => "All Products", :class => "form-control" %>
|
||||
<% end %>
|
||||
|
||||
<% if defined? items %>
|
||||
<%= select_tag "item", options_for_select(@items, :selected => params[:item_type]), :class => "form-control" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
@@ -108,7 +108,7 @@
|
||||
$('#waiter').show();
|
||||
if(payment_type){
|
||||
$('#payment_type').hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(item == 'sale'){
|
||||
$('#waiter').hide();
|
||||
@@ -116,7 +116,7 @@
|
||||
}
|
||||
else{
|
||||
$('#waiter').hide();
|
||||
$('#cashier').show();
|
||||
$('#cashier').show();
|
||||
$("#item").val('sale');
|
||||
}
|
||||
});
|
||||
@@ -151,7 +151,7 @@ $('#item').change(function(){
|
||||
|
||||
if(item == 'sale'){
|
||||
$('#waiter').hide();
|
||||
$('#cashier').show();
|
||||
$('#cashier').show();
|
||||
if(payment_type){
|
||||
$('#payment_type').show();
|
||||
}
|
||||
@@ -164,4 +164,4 @@ $('#item').change(function(){
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
<div class="page-header" style="width:130%;">
|
||||
<div class="page-header">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
|
||||
<li class="breadcrumb-item active"><%= t("views.right_panel.detail.daily_sale_report") %></li>
|
||||
@@ -15,50 +15,50 @@
|
||||
<hr />
|
||||
<div class=" text-right">
|
||||
<a href="javascript:export_to('<%=reports_dailysale_index_path%>.xls')" class = "btn btn-info wave-effects"><%= t("views.btn.exp_to_excel") %></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-12">
|
||||
<div class="card" style="width:129%;">
|
||||
<div class="card mbl_card">
|
||||
<div class="body table-responsive">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="15"> <%= t("views.right_panel.detail.from_date") %> : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - <%= t("views.right_panel.detail.to_date") %> : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%></th>
|
||||
<th colspan="18"> <%= t("views.right_panel.detail.from_date") %> : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - <%= t("views.right_panel.detail.to_date") %> : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.sr") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.date") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.void_amount") %></th>
|
||||
<% if @payment_methods.include? ("MPU") %>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.mpu_sales") %></th>
|
||||
<th style='text-align:center;' class="d-none d-sm-table-cell"><%= t("views.right_panel.detail.mpu_sales") %></th>
|
||||
<% end %>
|
||||
<% if @payment_methods.include? ("Master") %>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.master_sales") %></th>
|
||||
<th style='text-align:center;' class="d-none d-sm-table-cell"><%= t("views.right_panel.detail.master_sales") %></th>
|
||||
<% end %>
|
||||
<% if @payment_methods.include? ("VISA") %>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.visa_sales") %></th>
|
||||
<th style='text-align:center;' class="d-none d-sm-table-cell"><%= t("views.right_panel.detail.visa_sales") %></th>
|
||||
<% end %>
|
||||
<% if @payment_methods.include? ("JCB") %>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.jcb_sales") %></th>
|
||||
<th style='text-align:center;' class="d-none d-sm-table-cell"><%= t("views.right_panel.detail.jcb_sales") %></th>
|
||||
<% end %>
|
||||
<% if @payment_methods.include? ("UNIONPAY") %>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.unionpay_sales") %></th>
|
||||
<th style='text-align:center;' class="d-none d-sm-table-cell"><%= t("views.right_panel.detail.unionpay_sales") %></th>
|
||||
<% end %>
|
||||
<% if @payment_methods.include? ("Alipay") %>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.alipay_sales") %></th>
|
||||
<th style='text-align:center;' class="d-none d-sm-table-cell"><%= t("views.right_panel.detail.alipay_sales") %></th>
|
||||
<% end %>
|
||||
<% if @payment_methods.include? ("PAYMAL") %>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.paymal_sales") %></th>
|
||||
<th style='text-align:center;' class="d-none d-sm-table-cell"><%= t("views.right_panel.detail.paymal_sales") %></th>
|
||||
<% end %>
|
||||
<% if @payment_methods.include? ("DINGA") %>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.dinga_sales") %></th>
|
||||
<th style='text-align:center;' class="d-none d-sm-table-cell"><%= t("views.right_panel.detail.dinga_sales") %></th>
|
||||
<% end %>
|
||||
<% if @payment_methods.include? ("JunctionPay") %>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.junctionpay_sales") %></th>
|
||||
<th style='text-align:center;' class="d-none d-sm-table-cell"><%= t("views.right_panel.detail.junctionpay_sales") %></th>
|
||||
<% end %>
|
||||
<% if @payment_methods.include? ("Redeem") %>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.redeem_sales") %></th>
|
||||
<th style='text-align:center;' class="d-none d-sm-table-cell"><%= t("views.right_panel.detail.redeem_sales") %></th>
|
||||
<% end %>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.cash_sales") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.credit_sales") %></th>
|
||||
@@ -67,10 +67,10 @@
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.giftvoucher_sales") %></th>
|
||||
<% end %>
|
||||
<th style='text-align:center;'>(<%= t("views.right_panel.detail.discount") %>)</th>
|
||||
<!-- <th style='text-align:center;'><%= t("views.right_panel.detail.grand_total") %> + <br/> <%= t("views.right_panel.detail.rnd_adj_sh") %></th> -->
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.grand_total") %></th>
|
||||
<!-- <th style='text-align:center;'><%= t("views.right_panel.detail.grand_total") %> + <br/> <%= t("views.right_panel.detail.rnd_adj_sh") %></th> -->
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.grand_total") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.rnd_adj_sh") %></th>
|
||||
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<% if @print_settings.precision.to_i > 0
|
||||
@@ -84,7 +84,7 @@
|
||||
else
|
||||
delimiter = ""
|
||||
end
|
||||
%>
|
||||
%>
|
||||
<% unless @sale_data.empty? %>
|
||||
|
||||
<tbody>
|
||||
@@ -105,8 +105,8 @@
|
||||
<% foc = 0 %>
|
||||
<% discount = 0 %>
|
||||
<% total = 0 %>
|
||||
<% grand_total = 0 %>
|
||||
<% old_grand_total = 0 %>
|
||||
<% grand_total = 0 %>
|
||||
<% old_grand_total = 0 %>
|
||||
<% count = 1 %> <% rounding_adj = 0 %>
|
||||
<% @sale_data.each do |sale| %>
|
||||
<% void += sale[:void_amount] %>
|
||||
@@ -122,121 +122,141 @@
|
||||
<% giftvoucher += sale[:giftvoucher_amount] %>
|
||||
<% paypar += sale[:paypar_amount] %>
|
||||
<% cash += sale[:cash_amount]-sale[:total_change_amount] %>
|
||||
<% credit += sale[:credit_amount] %>
|
||||
<% credit += sale[:credit_amount] %>
|
||||
<% foc += sale[:foc_amount] %>
|
||||
<% discount += sale[:total_discount] %>
|
||||
<% total += sale[:grand_total].to_f + sale[:rounding_adj].to_f %>
|
||||
<% grand_total += sale[:grand_total].to_f %>
|
||||
<% old_grand_total += sale[:old_grand_total].to_f %>
|
||||
<% rounding_adj += sale[:rounding_adj].to_f %>
|
||||
<% grand_total += sale[:grand_total].to_f %>
|
||||
<% old_grand_total += sale[:old_grand_total].to_f %>
|
||||
<% rounding_adj += sale[:rounding_adj].to_f %>
|
||||
<tr>
|
||||
<td style='text-align:right;'><%= count %></td>
|
||||
<td><%= sale[:sale_date].strftime("#{sale[:sale_date].day.ordinalize} %b") rescue '-' %></td>
|
||||
<td style='color:red;text-align:right;'><%= number_with_precision(sale[:void_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<% if @payment_methods.include? ("MPU") %>
|
||||
<td style='text-align:right;'><%= number_with_precision(sale[:mpu_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(sale[:mpu_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<% end %>
|
||||
<% if @payment_methods.include? ("Master") %>
|
||||
<td style='text-align:right;'><%= number_with_precision(sale[:master_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(sale[:master_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<% end %>
|
||||
<% if @payment_methods.include? ("VISA") %>
|
||||
<td style='text-align:right;'><%= number_with_precision(sale[:visa_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(sale[:visa_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<% end %>
|
||||
<% if @payment_methods.include? ("JCB") %>
|
||||
<td style='text-align:right;'><%= number_with_precision(sale[:jcb_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(sale[:jcb_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<% end %>
|
||||
<% if @payment_methods.include? ("UNIONPAY") %>
|
||||
<td style='text-align:right;'><%= number_with_precision(sale[:unionpay_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(sale[:unionpay_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<% end %>
|
||||
<% if @payment_methods.include? ("Alipay") %>
|
||||
<td style='text-align:right;'><%= number_with_precision(sale[:alipay_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(sale[:alipay_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<% end %>
|
||||
<% if @payment_methods.include? ("PAYMAL") %>
|
||||
<td style='text-align:right;'><%= number_with_precision(sale[:paymal_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(sale[:paymal_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<% end %>
|
||||
<% if @payment_methods.include? ("DINGA") %>
|
||||
<td style='text-align:right;'><%= number_with_precision(sale[:dinga_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(sale[:dinga_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<% end %>
|
||||
<% if @payment_methods.include? ("JunctionPay") %>
|
||||
<td style='text-align:right;'><%= number_with_precision(sale[:junctionpay_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(sale[:junctionpay_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<% end %>
|
||||
<% if @payment_methods.include? ("Redeem") %>
|
||||
<td style='text-align:right;'><%= number_with_precision(sale[:paypar_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(sale[:paypar_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<% end %>
|
||||
<td style='text-align:right;'><%= number_with_precision(sale[:cash_amount]-sale[:total_change_amount], precision:precision.to_i, delimiter: delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_precision(sale[:credit_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_precision(sale[:foc_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_precision(sale[:foc_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<% if @payment_methods.include? ("GiftVoucher") %>
|
||||
<td style='text-align:right;'><%= number_with_precision(sale[:giftvoucher_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<% end %>
|
||||
<td style='text-align:right;'><%= number_with_precision(sale[:giftvoucher_amount], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<% end %>
|
||||
<td style='text-align:right;'>(<%= number_with_precision(sale[:total_discount], precision:precision,delimiter:delimiter) rescue '-'%>)</td>
|
||||
<!-- <td style='text-align:right;'><%= number_with_precision(sale[:grand_total].to_f + sale[:rounding_adj].to_f , precision:precision.to_i,delimiter:delimiter) rescue '-'%></td> -->
|
||||
<td style='text-align:right;'><%= number_with_precision(sale[:grand_total], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<!-- <td style='text-align:right;'><%= number_with_precision(sale[:grand_total].to_f + sale[:rounding_adj].to_f , precision:precision.to_i,delimiter:delimiter) rescue '-'%></td> -->
|
||||
<td style='text-align:right;'><%= number_with_precision(sale[:grand_total], precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_precision(sale[:rounding_adj].to_f, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
|
||||
|
||||
</tr>
|
||||
<% count = count + 1 %>
|
||||
<% end %>
|
||||
<% colspan = 7 %>
|
||||
<tr style="font-weight:600;">
|
||||
<td colspan="3" style='text-align:center;'>Total</td>
|
||||
<td colspan="3" style='text-align:center;'>Total</td>
|
||||
<% if @payment_methods.include? ("MPU") %>
|
||||
<% colspan += 1 %>
|
||||
<td style='text-align:right;'><%= number_with_precision(mpu , precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<% if !request.user_agent.include? "Mobile" %>
|
||||
<% colspan += 1 %>
|
||||
<% end %>
|
||||
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(mpu , precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<% end%>
|
||||
<% if @payment_methods.include? ("Master") %>
|
||||
<% colspan += 1 %>
|
||||
<td style='text-align:right;'><%= number_with_precision(master, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<% if !request.user_agent.include? "Mobile" %>
|
||||
<% colspan += 1 %>
|
||||
<% end %>
|
||||
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(master, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<% end%>
|
||||
<% if @payment_methods.include? ("VISA") %>
|
||||
<% colspan += 1 %>
|
||||
<td style='text-align:right;'><%= number_with_precision(visa, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<% if !request.user_agent.include? "Mobile" %>
|
||||
<% colspan += 1 %>
|
||||
<% end %>
|
||||
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(visa, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<% end%>
|
||||
<% if @payment_methods.include? ("JCB") %>
|
||||
<% colspan += 1 %>
|
||||
<td style='text-align:right;'><%= number_with_precision(jcb, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<% if !request.user_agent.include? "Mobile" %>
|
||||
<% colspan += 1 %>
|
||||
<% end %>
|
||||
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(jcb, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<% end%>
|
||||
<% if @payment_methods.include? ("UNIONPAY") %>
|
||||
<% colspan += 1 %>
|
||||
<td style='text-align:right;'><%= number_with_precision(unionpay, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<% if !request.user_agent.include? "Mobile" %>
|
||||
<% colspan += 1 %>
|
||||
<% end %>
|
||||
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(unionpay, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<% end %>
|
||||
<% if @payment_methods.include? ("Alipay") %>
|
||||
<% colspan += 1 %>
|
||||
<td style='text-align:right;'><%= number_with_precision(alipay, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<% if !request.user_agent.include? "Mobile" %>
|
||||
<% colspan += 1 %>
|
||||
<% end %>
|
||||
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(alipay, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<% end %>
|
||||
<% if @payment_methods.include? ("PAYMAL") %>
|
||||
<% colspan += 1 %>
|
||||
<td style='text-align:right;'><%= number_with_precision(paymal, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<% if !request.user_agent.include? "Mobile" %>
|
||||
<% colspan += 1 %>
|
||||
<% end %>
|
||||
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(paymal, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<% end %>
|
||||
<% if @payment_methods.include? ("DINGA") %>
|
||||
<% colspan += 1 %>
|
||||
<td style='text-align:right;'><%= number_with_precision(dinga, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<% if !request.user_agent.include? "Mobile" %>
|
||||
<% colspan += 1 %>
|
||||
<% end %>
|
||||
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(dinga, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<% end %>
|
||||
<% if @payment_methods.include? ("JunctionPay") %>
|
||||
<% colspan += 1 %>
|
||||
<td style='text-align:right;'><%= number_with_precision(junctionpay, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<% if !request.user_agent.include? "Mobile" %>
|
||||
<% colspan += 1 %>
|
||||
<% end %>
|
||||
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(junctionpay, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<% end %>
|
||||
<% if @payment_methods.include? ("Redeem") %>
|
||||
<% colspan += 1 %>
|
||||
<td style='text-align:right;'><%= number_with_precision(paypar, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<% if !request.user_agent.include? "Mobile" %>
|
||||
<% colspan += 1 %>
|
||||
<% end %>
|
||||
<td style='text-align:right;' class="d-none d-sm-table-cell"><%= number_with_precision(paypar, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<% end %>
|
||||
<td style='text-align:right;'><%= number_with_precision(cash, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_precision(credit, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_precision(foc, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<% if @payment_methods.include? ("GiftVoucher") %>
|
||||
<% colspan += 1 %>
|
||||
<td style='text-align:right;'><%= number_with_precision(giftvoucher, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<% end %>
|
||||
<td style='text-align:right;'><%= number_with_precision(giftvoucher, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<% end %>
|
||||
<td style='text-align:right;'>(<%= number_with_precision(discount, precision:precision.to_i,delimiter:delimiter) rescue '-'%>)</td>
|
||||
<!-- <td style='text-align:right;'><%= number_with_precision(total, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td> -->
|
||||
<td style='text-align:right;'><%= number_with_precision(grand_total, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_precision(rounding_adj, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
|
||||
<td style='text-align:right;'><%= number_with_precision(grand_total, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td style='text-align:right;'><%= number_with_precision(rounding_adj, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
|
||||
</tr>
|
||||
<% total_tax = 0 %>
|
||||
<% net = 0 %>
|
||||
<% unless @tax.empty? %>
|
||||
<% @tax.each do |tax|
|
||||
<% @tax.each do |tax|
|
||||
total_tax += tax.tax_amount.to_f %>
|
||||
<tr style="font-weight:600;">
|
||||
<td colspan="<%= colspan %>" style='text-align:right;'><%= tax.tax_name rescue '-'%></td>
|
||||
@@ -245,14 +265,14 @@
|
||||
</tr>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
|
||||
<% net = grand_total %>
|
||||
<% net = net - rounding_adj%>
|
||||
<% net = net - total_tax %>
|
||||
<tr style="font-weight:600;">
|
||||
<td colspan="<%= colspan %>" style='text-align:right;'><%= t("views.right_panel.detail.net_amount") %></td>
|
||||
<td style='text-align:right;'><%= number_with_precision(net, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td colspan="2"> </td>
|
||||
<td colspan="2"> </td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<% end %>
|
||||
@@ -263,4 +283,4 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.date") %></th>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.void_amount") %></th>
|
||||
<% if @payment_methods.include? ("MPU") %>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.mpu_sales") %></th>
|
||||
<th style='text-align:center;' class='mobile'><%= t("views.right_panel.detail.mpu_sales") %></th>
|
||||
<% end %>
|
||||
<% if @payment_methods.include? ("Master") %>
|
||||
<th style='text-align:center;'><%= t("views.right_panel.detail.master_sales") %></th>
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
<%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %>
|
||||
<% if period_type != false %>
|
||||
<div class="row">
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.select_period") %></label>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 mbl-style">
|
||||
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.select_period") %></label>
|
||||
<select name="period" id="sel_period" class="form-control">
|
||||
<option value=""><%= t("views.right_panel.detail.select_period") %></option>
|
||||
<option value="0">Today</option>
|
||||
@@ -20,8 +20,8 @@
|
||||
</div>
|
||||
<!-- <input type="hidden" name="report_type" value="sale_item" id="sel_sale_type"> -->
|
||||
<% if defined? commissioners %>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14">Select Commissioner</label>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 mbl-style">
|
||||
<label class="font-14 mbl_lbl">Select Commissioner</label>
|
||||
<select class="form-control" id="commissioner" name="commissioner">
|
||||
<option value="">--Select Commissioner--</option>
|
||||
<% if !@commissioners.nil? %>
|
||||
@@ -34,31 +34,31 @@
|
||||
<% end %>
|
||||
<% end %>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
|
||||
<!-- <label class="">Select Shift Period</label> -->
|
||||
<label class="font-14"><%= t("views.right_panel.detail.from") %></label>
|
||||
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.from") %></label>
|
||||
<input data-behaviour='datepicker' class="form-control m-t-3 datepicker" name="from" id="from" type="text" placeholder="From date" style="height: 32px;">
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.to") %></label>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
|
||||
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.to") %></label>
|
||||
<input data-behaviour='datepicker' class="form-control m-t-3 datepicker" name="to" id="to" type="text" placeholder="To date" style="height: 32px;">
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14">All Shift</label>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 mbl-style">
|
||||
<label class="font-14 mbl_lbl">All Shift</label>
|
||||
<select class="form-control select" name="shift_name" id="shift_name" >
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 margin-top-20">
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 margin-top-20 mbl-right-btn mbl-style">
|
||||
<br>
|
||||
<input type="submit" value="Generate Report" class='btn btn-primary'>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
@@ -83,7 +83,7 @@
|
||||
}
|
||||
else{
|
||||
$('#waiter').hide();
|
||||
$('#cashier').show();
|
||||
$('#cashier').show();
|
||||
$("#item").val('sale');
|
||||
}
|
||||
});
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
<%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %>
|
||||
<% if period_type != false %>
|
||||
<div class="row">
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-13"><%= t("views.right_panel.detail.select_period") %></label>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 mbl-style">
|
||||
<label class="font-13 mbl_lbl"><%= t("views.right_panel.detail.select_period") %></label>
|
||||
<select name="period" id="sel_period" class="form-control">
|
||||
<option value=""><%= t("views.right_panel.detail.select_period") %></option>
|
||||
<option value="0">Today</option>
|
||||
@@ -19,40 +19,40 @@
|
||||
</select>
|
||||
</div>
|
||||
<% if defined? providers %>
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<div class="col-lg-1 col-md-1 col-sm-1 col-mbl-view mbl-style">
|
||||
<label class="font-13"><%= t("views.right_panel.detail.select_providers") %></label>
|
||||
<%= select_tag "provider", options_for_select(@providers, :selected => params[:provider]), :class => "form-control", :style => "height: 35px;" %>
|
||||
<%= select_tag "provider", options_for_select(@providers, :selected => params[:provider]), :class => "form-control", :style => "height: 35px;" %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if defined? payment_types %>
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<div class="col-lg-1 col-md-1 col-sm-1 col-mbl-view mbl-style">
|
||||
<label class="font-13"><%= t("views.right_panel.detail.select_payment") %></label>
|
||||
<%= select_tag "payment_type", options_for_select(@payment_types, :selected => params[:payment_type]), :class => "form-control", :style => "height: 35px;" %>
|
||||
<%= select_tag "payment_type", options_for_select(@payment_types, :selected => params[:payment_type]), :class => "form-control", :style => "height: 35px;" %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
|
||||
<!-- <label class="">Select Shift Period</label> -->
|
||||
<label class="font-13"><%= t("views.right_panel.detail.from") %></label>
|
||||
<label class="font-13 mbl_lbl"><%= t("views.right_panel.detail.from") %></label>
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="from" id="from" type="text" placeholder="From date" style="height: 32px;">
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-13"><%= t("views.right_panel.detail.to") %></label>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
|
||||
<label class="font-13 mbl_lbl"><%= t("views.right_panel.detail.to") %></label>
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="to" id="to" type="text" placeholder="To date" style="height: 32px;">
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-13"><%= t("views.right_panel.detail.all_shift") %></label>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 mbl-style">
|
||||
<label class="font-13 mbl_lbl"><%= t("views.right_panel.detail.all_shift") %></label>
|
||||
<select class="form-control select" name="shift_name" id="shift_name" >
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-lg-1 col-md-1 col-sm-1 margin-top-20">
|
||||
<div class="col-lg-1 col-md-1 col-sm-1 margin-top-20 mbl-right-btn mbl-style">
|
||||
<br>
|
||||
<input type="submit" value="Generate Report" class='btn btn-primary'>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
<% if params[:shift_name].to_i > 0%>
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
<%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %>
|
||||
<% if period_type != false %>
|
||||
<div class="row">
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.select_period") %></label>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 mbl-style">
|
||||
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.select_period") %></label>
|
||||
<select name="period" id="sel_period" class="form-control">
|
||||
<option value=""><%= t("views.right_panel.detail.select_period") %></option>
|
||||
<option value="0">Today</option>
|
||||
@@ -19,55 +19,55 @@
|
||||
</select>
|
||||
</div>
|
||||
<% if defined? payments %>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 mbl-style">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.select_payments") %></label>
|
||||
<%= select_tag "payment_type", options_for_select(@payments, :selected => params[:payment_type]), :class => "form-control" %>
|
||||
<%= select_tag "payment_type", options_for_select(@payments, :selected => params[:payment_type]), :class => "form-control" %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
|
||||
<!-- <label class="">Select Shift Period</label> -->
|
||||
<label class="font-14"><%= t("views.right_panel.detail.from") %></label>
|
||||
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.from") %></label>
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3 from" name="from" id="from" type="text" placeholder="From date" style="height: 34px;">
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.to") %></label>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
|
||||
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.to") %></label>
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3 to" name="to" id="to" type="text" placeholder="To date" style="height: 34px;">
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.all_shift") %></label>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 mbl-style">
|
||||
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.all_shift") %></label>
|
||||
<select class="form-control select" name="shift_name" id="shift_name" style="height: 37px;" >
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-lg-1 col-md-1 col-sm-1 margin-top-20">
|
||||
<div class="col-lg-1 col-md-1 col-sm-1 margin-top-20 mbl-right-btn mbl-style">
|
||||
<br>
|
||||
<input type="submit" value="Generate Report" class='btn btn-primary'>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$('#custom_excel').hide();
|
||||
|
||||
|
||||
$('#custom_excel').click(function(){
|
||||
var url = $('#custom_excel').attr('data-url');
|
||||
$('#frm_report').attr('action',url)
|
||||
$('#frm_report').submit();
|
||||
// window.location = url;
|
||||
});
|
||||
|
||||
|
||||
var item = $('#item').val();
|
||||
var payment_type = $('#payment_type');
|
||||
|
||||
|
||||
if(item == 'order'){
|
||||
$('#cashier').hide();
|
||||
$('#waiter').show();
|
||||
if(payment_type){
|
||||
$('#payment_type').hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(item == 'sale'){
|
||||
$('#waiter').hide();
|
||||
@@ -75,7 +75,7 @@
|
||||
}
|
||||
else{
|
||||
$('#waiter').hide();
|
||||
$('#cashier').show();
|
||||
$('#cashier').show();
|
||||
$("#item").val('sale');
|
||||
}
|
||||
});
|
||||
@@ -112,7 +112,7 @@
|
||||
|
||||
if(item == 'sale'){
|
||||
$('#waiter').hide();
|
||||
$('#cashier').show();
|
||||
$('#cashier').show();
|
||||
if(payment_type){
|
||||
$('#payment_type').show();
|
||||
}
|
||||
|
||||
@@ -16,14 +16,14 @@
|
||||
<hr />
|
||||
<div class="text-right">
|
||||
<a href="javascript:export_to('<%=reports_payment_method_index_path%>.xls')" class = "btn btn-info wave-effects"><%= t("views.btn.exp_to_excel") %></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="margin-top-20">
|
||||
<div class="card">
|
||||
<div class="margin-top-20 mbl-table">
|
||||
<div class="card mbl-table-card">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="9">
|
||||
<th colspan="9">
|
||||
<strong>
|
||||
<%= t("views.right_panel.detail.from_date") %> : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - <%= t("views.right_panel.detail.to_date") %> : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%>
|
||||
</strong>
|
||||
@@ -31,9 +31,9 @@
|
||||
</tr>
|
||||
<% if @shift_from %>
|
||||
<tr>
|
||||
<% if @shift_data.employee %>
|
||||
<% if @shift_data.employee %>
|
||||
<% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<th colspan="9">
|
||||
<strong><%= t("views.right_panel.detail.shift_name") %> = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )</strong>
|
||||
</th>
|
||||
@@ -67,7 +67,7 @@
|
||||
else
|
||||
delimiter = ""
|
||||
end
|
||||
%>
|
||||
%>
|
||||
<% unless @sale_data.empty? %>
|
||||
<tbody>
|
||||
<% @sale_data.each do |sale| %>
|
||||
@@ -88,7 +88,7 @@
|
||||
<td><%= number_with_precision(sale[:giftvoucher_amount] , precision: precision.to_i ,delimiter: delimiter) rescue '-' %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
|
||||
</tbody>
|
||||
<% end %>
|
||||
</table>
|
||||
@@ -103,7 +103,7 @@
|
||||
<td colspan="7"><strong>All Payment Details</strong></td>
|
||||
</tr>
|
||||
<%end%>
|
||||
|
||||
|
||||
<tr>
|
||||
<th> <%= t("views.right_panel.detail.shift_name") %> </th>
|
||||
<th><%= t("views.right_panel.detail.receipt_no") %></th>
|
||||
@@ -120,9 +120,9 @@
|
||||
<% if payment.payment_method === 'cash'
|
||||
total += payment.payment_amount - payment.change_amount
|
||||
else
|
||||
total += payment.payment_amount
|
||||
end%>
|
||||
<tr>
|
||||
total += payment.payment_amount
|
||||
end%>
|
||||
<tr>
|
||||
<% if @shift_from.nil? && @shift_to.nil? %>
|
||||
<td><%= payment.sale_date.utc.getlocal.strftime("%e %b %I:%M%p") rescue '-'%></td>
|
||||
<% else %>
|
||||
@@ -138,9 +138,9 @@
|
||||
<td><%= number_with_precision(payment.payment_amount , precision: precision.to_i ,delimiter: delimiter) rescue '-' %> </td>
|
||||
<%end%>
|
||||
<td><%= number_with_precision(payment.sale.grand_total , precision: precision.to_i ,delimiter: delimiter) rescue '-' %></td>
|
||||
|
||||
|
||||
</tr>
|
||||
|
||||
|
||||
<% end %>
|
||||
<%if total>0%>
|
||||
<tr>
|
||||
@@ -162,15 +162,15 @@
|
||||
$('#sel_period').change(function(){
|
||||
search_by_period();
|
||||
});
|
||||
|
||||
|
||||
function search_by_period(){
|
||||
var period = $('#sel_period').val();
|
||||
var period_type = 0;
|
||||
var from = "";
|
||||
var to = "";
|
||||
|
||||
show_shift_name(period,period_type,from,to,'shift_item');
|
||||
}
|
||||
show_shift_name(period,period_type,from,to,'shift_item');
|
||||
}
|
||||
|
||||
// OK button is clicked
|
||||
$('#from').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
|
||||
@@ -186,49 +186,49 @@
|
||||
to = new_date.getDate() + "-" + month + "-" + new_date.getFullYear();
|
||||
$('#to').val(to)
|
||||
search_by_date();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function search_by_date(){
|
||||
|
||||
from = $("#from").val();
|
||||
to = $("#to").val();
|
||||
|
||||
var period = 0;
|
||||
var period_type = 1;
|
||||
var period_type = 1;
|
||||
if(to != '' && from != ''){
|
||||
shift_name = from + ',' + to;
|
||||
|
||||
check_arr.push(to);
|
||||
|
||||
|
||||
if(check_arr.length == 1){
|
||||
show_shift_name(period,period_type,from,to,'shift_item');
|
||||
show_shift_name(period,period_type,from,to,'shift_item');
|
||||
}
|
||||
if(check_arr.length == 3){
|
||||
check_arr = [];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
function show_shift_name(period,period_type,from,to,shift_item){
|
||||
var shift = $('#shift_name');
|
||||
|
||||
|
||||
shift.empty();
|
||||
if (from == '' && to == '') {
|
||||
from = $("#from").val();
|
||||
to = $("#to").val();
|
||||
}
|
||||
var str = '';
|
||||
var param_shift = '';
|
||||
var param_shift = '';
|
||||
var param_shift = '<%= params[:shift_name] rescue '-'%>';
|
||||
console.log(param_shift);
|
||||
url = '<%= reports_get_shift_by_date_path %>';
|
||||
console.log(url);
|
||||
console.log(url);
|
||||
$.get(url, {period :period, period_type :period_type, from :from, to :to, report_type :shift_item} , function(data){
|
||||
console.log(data);
|
||||
str = '<option value="0">--- All Shift ---</option>';
|
||||
$(data.message).each(function(index){
|
||||
|
||||
$(data.message).each(function(index){
|
||||
|
||||
var local_date = data.message[index].local_opening_date + ' - ' + data.message[index].local_closing_date;
|
||||
var sh_date = data.message[index].opening_date + ' - ' + data.message[index].closing_date;
|
||||
var shift_id = data.message[index].shift_id ;
|
||||
@@ -237,19 +237,19 @@
|
||||
selected = 'selected = "selected"';
|
||||
}
|
||||
else{
|
||||
selected = '';
|
||||
}
|
||||
selected = '';
|
||||
}
|
||||
}else{
|
||||
selected = '';
|
||||
}
|
||||
selected = '';
|
||||
}
|
||||
str += '<option value="'+ shift_id +'" '+ selected +'>' + local_date + '</option>';
|
||||
|
||||
|
||||
// console.log(sh_date)
|
||||
})
|
||||
})
|
||||
shift.append(str);
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</script>
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
<%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %>
|
||||
<% if period_type != false %>
|
||||
<div class="row">
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.select_period") %></label>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 mbl-style">
|
||||
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.select_period") %></label>
|
||||
<select name="period" id="sel_period" class="form-control">
|
||||
<option value=""><%= t("views.right_panel.detail.select_period") %></option>
|
||||
<option value="0">Today</option>
|
||||
@@ -33,21 +33,21 @@
|
||||
</select>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
|
||||
<!-- <label class="">Select Shift Period</label> -->
|
||||
<label class="font-14"><%= t("views.right_panel.detail.from") %></label>
|
||||
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.from") %></label>
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="from" id="from" type="text" placeholder="From date" style="height: 32px;">
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.to") %></label>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
|
||||
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.to") %></label>
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="to" id="to" type="text" placeholder="To date" style="height: 32px;">
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.all_shift") %></label>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 mbl-style">
|
||||
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.all_shift") %></label>
|
||||
<select class="form-control select" name="shift_name" id="shift_name" >
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 margin-top-20" style="margin-top: 20px;">
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 margin-top-20 mbl-style mbl-right-btn" style="margin-top: 20px;">
|
||||
|
||||
<input type="submit" value="Generate Report" class='btn btn-primary'>
|
||||
</div>
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
<!-- </div> -->
|
||||
<!-- </div> -->
|
||||
|
||||
<div class="margin-top-20">
|
||||
<div class="card">
|
||||
<div class="margin-top-20 mbl-table">
|
||||
<div class="card mbl-table-card">
|
||||
<table class="table table-striped" border="0">
|
||||
<thead>
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
<%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %>
|
||||
<% if period_type != false %>
|
||||
<div class="row">
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.select_period") %></label>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 mbl-style">
|
||||
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.select_period") %></label>
|
||||
<select name="period" id="sel_period" class="form-control">
|
||||
<option value=""><%= t("views.right_panel.detail.select_period") %></option>
|
||||
<option value="0">Today</option>
|
||||
@@ -19,10 +19,10 @@
|
||||
</select>
|
||||
</div>
|
||||
<% if defined? payments %>
|
||||
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.select_payments") %></label>
|
||||
|
||||
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 mbl-style">
|
||||
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.select_payments") %></label>
|
||||
|
||||
<select name="payment_type" id="payment_type" class="form-control">
|
||||
<% @payments.each do |pm| %>
|
||||
<option class="<%=pm[1].downcase%>" value="<%=pm[1].downcase%>"><%=pm[0]%></option>
|
||||
@@ -31,52 +31,52 @@
|
||||
<option value="<%=pm.payment_method%>" class="<%=pm.payment_method%>" > <%=pm.payment_method%></option>
|
||||
<%end %>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
|
||||
<!-- <label class="">Select Shift Period</label> -->
|
||||
<label class="font-14"><%= t("views.right_panel.detail.from") %></label>
|
||||
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.from") %></label>
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="from" id="from" type="text" placeholder="From date" style="height: 32px;">
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.to") %></label>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
|
||||
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.to") %></label>
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="to" id="to" type="text" placeholder="To date" style="height: 32px;">
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.all_shift") %></label>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 mbl-style">
|
||||
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.all_shift") %></label>
|
||||
<select class="form-control select" name="shift_name" id="shift_name" >
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-lg-1 col-md-1 col-sm-1 margin-top-20">
|
||||
<div class="col-lg-1 col-md-1 col-sm-1 margin-top-20 mbl-style mbl-right-btn">
|
||||
<br>
|
||||
<input type="submit" value="Generate Report" class='btn btn-primary'>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$('#custom_excel').hide();
|
||||
|
||||
|
||||
$('#custom_excel').click(function(){
|
||||
var url = $('#custom_excel').attr('data-url');
|
||||
$('#frm_report').attr('action',url)
|
||||
$('#frm_report').submit();
|
||||
// window.location = url;
|
||||
});
|
||||
|
||||
|
||||
var item = $('#item').val();
|
||||
var payment_type = $('#payment_type');
|
||||
|
||||
|
||||
if(item == 'order'){
|
||||
$('#cashier').hide();
|
||||
$('#waiter').show();
|
||||
if(payment_type){
|
||||
$('#payment_type').hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(item == 'sale'){
|
||||
$('#waiter').hide();
|
||||
@@ -84,7 +84,7 @@
|
||||
}
|
||||
else{
|
||||
$('#waiter').hide();
|
||||
$('#cashier').show();
|
||||
$('#cashier').show();
|
||||
$("#item").val('sale');
|
||||
}
|
||||
});
|
||||
@@ -101,7 +101,7 @@
|
||||
$("#to").val("<%=params[:to] rescue '-'%>");
|
||||
$("#sel_period").val(<%=params[:period] rescue '-'%>);
|
||||
$("#sel_sale_type").val(<%=params[:sale_type] rescue '-'%>);
|
||||
|
||||
|
||||
$(".<%=params[:payment_type]%>").attr('selected','selected')
|
||||
|
||||
// shift = $(".shift-id").text()
|
||||
@@ -124,7 +124,7 @@
|
||||
|
||||
if(item == 'sale'){
|
||||
$('#waiter').hide();
|
||||
$('#cashier').show();
|
||||
$('#cashier').show();
|
||||
if(payment_type){
|
||||
$('#payment_type').show();
|
||||
}
|
||||
|
||||
@@ -15,10 +15,10 @@
|
||||
<hr />
|
||||
<div class="text-right">
|
||||
<a href="javascript:export_to('<%=reports_receipt_no_detail_index_path%>.xls')" class = "btn btn-info wave-effects"><%= t("views.btn.exp_to_excel") %></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="margin-top-20">
|
||||
<div class="card">
|
||||
<div class="margin-top-20 mbl-table">
|
||||
<div class="card mbl-table-card">
|
||||
<table class="table table-striped" border="0">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -27,9 +27,9 @@
|
||||
</tr>
|
||||
<% if @shift_from %>
|
||||
<tr>
|
||||
<% if @shift_data.employee %>
|
||||
<% if @shift_data.employee %>
|
||||
<% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<th colspan="7"><%= t("views.right_panel.detail.shift_name") %> = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )</th>
|
||||
</tr>
|
||||
<% end %>
|
||||
@@ -37,9 +37,9 @@
|
||||
<th><b><%= t("views.right_panel.detail.shift_name") %></b></th>
|
||||
<th><b><%= t("views.right_panel.detail.table") %></b></th>
|
||||
<th><b><%= t("views.right_panel.detail.receipt_no") %></b></th>
|
||||
<th><b><%= t :cashier %> <%= t("views.right_panel.detail.name") %></b></th>
|
||||
<th><b><%= t :cashier %> <%= t("views.right_panel.detail.name") %></b></th>
|
||||
<th><b><%= t("views.right_panel.detail.revenue") %></b></th>
|
||||
<th> </th>
|
||||
<th> </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -48,7 +48,7 @@
|
||||
<% table_name=nil
|
||||
table_type =nil
|
||||
if result.table_id.to_i>0
|
||||
table = DiningFacility.find(result.table_id)
|
||||
table = DiningFacility.find(result.table_id)
|
||||
table_type = table.type
|
||||
table_name = table.name
|
||||
end %>
|
||||
@@ -57,7 +57,7 @@
|
||||
<td><%= @shift_from %> - <%= @shift_to %></td>
|
||||
<td><%= table_type %> - <%= table_name %></td>
|
||||
<td><%= result.receipt_no rescue '-' %> </td>
|
||||
<td><%= result.cashier_name rescue '-' %></td>
|
||||
<td><%= result.cashier_name rescue '-' %></td>
|
||||
<td><%=result.grand_total%></td>
|
||||
<!-- <td> </td> -->
|
||||
</tr>
|
||||
@@ -76,8 +76,8 @@
|
||||
<% if item.price.to_i < 0.to_i %>
|
||||
<% if item.qty.to_i < 0.to_i%>
|
||||
[PROMO QTY]<%= item.product_name rescue '-' %>
|
||||
<% else %>
|
||||
[PROMO PRICE]<%= item.product_name rescue '-' %>
|
||||
<% else %>
|
||||
[PROMO PRICE]<%= item.product_name rescue '-' %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= item.product_name rescue '-' %>
|
||||
@@ -86,70 +86,70 @@
|
||||
<td><%= item.qty rescue '-' %></td>
|
||||
<td><%= item.unit_price rescue '-' %></td>
|
||||
<td><%= item.price rescue '-' %></td>
|
||||
<td><%=l item.created_at.utc.getlocal, :format => :short rescue '-' %> </td>
|
||||
<td><%=l item.created_at.utc.getlocal, :format => :short rescue '-' %> </td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
|
||||
<tr><td colspan="5"> </td></tr>
|
||||
|
||||
<%survey = Survey.find_by_receipt_no(result.receipt_no)%>
|
||||
<% if !survey.nil?%>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>No. of Guest</td>
|
||||
<td><%= survey.total_customer rescue '-' %></td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
<td> </td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
<% if !result.total_amount.nil?%>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.amount") %></td>
|
||||
<td><%= result.total_amount %></td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
<% if result.total_discount.to_f > 0 %>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td><%= t("views.right_panel.detail.total") %>
|
||||
<%= t("views.right_panel.detail.discount") %>
|
||||
<%= t("views.right_panel.detail.discount") %>
|
||||
<%= t("views.right_panel.detail.amount") %></td>
|
||||
<td> - <%= result.total_discount %> </td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
|
||||
<% if !result.total_tax.nil? %>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>Tax Amount </td>
|
||||
<td><%= result.total_tax %> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% sale_payments = SalePayment.get_sale_payments(result) %>
|
||||
<% if sale_payments.length > 0%>
|
||||
<% if sale_payments.length > 0%>
|
||||
<% sale_payments.each do |rec| %>
|
||||
<%if rec.payment_amount.to_f > 0 %>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>Payment <%= rec.payment_method.upcase %></td>
|
||||
<td><%= rec.payment_amount %> ( <%= rec.payment_status %> )</td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
</tr>
|
||||
|
||||
<% if !rec.payment_reference.nil? %>
|
||||
<% if !rec.payment_reference.nil? %>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>Payment Ref.</td>
|
||||
<td><%= rec.payment_reference %></td>
|
||||
<td> </td>
|
||||
@@ -157,10 +157,10 @@
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if result.amount_changed != 0 && !result.amount_changed.nil? %>
|
||||
<% if result.amount_changed != 0 && !result.amount_changed.nil? %>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td><%= t("views.right_panel.detail.change") %> <%= t("views.right_panel.detail.amount") %></td>
|
||||
<td><%= result.amount_changed %></td>
|
||||
<td> </td>
|
||||
@@ -169,25 +169,25 @@
|
||||
<% if !result.customer_id.nil?%>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>Customer</td>
|
||||
<td><%= result.customer.name rescue '-'%>
|
||||
<td><%= result.customer.name rescue '-'%>
|
||||
(<%= result.customer.company rescue '-' %>)
|
||||
</td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
|
||||
<% end %>
|
||||
<tr style="border-top:4px double #666;">
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td><b>Total Nett</b> - <b><%= grand_total %></b></td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -201,20 +201,20 @@
|
||||
var check_arr = [];
|
||||
search_by_period();
|
||||
$('#sel_period').change(function(){
|
||||
|
||||
|
||||
search_by_period();
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
function search_by_period(){
|
||||
var period = $('#sel_period').val();
|
||||
var period_type = 0;
|
||||
var from = "";
|
||||
var to = "";
|
||||
|
||||
show_shift_name(period,period_type,from,to,'shift_item');
|
||||
}
|
||||
|
||||
show_shift_name(period,period_type,from,to,'shift_item');
|
||||
}
|
||||
|
||||
// OK button is clicked
|
||||
$('#from').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
|
||||
new_date = new Date(date) ;
|
||||
@@ -229,50 +229,50 @@
|
||||
to = new_date.getDate() + "-" + month + "-" + new_date.getFullYear();
|
||||
$('#to').val(to)
|
||||
search_by_date();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function search_by_date(){
|
||||
|
||||
|
||||
from = $("#from").val();
|
||||
to = $("#to").val();
|
||||
|
||||
var period = 0;
|
||||
var period_type = 1;
|
||||
var period_type = 1;
|
||||
|
||||
if(to != '' && from != ''){
|
||||
shift_name = from + ',' + to;
|
||||
|
||||
check_arr.push(to);
|
||||
|
||||
|
||||
if(check_arr.length == 1){
|
||||
show_shift_name(period,period_type,from,to,'shift_item');
|
||||
show_shift_name(period,period_type,from,to,'shift_item');
|
||||
}
|
||||
if(check_arr.length == 3){
|
||||
check_arr = [];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
function show_shift_name(period,period_type,from,to,shift_item){
|
||||
var shift = $('#shift_name');
|
||||
|
||||
|
||||
shift.empty();
|
||||
|
||||
|
||||
var str = '';
|
||||
var param_shift = '';
|
||||
var param_shift = '';
|
||||
var param_shift = '<%= params[:shift_name] rescue '-'%>';
|
||||
if (from == '' && to == '') {
|
||||
from = $("#from").val();
|
||||
to = $("#to").val();
|
||||
}
|
||||
url = '<%= reports_get_shift_by_date_path %>';
|
||||
|
||||
|
||||
$.get(url, {period :period, period_type :period_type, from :from, to :to, report_type :shift_item} , function(data){
|
||||
|
||||
str = '<option value="0">--- All Shift ---</option>';
|
||||
$(data.message).each(function(index){
|
||||
|
||||
$(data.message).each(function(index){
|
||||
|
||||
var local_date = data.message[index].local_opening_date + ' - ' + data.message[index].local_closing_date;
|
||||
var sh_date = data.message[index].opening_date + ' - ' + data.message[index].closing_date;
|
||||
var shift_id = data.message[index].shift_id ;
|
||||
@@ -281,18 +281,18 @@
|
||||
selected = 'selected = "selected"';
|
||||
}
|
||||
else{
|
||||
selected = '';
|
||||
}
|
||||
selected = '';
|
||||
}
|
||||
}else{
|
||||
selected = '';
|
||||
}
|
||||
selected = '';
|
||||
}
|
||||
str += '<option value="'+ shift_id +'" '+ selected +'>' + local_date + '</option>';
|
||||
|
||||
|
||||
// console.log(sh_date)
|
||||
})
|
||||
})
|
||||
shift.append(str);
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
<%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %>
|
||||
<% if period_type != false %>
|
||||
<div class="row">
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.select_period") %></label>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 mbl-style">
|
||||
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.select_period") %></label>
|
||||
<select name="period" id="sel_period" class="form-control">
|
||||
<option value=""><%= t("views.right_panel.detail.select_period") %></option>
|
||||
<option value="0">Today</option>
|
||||
@@ -18,9 +18,9 @@
|
||||
<option value="9">Last year</option>
|
||||
</select>
|
||||
</div>
|
||||
<!-- <input type="hidden" name="report_type" value="sale_item" id="sel_sale_type"> -->
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14">Select Type</label>
|
||||
<!-- <input type="hidden" name="report_type" value="sale_item" id="sel_sale_type"> -->
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
|
||||
<label class="font-14 mbl_lbl">Select Type</label>
|
||||
<select name="sale_type" id="sel_sale_type" class="form-control">
|
||||
<option value="">Select Type</option>
|
||||
<option value="revenue" selected>Revenue Only</option>
|
||||
@@ -31,40 +31,40 @@
|
||||
<option value="promotion">Promotion Only</option>
|
||||
<option value="other">Other Amount Only</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.select_account") %></label>
|
||||
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
|
||||
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.select_account") %></label>
|
||||
|
||||
<select name="account_type" id="account_type" class="form-control">
|
||||
<option value = "">Select Account</option>
|
||||
<% @account.each do |acc| %>
|
||||
<option value="<%=acc.title%>" class="<%=acc.title%>" > <%=acc.title%></option>
|
||||
<%end %>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
|
||||
<!-- <label class="">Select Shift Period</label> -->
|
||||
<label class="font-14"><%= t("views.right_panel.detail.from") %></label>
|
||||
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.from") %></label>
|
||||
<input data-behaviour='datepicker' class="form-control m-t-3 datepicker" name="from" id="from" type="text" placeholder="From date" style="height: 32px;">
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.to") %></label>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
|
||||
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.to") %></label>
|
||||
<input data-behaviour='datepicker' class="form-control m-t-3 datepicker" name="to" id="to" type="text" placeholder="To date" style="height: 32px;">
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14">All Shift</label>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 mbl-style">
|
||||
<label class="font-14 mbl_lbl">All Shift</label>
|
||||
<select class="form-control select" name="shift_name" id="shift_name" >
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-lg-12 col-md-12 col-sm-12 margin-top-20">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12 margin-top-20 mbl-right-btn">
|
||||
<br>
|
||||
<input type="submit" value="Generate Report" class='btn btn-primary float_right'>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
@@ -87,7 +87,7 @@
|
||||
$('#waiter').show();
|
||||
if(payment_type){
|
||||
$('#payment_type').hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(item == 'sale'){
|
||||
$('#waiter').hide();
|
||||
@@ -95,7 +95,7 @@
|
||||
}
|
||||
else{
|
||||
$('#waiter').hide();
|
||||
$('#cashier').show();
|
||||
$('#cashier').show();
|
||||
$("#item").val('sale');
|
||||
}
|
||||
});
|
||||
@@ -130,7 +130,7 @@
|
||||
|
||||
if(item == 'sale'){
|
||||
$('#waiter').hide();
|
||||
$('#cashier').show();
|
||||
$('#cashier').show();
|
||||
if(payment_type){
|
||||
$('#payment_type').show();
|
||||
}
|
||||
|
||||
@@ -15,13 +15,13 @@
|
||||
<hr />
|
||||
|
||||
<div class="text-right">
|
||||
<%= link_to "Print", reports_print_sale_items_path(:type => params[:sale_type], :period => params[:period], :account => params[:account_type], :from => @from, :to => @to, :shift_name => params[:shift_name], :shift_from => @shift_from, :shift_to => @shift_to, :menu_cate_count => @menu_cate_count, :sale_items => @sale_data.to_json), :method => 'post', class:"btn btn-info wave-effects" %>
|
||||
<button class="btn btn-info wave-effects" onclick="print_sale_items()">Print</button>
|
||||
<a href="javascript:export_to('<%=reports_saleitem_index_path%>.xls')" class = "btn btn-info wave-effects "><%= t("views.btn.exp_to_excel") %></a>
|
||||
</div>
|
||||
|
||||
<div class="margin-top-20">
|
||||
<div class="card">
|
||||
<div class="table-responsive">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped" id="items_table" border="0">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -29,9 +29,9 @@
|
||||
</tr>
|
||||
<% if @shift_from %>
|
||||
<tr>
|
||||
<% if @shift_data.employee %>
|
||||
<% if @shift_data.employee %>
|
||||
<% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<th colspan="7"> <%= t("views.right_panel.detail.shift_name") %> = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )</th>
|
||||
</tr>
|
||||
<% end %>
|
||||
@@ -43,9 +43,11 @@
|
||||
<th><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.item") %></th>
|
||||
<th><%= t("views.right_panel.detail.unit_price") %></th>
|
||||
<th><%= t("views.right_panel.detail.revenue") %></th>
|
||||
</tr>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% puts 'testing!!!!!!' %>
|
||||
<% puts @print_settings.precision.to_i %>
|
||||
<% if @print_settings.precision.to_i > 0
|
||||
precision = @print_settings.precision
|
||||
else
|
||||
@@ -57,15 +59,16 @@
|
||||
else
|
||||
delimiter = ""
|
||||
end
|
||||
%>
|
||||
%>
|
||||
<% acc_arr = Array.new %>
|
||||
<% cate_arr = Array.new %>
|
||||
<% cate_arr = Array.new %>
|
||||
<% p_qty = 0 %>
|
||||
<% sub_qty = 0 %>
|
||||
<% sub_total = 0 %>
|
||||
<% other_sub_total = 0 %>
|
||||
<% product_sub_total = 0 %>
|
||||
<% count = 0 %>
|
||||
<% row_count = 0 %>
|
||||
<% total_price = 0 %>
|
||||
<% cate_count = 0 %>
|
||||
<% acc_count = 0 %>
|
||||
@@ -78,8 +81,9 @@
|
||||
<% total_tax = 0 %>
|
||||
<% unless @sale_data.blank? %>
|
||||
<% @sale_data.each do |sale| %>
|
||||
<% row_count += 1 %>
|
||||
<!-- all total qty sum -->
|
||||
|
||||
|
||||
<% if sale.status_type != "Discount" && sale.status_type != "foc" && sale.status_type != "promotion"
|
||||
total_qty += sale.total_item
|
||||
end %>
|
||||
@@ -93,15 +97,15 @@
|
||||
total_qty += sale.total_item*(-1)
|
||||
end %>
|
||||
<!-- end all total qty -->
|
||||
|
||||
|
||||
<% if sale.status_type == "foc" && sale.grand_total < 0
|
||||
total_item_foc += sale.grand_total*(-1)
|
||||
end %>
|
||||
end %>
|
||||
|
||||
<% if sale.status_type == "Discount" && sale.grand_total < 0
|
||||
total_item_dis += sale.grand_total*(-1)
|
||||
end %>
|
||||
|
||||
|
||||
<% if !acc_arr.include?(sale.account_id) %>
|
||||
<tr>
|
||||
<td><b><%= sale.account_name %></b></td>
|
||||
@@ -111,7 +115,7 @@
|
||||
<% @totalByAccount.each do |account, total| %>
|
||||
<% if sale.account_id == account %>
|
||||
<b><%= number_with_precision(total, precision:precision.to_i,delimiter:delimiter) %></b>
|
||||
<% grand_total += total %>
|
||||
<% grand_total += total %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</td>
|
||||
@@ -120,7 +124,7 @@
|
||||
<% end %>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<% if !cate_arr.include?(sale.menu_category_id) %>
|
||||
<% if !cate_arr.include?(sale.menu_category_id) %>
|
||||
<td><%= sale.menu_category_name %></td>
|
||||
<% cate_arr.push(sale.menu_category_id) %>
|
||||
<% else %>
|
||||
@@ -133,7 +137,7 @@
|
||||
<%else%>
|
||||
<td><%= sale.total_item*(-1) rescue '-' %></td>
|
||||
<% end %>
|
||||
|
||||
|
||||
<td><%= number_with_precision(sale.unit_price , precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td><%= number_with_precision(sale.grand_total , precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
</tr>
|
||||
@@ -141,7 +145,7 @@
|
||||
|
||||
<% @menu_cate_count.each do |key,value| %>
|
||||
<% if sale.account_id == key %>
|
||||
<% count = count + 1 %>
|
||||
<% count = count + 1 %>
|
||||
<% sub_total += sale.grand_total %>
|
||||
<% #sub_qty += sale.total_item %>
|
||||
<% if sale.status_type !="Discount" && (!sale.product_name.include? "FOC") && sale.status_type != "promotion"
|
||||
@@ -154,7 +158,7 @@
|
||||
<% if sale.status_type == "promotion" && @type == "promotion"
|
||||
sub_qty += sale.total_item*(-1)
|
||||
end %>
|
||||
<% if count == value %>
|
||||
<% if count == value %>
|
||||
<tr>
|
||||
<td colspan="3"> </td>
|
||||
<td><b>Total <%= sale.account_name %> Qty </b> </td>
|
||||
@@ -172,7 +176,7 @@
|
||||
<% end %>
|
||||
<!--Product Sale -->
|
||||
<% if @product.present?%>
|
||||
|
||||
|
||||
<tr>
|
||||
<td><b>Product</b></td>
|
||||
<td colspan="4"> </td>
|
||||
@@ -194,9 +198,9 @@
|
||||
<td> <%= number_with_precision(product.grand_total , precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
</tr>
|
||||
<!-- sub total -->
|
||||
|
||||
|
||||
<% product_sub_total += product.grand_total %>
|
||||
<!-- end sub total -->
|
||||
<!-- end sub total -->
|
||||
<% end %>
|
||||
<tr>
|
||||
<td colspan="3"> </td>
|
||||
@@ -211,7 +215,7 @@
|
||||
|
||||
<!--Other Charges -->
|
||||
<% if @type == "other" || @other_charges.present?%>
|
||||
|
||||
|
||||
<tr>
|
||||
<td><b>Other Charges</b></td>
|
||||
<td colspan="4"> </td>
|
||||
@@ -232,9 +236,9 @@
|
||||
<td> <%= number_with_precision(other.grand_total , precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
</tr>
|
||||
<!-- sub total -->
|
||||
|
||||
|
||||
<% other_sub_total += other.grand_total %>
|
||||
<!-- end sub total -->
|
||||
<!-- end sub total -->
|
||||
<% end %>
|
||||
<tr>
|
||||
<td colspan="5"> </td>
|
||||
@@ -248,11 +252,11 @@
|
||||
<td><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.item") %></td>
|
||||
<td><span><%= total_qty%></span></td>
|
||||
<td style="border-bottom:2px solid grey;"><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.amount") %></td>
|
||||
<td style="border-bottom:2px solid grey;"><span><%= number_with_precision(grand_total , precision:precision.to_i,delimiter:delimiter)%></span></td>
|
||||
<td style="border-bottom:2px solid grey;"><span><%= number_with_precision(grand_total , precision:precision.to_i,delimiter:delimiter)%></span></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% if @type == "other"%>
|
||||
|
||||
|
||||
<tr>
|
||||
<td><b>Other Charges</b></td>
|
||||
<td colspan="4"> </td>
|
||||
@@ -273,9 +277,9 @@
|
||||
<td> <%= number_with_precision(other.grand_total , precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
</tr>
|
||||
<!-- sub total -->
|
||||
|
||||
|
||||
<% other_sub_total += other.grand_total %>
|
||||
<!-- end sub total -->
|
||||
<!-- end sub total -->
|
||||
<% end %>
|
||||
<tr>
|
||||
<td colspan="5"> </td>
|
||||
@@ -285,6 +289,7 @@
|
||||
<%end%>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -293,23 +298,20 @@
|
||||
|
||||
<script>
|
||||
$(function(){
|
||||
|
||||
|
||||
var check_arr = [];
|
||||
|
||||
var search = '<%= params[:period_type] %>';
|
||||
|
||||
if(search){
|
||||
|
||||
if(parseInt(search) == 0){
|
||||
search_by_period();
|
||||
search_by_period();
|
||||
}
|
||||
else{
|
||||
search_by_date();
|
||||
search_by_date();
|
||||
}
|
||||
}else{
|
||||
search_by_period();
|
||||
}
|
||||
search_by_period();
|
||||
}
|
||||
|
||||
$('#sel_period').change(function(){
|
||||
search_by_period();
|
||||
@@ -321,8 +323,8 @@
|
||||
var from = "";
|
||||
var to = "";
|
||||
|
||||
show_shift_name(period,period_type,from,to,'shift_item');
|
||||
}
|
||||
show_shift_name(period,period_type,from,to,'shift_item');
|
||||
}
|
||||
|
||||
// OK button is clicked
|
||||
$('#from').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
|
||||
@@ -338,13 +340,13 @@
|
||||
to = new_date.getDate() + "-" + month + "-" + new_date.getFullYear();
|
||||
$('#to').val(to)
|
||||
search_by_date();
|
||||
});
|
||||
});
|
||||
|
||||
function search_by_date(){
|
||||
from = $("#from").val();
|
||||
to = $("#to").val();
|
||||
var period = 0;
|
||||
var period_type = 1;
|
||||
var period_type = 1;
|
||||
|
||||
if(to != '' && from != ''){
|
||||
shift_name = from + ',' + to;
|
||||
@@ -353,7 +355,7 @@
|
||||
|
||||
console.log(check_arr.length)
|
||||
if(check_arr.length == 1){
|
||||
show_shift_name(period,period_type,from,to,'shift_item');
|
||||
show_shift_name(period,period_type,from,to,'shift_item');
|
||||
}
|
||||
if(check_arr.length == 3){
|
||||
check_arr = [];
|
||||
@@ -372,14 +374,14 @@
|
||||
var selected = '';
|
||||
var str = '';
|
||||
var param_shift = '<%= params[:shift_name]%>';
|
||||
|
||||
|
||||
url = '<%= reports_get_shift_by_sale_item_path %>';
|
||||
console.log(url)
|
||||
$.get(url, {period :period, period_type :period_type, from :from, to :to, report_type :shift_item} , function(data){
|
||||
console.log(data)
|
||||
|
||||
str = '<option value="0">--- All Shift ---</option>';
|
||||
$(data.message).each(function(index){
|
||||
$(data.message).each(function(index){
|
||||
|
||||
var local_date = data.message[index].local_opening_date + ' - ' + data.message[index].local_closing_date;
|
||||
var sh_date = data.message[index].opening_date + ' - ' + data.message[index].closing_date;
|
||||
@@ -390,21 +392,46 @@
|
||||
selected = 'selected = "selected"';
|
||||
}
|
||||
else{
|
||||
selected = '';
|
||||
}
|
||||
selected = '';
|
||||
}
|
||||
}
|
||||
else{
|
||||
selected = '';
|
||||
}
|
||||
selected = '';
|
||||
}
|
||||
|
||||
|
||||
str += '<option value="'+ shift_id +'" '+ selected +'>' + local_date + '</option>';
|
||||
|
||||
// console.log(sh_date)
|
||||
})
|
||||
})
|
||||
shift.append(str);
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
function print_sale_items(){
|
||||
var period = $('#sel_period').val();
|
||||
var type = $('#sel_sale_type').val();
|
||||
var account = $('#account_type').val();
|
||||
var from = $('#from').val();
|
||||
var to = $('#to').val();
|
||||
var shift = $('#shift_name').val();
|
||||
// var flag = false;
|
||||
// alert($('#row_count').val())
|
||||
|
||||
// if (flag == true) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "<%= reports_print_sale_items_path %>",
|
||||
data: "period="+period+"&period_type="+type+"&account_type="+account+"&from="+from+"&to="+to+"&shift_name="+shift,
|
||||
success: function(data){
|
||||
if (data != null){
|
||||
location.reload();
|
||||
}
|
||||
$("#loader").hide();
|
||||
}
|
||||
});
|
||||
// }
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
<%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %>
|
||||
<% if period_type != false %>
|
||||
<div class="row">
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.select_period") %></label>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 mbl-style">
|
||||
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.select_period") %></label>
|
||||
<select name="period" id="sel_period" class="form-control">
|
||||
<option value=""><%= t("views.right_panel.detail.select_period") %></option>
|
||||
<option value="0">Today</option>
|
||||
@@ -18,50 +18,50 @@
|
||||
<option value="9">Last year</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-3 col-md-3 col-sm-3">
|
||||
|
||||
<div class="col-lg-3 col-md-3 col-sm-3 col-mbl-view mbl-style">
|
||||
<!-- <label class="font-14">Select Shift Period</label> -->
|
||||
<label class="font-14"><%= t("views.right_panel.detail.from") %></label>
|
||||
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.from") %></label>
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="from" id="from" type="text" placeholder="From date" style="height: 32px;">
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-3 col-sm-3">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.to") %></label>
|
||||
<div class="col-lg-3 col-md-3 col-sm-3 col-mbl-view mbl-style">
|
||||
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.to") %></label>
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="to" id="to" type="text" placeholder="To date" style="height: 32px;">
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.all_shift") %></label>
|
||||
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.all_shift") %></label>
|
||||
<select class="form-control select" name="shift_name" id="shift_name" >
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 margin-top-20"><br>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 margin-top-20 mbl-style mbl-right-btn"><br>
|
||||
<input type="submit" value="Generate Report" class='btn btn-primary'>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$('#custom_excel').hide();
|
||||
|
||||
|
||||
$('#custom_excel').click(function(){
|
||||
var url = $('#custom_excel').attr('data-url');
|
||||
$('#frm_report').attr('action',url)
|
||||
$('#frm_report').submit();
|
||||
// window.location = url;
|
||||
});
|
||||
|
||||
|
||||
var item = $('#item').val();
|
||||
var payment_type = $('#payment_type');
|
||||
|
||||
|
||||
if(item == 'order'){
|
||||
$('#cashier').hide();
|
||||
$('#waiter').show();
|
||||
if(payment_type){
|
||||
$('#payment_type').hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(item == 'sale'){
|
||||
$('#waiter').hide();
|
||||
@@ -69,7 +69,7 @@
|
||||
}
|
||||
else{
|
||||
$('#waiter').hide();
|
||||
$('#cashier').show();
|
||||
$('#cashier').show();
|
||||
$("#item").val('sale');
|
||||
}
|
||||
});
|
||||
@@ -102,7 +102,7 @@ $('#item').change(function(){
|
||||
|
||||
if(item == 'sale'){
|
||||
$('#waiter').hide();
|
||||
$('#cashier').show();
|
||||
$('#cashier').show();
|
||||
if(payment_type){
|
||||
$('#payment_type').show();
|
||||
}
|
||||
@@ -115,4 +115,4 @@ $('#item').change(function(){
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
|
||||
@@ -54,13 +54,18 @@
|
||||
<th><%= t("views.right_panel.detail.cash_payment") %></th>
|
||||
<!-- <th>Credit Charges</th> -->
|
||||
<th><%= t("views.right_panel.detail.credit_payment") %></th>
|
||||
<th><%= t("views.btn.other_payment") %></th>
|
||||
<th><%= t("views.btn.foc") %> <%= t :payment %></th>
|
||||
<th class="d-none d-sm-table-cell"><%= t("views.btn.other_payment") %></th>
|
||||
<th class="d-none d-sm-table-cell"><%= t("views.btn.foc") %> <%= t :payment %></th>
|
||||
<!-- <th>Grand Total
|
||||
<br/>Rounding Adj</th> -->
|
||||
|
||||
|
||||
<!-- <th>Grand Total
|
||||
<br/>Rounding Adj</th> -->
|
||||
|
||||
<!-- <th>Rounding Adj</th> -->
|
||||
<th><%= t("views.right_panel.detail.grand_total") %></th>
|
||||
<th>Print</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -104,8 +109,8 @@
|
||||
<!-- <td><%= sprintf "%.2f",result.accept_credit_amount.to_f.to_d rescue '-'%></td> -->
|
||||
<!-- <td><%= sprintf "%.2f",result.foc_amount.to_f.to_d rescue '-'%></td>
|
||||
<td><%= sprintf "%.2f",result.card_amount.to_f.to_d rescue '-'%></td> -->
|
||||
<td><%= number_with_precision(result[:other_sales].to_f, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td>
|
||||
<td class="d-none d-sm-table-cell"><%= number_with_precision(result[:other_sales].to_f, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
<td class="d-none d-sm-table-cell">
|
||||
<%= number_with_precision(result[:foc_sales].to_f, precision:precision.to_i,delimiter:delimiter) rescue '-'%>
|
||||
</td>
|
||||
<td><%= number_with_precision(result[:grand_total].to_f, precision:precision.to_i,delimiter:delimiter) rescue '-'%></td>
|
||||
@@ -133,8 +138,8 @@
|
||||
<td><b><%= number_with_precision(credit, precision:precision.to_i,delimiter:delimiter) rescue '-'%></b></td>
|
||||
<!-- <td><b><%= sprintf("%.2f",accept_credit) rescue '-'%></b></td> -->
|
||||
<!-- <td><b><%= sprintf("%.2f",foc) rescue '-'%></b></td> -->
|
||||
<td><b><%= number_with_precision(card, precision:precision.to_i,delimiter:delimiter) rescue '-'%></b></td>
|
||||
<td><b><%= number_with_precision(foc, precision:precision.to_i,delimiter:delimiter) rescue '-'%></b></td>
|
||||
<td class="d-none d-sm-table-cell"><b><%= number_with_precision(card, precision:precision.to_i,delimiter:delimiter) rescue '-'%></b></td>
|
||||
<td class="d-none d-sm-table-cell"><b><%= number_with_precision(foc, precision:precision.to_i,delimiter:delimiter) rescue '-'%></b></td>
|
||||
<!-- <td><b><%= sprintf("%.2f",total) rescue '-'%></b></td> -->
|
||||
<!-- <td><b><%= sprintf("%.2f",rounding_adj) rescue '-'%></b></td> -->
|
||||
<td><b><%= number_with_precision(g_total, precision:precision.to_i,delimiter:delimiter) rescue '-'%></b></td>
|
||||
|
||||
@@ -11,23 +11,23 @@
|
||||
<input class="form-control" name="daterange" id="daterange" type="text" placeholder="Date Range" readonly="true">
|
||||
<% end %>
|
||||
</div> -->
|
||||
<div class="col-lg-3 col-md-3 col-sm-3">
|
||||
<div class="col-lg-3 col-md-3 col-sm-3 col-mbl-view mbl-style">
|
||||
<!-- <label class="">Select Shift Period</label> -->
|
||||
<label class="font-14">From</label>
|
||||
<label class="font-14 mbl_lbl">From</label>
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="from" id="from" type="text" placeholder="From date" style="height: 32px;">
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-3 col-sm-3">
|
||||
<label class="font-14">To</label>
|
||||
<div class="col-lg-3 col-md-3 col-sm-3 col-mbl-view mbl-style">
|
||||
<label class="font-14 mbl_lbl">To</label>
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="to" id="to" type="text" placeholder="To date" style="height: 32px;">
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label class="font-14">Select Item</label>
|
||||
<div class="form-group col-md-4 mbl-style">
|
||||
<label class="font-14 mbl_lbl">Select Item</label>
|
||||
<select class="form-control" name="item_code" id="item_code">
|
||||
<option value="">Select Item</option>
|
||||
<% @inventory_definitions.each do |item| %>
|
||||
<%
|
||||
<%
|
||||
selected = ""
|
||||
if item.item_code.to_s == params[:item_code].to_s
|
||||
if item.item_code.to_s == params[:item_code].to_s
|
||||
selected = "selected"
|
||||
end
|
||||
%>
|
||||
@@ -43,7 +43,7 @@
|
||||
<% end %>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-md-2 margin-top-20"><br>
|
||||
<div class="form-group col-md-2 margin-top-20 mbl-right-btn mbl-style"><br>
|
||||
<input type="submit" value="Generate Report" class='btn btn-primary'>
|
||||
</div>
|
||||
<!-- <div class="form-group col-md-2 margin-top-20">
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
<%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %>
|
||||
<% if period_type != false %>
|
||||
<div class="row">
|
||||
<div class="form-group col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-20"><%= t("views.right_panel.detail.select_period") %><%= t("views.right_panel.detail.select_period") %></label>
|
||||
<div class="form-group col-lg-2 col-md-2 col-sm-2 mbl-style">
|
||||
<label class="font-20 mbl_lbl"><%= t("views.right_panel.detail.select_period") %><%= t("views.right_panel.detail.select_period") %></label>
|
||||
<select name="period" id="sel_period" class="form-control">
|
||||
<option value=""><%= t("views.right_panel.detail.select_period") %></option>
|
||||
<option value="0">Today</option>
|
||||
@@ -19,25 +19,25 @@
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-lg-2 col-md-2 col-sm-2">
|
||||
<div class="form-group col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
|
||||
<!-- <label class="">Select Shift Period</label> -->
|
||||
<label class="font-20"><%= t("views.right_panel.detail.from") %></label>
|
||||
<label class="font-20 mbl_lbl"><%= t("views.right_panel.detail.from") %></label>
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="from" id="from" type="text" placeholder="From date" style="height: 34px;">
|
||||
</div>
|
||||
<div class="form-group col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-20"><%= t("views.right_panel.detail.to") %></label>
|
||||
<div class="form-group col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
|
||||
<label class="font-20 mbl_lbl"><%= t("views.right_panel.detail.to") %></label>
|
||||
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="to" id="to" type="text" placeholder="To date" style="height: 34px;">
|
||||
</div>
|
||||
<div class="form-group col-lg-3 col-md-3 col-sm-3">
|
||||
<label class="font-20"><%= t("views.right_panel.detail.all_shift") %></label>
|
||||
<div class="form-group col-lg-3 col-md-3 col-sm-3 mbl-style">
|
||||
<label class="font-20 mbl_lbl"><%= t("views.right_panel.detail.all_shift") %></label>
|
||||
<select class="form-control select" name="shift_name" id="shift_name" style="height: 37px;">
|
||||
</select>
|
||||
</div>
|
||||
<div class=" col-lg-1 col-md-1 col-sm-1 margin-top-20">
|
||||
<div class=" col-lg-1 col-md-1 col-sm-1 margin-top-20 mbl-right-btn mbl-style">
|
||||
<br>
|
||||
<input type="submit" value="Generate Report" class='btn btn-primary'>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
@@ -60,7 +60,7 @@
|
||||
$('#waiter').show();
|
||||
if(payment_type){
|
||||
$('#payment_type').hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(item == 'sale'){
|
||||
$('#waiter').hide();
|
||||
@@ -68,7 +68,7 @@
|
||||
}
|
||||
else{
|
||||
$('#waiter').hide();
|
||||
$('#cashier').show();
|
||||
$('#cashier').show();
|
||||
$("#item").val('sale');
|
||||
}
|
||||
});
|
||||
@@ -105,7 +105,7 @@
|
||||
|
||||
if(item == 'sale'){
|
||||
$('#waiter').hide();
|
||||
$('#cashier').show();
|
||||
$('#cashier').show();
|
||||
if(payment_type){
|
||||
$('#payment_type').show();
|
||||
}
|
||||
|
||||
@@ -19,12 +19,12 @@
|
||||
<!-- <div class="row"> -->
|
||||
<div class="col-md-12 text-right">
|
||||
<a href="javascript:export_to('<%=reports_void_sale_index_path%>.xls')" class = "btn btn-info wave-effects"><%= t("views.btn.exp_to_excel") %></a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- </div> -->
|
||||
<!-- </div> -->
|
||||
|
||||
<div class="margin-top-20">
|
||||
<div class="card">
|
||||
<div class="margin-top-20 mbl-table">
|
||||
<div class="card mbl-table-card">
|
||||
<% if @sale_data.count > 0 %>
|
||||
<table class="table table-striped" border="0">
|
||||
<thead>
|
||||
@@ -35,19 +35,19 @@
|
||||
<% end %>
|
||||
<% if @shift_from %>
|
||||
<tr>
|
||||
<% if @shift %>
|
||||
<% if @shift %>
|
||||
<% cashier_name = !@shift.nil? ? @shift[0].employee.name : '-' %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<th colspan="3"><%= t("views.right_panel.detail.shift_name") %> = <%= @shift_from rescue '-'%> - <%= @shift_to rescue '-'%> ( <%= cashier_name rescue '-'%> )</th>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<tr>
|
||||
<th><%= t("views.right_panel.detail.receipt_no") %></th>
|
||||
<th><%= t("views.right_panel.detail.sale_date") %></th>
|
||||
<th><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.amount") %></th>
|
||||
<th><%= t("views.right_panel.detail.grand_total") %></th>
|
||||
<th><%= t("views.right_panel.detail.rnd_adj_sh") %></th>
|
||||
<th><%= t("views.right_panel.detail.grand_total") %> + <br/><%= t("views.right_panel.detail.rnd_adj_sh") %></th>
|
||||
<th><%= t("views.right_panel.detail.grand_total") %> + <br/><%= t("views.right_panel.detail.rnd_adj_sh") %></th>
|
||||
<!-- <th>Sale Status</th> -->
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -63,7 +63,7 @@
|
||||
else
|
||||
delimiter = ""
|
||||
end
|
||||
%>
|
||||
%>
|
||||
<% total_amount = 0.0 %>
|
||||
<% grand_total = 0.0 %>
|
||||
<% rounding_adjustment = 0.0 %>
|
||||
@@ -76,7 +76,7 @@
|
||||
<td><%= number_with_precision(item.total_amount.to_f, precision: precision.to_i ,delimiter: delimiter) %> </td>
|
||||
<td><%= number_with_precision(item.grand_total.to_f , precision: precision.to_i ,delimiter: delimiter) rescue '-'%> </td>
|
||||
<td><%= number_with_precision(item.rounding_adjustment.to_f, precision: precision.to_i ,delimiter: delimiter) rescue '-' %></td>
|
||||
<td><%= number_with_precision(item.grand_total.to_f + item.rounding_adjustment.to_f , precision: precision.to_i ,delimiter: delimiter) rescue '-'%> </td>
|
||||
<td><%= number_with_precision(item.grand_total.to_f + item.rounding_adjustment.to_f , precision: precision.to_i ,delimiter: delimiter) rescue '-'%> </td>
|
||||
<!-- <td><%= result.sales_status rescue '-' %> </td> -->
|
||||
<!-- <td><%= item.remarks rescue '-' %> </td> -->
|
||||
</tr>
|
||||
@@ -113,8 +113,8 @@
|
||||
var from = "";
|
||||
var to = "";
|
||||
|
||||
show_shift_name(period,period_type,from,to,'shift_item');
|
||||
}
|
||||
show_shift_name(period,period_type,from,to,'shift_item');
|
||||
}
|
||||
|
||||
// OK button is clicked
|
||||
$('#from').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
|
||||
@@ -130,13 +130,13 @@
|
||||
to = new_date.getDate() + "-" + month + "-" + new_date.getFullYear();
|
||||
$('#to').val(to)
|
||||
search_by_date();
|
||||
});
|
||||
});
|
||||
|
||||
function search_by_date(){
|
||||
from = $("#from").val();
|
||||
to = $("#to").val();
|
||||
var period = 0;
|
||||
var period_type = 1;
|
||||
var period_type = 1;
|
||||
|
||||
if(to != '' && from != ''){
|
||||
shift_name = from + ',' + to;
|
||||
@@ -145,7 +145,7 @@
|
||||
|
||||
console.log(check_arr.length)
|
||||
if(check_arr.length == 1){
|
||||
show_shift_name(period,period_type,from,to,'shift_item');
|
||||
show_shift_name(period,period_type,from,to,'shift_item');
|
||||
}
|
||||
if(check_arr.length == 3){
|
||||
check_arr = [];
|
||||
@@ -163,7 +163,7 @@
|
||||
shift.empty();
|
||||
|
||||
var str = '';
|
||||
var param_shift = '';
|
||||
var param_shift = '';
|
||||
var param_shift = '<%= params[:shift_name] rescue '-'%>';
|
||||
|
||||
url = '<%= reports_get_shift_by_date_path %>';
|
||||
@@ -171,7 +171,7 @@
|
||||
$.get(url, {period :period, period_type :period_type, from :from, to :to, report_type :shift_item} , function(data){
|
||||
|
||||
str = '<option value="0">--- All Shift ---</option>';
|
||||
$(data.message).each(function(index){
|
||||
$(data.message).each(function(index){
|
||||
|
||||
var local_date = data.message[index].local_opening_date + ' - ' + data.message[index].local_closing_date;
|
||||
var sh_date = data.message[index].opening_date + ' - ' + data.message[index].closing_date;
|
||||
@@ -181,18 +181,18 @@
|
||||
selected = 'selected = "selected"';
|
||||
}
|
||||
else{
|
||||
selected = '';
|
||||
}
|
||||
selected = '';
|
||||
}
|
||||
}else{
|
||||
selected = '';
|
||||
}
|
||||
selected = '';
|
||||
}
|
||||
str += '<option value="'+ shift_id +'" '+ selected +'>' + local_date + '</option>';
|
||||
|
||||
// console.log(sh_date)
|
||||
})
|
||||
})
|
||||
shift.append(str);
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
|
||||
@@ -7,6 +7,13 @@
|
||||
</span>
|
||||
</ol>
|
||||
</div>
|
||||
<style>
|
||||
@media screen and (max-width: 785px) {
|
||||
section.content{
|
||||
margin: 80px 5px 0 5px !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
||||
<div class="main-box-body clearfix p-l-5 p-r-5">
|
||||
@@ -17,20 +24,20 @@
|
||||
<td colspan="8">
|
||||
<%= form_tag transactions_bookings_path, :method => :get do %>
|
||||
<div class="row clearfix">
|
||||
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4">
|
||||
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 mbl-style">
|
||||
<label><%= t("views.right_panel.detail.enter_keyboards") %></label>
|
||||
<input type="text" id="receipt_no" name="receipt_no" class="form-control" placeholder="Booking/ Sale ID/ Table/ Room" style="margin-right: 10px">
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
|
||||
<label class=""><%= t("views.right_panel.detail.from") %></label>
|
||||
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 col-mbl-view mbl-style">
|
||||
<label class="mbl_lbl"><%= t("views.right_panel.detail.from") %></label>
|
||||
<input class="form-control datepicker" name="from" id="from" type="text" placeholder="From date">
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
|
||||
<label class=""><%= t("views.right_panel.detail.to") %></label>
|
||||
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 col-mbl-view mbl-style">
|
||||
<label class="mbl_lbl"><%= t("views.right_panel.detail.to") %></label>
|
||||
<input class="form-control datepicker" name="to" id="to" type="text" placeholder="To date">
|
||||
</div>
|
||||
|
||||
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1">
|
||||
|
||||
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 mbl-right-btn mbl-style">
|
||||
<label></label>
|
||||
<br><input type="submit" value="Search" class='btn btn-primary btn-md'>
|
||||
</div>
|
||||
@@ -96,7 +103,3 @@
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<a class="nav-link" data-toggle="tab" href="#sale" role="tab"><%= t :sale_details %></a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<!-- Nav tabs - End -->
|
||||
<div class="tab-content" style="min-height:670px; max-height:670px;">
|
||||
<div class="tab-pane active" id="booking" role="tabpanel">
|
||||
@@ -78,7 +78,7 @@
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="tab-pane" id="order" role="tabpanel">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
@@ -167,7 +167,7 @@
|
||||
if(order_id!=undefined && order_id!=null && order_id!=""){
|
||||
if($('#request_bill').is(":visible")) {
|
||||
$('#request_bill').prop("disabled",true);
|
||||
}
|
||||
}
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: ajax_url,
|
||||
@@ -176,11 +176,11 @@
|
||||
$('#request_bill').prop("disabled",false);
|
||||
swal("Information!", result.error_message);
|
||||
}
|
||||
else {
|
||||
else {
|
||||
location.reload();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}else{
|
||||
swal("Opps","There is no orders!","warning");
|
||||
}
|
||||
@@ -198,10 +198,10 @@
|
||||
$('#change_booking_status').prop("disabled",false);
|
||||
swal("Opps",result.error_message,"warning");
|
||||
}
|
||||
else {
|
||||
else {
|
||||
swal({
|
||||
title: "Information",
|
||||
text: result.message,
|
||||
title: "Information",
|
||||
text: result.message,
|
||||
type: "success",
|
||||
html: true,
|
||||
closeOnConfirm: false,
|
||||
@@ -213,8 +213,6 @@
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
@@ -7,6 +7,13 @@
|
||||
</span>
|
||||
</ol>
|
||||
</div>
|
||||
<style>
|
||||
@media screen and (max-width: 785px) {
|
||||
section.content{
|
||||
margin: 80px 5px 0 5px !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
||||
<div class="main-box-body clearfix p-l-5 p-r-5">
|
||||
@@ -17,40 +24,40 @@
|
||||
<td colspan="8">
|
||||
<%= form_tag transactions_card_sale_trans_path, :method => :get do %>
|
||||
<div class="row clearfix">
|
||||
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
|
||||
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 mbl-style">
|
||||
<label><%= t("views.right_panel.detail.enter_keyboards") %></label>
|
||||
<input type="text" id="sale_id" name="sale_id" class="form-control" placeholder="Sale ID/ Customer Name/ Cashier Name" style="margin-right: 10px;height: 34px;">
|
||||
</div>
|
||||
|
||||
<% if defined? @payment_method %>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.select_payments") %></label>
|
||||
<%= select_tag "payment_type", options_for_select(@payment_method, :selected => params[:payment_type]), :class => "form-control" %>
|
||||
<%= select_tag "payment_type", options_for_select(@payment_method, :selected => params[:payment_type]), :class => "form-control" %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if not defined? status %>
|
||||
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.select_status") %></label>
|
||||
|
||||
|
||||
<select name="status_type" id="status_type" class="form-control">
|
||||
<% @status.each do |pm| %>
|
||||
<option class="<%=pm[1].downcase%>" value="<%=pm[1].downcase%>"><%=pm[0]%></option>
|
||||
<%end %>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
|
||||
<label class=""><%= t("views.right_panel.detail.from") %></label>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 col-mbl-view mbl-style">
|
||||
<label class="mbl_lbl"><%= t("views.right_panel.detail.from") %></label>
|
||||
<input class="form-control datepicker" name="from" id="from" type="text" placeholder="From date" style="height: 34px;">
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
|
||||
<label class=""><%= t("views.right_panel.detail.to") %></label>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 col-mbl-view mbl-style">
|
||||
<label class="mbl_lbl"><%= t("views.right_panel.detail.to") %></label>
|
||||
<input class="form-control datepicker" name="to" id="to" type="text" placeholder="To date" style="height: 34px;">
|
||||
</div>
|
||||
|
||||
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1">
|
||||
|
||||
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 mbl-right-btn mbl-style">
|
||||
<label></label>
|
||||
<br><input type="submit" value="Search" class='btn btn-primary btn-md'>
|
||||
</div>
|
||||
@@ -58,12 +65,12 @@
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
|
||||
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="card" style="width:122%;">
|
||||
<div class="table-responsive">
|
||||
@@ -102,7 +109,7 @@
|
||||
UnionPay
|
||||
<% else %>
|
||||
<%= cardSale.app %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td><%= cardSale.sale.customer.name rescue '-' %></td>
|
||||
<td><%= cardSale.sale.cashier_name rescue '-' %></td>
|
||||
@@ -111,18 +118,18 @@
|
||||
TID : <%= cardSale.terminal_id %>
|
||||
<br>
|
||||
<% end %>
|
||||
<% if cardSale.merchant_id != '' %>
|
||||
<% if cardSale.merchant_id != '' %>
|
||||
MID : <%= cardSale.merchant_id %>
|
||||
<br>
|
||||
<% end %>
|
||||
<% if cardSale.batch_no != '' %>
|
||||
<% if cardSale.batch_no != '' %>
|
||||
Batch : <%= cardSale.batch_no %>
|
||||
<br>
|
||||
<% end %>
|
||||
<% if cardSale.trace != '' %>
|
||||
<% if cardSale.trace != '' %>
|
||||
Trace : <%= cardSale.trace %>
|
||||
<% end %>
|
||||
</td>
|
||||
<% end %>
|
||||
</td>
|
||||
<td><%= cardSale.status %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
@@ -150,24 +157,24 @@
|
||||
$('#status_type').val("<%= params[:status_type] %>");
|
||||
$('#sale_id').val("<%= params[:sale_id] %>");
|
||||
$('#sel_period').val("<%= params[:period] %>");
|
||||
|
||||
|
||||
var check_arr = [];
|
||||
search_by_period();
|
||||
$('#sel_period').change(function(){
|
||||
|
||||
|
||||
search_by_period();
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
function search_by_period(){
|
||||
var period = $('#sel_period').val();
|
||||
var period_type = 0;
|
||||
var from = "";
|
||||
var to = "";
|
||||
|
||||
show_shift_name(period,period_type,from,to,'shift_item');
|
||||
}
|
||||
|
||||
show_shift_name(period,period_type,from,to,'shift_item');
|
||||
}
|
||||
|
||||
// OK button is clicked
|
||||
$('#from').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
|
||||
new_date = new Date(date) ;
|
||||
@@ -182,32 +189,32 @@
|
||||
to = new_date.getDate() + "-" + month + "-" + new_date.getFullYear();
|
||||
$('#to').val(to);
|
||||
search_by_date();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function search_by_date(){
|
||||
|
||||
from = $("#from").val();
|
||||
to = $("#to").val();
|
||||
to = $("#to").val();
|
||||
|
||||
var period = 0;
|
||||
var period_type = 1;
|
||||
var period_type = 1;
|
||||
|
||||
if(to != '' && from != ''){
|
||||
shift_name = from + ',' + to;
|
||||
|
||||
check_arr.push(to);
|
||||
|
||||
|
||||
console.log(check_arr.length)
|
||||
if(check_arr.length == 1){
|
||||
show_shift_name(period,period_type,from,to,'shift_item');
|
||||
show_shift_name(period,period_type,from,to,'shift_item');
|
||||
}
|
||||
if(check_arr.length == 3){
|
||||
check_arr = [];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
function show_shift_name(period,period_type,from,to,shift_item){
|
||||
var shift = $('#shift_name');
|
||||
if (from == '' && to == '') {
|
||||
@@ -215,18 +222,18 @@
|
||||
to = $("#to").val();
|
||||
}
|
||||
shift.empty();
|
||||
|
||||
|
||||
var str = '';
|
||||
var param_shift = '';
|
||||
var param_shift = '';
|
||||
var param_shift = '<%= params[:shift_name] rescue '-'%>';
|
||||
|
||||
url = '<%= reports_get_shift_by_date_path %>';
|
||||
|
||||
|
||||
$.get(url, {period :period, period_type :period_type, from :from, to :to, report_type :shift_item} , function(data){
|
||||
|
||||
str = '<option value="0">--- All Shift ---</option>';
|
||||
$(data.message).each(function(index){
|
||||
|
||||
$(data.message).each(function(index){
|
||||
|
||||
var local_date = data.message[index].local_opening_date + ' - ' + data.message[index].local_closing_date;
|
||||
var sh_date = data.message[index].opening_date + ' - ' + data.message[index].closing_date;
|
||||
var shift_id = data.message[index].shift_id ;
|
||||
@@ -235,18 +242,18 @@
|
||||
selected = 'selected = "selected"';
|
||||
}
|
||||
else{
|
||||
selected = '';
|
||||
}
|
||||
selected = '';
|
||||
}
|
||||
}else{
|
||||
selected = '';
|
||||
}
|
||||
selected = '';
|
||||
}
|
||||
str += '<option value="'+ shift_id +'" '+ selected +'>' + local_date + '</option>';
|
||||
|
||||
|
||||
// console.log(sh_date)
|
||||
})
|
||||
})
|
||||
shift.append(str);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
</script>
|
||||
|
||||
@@ -7,6 +7,13 @@
|
||||
</span>
|
||||
</ol>
|
||||
</div>
|
||||
<style>
|
||||
@media screen and (max-width: 785px) {
|
||||
section.content{
|
||||
margin: 80px 5px 0 5px !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
||||
<div class="main-box-body clearfix p-l-5 p-r-5">
|
||||
@@ -17,40 +24,40 @@
|
||||
<td colspan="8">
|
||||
<%= form_tag transactions_card_settle_trans_path, :method => :get do %>
|
||||
<div class="row clearfix">
|
||||
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
|
||||
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 mbl-style">
|
||||
<label><%= t("views.right_panel.detail.enter_keyboards") %></label>
|
||||
<input type="text" id="cashier_name" name="cashier_name" class="form-control" placeholder="Cashier Name" style="margin-right: 10px;height: 34px;">
|
||||
</div>
|
||||
|
||||
<% if defined? @payment_method %>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.select_payments") %></label>
|
||||
<%= select_tag "payment_type", options_for_select(@payment_method, :selected => params[:payment_type]), :class => "form-control" %>
|
||||
<%= select_tag "payment_type", options_for_select(@payment_method, :selected => params[:payment_type]), :class => "form-control" %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if not defined? status %>
|
||||
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-mbl-view mbl-style">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.select_status") %></label>
|
||||
|
||||
|
||||
<select name="status_type" id="status_type" class="form-control">
|
||||
<% @status.each do |pm| %>
|
||||
<option class="<%=pm[1].downcase%>" value="<%=pm[1].downcase%>"><%=pm[0]%></option>
|
||||
<%end %>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
|
||||
<label class=""><%= t("views.right_panel.detail.from") %></label>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 col-mbl-view mbl-style">
|
||||
<label class="mbl_lbl"><%= t("views.right_panel.detail.from") %></label>
|
||||
<input class="form-control datepicker" name="from" id="from" type="text" placeholder="From date" style="height: 34px;">
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
|
||||
<label class=""><%= t("views.right_panel.detail.to") %></label>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 col-mbl-view mbl-style">
|
||||
<label class="mbl_lbl"><%= t("views.right_panel.detail.to") %></label>
|
||||
<input class="form-control datepicker" name="to" id="to" type="text" placeholder="To date" style="height: 34px;">
|
||||
</div>
|
||||
|
||||
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1">
|
||||
|
||||
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 mbl-right-btn mbl-style">
|
||||
<label></label>
|
||||
<br><input type="submit" value="Search" class='btn btn-primary btn-md'>
|
||||
</div>
|
||||
@@ -58,14 +65,14 @@
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
|
||||
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="card" style="width:112%;">
|
||||
<div class="card">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
@@ -128,20 +135,20 @@
|
||||
var check_arr = [];
|
||||
search_by_period();
|
||||
$('#sel_period').change(function(){
|
||||
|
||||
|
||||
search_by_period();
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
function search_by_period(){
|
||||
var period = $('#sel_period').val();
|
||||
var period_type = 0;
|
||||
var from = "";
|
||||
var to = "";
|
||||
|
||||
show_shift_name(period,period_type,from,to,'shift_item');
|
||||
}
|
||||
|
||||
show_shift_name(period,period_type,from,to,'shift_item');
|
||||
}
|
||||
|
||||
// OK button is clicked
|
||||
$('#from').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
|
||||
new_date = new Date(date) ;
|
||||
@@ -156,50 +163,50 @@
|
||||
to = new_date.getDate() + "-" + month + "-" + new_date.getFullYear();
|
||||
$('#to').val(to)
|
||||
search_by_date();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function search_by_date(){
|
||||
|
||||
|
||||
from = $("#from").val();
|
||||
to = $("#to").val();
|
||||
|
||||
var period = 0;
|
||||
var period_type = 1;
|
||||
var period_type = 1;
|
||||
|
||||
if(to != '' && from != ''){
|
||||
shift_name = from + ',' + to;
|
||||
|
||||
check_arr.push(to);
|
||||
|
||||
|
||||
if(check_arr.length == 1){
|
||||
show_shift_name(period,period_type,from,to,'shift_item');
|
||||
show_shift_name(period,period_type,from,to,'shift_item');
|
||||
}
|
||||
if(check_arr.length == 3){
|
||||
check_arr = [];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
function show_shift_name(period,period_type,from,to,shift_item){
|
||||
var shift = $('#shift_name');
|
||||
|
||||
|
||||
shift.empty();
|
||||
|
||||
|
||||
var str = '';
|
||||
var param_shift = '';
|
||||
var param_shift = '';
|
||||
var param_shift = '<%= params[:shift_name] rescue '-'%>';
|
||||
if (from == '' && to == '') {
|
||||
from = $("#from").val();
|
||||
to = $("#to").val();
|
||||
}
|
||||
url = '<%= reports_get_shift_by_date_path %>';
|
||||
|
||||
|
||||
$.get(url, {period :period, period_type :period_type, from :from, to :to, report_type :shift_item} , function(data){
|
||||
|
||||
str = '<option value="0">--- All Shift ---</option>';
|
||||
$(data.message).each(function(index){
|
||||
|
||||
$(data.message).each(function(index){
|
||||
|
||||
var local_date = data.message[index].local_opening_date + ' - ' + data.message[index].local_closing_date;
|
||||
var sh_date = data.message[index].opening_date + ' - ' + data.message[index].closing_date;
|
||||
var shift_id = data.message[index].shift_id ;
|
||||
@@ -208,19 +215,19 @@
|
||||
selected = 'selected = "selected"';
|
||||
}
|
||||
else{
|
||||
selected = '';
|
||||
}
|
||||
selected = '';
|
||||
}
|
||||
}else{
|
||||
selected = '';
|
||||
}
|
||||
selected = '';
|
||||
}
|
||||
str += '<option value="'+ shift_id +'" '+ selected +'>' + local_date + '</option>';
|
||||
|
||||
|
||||
// console.log(sh_date)
|
||||
})
|
||||
})
|
||||
shift.append(str);
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
</script>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<li class="active">
|
||||
<a href="<%= transactions_credit_notes_path %>">Credit Note</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ol>
|
||||
</div>
|
||||
</div> -->
|
||||
@@ -18,6 +18,13 @@
|
||||
</span>
|
||||
</ol>
|
||||
</div>
|
||||
<style>
|
||||
@media screen and (max-width: 785px) {
|
||||
section.content{
|
||||
margin: 80px 5px 0 5px !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
||||
<div class="main-box-body clearfix p-l-5 p-r-5">
|
||||
@@ -28,11 +35,11 @@
|
||||
<td colspan="">
|
||||
<%= form_tag transactions_credit_notes_path, :method => :get do %>
|
||||
<div class="row clearfix">
|
||||
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
|
||||
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 mbl-style">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.enter_keyboards") %></label>
|
||||
<input type="text" name="receipt_no" class="form-control m-t-3" placeholder="Receipt No/Cashier Name/Status" style="margin-right: 10px">
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 col-mbl-view mbl-style">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.select_customer") %></label>
|
||||
<select class="selectpicker form-control col-md-12" name="customer">
|
||||
<option value=""><%= t("views.right_panel.detail.select_customer") %></option>
|
||||
@@ -40,22 +47,22 @@
|
||||
<option value="<%= customer.customer_id %>">
|
||||
<%= customer.name %></option>
|
||||
<%end %>
|
||||
</select>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 col-mbl-view mbl-style">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.order_source") %></label>
|
||||
<%= select_tag "order_source", options_for_select(@sources, :selected => params[:order_source]), :class => "form-control" %>
|
||||
<%= select_tag "order_source", options_for_select(@sources, :selected => params[:order_source]), :class => "form-control" %>
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.from") %></label>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 col-mbl-view mbl-style">
|
||||
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.from") %></label>
|
||||
<input class="form-control datepicker m-t-3" name="from" id="date" type="text" placeholder="From date">
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.to") %></label>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 col-mbl-view mbl-style">
|
||||
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.to") %></label>
|
||||
<input class="form-control datepicker m-t-3" name="to" id="date" type="text" placeholder="To date">
|
||||
</div>
|
||||
|
||||
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1">
|
||||
|
||||
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 mbl-right-btn mbl-style">
|
||||
<label class="font-14"> </label><br>
|
||||
<input type="submit" value="Search" class='btn btn-primary btn-md'>
|
||||
</div>
|
||||
@@ -63,10 +70,10 @@
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
|
||||
|
||||
|
||||
</table>
|
||||
</div>
|
||||
<div class="card">
|
||||
@@ -109,14 +116,14 @@
|
||||
</td>
|
||||
<td><%= sale.cashier_name rescue '-' %></td>
|
||||
<td><%= link_to sale.customer.name, crm_customer_path(sale.customer_id) %></td>
|
||||
<td>
|
||||
<td>
|
||||
<%if sale.source == "cashier" || sale.source == "emenu" %>
|
||||
Cashier
|
||||
<% elsif sale.source == "quick_service" %>
|
||||
Quick Service
|
||||
<% else %>
|
||||
Online Order
|
||||
<% end %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td> <%= sale.receipt_date.strftime("%d-%m-%Y %I:%M %p") %> </td>
|
||||
</tr>
|
||||
@@ -152,7 +159,7 @@
|
||||
}
|
||||
// console.log(arr_sale);
|
||||
});
|
||||
|
||||
|
||||
$(".credit_payment").on('click', function(){
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
@@ -194,8 +201,3 @@
|
||||
return arr_item;
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -7,6 +7,13 @@
|
||||
</span>
|
||||
</ol>
|
||||
</div>
|
||||
<style>
|
||||
@media screen and (max-width: 785px) {
|
||||
section.content{
|
||||
margin: 80px 5px 0 5px !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
||||
<div class="main-box-body clearfix p-l-5 p-r-5">
|
||||
@@ -17,13 +24,13 @@
|
||||
<td colspan="14">
|
||||
<%= form_tag transactions_order_reservations_path, :method => :get do %>
|
||||
<div class="row clearfix">
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 mbl-style">
|
||||
<label><%= t("views.right_panel.detail.enter_keyboards") %></label>
|
||||
<input type="text" id="filter" name="filter" class="form-control" placeholder="Status/Payment Type" style="margin-right: 10px;height: 34px;">
|
||||
</div>
|
||||
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.select_period") %></label>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 mbl-style">
|
||||
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.select_period") %></label>
|
||||
<select name="period" id="sel_period" class="form-control">
|
||||
<option value=""><%= t("views.right_panel.detail.select_period") %></option>
|
||||
<option value="0">Today</option>
|
||||
@@ -39,16 +46,16 @@
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
|
||||
<label class=""><%= t("views.right_panel.detail.from") %></label>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 col-mbl-view mbl-style">
|
||||
<label class="mbl_lbl"><%= t("views.right_panel.detail.from") %></label>
|
||||
<input class="form-control datepicker" name="from" id="from" type="text" placeholder="From date" style="height: 34px;">
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
|
||||
<label class=""><%= t("views.right_panel.detail.to") %></label>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 col-mbl-view mbl-style">
|
||||
<label class="mbl_lbl"><%= t("views.right_panel.detail.to") %></label>
|
||||
<input class="form-control datepicker" name="to" id="to" type="text" placeholder="To date" style="height: 34px;">
|
||||
</div>
|
||||
|
||||
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1">
|
||||
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 mbl-right-btn mbl-style">
|
||||
<label></label>
|
||||
<br><input type="submit" value="Search" class='btn btn-primary btn-md'>
|
||||
</div>
|
||||
@@ -56,18 +63,18 @@
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
|
||||
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-striped table-hover">
|
||||
<thead>
|
||||
|
||||
|
||||
<tr>
|
||||
<th><%= t("views.right_panel.detail.order_reservation_id") %></th>
|
||||
<th><%= t("views.right_panel.detail.sale_id") %></th>
|
||||
@@ -112,8 +119,8 @@
|
||||
%>
|
||||
<% if @order_reservations != 0 %>
|
||||
<% @order_reservations.each do |order_reservation| %>
|
||||
<%
|
||||
provider = ""
|
||||
<%
|
||||
provider = ""
|
||||
discount_amount = order_reservation.discount_amount
|
||||
delivery_fee = order_reservation.delivery_fee ? order_reservation.delivery_fee : 0.0
|
||||
convenience_charge = order_reservation.convenience_charge
|
||||
@@ -187,4 +194,4 @@
|
||||
$('#sel_period').val("<%= params[:period] %>");
|
||||
$('#filter').val("<%= params[:filter] %>");
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
|
||||
@@ -8,12 +8,19 @@
|
||||
</span>
|
||||
</ol>
|
||||
</div>
|
||||
<style>
|
||||
@media screen and (max-width: 785px) {
|
||||
section.content{
|
||||
margin: 80px 5px 0 5px !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
||||
<div class="main-box-body clearfix p-l-15 p-r-15">
|
||||
<%= form_tag transactions_orders_path, :method => :get do %>
|
||||
<div class="row clearfix">
|
||||
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
|
||||
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 mbl-style">
|
||||
<label class="form-control-label"><%= t("views.right_panel.button.search_keyboard") %></label>
|
||||
<input type="text" id="receipt_no" name="filter" placeholder="Order ID" class="form-control input-md" >
|
||||
</div>
|
||||
@@ -24,31 +31,31 @@
|
||||
<span class="highlight"></span>
|
||||
<output id="rangevalue">0</output>
|
||||
</div>
|
||||
|
||||
|
||||
</div> -->
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
|
||||
<label class="form-control-label"><%= t("views.right_panel.detail.from") %></label>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 col-mbl-view mbl-style">
|
||||
<label class="form-control-label mbl_lbl"><%= t("views.right_panel.detail.from") %></label>
|
||||
<input class="form-control datepicker" name="from" id="from" type="text" placeholder="From date">
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
|
||||
<label class="form-control-label"><%= t("views.right_panel.detail.to") %></label>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 col-mbl-view mbl-style">
|
||||
<label class="form-control-label mbl_lbl"><%= t("views.right_panel.detail.to") %></label>
|
||||
<input class="form-control datepicker" name="to" id="to" type="text" placeholder="To date">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-lg-1 col-md-1 col-sm-1 col-xs-1">
|
||||
|
||||
<div class="form-group col-lg-1 col-md-1 col-sm-1 col-xs-1 mbl-right-btn mbl-style">
|
||||
<label > </label>
|
||||
<br> <input type="submit" value="Search" class='btn btn-primary btn-md'>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="card">
|
||||
<div class="table-responsive">
|
||||
<table class="table ">
|
||||
<thead>
|
||||
|
||||
|
||||
<tr>
|
||||
<th><%= t("views.right_panel.detail.order_id") %></th>
|
||||
|
||||
|
||||
<th><%= t :table %>/<%= t :room %></th>
|
||||
<th><%= t("views.right_panel.detail.order_by") %></th>
|
||||
<th><%= t("views.right_panel.detail.type") %></th>
|
||||
@@ -60,7 +67,7 @@
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% @orders.each do |order|
|
||||
<% @orders.each do |order|
|
||||
@dining = BookingOrder.find_by_order_id(order.order_id).booking.dining_facility
|
||||
%>
|
||||
|
||||
@@ -73,13 +80,13 @@
|
||||
<td><%= order.status %></td>
|
||||
<td> <%= order.date.utc.getlocal.strftime("%d-%m-%Y %I:%M %p") %> </td>
|
||||
<td> <%= order.item_count %> </td>
|
||||
|
||||
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<br>
|
||||
|
||||
|
||||
<%if !@orders.nil?%>
|
||||
<%= paginate @orders %>
|
||||
<%end%>
|
||||
|
||||
@@ -7,6 +7,13 @@
|
||||
</span>
|
||||
</ol>
|
||||
</div>
|
||||
<style>
|
||||
@media screen and (max-width: 785px) {
|
||||
section.content{
|
||||
margin: 80px 5px 0 5px !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
||||
<div class="main-box-body clearfix p-l-5 p-r-5">
|
||||
@@ -17,13 +24,13 @@
|
||||
<td colspan="8">
|
||||
<%= form_tag transactions_sales_path, :method => :get do %>
|
||||
<div class="row clearfix">
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 mbl-style">
|
||||
<label><%= t("views.right_panel.detail.enter_keyboards") %></label>
|
||||
<input type="text" id="receipt_no" name="receipt_no" class="form-control" placeholder="Receipt No/Cashier Name/Status" style="margin-right: 10px;height: 34px;">
|
||||
</div>
|
||||
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.select_period") %></label>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 mbl-style">
|
||||
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.select_period") %></label>
|
||||
<select name="period" id="sel_period" class="form-control">
|
||||
<option value=""><%= t("views.right_panel.detail.select_period") %></option>
|
||||
<option value="0">Today</option>
|
||||
@@ -39,22 +46,22 @@
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
|
||||
<label class=""><%= t("views.right_panel.detail.from") %></label>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 col-mbl-view mbl-style">
|
||||
<label class="mbl_lbl"><%= t("views.right_panel.detail.from") %></label>
|
||||
<input class="form-control datepicker" name="from" id="from" type="text" placeholder="From date" style="height: 34px;">
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
|
||||
<label class=""><%= t("views.right_panel.detail.to") %></label>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 col-mbl-view mbl-style">
|
||||
<label class="mbl_lbl"><%= t("views.right_panel.detail.to") %></label>
|
||||
<input class="form-control datepicker" name="to" id="to" type="text" placeholder="To date" style="height: 34px;">
|
||||
</div>
|
||||
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.all_shift") %></label>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 mbl-style">
|
||||
<label class="font-14 mbl_lbl"><%= t("views.right_panel.detail.all_shift") %></label>
|
||||
<select class="form-control select" name="shift_name" id="shift_name" >
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1">
|
||||
|
||||
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 mbl-right-btn mbl-style">
|
||||
<label></label>
|
||||
<br><input type="submit" value="Search" class='btn btn-primary btn-md'>
|
||||
</div>
|
||||
@@ -62,18 +69,18 @@
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
|
||||
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
|
||||
|
||||
<tr>
|
||||
<th><%= t("views.right_panel.detail.sale_id") %></th>
|
||||
<th><%= t("views.right_panel.detail.receipt_no") %></th>
|
||||
@@ -144,24 +151,24 @@
|
||||
$('#from').val("<%= params[:from] %>");
|
||||
$('#to').val("<%= params[:to] %>");
|
||||
$('#sel_period').val("<%= params[:period] %>");
|
||||
|
||||
|
||||
var check_arr = [];
|
||||
search_by_period();
|
||||
$('#sel_period').change(function(){
|
||||
|
||||
|
||||
search_by_period();
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
function search_by_period(){
|
||||
var period = $('#sel_period').val();
|
||||
var period_type = 0;
|
||||
var from = "";
|
||||
var to = "";
|
||||
|
||||
show_shift_name(period,period_type,from,to,'shift_item');
|
||||
}
|
||||
|
||||
show_shift_name(period,period_type,from,to,'shift_item');
|
||||
}
|
||||
|
||||
// OK button is clicked
|
||||
$('#from').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
|
||||
new_date = new Date(date) ;
|
||||
@@ -176,32 +183,32 @@
|
||||
to = new_date.getDate() + "-" + month + "-" + new_date.getFullYear();
|
||||
$('#to').val(to);
|
||||
search_by_date();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function search_by_date(){
|
||||
|
||||
from = $("#from").val();
|
||||
to = $("#to").val();
|
||||
to = $("#to").val();
|
||||
|
||||
var period = 0;
|
||||
var period_type = 1;
|
||||
var period_type = 1;
|
||||
|
||||
if(to != '' && from != ''){
|
||||
shift_name = from + ',' + to;
|
||||
|
||||
check_arr.push(to);
|
||||
|
||||
|
||||
console.log(check_arr.length)
|
||||
if(check_arr.length == 1){
|
||||
show_shift_name(period,period_type,from,to,'shift_item');
|
||||
show_shift_name(period,period_type,from,to,'shift_item');
|
||||
}
|
||||
if(check_arr.length == 3){
|
||||
check_arr = [];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
function show_shift_name(period,period_type,from,to,shift_item){
|
||||
var shift = $('#shift_name');
|
||||
if (from == '' && to == '') {
|
||||
@@ -209,18 +216,18 @@
|
||||
to = $("#to").val();
|
||||
}
|
||||
shift.empty();
|
||||
|
||||
|
||||
var str = '';
|
||||
var param_shift = '';
|
||||
var param_shift = '';
|
||||
var param_shift = '<%= params[:shift_name] rescue '-'%>';
|
||||
|
||||
url = '<%= reports_get_shift_by_date_path %>';
|
||||
|
||||
|
||||
$.get(url, {period :period, period_type :period_type, from :from, to :to, report_type :shift_item} , function(data){
|
||||
|
||||
str = '<option value="0">--- All Shift ---</option>';
|
||||
$(data.message).each(function(index){
|
||||
|
||||
$(data.message).each(function(index){
|
||||
|
||||
var local_date = data.message[index].local_opening_date + ' - ' + data.message[index].local_closing_date;
|
||||
var sh_date = data.message[index].opening_date + ' - ' + data.message[index].closing_date;
|
||||
var shift_id = data.message[index].shift_id ;
|
||||
@@ -229,18 +236,18 @@
|
||||
selected = 'selected = "selected"';
|
||||
}
|
||||
else{
|
||||
selected = '';
|
||||
}
|
||||
selected = '';
|
||||
}
|
||||
}else{
|
||||
selected = '';
|
||||
}
|
||||
selected = '';
|
||||
}
|
||||
str += '<option value="'+ shift_id +'" '+ selected +'>' + local_date + '</option>';
|
||||
|
||||
|
||||
// console.log(sh_date)
|
||||
})
|
||||
})
|
||||
shift.append(str);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
</script>
|
||||
|
||||
@@ -7,6 +7,13 @@
|
||||
</span>
|
||||
</ol>
|
||||
</div>
|
||||
<style>
|
||||
@media screen and (max-width: 785px) {
|
||||
section.content{
|
||||
margin: 80px 5px 0 5px !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
||||
<div class="main-box-body clearfix p-l-5 p-r-5">
|
||||
@@ -21,7 +28,7 @@
|
||||
<label><%= t("views.right_panel.detail.enter_keyboards") %></label>
|
||||
<input type="text" name="receipt_no" class="form-control" placeholder="" style="margin-right: 10px">
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
|
||||
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
|
||||
<label class=""><%= t("views.right_panel.detail.from") %></label>
|
||||
<input class="form-control datepicker" name="from" id="from date" type="text" placeholder="From date">
|
||||
</div>
|
||||
@@ -29,7 +36,7 @@
|
||||
<label class=""><%= t("views.right_panel.detail.to") %></label>
|
||||
<input class="form-control datepicker" name="to" id="to date" type="text" placeholder="To date">
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1">
|
||||
<label></label>
|
||||
<br><input type="submit" value="Search" class='btn btn-primary btn-md'>
|
||||
@@ -107,6 +114,3 @@
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
<%= form_tag transactions_surveys_path, :method => :get, :id=>"frm_report", :class => "form" do %>
|
||||
<div class="row clearfix">
|
||||
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
|
||||
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 mbl-style">
|
||||
<label class="form-control-label"><%= t("views.right_panel.button.search_keyboard") %></label>
|
||||
<input type="text" id="dining_name" name="filter" placeholder="Dining Name" class="form-control input-md" >
|
||||
</div>
|
||||
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
|
||||
<label class="form-control-label"><%= t("views.right_panel.detail.from") %></label>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 col-mbl-view mbl-style">
|
||||
<label class="form-control-label mbl_lbl"><%= t("views.right_panel.detail.from") %></label>
|
||||
<input class="form-control datepicker" name="from" id="from" type="text" placeholder="From date">
|
||||
</div>
|
||||
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
|
||||
<label class="form-control-label"><%= t("views.right_panel.detail.to") %></label>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 col-mbl-view mbl-style">
|
||||
<label class="form-control-label mbl_lbl"><%= t("views.right_panel.detail.to") %></label>
|
||||
<input class="form-control datepicker" name="to" id="to" type="text" placeholder="To date">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-lg-1 col-md-1 col-sm-1 col-xs-1">
|
||||
|
||||
<div class="form-group col-lg-1 col-md-1 col-sm-1 col-xs-1 mbl-right-btn mbl-style">
|
||||
<label > </label>
|
||||
<br> <input type="submit" value="Search" class='btn btn-primary btn-md'>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
@@ -38,4 +38,4 @@ $("#dining_name").val("<%=params[:filter]%>");
|
||||
$("#from").val("<%=params[:from]%>");
|
||||
$("#to").val("<%=params[:to]%>");
|
||||
|
||||
</script>
|
||||
</script>
|
||||
|
||||
@@ -7,6 +7,13 @@
|
||||
</span>
|
||||
</ol>
|
||||
</div>
|
||||
<style>
|
||||
@media screen and (max-width: 785px) {
|
||||
section.content{
|
||||
margin: 80px 5px 0 5px !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
||||
<div class="main-box-body clearfix p-l-15 p-r-15">
|
||||
@@ -67,8 +74,8 @@
|
||||
<% foreigner_lists = foreign.split(",") %>
|
||||
<% if !foreigner_lists.empty? %>
|
||||
<% foreigner_lists.each do |fgn| %>
|
||||
<% unless fgn.match(/[^[:digit:]]+/)
|
||||
total_foreigner = total_foreigner.to_i + fgn.to_i
|
||||
<% unless fgn.match(/[^[:digit:]]+/)
|
||||
total_foreigner = total_foreigner.to_i + fgn.to_i
|
||||
end %>
|
||||
<% if !fgn.scan(/\D/).empty? %>
|
||||
<%= fgn %> :<% end %> <%= fgn.to_i unless fgn.match(/[^[:digit:]]+/) %><br>
|
||||
@@ -104,4 +111,4 @@
|
||||
$("#from").val("<%=params[:from] rescue '-'%>");
|
||||
$("#to").val("<%=params[:to] rescue '-'%>");
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
|
||||
@@ -1,83 +1,16 @@
|
||||
# ## SQLIte3 --- Setup
|
||||
#
|
||||
# # SQLite version 3.x
|
||||
# # gem install sqlite3
|
||||
# #
|
||||
# # Ensure the SQLite 3 gem is defined in your Gemfile
|
||||
# # gem 'sqlite3'
|
||||
# #
|
||||
# default: &default
|
||||
# adapter: sqlite3
|
||||
# pool: 5
|
||||
# timeout: 5000
|
||||
#
|
||||
# development:
|
||||
# <<: *default
|
||||
# database: db/development.sqlite3
|
||||
#
|
||||
# # Warning: The database defined as "test" will be erased and
|
||||
# # re-generated from your development database when you run "rake".
|
||||
# # Do not set this db to the same as development or production.
|
||||
# test:
|
||||
# <<: *default
|
||||
# database: db/test.sqlite3
|
||||
#
|
||||
# production:
|
||||
# <<: *default
|
||||
# database: db/production.sqlite3
|
||||
|
||||
# Mysql --- Setup
|
||||
# MySQL. Versions 5.0 and up are supported.
|
||||
#
|
||||
# Install the MySQL driver
|
||||
# gem install mysql2
|
||||
#
|
||||
# Ensure the MySQL gem is defined in your Gemfile
|
||||
# gem 'mysql2'
|
||||
#
|
||||
# And be sure to use new-style password hashing:
|
||||
# http://dev.mysql.com/doc/refman/5.7/en/old-client.html
|
||||
#
|
||||
default: &default
|
||||
adapter: mysql2
|
||||
encoding: utf8
|
||||
pool: 5
|
||||
username: root
|
||||
password:
|
||||
socket: /tmp/mysql.sock
|
||||
adapter: postgresql
|
||||
host: localhost
|
||||
pool: 5
|
||||
timeout: 5000
|
||||
encoding: unicode
|
||||
username: wunna
|
||||
password: admin123
|
||||
port: 5432
|
||||
|
||||
development:
|
||||
<<: *default
|
||||
database: SXRestaurants_development
|
||||
|
||||
# Warning: The database defined as "test" will be erased and
|
||||
# re-generated from your development database when you run "rake".
|
||||
# Do not set this db to the same as development or production.
|
||||
test:
|
||||
<<: *default
|
||||
database: SXRestaurants_test
|
||||
|
||||
# As with config/secrets.yml, you never want to store sensitive information,
|
||||
# like your database password, in your source code. If your source code is
|
||||
# ever seen by anyone, they now have access to your database.
|
||||
#
|
||||
# Instead, provide the password as a unix environment variable when you boot
|
||||
# the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database
|
||||
# for a full rundown on how to provide these environment variables in a
|
||||
# production deployment.
|
||||
#
|
||||
# On Heroku and other platform providers, you may have a full connection URL
|
||||
# available as an environment variable. For example:
|
||||
#
|
||||
# DATABASE_URL="mysql2://myuser:mypass@localhost/somedatabase"
|
||||
#
|
||||
# You can use this database configuration with:
|
||||
#
|
||||
# production:
|
||||
# url: <%= ENV['DATABASE_URL'] %>
|
||||
#
|
||||
<<: *default
|
||||
database: SXDatabase
|
||||
production:
|
||||
<<: *default
|
||||
database: SXRestaurants_production
|
||||
username: SXRestaurants
|
||||
password: <%= ENV['SXRESTAURANTS_DATABASE_PASSWORD'] %>
|
||||
<<: *default
|
||||
database: paymal
|
||||
|
||||
@@ -21,11 +21,11 @@ class ActionController::Base
|
||||
end
|
||||
else
|
||||
# check for license file
|
||||
if check_license
|
||||
current_license(ENV["SX_PROVISION_URL"])
|
||||
else
|
||||
redirect_to activate_path
|
||||
end
|
||||
if check_license
|
||||
current_license(ENV["SX_PROVISION_URL"])
|
||||
else
|
||||
redirect_to activate_path
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -11,21 +11,20 @@
|
||||
# if you're sharing your code publicly.
|
||||
|
||||
development:
|
||||
secret_key_base: b61d85f8ed2a1a9e0eeece3443b3e8f838d002cc1d9f32115d8e93db920e2957adfedc57501d44741211538f3108b742cdeada87d5bfae796c53da1f90a3cd61
|
||||
sx_provision_url: connect.smartsales.asia/api #connect.smartsales.dev/api #connect.smartsales.asia/api #provision.zsai.ws/api
|
||||
server_mode: application
|
||||
cipher_type: AES-256-CBC
|
||||
sx_key: Wh@t1$C2L
|
||||
secret_key_base: b61d85f8ed2a1a9e0eeece3443b3e8f838d002cc1d9f32115d8e93db920e2957adfedc57501d44741211538f3108b742cdeada87d5bfae796c53da1f90a3cd61
|
||||
sx_provision_url: connect.smartsales.asia/api #connect.smartsales.dev/api #connect.smartsales.asia/api #provision.zsai.ws/api
|
||||
server_mode: application
|
||||
cipher_type: AES-256-CBC
|
||||
sx_key: Wh@t1$C2L
|
||||
|
||||
test:
|
||||
secret_key_base: 5c92143fd4a844fdaf8b22aba0cda22ef1fc68f1b26dd3d40656866893718ae5e58625b4c3a5dc86b04c8be0a505ec0ebc0be3bf52249a3d1e0c1334ee591cf0
|
||||
secret_key_base: 5c92143fd4a844fdaf8b22aba0cda22ef1fc68f1b26dd3d40656866893718ae5e58625b4c3a5dc86b04c8be0a505ec0ebc0be3bf52249a3d1e0c1334ee591cf0
|
||||
|
||||
# Do not keep production secrets in the repository,
|
||||
# instead read values from the environment.
|
||||
production:
|
||||
secret_key_base: c4bc81065013f9a3506d385bcbd49586c42e586488144b0de90c7da36867de9fa880f46b5c4f86f0ce9b7c783bb5a73bdb0e5605a47716567294390e726d3e22
|
||||
sx_provision_url: connect.smartsales.asia/api #192.168.1.147:3002/api
|
||||
server_mode: application
|
||||
cipher_type: AES-256-CBC
|
||||
sx_key: Wh@t1$C2L
|
||||
|
||||
secret_key_base: c4bc81065013f9a3506d385bcbd49586c42e586488144b0de90c7da36867de9fa880f46b5c4f86f0ce9b7c783bb5a73bdb0e5605a47716567294390e726d3e22
|
||||
sx_provision_url: connect.smartsales.asia/api #192.168.1.147:3002/api
|
||||
server_mode: application
|
||||
cipher_type: AES-256-CBC
|
||||
sx_key: Wh@t1$C2L
|
||||
|
||||
Reference in New Issue
Block a user