diff --git a/app/assets/javascripts/transactions.js b/app/assets/javascripts/transactions.js new file mode 100644 index 00000000..12e8ee44 --- /dev/null +++ b/app/assets/javascripts/transactions.js @@ -0,0 +1,7 @@ +//= require jquery +//= require bootstrap +//= require jquery_ujs +//= require turbolinks +//= require cable +//= require jquery-ui +//= require bootstrap-datepicker \ No newline at end of file diff --git a/app/assets/stylesheets/transactions.scss b/app/assets/stylesheets/transactions.scss new file mode 100644 index 00000000..5ca9b171 --- /dev/null +++ b/app/assets/stylesheets/transactions.scss @@ -0,0 +1,5 @@ +@import "bootstrap"; +@import "font-awesome"; +@import "theme"; +@import "jquery-ui"; +@import "bootstrap-datepicker3"; \ No newline at end of file diff --git a/app/controllers/transactions/orders_controller.rb b/app/controllers/transactions/orders_controller.rb new file mode 100644 index 00000000..35cefe6f --- /dev/null +++ b/app/controllers/transactions/orders_controller.rb @@ -0,0 +1,32 @@ +class Transactions::OrdersController < ApplicationController + def index + + filter = params[:filter] + if filter.nil? + orders = Order.order("order_id desc") + else + order = Order.search(filter) + if order.count > 0 + orders = order + else + orders = Order.order("order_id desc") + + end + end + @orders = Kaminari.paginate_array(orders).page(params[:page]).per(50) + respond_to do |format| + format.html # index.html.erb + format.json { render json: @orders } + end + end + def show + + @order = Order.find(params[:id]) + + respond_to do |format| + format.html # show.html.erb + format.json { render json: @order } + end + end + +end diff --git a/app/views/crm/customers/showbackup.html.erb b/app/views/crm/customers/showbackup.html.erb new file mode 100644 index 00000000..936192cf --- /dev/null +++ b/app/views/crm/customers/showbackup.html.erb @@ -0,0 +1,85 @@ +
+
+ +
+
+ + +
+
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + +
NameEmailContact noCompanyDate Of BirthMembership Account
<%= @crm_customer.name %><%= @crm_customer.email %><%= @crm_customer.contact_no %><%= @crm_customer.company %><%= @crm_customer.date_of_birth %>
+
+ + +

Sale Items

+ + + + + + + + + + + + + + + <% @sale_items.each do |sale_item| %> + + + + + + + + + + <% end %> + +
Sale ID Menu ItemQTYUnit Price Tax PriceCreated At
<%= sale_item.sale_id %><%= sale_item.product_name %><%= sale_item.qty %><%= sale_item.unit_price %><%= sale_item.taxable_price %><%= sale_item.created_at %>
+
+
+ +
+ + +
+ + + + + diff --git a/app/views/transactions/orders/index.html.erb b/app/views/transactions/orders/index.html.erb new file mode 100644 index 00000000..29cd001c --- /dev/null +++ b/app/views/transactions/orders/index.html.erb @@ -0,0 +1,68 @@ +
+
+ +
+
+
+ +
+
+
+
+ + + + + + + + + + + + + + + + + + <% @orders.each do |order| %> + + + + + + + + + + + <% end %> + +
+ <%= form_tag transactions_orders_path, :method => :get do %> +
+ + +
+ <% end %> +
Order ID TypeCustomerOrder statusOrder dateItems CountAction
<%= order.order_id %><%= order.order_type %><%= order.customer.name rescue '-' %><%= order.status %> <%= order.date.strftime("%d-%m-%Y") %> <%= order.item_count %> <%= link_to 'Show', transactions_order_path(order) %>
+
+ + <%= paginate @orders %> +
+
+ +
+
+ + + + + diff --git a/app/views/transactions/orders/show.html.erb b/app/views/transactions/orders/show.html.erb new file mode 100644 index 00000000..bd17dadb --- /dev/null +++ b/app/views/transactions/orders/show.html.erb @@ -0,0 +1,85 @@ +
+
+ +
+
+
+ +
+
+
+
+ + + + + + + + + + + + + + + + + + + + +
TypeCustomerOrder statusOrder dateOrder By
<%= @order.order_type %><%= @order.customer.name rescue '-' %><%= @order.status %> <%= @order.date.strftime("%d-%m-%Y") %> <%= @order.waiter rescue '-' %>
+

Order Items

+ + + + + + + + + + + + + + + + + <% @order.order_items.each do |order| %> + + + + + + + + + + + + <% end %> + +
Item NameQty Unit PriceTotal PriceOptionStatusOrder ByCreated at
<%= order.item_name %><%= order.qty %><%= order.price %><%= order.qty * order.price %> <%= order.options %> <%= order.order_item_status %> <%= order.item_order_by %> <%= order.created_at.strftime("%d-%m-%Y") %>
+ + Back + +
+
+ +
+
+ + + + + diff --git a/app/views/transactions/sales/indexback.html.erb b/app/views/transactions/sales/indexback.html.erb new file mode 100644 index 00000000..c39b0ac3 --- /dev/null +++ b/app/views/transactions/sales/indexback.html.erb @@ -0,0 +1,59 @@ +

<%= notice %>

+ +

Transactions Sales

+ + + + + + + + + + + + + + + + + + + + + + + + + + + <% @transactions_sales.each do |transactions_sale| %> + + + + + + + + + + + + + + + + + + + + + + + <% end %> + +
CashierCashier nameRequested byRequested atReceipt noReceipt dateCustomerPayment statusSale statusTotal amountTotal discountTotal taxTax typeGrand totalRounding adjustmentAmount receivedAmount changed
<%= transactions_sale.cashier %><%= transactions_sale.cashier_name %><%= transactions_sale.requested_by %><%= transactions_sale.requested_at %><%= transactions_sale.receipt_no %><%= transactions_sale.receipt_date %><%= transactions_sale.customer %><%= transactions_sale.payment_status %><%= transactions_sale.sale_status %><%= transactions_sale.total_amount %><%= transactions_sale.total_discount %><%= transactions_sale.total_tax %><%= transactions_sale.tax_type %><%= transactions_sale.grand_total %><%= transactions_sale.rounding_adjustment %><%= transactions_sale.amount_received %><%= transactions_sale.amount_changed %><%= link_to 'Show', transactions_sale %><%= link_to 'Edit', edit_transactions_sale_path(transactions_sale) %><%= link_to 'Destroy', transactions_sale, method: :delete, data: { confirm: 'Are you sure?' } %>
+ +
+ +<%= link_to 'New Transactions Sale', new_transactions_sale_path %> diff --git a/app/views/transactions/sales/showback.html.erb b/app/views/transactions/sales/showback.html.erb new file mode 100644 index 00000000..c82c2c5e --- /dev/null +++ b/app/views/transactions/sales/showback.html.erb @@ -0,0 +1,89 @@ +

<%= notice %>

+ +

+ Cashier: + <%= @transactions_sale.cashier %> +

+ +

+ Cashier name: + <%= @transactions_sale.cashier_name %> +

+ +

+ Requested by: + <%= @transactions_sale.requested_by %> +

+ +

+ Requested at: + <%= @transactions_sale.requested_at %> +

+ +

+ Receipt no: + <%= @transactions_sale.receipt_no %> +

+ +

+ Receipt date: + <%= @transactions_sale.receipt_date %> +

+ +

+ Customer: + <%= @transactions_sale.customer %> +

+ +

+ Payment status: + <%= @transactions_sale.payment_status %> +

+ +

+ Sale status: + <%= @transactions_sale.sale_status %> +

+ +

+ Total amount: + <%= @transactions_sale.total_amount %> +

+ +

+ Total discount: + <%= @transactions_sale.total_discount %> +

+ +

+ Total tax: + <%= @transactions_sale.total_tax %> +

+ +

+ Tax type: + <%= @transactions_sale.tax_type %> +

+ +

+ Grand total: + <%= @transactions_sale.grand_total %> +

+ +

+ Rounding adjustment: + <%= @transactions_sale.rounding_adjustment %> +

+ +

+ Amount received: + <%= @transactions_sale.amount_received %> +

+ +

+ Amount changed: + <%= @transactions_sale.amount_changed %> +

+ +<%= link_to 'Edit', edit_transactions_sale_path(@transactions_sale) %> | +<%= link_to 'Back', transactions_sales_path %>