promotion + merge with master

This commit is contained in:
Nweni
2017-08-23 10:12:41 +06:30
parent 28dab9d3e0
commit eedf6c39a1
4 changed files with 20 additions and 22 deletions

View File

@@ -24,6 +24,7 @@ class Api::BillController < Api::ApiController
@sale = Sale.new @sale = Sale.new
@status, @sale_id = @sale.generate_invoice_from_order(params[:order_id], current_login_employee, get_cashier) @status, @sale_id = @sale.generate_invoice_from_order(params[:order_id], current_login_employee, get_cashier)
end end
# Promotion.promo_activate(@sale)
else else
@status = false @status = false
@error_message = "No Current Open Shift" @error_message = "No Current Open Shift"

View File

@@ -10,8 +10,7 @@ class Promotion < ApplicationRecord
PROMO_TYPE3 = "Net_price" PROMO_TYPE3 = "Net_price"
PROMO_TYPE4 = "Percentage" PROMO_TYPE4 = "Percentage"
def self.promo_activate def self.promo_activate(saleObj)
saleObj = Sale.first # Test
current_day = Time.now.strftime("%Y-%m-%d") current_day = Time.now.strftime("%Y-%m-%d")
current_time = Time.now.strftime('%H:%M:%S') current_time = Time.now.strftime('%H:%M:%S')
day = Date.today.wday day = Date.today.wday

View File

@@ -340,7 +340,7 @@ class Sale < ApplicationRecord
tax_profiles = TaxProfile.all.order("order_by asc") tax_profiles = TaxProfile.all.order("order_by asc")
customer = Customer.find(self.customer_id) customer = Customer.find(self.customer_id)
puts customer
#Create new tax records #Create new tax records
tax_profiles.each do |tax| tax_profiles.each do |tax|
customer.tax_profiles.each do |cus_tax| customer.tax_profiles.each do |cus_tax|

View File

@@ -108,9 +108,7 @@
<button id="cash_in" type="button" class="btn btn-block btn-primary"> Cash In </button> <button id="cash_in" type="button" class="btn btn-block btn-primary"> Cash In </button>
<button id="cash_out" type="button" class="btn btn-block btn-primary"> Cash Out </button> <button id="cash_out" type="button" class="btn btn-block btn-primary"> Cash Out </button>
<!-- Temporary Disabled --> <!-- Temporary Disabled -->
<%if current_login_employee.role == "cashier" && @shop.quick_sale_summary == true%>
<button id="sale_summary" type="button" class="btn btn-block btn-primary">Sale Summary</button>
<%end%>
<button id="close_cashier" type="button" class="btn btn-block btn-primary"> Close Cashier </button> <button id="close_cashier" type="button" class="btn btn-block btn-primary"> Close Cashier </button>