Merge branch 'crm' of bitbucket.org:code2lab/sxrestaurant
This commit is contained in:
@@ -0,0 +1,18 @@
|
|||||||
|
class Transactions::CreditNotesController < ApplicationController
|
||||||
|
before_action :set_transactions_sale, only: [:show, :edit, :update, :destroy]
|
||||||
|
|
||||||
|
# GET /transactions/sales
|
||||||
|
# GET /transactions/sales.json
|
||||||
|
def index
|
||||||
|
|
||||||
|
@sales = Sale.where('payment_status = ?', Sale::SALE_STATUS_OUTSTANDING)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
respond_to do |format|
|
||||||
|
format.html # index.html.erb
|
||||||
|
format.json { render json: @sales }
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -20,9 +20,9 @@ class Ability
|
|||||||
can :manage, Zone
|
can :manage, Zone
|
||||||
can :manage, CashierTerminal
|
can :manage, CashierTerminal
|
||||||
can :manage, Employee
|
can :manage, Employee
|
||||||
can :manage, MembershipSetting
|
# can :manage, MembershipSetting
|
||||||
can :manage, MembershipAction
|
# can :manage, MembershipAction
|
||||||
can :manage, PaymentMethodSetting
|
# can :manage, PaymentMethodSetting
|
||||||
can :manage, TaxProfile
|
can :manage, TaxProfile
|
||||||
can :manage, PrintSetting
|
can :manage, PrintSetting
|
||||||
can :manage, Account
|
can :manage, Account
|
||||||
@@ -30,9 +30,26 @@ class Ability
|
|||||||
can :manage, Order
|
can :manage, Order
|
||||||
can :manage, Sale
|
can :manage, Sale
|
||||||
|
|
||||||
|
can :manage, Customer
|
||||||
|
|
||||||
can :index, :dailysale
|
can :index, :dailysale
|
||||||
can :index, :saleitem
|
can :index, :saleitem
|
||||||
|
|
||||||
|
can :add_customer, Customer
|
||||||
|
can :update_sale_by_customer, Customer
|
||||||
|
|
||||||
|
can :index, :discount
|
||||||
|
can :create, :discount
|
||||||
|
|
||||||
|
can :show, :payment
|
||||||
|
can :create, :payment
|
||||||
|
can :reprint, :payment
|
||||||
|
|
||||||
|
can :move_dining, :movetable
|
||||||
|
can :moving, :movetable
|
||||||
|
|
||||||
|
can :move_dining, :moveroom
|
||||||
|
|
||||||
elsif user.role == "cashier"
|
elsif user.role == "cashier"
|
||||||
|
|
||||||
can :read, Order
|
can :read, Order
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class Sale < ApplicationRecord
|
|||||||
"monthly" => 1,
|
"monthly" => 1,
|
||||||
"yearly" => 2
|
"yearly" => 2
|
||||||
}
|
}
|
||||||
|
SALE_STATUS_OUTSTANDING = "outstanding"
|
||||||
SALE_STATUS_COMPLETED = "completed"
|
SALE_STATUS_COMPLETED = "completed"
|
||||||
|
|
||||||
def generate_invoice_from_booking(booking_id, requested_by)
|
def generate_invoice_from_booking(booking_id, requested_by)
|
||||||
|
|||||||
@@ -47,7 +47,7 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<% @i = 0 %>
|
<% @i = 0 %>
|
||||||
<% @crm_customers.each do |crm_customer| %>
|
<% @crm_customers.each do |crm_customer| %>
|
||||||
<% if crm_customer.customer_id != "CUS-000000000001" && crm_customer.customer_id != "CUS-000000000002" %>
|
<% if crm_customer.customer_id != "CUS-00001" && crm_customer.customer_id != "CUS-000000000" %>
|
||||||
<tr class="customer_tr" data-ref="<%= crm_customer.customer_id %>">
|
<tr class="customer_tr" data-ref="<%= crm_customer.customer_id %>">
|
||||||
<td>
|
<td>
|
||||||
<input type="radio" style="width:20px;" name="checkbox" class="checkbox_check" ></td>
|
<input type="radio" style="width:20px;" name="checkbox" class="checkbox_check" ></td>
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
<ul class="dropdown-menu">
|
<ul class="dropdown-menu">
|
||||||
<li><%= link_to "Orders ", transactions_orders_path, :tabindex =>"-1" %></li>
|
<li><%= link_to "Orders ", transactions_orders_path, :tabindex =>"-1" %></li>
|
||||||
<li><%= link_to "Sales ", transactions_sales_path, :tabindex =>"-1" %></li>
|
<li><%= link_to "Sales ", transactions_sales_path, :tabindex =>"-1" %></li>
|
||||||
|
<!-- <li><%= link_to "Sales ", transactions_credit_notes_path, :tabindex =>"-1" %></li> -->
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li class="navbar-nav mr-auto dropdown">
|
<li class="navbar-nav mr-auto dropdown">
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
<% if @crm_customers.count > 0 %>
|
<% if @crm_customers.count > 0 %>
|
||||||
<% @i = 0 %>
|
<% @i = 0 %>
|
||||||
<% @crm_customers.each do |crm_customer| %>
|
<% @crm_customers.each do |crm_customer| %>
|
||||||
<% if crm_customer.customer_id != "CUS-000000000001" && crm_customer.customer_id != "CUS-000000000002" %>
|
<% if crm_customer.customer_id != "CUS-00000" && crm_customer.customer_id != "CUS-00000000" %>
|
||||||
<tr class="customer_tr" data-ref="<%= crm_customer.customer_id %>">
|
<tr class="customer_tr" data-ref="<%= crm_customer.customer_id %>">
|
||||||
<td>
|
<td>
|
||||||
<input type="radio" style="width:20px;" name="checkbox" class="checkbox_check" ></td>
|
<input type="radio" style="width:20px;" name="checkbox" class="checkbox_check" ></td>
|
||||||
|
|||||||
70
app/views/transactions/credit_notes/index.html.erb
Normal file
70
app/views/transactions/credit_notes/index.html.erb
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
<div class="row">
|
||||||
|
<div class="col-lg-12">
|
||||||
|
<ol class="breadcrumb">
|
||||||
|
<li><a href="<%= crm_root_path %>">Home</a></li>
|
||||||
|
<li class="active">
|
||||||
|
<a href="<%= transactions_credit_notes_path %>">Credit Note</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ol>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-lg-12">
|
||||||
|
<div class="main-box-body clearfix">
|
||||||
|
<div class="table-responsive">
|
||||||
|
<table class="table table-striped">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Sale Id </th>
|
||||||
|
<th>Receipt no </th>
|
||||||
|
<th>Credit Amount</th>
|
||||||
|
<th>Cashier</th>
|
||||||
|
<th>Customer Name</th>
|
||||||
|
<th>Receipt Date</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
<% @sales.each do |sale| %>
|
||||||
|
<tr>
|
||||||
|
<td><%= link_to sale.sale_id, transactions_sale_path(sale) %></td>
|
||||||
|
<td><%= sale.receipt_no %></td>
|
||||||
|
<td><%credit = SalePayment.where('sale_id = ? AND payment_method=?', sale.sale_id,"creditnote").first %>
|
||||||
|
<%= credit.payment_amount rescue '-' %>
|
||||||
|
</td>
|
||||||
|
<td><%= sale.cashier_name rescue '-' %></td>
|
||||||
|
<td><%= link_to sale.customer.name, crm_customer_path(sale.customer_id) %></td>
|
||||||
|
<td> <%= sale.receipt_date.strftime("%d-%m-%Y") %> </td>
|
||||||
|
</tr>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!--
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(function () {
|
||||||
|
|
||||||
|
$('.datepicker').datepicker({
|
||||||
|
format : 'dd-mm-yyyy',
|
||||||
|
autoclose: true
|
||||||
|
});
|
||||||
|
$('.datepicker').attr('ReadOnly','true');
|
||||||
|
$('.datepicker').css('cursor','pointer');
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
</script> -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -13,6 +13,7 @@ module SXRestaurants
|
|||||||
# -- all .rb files in that directory are automatically loaded.
|
# -- all .rb files in that directory are automatically loaded.
|
||||||
config.active_record.time_zone_aware_types = [:datetime, :time]
|
config.active_record.time_zone_aware_types = [:datetime, :time]
|
||||||
config.active_job.queue_adapter = :sidekiq
|
config.active_job.queue_adapter = :sidekiq
|
||||||
|
config.time_zone = 'Asia/Rangoon'
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -228,6 +228,7 @@ Rails.application.routes.draw do
|
|||||||
namespace :transactions do
|
namespace :transactions do
|
||||||
resources :sales
|
resources :sales
|
||||||
resources :orders
|
resources :orders
|
||||||
|
resources :credit_notes
|
||||||
|
|
||||||
get "/sales/:sale_id/manual_complete_sale" =>"manual_sales#manual_complete_sale", :as => "manual_complete_sale"
|
get "/sales/:sale_id/manual_complete_sale" =>"manual_sales#manual_complete_sale", :as => "manual_complete_sale"
|
||||||
get "/sales/:sale_id/void" =>"manual_sales#void", :as => "void"
|
get "/sales/:sale_id/void" =>"manual_sales#void", :as => "void"
|
||||||
|
|||||||
Reference in New Issue
Block a user