From da7c3441794bbcac25bce34bcffa74d62f4f8a4a Mon Sep 17 00:00:00 2001 From: Zoey Date: Thu, 16 May 2019 14:10:57 +0630 Subject: [PATCH] foc error --- app/controllers/crm/customers_controller.rb | 2 +- app/models/sale_item.rb | 4 ++-- app/pdf/order_item_pdf.rb | 1 + app/pdf/order_item_slim_pdf.rb | 1 + app/pdf/receipt_bill_pdf.rb | 11 ++++++----- config/initializers/action_controller.rb | 10 +++++----- config/puma.rb | 18 +++++++++--------- dump.rdb | Bin 908 -> 1084 bytes 8 files changed, 25 insertions(+), 22 deletions(-) mode change 100755 => 100644 dump.rdb diff --git a/app/controllers/crm/customers_controller.rb b/app/controllers/crm/customers_controller.rb index 21c2d373..52149abb 100644 --- a/app/controllers/crm/customers_controller.rb +++ b/app/controllers/crm/customers_controller.rb @@ -165,7 +165,7 @@ class Crm::CustomersController < BaseCrmController paypar_account_no: paypar_account_no, member_group_id: member_group_id, merchant_uid:merchant_uid,auth_token:auth_token}.to_json - end + end begin response = HTTParty.post(url, diff --git a/app/models/sale_item.rb b/app/models/sale_item.rb index 13f295a9..c69e3626 100755 --- a/app/models/sale_item.rb +++ b/app/models/sale_item.rb @@ -180,10 +180,10 @@ class SaleItem < ApplicationRecord def self.get_all_sale_items(sale_id) sale_items = SaleItem.select("sale_id,product_code,item_instance_code, product_name,product_alt_name,account_id,status,remark, - (CASE WHEN (qty > 0 AND remark IS NULL) OR (qty < 0 AND status='Discount') OR (status='promotion' AND (remark='promotion' OR remark = 'promotion nett price' OR remark= 'promotion discount')) THEN SUM(qty) ELSE qty END) as qty, + (CASE WHEN (qty > 0 AND remark IS NULL) OR (qty < 0 AND status = 'foc') OR (qty < 0 AND status='Discount') OR (status='promotion' AND (remark='promotion' OR remark = 'promotion nett price' OR remark= 'promotion discount')) THEN SUM(qty) ELSE qty END) as qty, unit_price, taxable_price, - (CASE WHEN (price > 0 AND remark IS NULL) OR (price < 0 AND status='Discount') OR (status='promotion' AND (remark='promotion' OR remark = 'promotion nett price' OR remark= 'promotion discount')) THEN SUM(price) ELSE price END) as price, + (CASE WHEN (price > 0 AND remark IS NULL) OR (qty < 0 AND status = 'foc') OR (price < 0 AND status='Discount') OR (status='promotion' AND (remark='promotion' OR remark = 'promotion nett price' OR remark= 'promotion discount')) THEN SUM(price) ELSE price END) as price, is_taxable") .where("sale_id = ?",sale_id) .order("product_name asc") diff --git a/app/pdf/order_item_pdf.rb b/app/pdf/order_item_pdf.rb index f3883627..f872d608 100755 --- a/app/pdf/order_item_pdf.rb +++ b/app/pdf/order_item_pdf.rb @@ -1,6 +1,7 @@ class OrderItemPdf < 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 + def initialize(print_settings,order_item, print_status, options, alt_name, before_updated_qty) self.page_width = print_settings.page_width self.page_height = print_settings.page_height diff --git a/app/pdf/order_item_slim_pdf.rb b/app/pdf/order_item_slim_pdf.rb index 83df19da..33e1e314 100755 --- a/app/pdf/order_item_slim_pdf.rb +++ b/app/pdf/order_item_slim_pdf.rb @@ -1,6 +1,7 @@ class OrderItemSlimPdf < 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 + def initialize(print_settings,order_item_slim, print_status, options, alt_name, before_updated_qty) self.page_width = print_settings.page_width self.page_height = print_settings.page_height diff --git a/app/pdf/receipt_bill_pdf.rb b/app/pdf/receipt_bill_pdf.rb index 573dd1ee..fbb15b1b 100755 --- a/app/pdf/receipt_bill_pdf.rb +++ b/app/pdf/receipt_bill_pdf.rb @@ -408,13 +408,13 @@ class ReceiptBillPdf < Prawn::Document sale_payments.each do |payment| y_position = cursor if payment.payment_method == "paypar" - bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do + bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do text "Redeem Payment", :size => self.item_font_size,:align => :left - end + end else - bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do + bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do text "#{payment.payment_method.capitalize} Payment", :size => self.item_font_size,:align => :left - end + end end bounding_box([self.item_description_width,y_position], :width =>self.label_width) do @@ -432,7 +432,7 @@ class ReceiptBillPdf < Prawn::Document text "#{number_with_precision(sale_data.amount_changed, :precision => precision.to_i, :delimiter => delimiter)}" , :size => self.item_font_size,:align => :right end # move_down line_move - end + end end # show member information @@ -538,6 +538,7 @@ class ReceiptBillPdf < Prawn::Document text "#{ customer_name }" , :size => self.item_font_size,:align => :right end move_down line_move + stroke_horizontal_rule end diff --git a/config/initializers/action_controller.rb b/config/initializers/action_controller.rb index 5abb412e..cab8fe5d 100644 --- a/config/initializers/action_controller.rb +++ b/config/initializers/action_controller.rb @@ -20,11 +20,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 diff --git a/config/puma.rb b/config/puma.rb index fd89392f..fbe48c81 100755 --- a/config/puma.rb +++ b/config/puma.rb @@ -1,10 +1,10 @@ -application_path="#{File.expand_path("../..", __FILE__)}" -directory application_path +#application_path="#{File.expand_path("../..", __FILE__)}" +#directory application_path #environment ENV.fetch("RAILS_ENV") { "production" } -environment "production" -pidfile "#{application_path}/tmp/puma/pid" -state_path "#{application_path}/tmp/puma/state" -stdout_redirect "#{application_path}/log/puma.stdout.log", "#{application_path}/log/puma.stderr.log" -port ENV.fetch("PORT") { 62158 } -workers 2 -preload_app! +#environment "production" +#pidfile "#{application_path}/tmp/puma/pid" +#state_path "#{application_path}/tmp/puma/state" +#stdout_redirect "#{application_path}/log/puma.stdout.log", "#{application_path}/log/puma.stderr.log" +#port ENV.fetch("PORT") { 62158 } +#workers 2 +#preload_app! diff --git a/dump.rdb b/dump.rdb old mode 100755 new mode 100644 index 7d7b359cf467d72ccdedbb6c289ac7f4a3c49f3d..87e22f1d49653abdc6c0f99faa01b9c718bc686f GIT binary patch literal 1084 zcmaJ=L5tHs7@d@~tL|E44~h%YGI)|snM{&q5-$}LT*ZqXJgC&9nQkLV(>u!7qCM!`}#CHm&D9P0SgZA{@McBmK_ezIAV6-_$&p-;OEW; zsK?yq);J3LEEd(X&(i$u_jeCoNdSPWr!k9Q#Y9*~n9g1Uu$iL++w+;5R>0*GpNmQZ zVFM{N1w{xu$@Ku#l_Vw!;nE~Vu?Yo$FGR_0%jdjIUvjFc4_7RtiYfByQk%Uq0N z+Z3t7_WVcv35%r-mksR1=Oq&@o0fp9pw?ZAaD`E&G{O~FKoe@^ zG>R}urTOD)_ddK3cO&ogLzfZXb}W?=)6yKQ(~jvnL^I^-B=H!Rd6Y2O8x6vv?)&ah z<0Tx1F(26hgBJYDhAk*=D&oxTHEa$oMb`~#Vy#2ls)i|{S__Un7cNw)W(#tAuX*#L z8^k@A?fc<4U?bkV)#!(#eiB7&)Sp6&=q#)Ept&h|ZgaPL<(u^8c~n0&3p|h=X7lZZFOy(m8f`5LZ7*1-obz3YbY{gTTu?G)Hm`t+f!-E0!;8joJN0}t=b_cS_c4ktIB6#vI z^x(mIQv44>sQWZ|QWb7FtvkJO!)>mItJ z`UXBJspWWstn`03C)CSNS(dVFHYsy6&10GdWJLT?U{l9UA`2qV_uG_~1~yL*QLVN8 zb&W+$?V~k|uB`4CP=HX^5*X7Wl^qj%M!nVQ_s2(Xu02u}Mf)H7nidtJtQ3u9E7_h z8S#X}(9sG`GdaAz9_LwHa1L2qhF8w(sELPy`=|*R?hGbuZ?Ze%Eayy?=%J2M8bKQF z3^z2EKqkYBU;3|Kl$)ovK+k*o1q0a|(^P;K0hJeOgATDh-?2>B@;uieKVQ9n@bd7j GdiV?6cOB9I