fixed conflic

This commit is contained in:
Aung Myo
2017-10-27 13:25:13 +06:30
9 changed files with 22 additions and 15 deletions

View File

@@ -29,6 +29,7 @@
//= require autosize/autosize.js
//= require jquery-countto/jquery.countTo.js
//= require raphael/raphael.min
//= require morrisjs/morris.js
//= require chartjs/Chart.bundle.js
//= require fileinput.min
//= require BSBMaterial/admin.js
@@ -36,7 +37,6 @@
//= require BSBMaterial/demo.js
//= require custom.js
$(document).on('turbolinks:load', function() {
$('.datetimepicker').bootstrapMaterialDatePicker({
format: 'DD-MM-YYYY - HH:mm',

View File

@@ -1,7 +1,6 @@
$(document).on('turbolinks:load', function() {
// $("body").boostrapMaterialDesign();
var height = ($(window).height() - ($('.legal').outerHeight() + $('.user-info').outerHeight() + $('.navbar').innerHeight()));
$('#custom-slimscroll').slimScroll({
@@ -54,7 +53,7 @@ $(document).on('turbolinks:load', function() {
var animateExit = $("#notify_message").attr('data-animate-exit');
var colorName = $("#notify_message").attr('data-color-name');
var text = $("#notify_message").attr('data-message');
console.log(text);
if (text != null || colorName != null){
showNotification(colorName, text, placementFrom, placementAlign, animateEnter, animateExit);
}

View File

@@ -68,7 +68,7 @@ class HomeController < ApplicationController
@sales = Sale::where("payment_status='paid' and sale_status='completed' and DATE_FORMAT(receipt_date,'%Y-%m-%d') = '#{today}'").count()
@top_products = Sale.top_products(today)
@hourly_sales = Sale.hourly_sales(today)
@hourly_sales = Sale.hourly_sales(today).sum(:grand_total)
# .group_by_hour(:created_at, :time_zone => 'Asia/Rangoon',format: '%I:%p')
# .sum(:grand_total)
@employee_sales = Sale.employee_sales(today).sum(:grand_total)

View File

@@ -5,6 +5,7 @@ class DiningCharge < ApplicationRecord
def self.amount_calculate(dining_charges_obj, checkin , checkout)
# note :: the first Charge Block will cost all, the Time rounding block will included in 2nd Charge Block
if !checkin.nil? && !checkout.nil? && !dining_charges_obj.nil?
block_count = 0
price = 0
minutes = DiningCharge.time_diff(checkout, checkin)
free_time = DiningCharge.convert_to_minutes(dining_charges_obj.minimum_free_time.utc.localtime.strftime('%H:%M'))

View File

@@ -856,7 +856,9 @@ end
end
def self.hourly_sales(today)
query= Sale.select("grand_total").where('payment_status="paid" and sale_status = "completed" and DATE_FORMAT(receipt_date,"%Y-%m-%d") = ?',today)
query= Sale.select("grand_total")
.where('payment_status="paid" and sale_status = "completed" and DATE_FORMAT(receipt_date,"%Y-%m-%d") = ?',today)
.group("date_format(receipt_date, '%I %p')")
end
def self.employee_sales(today)

View File

@@ -124,8 +124,10 @@
datasets.push(val.total_item);
backgroundColor.push(randomColorGenerator());
});
var ctx = $("#top_products").get(0).getContext("2d");
var chart = new Chart("top_products", {
var chart = new Chart(ctx, {
type: 'pie',
data: {
labels: labels,
@@ -159,8 +161,9 @@
backgroundColor.push(randomColorGenerator());
});
var ctx = $("#hourly_sales").get(0).getContext("2d");
var myChart = new Chart("hourly_sales", {
var myChart = new Chart(ctx, {
type: 'bar',
data: {
labels: labels,
@@ -206,8 +209,9 @@
datasets.push(val);
backgroundColor.push(randomColorGenerator());
});
var ctx = $("#employee_sales").get(0).getContext("2d");
var myChart = new Chart("employee_sales", {
var myChart = new Chart(ctx, {
type: 'bar',
data: {
labels: labels,
@@ -254,7 +258,9 @@
borderColor.push(randomColorGenerator());
});
var myChart = new Chart("inventory", {
var ctx = $("#inventory").get(0).getContext("2d");
var myChart = new Chart(ctx, {
type: 'line',
data: {
labels: labels,

View File

@@ -57,7 +57,6 @@
</p>
<% end %>
<%= yield %>
</section>
</section>
</body>
</html>

View File

@@ -6,7 +6,7 @@
<div class="form-inputs p-l-15">
<%= f.input :payment_method %>
<%= f.input :is_active,:class=> "checkbox" %>
<%= f.input :is_active %>
<%= f.input :gateway_communication_type %>
<%= f.input :gateway_url %>
<%= f.input :auth_token %>

View File

@@ -219,8 +219,8 @@
7) <%= t("views.right_panel.detail.type") %> - <%= t("views.right_panel.detail.select_txt") %> <%= t("views.right_panel.detail.type_txt") %> <br>
8) <%= t("views.right_panel.detail.item") %> - <%= t("views.right_panel.detail.select_txt") %> <%= t("views.right_panel.detail.item_txt") %> <br>
9) <%= t("views.right_panel.detail.original_product") %> - <%= t("views.right_panel.detail.select_txt") %> <%= t("views.right_panel.detail.original_product_txt") %> <br>
10) <%= t("views.right_panel.detail.min_qty") %> - <%= t("views.right_panel.detail.write_txt") %> <%= t("views.right_panel.detail.min_qty_txt") %>
--------------------------------------------------------------------------------
10) <%= t("views.right_panel.detail.min_qty") %> - <%= t("views.right_panel.detail.write_txt") %> <%= t("views.right_panel.detail.min_qty_txt") %> <br>
-------------------------------------------------------------------
<h5>ADD PRODUCT</h5>
1) <%= t("views.right_panel.detail.item_code") %> - <%= t("views.right_panel.detail.select_txt") %> <%= t("views.right_panel.detail.item_code_txt") %> <%= t("views.right_panel.detail.product_txt") %> <br>
2) <%= t("views.right_panel.detail.min_qty") %> - <%= t("views.right_panel.detail.write_txt") %> <%= t("views.right_panel.detail.min_qty_txt") %> <br>