diff --git a/app/controllers/inventory/inventory_controller.rb b/app/controllers/inventory/inventory_controller.rb index 679c37dc..98a60c4e 100755 --- a/app/controllers/inventory/inventory_controller.rb +++ b/app/controllers/inventory/inventory_controller.rb @@ -24,6 +24,8 @@ class Inventory::InventoryController < BaseInventoryController inventory = InventoryDefinition.find(inventory_definition_id) @stock_journals = StockJournal.where(item_code: inventory.item_code) + @stock_journals = Kaminari.paginate_array(@stock_journals).page(params[:page]).per(20) + respond_to do |format| format.html format.xls diff --git a/app/views/inventory/inventory/_inventory_list.html.erb b/app/views/inventory/inventory/_inventory_list.html.erb index 921c382a..a333dc7a 100755 --- a/app/views/inventory/inventory/_inventory_list.html.erb +++ b/app/views/inventory/inventory/_inventory_list.html.erb @@ -28,7 +28,13 @@ <%= item.min_order_level %> <%= item.max_stock_level %> - <%= item.balance rescue '0' %> + + <% if item.balance.nil? %> + 0 + <% else %> + <%= item.balance rescue 0 %> + <% end %> + diff --git a/app/views/inventory/inventory/show.html.erb b/app/views/inventory/inventory/show.html.erb index 0176928b..a08110e8 100644 --- a/app/views/inventory/inventory/show.html.erb +++ b/app/views/inventory/inventory/show.html.erb @@ -66,5 +66,9 @@ <% end %> +
+ <% if !@stock_journals.nil? && !@stock_journals.empty? %> + <%= paginate @stock_journals %> + <% end %> \ No newline at end of file diff --git a/app/views/reports/payment_method/index.html.erb b/app/views/reports/payment_method/index.html.erb index 23480521..b5dce43d 100755 --- a/app/views/reports/payment_method/index.html.erb +++ b/app/views/reports/payment_method/index.html.erb @@ -109,6 +109,7 @@ <%= t("views.right_panel.detail.receipt_no") %> <%= t :cashier %> <%= t("views.right_panel.detail.name") %> <%= t :payment_method %> + <%= t :customer %> <%= t("views.right_panel.detail.amount") %> <%= t("views.right_panel.detail.grand_total") %> @@ -129,8 +130,8 @@ <% end %> <%= payment.receipt_no rescue '-' %> <%= payment.cashier_name rescue '-' %> - <%= payment.payment_method rescue '-' %> + <%= payment.sale.customer.name rescue '-' %> <% if payment.payment_method === 'cash' %> <%= number_with_precision(payment.payment_amount - payment.change_amount , precision: precision.to_i ,delimiter: delimiter) rescue '-' %> <%else%> @@ -143,7 +144,7 @@ <% end %> <%if total>0%> - Total + Total <%=number_with_precision(total , precision: precision.to_i ,delimiter: delimiter) rescue '-' %> <%end%> diff --git a/app/views/reports/payment_method/index.xls.erb b/app/views/reports/payment_method/index.xls.erb index 9e42b9f3..ab966b7d 100755 --- a/app/views/reports/payment_method/index.xls.erb +++ b/app/views/reports/payment_method/index.xls.erb @@ -96,6 +96,7 @@ <%= t("views.right_panel.detail.receipt_no") %> <%= t :cashier %> <%= t("views.right_panel.detail.name") %> <%= t :payment_method %> + <%= t :customer %> <%= t("views.right_panel.detail.amount") %> <%= t("views.right_panel.detail.grand_total") %> @@ -116,8 +117,8 @@ <% end %> <%= payment.receipt_no rescue '-' %> <%= payment.cashier_name rescue '-' %> - <%= payment.payment_method rescue '-' %> + <%= payment.sale.customer.name rescue '-' %> <% if payment.payment_method === 'cash' %> <%= number_with_precision(payment.payment_amount - payment.change_amount , precision: precision.to_i ,delimiter: delimiter) rescue '-' %> <%else%> diff --git a/app/views/reports/stock_check/index.html.erb b/app/views/reports/stock_check/index.html.erb index a1351221..fc688d8c 100755 --- a/app/views/reports/stock_check/index.html.erb +++ b/app/views/reports/stock_check/index.html.erb @@ -53,6 +53,7 @@ <%= t("views.right_panel.detail.remark") %> <%= t("views.right_panel.detail.checked_by") %> <%= t("views.right_panel.detail.stock_check") %> <%= t("views.right_panel.detail.reason") %> + <%= t :date_time %> @@ -87,6 +88,7 @@ <%= result.remark rescue '-' %> <%= Employee.find(result.stock_check.check_by).name rescue '-' %> <%= result.stock_check.reason rescue '-' %> + <%= result.created_at.utc.getlocal.strftime("%e %b %Y %I:%M %p") rescue '-' %> <% !result.stock_count.nil? ? total_stock_count += result.stock_count : total_stock_count += 0 %> <% !result.stock_balance.nil? ? total_stock_balance += result.stock_balance : total_stock_balance += 0 %> diff --git a/app/views/reports/stock_check/index.xls.erb b/app/views/reports/stock_check/index.xls.erb index ea90c8af..8fa98977 100755 --- a/app/views/reports/stock_check/index.xls.erb +++ b/app/views/reports/stock_check/index.xls.erb @@ -21,6 +21,7 @@ <%= t("views.right_panel.detail.remark") %> <%= t("views.right_panel.detail.checked_by") %> <%= t("views.right_panel.detail.stock_check") %> <%= t("views.right_panel.detail.reason") %> + <%= t :date_time %> @@ -55,6 +56,7 @@ <%= result.remark rescue '-' %> <%= Employee.find(result.stock_check.check_by).name rescue '-' %> <%= result.stock_check.reason rescue '-' %> + <%= result.created_at.utc.getlocal.strftime("%e %b %Y %I:%M %p") rescue '-' %> <% !result.stock_count.nil? ? total_stock_count += result.stock_count : total_stock_count += 0 %> <% !result.stock_balance.nil? ? total_stock_balance += result.stock_balance : total_stock_balance += 0 %>