Merge branch 'r-1902001-01' into foodcourt
This commit is contained in:
8
app/controllers/api/tax_profiles_controller.rb
Normal file
8
app/controllers/api/tax_profiles_controller.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
class Api::TaxProfilesController < Api::ApiController
|
||||
|
||||
def index
|
||||
@tax_profiles = TaxProfile.where(nil)
|
||||
@tax_profiles = @tax_profiles.filter_by_group_type(params[:group_type]) if params[:group_type].present?
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1243,7 +1243,7 @@ end
|
||||
|
||||
def self.get_shift_sales_by_receipt_no_detail(shift_sale_range, shift, from, to, payment_type, customer_filter)
|
||||
## => left join -> show all sales although no orders
|
||||
|
||||
puts customer_filter
|
||||
query = Sale.includes([:survey, :sale_payments])
|
||||
.select("sales.*, SUM(sale_payments.payment_amount) AS payments_for_credits_amount")
|
||||
.select("dining_facilities.type AS table_type, dining_facilities.name AS table_name")
|
||||
|
||||
@@ -5,6 +5,8 @@ class TaxProfile < ApplicationRecord
|
||||
# validations
|
||||
validates_presence_of :name, :rate, :group_type
|
||||
|
||||
scope :filter_by_group_type, -> (group_type) { where group_type: group_type }
|
||||
|
||||
def self.calculate_tax(group_type)
|
||||
divided_value =0.0
|
||||
exclusive =0.0
|
||||
|
||||
4
app/views/api/tax_profiles/index.json.jbuilder
Normal file
4
app/views/api/tax_profiles/index.json.jbuilder
Normal file
@@ -0,0 +1,4 @@
|
||||
json.status true
|
||||
json.data do
|
||||
json.tax_profiles @tax_profiles, :name, :group_type, :rate, :inclusive, :order_by
|
||||
end
|
||||
@@ -18,7 +18,12 @@
|
||||
<option value="9">Last year</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 mbl-style">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.customer_name") %></label>
|
||||
<input type="text" placeholder="Customer name" class="form-control m-t-3" name="customer" value="<%= params[:customer] %>" id="customer_filter" style="height: 32px;">
|
||||
</div>
|
||||
|
||||
<% if defined? @payment_methods %>
|
||||
<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>
|
||||
@@ -31,11 +36,6 @@
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="col-lg-2 col-md-2 col-sm-2 mbl-style">
|
||||
<label class="font-14"><%= t("views.right_panel.detail.customer_name") %></label>
|
||||
<input type="text" placeholder="Customer name" class="form-control m-t-3" name="customer" id="customer_filter" >
|
||||
</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 mbl_lbl"><%= t("views.right_panel.detail.from") %></label>
|
||||
|
||||
Reference in New Issue
Block a user