Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant
This commit is contained in:
@@ -878,10 +878,9 @@ def self.get_by_shift_sale_by_item(from,to,status)
|
||||
end
|
||||
|
||||
def self.get_item_query(type)
|
||||
|
||||
if type == "revenue" || type.nil?
|
||||
sale_type = "i.status IS NULL and i.qty >0 "
|
||||
elsif type == "all"
|
||||
if type == "revenue"
|
||||
sale_type = "i.qty > 0 and status IS NULL"
|
||||
elsif type == "all" || type.nil?
|
||||
sale_type = ""
|
||||
elsif type == "discount"
|
||||
sale_type = "i.status = 'Discount'"
|
||||
|
||||
@@ -401,26 +401,34 @@
|
||||
</button>
|
||||
<!-- -->
|
||||
<% if current_login_employee.role == "cashier" %>
|
||||
<% if @other_payment <= 0 && @sale_payment.nil? %>
|
||||
<% if @other_payment < 0 && @sale_payment.nil? %>
|
||||
<%if @sale_data.total_discount == 0 %>
|
||||
<a class="btn btn-block bg-deep-purple waves-effect access_modal" data-toggle="modal" data-type="foc"> FOC</a>
|
||||
<% end %>
|
||||
<%end %>
|
||||
<% if @sale_payment.nil? %>
|
||||
<a class="btn btn-block bg-red waves-effect access_modal" data-toggle="modal" data-type="void"> Void</a>
|
||||
<a class="btn btn-block bg-deep-purple waves-effect access_modal" data-toggle="modal" data-type="waste"> Waste</a>
|
||||
<a class="btn btn-block bg-deep-purple waves-effect access_modal" data-toggle="modal" data-type="spoile"> Spoile</a>
|
||||
<% if @other_payment < 0 %>
|
||||
<%if @sale_data.total_discount == 0 %>
|
||||
<a class="btn btn-block bg-deep-purple waves-effect access_modal" data-toggle="modal" data-type="waste"> Waste</a>
|
||||
<a class="btn btn-block bg-deep-purple waves-effect access_modal" data-toggle="modal" data-type="spoile"> Spoile</a>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% if @other_payment <= 0 && @sale_payment.nil?%>
|
||||
<% if @other_payment < 0 && @sale_payment.nil?%>
|
||||
<%if @sale_data.total_discount == 0 %>
|
||||
<button type="button" class="btn bg-deep-purple btn-block" data-toggle="modal" data-target="#focModal" <%= (can? :foc, :payment)? ' ': 'disabled=' %> active="true"> FOC </button>
|
||||
<%end %>
|
||||
<%end %>
|
||||
<% if @sale_payment.nil? %>
|
||||
<button type="button" class="btn bg-red btn-block" data-toggle="modal" data-target="#voidModal" <%= (can? :overall_void, :void)? ' ': 'disabled=' %> > Void </button>
|
||||
<button type="button" class="btn btn-block bg-deep-purple waves-effect " data-status="waste" value="waste" id="btn_waste" onclick="waste_and_spoilage('waste')">Waste</button>
|
||||
<button type="button" class="btn btn-block bg-deep-purple waves-effect " data-status="spoile" value="spoile" id="btn_spoile" onclick="waste_and_spoilage('spoile')">Spoile</button>
|
||||
<% if @other_payment < 0 %>
|
||||
<%if @sale_data.total_discount == 0 %>
|
||||
<button type="button" class="btn btn-block bg-deep-purple waves-effect " data-status="waste" value="waste" id="btn_waste" onclick="waste_and_spoilage('waste')">Waste</button>
|
||||
<button type="button" class="btn btn-block bg-deep-purple waves-effect " data-status="spoile" value="spoile" id="btn_spoile" onclick="waste_and_spoilage('spoile')">Spoile</button>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user