diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index cd4a6736..467886cf 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -3,13 +3,14 @@
-
-
+
+
+
+
-
-
-
-
+
+
+
@@ -24,7 +25,7 @@
-
+
@@ -50,100 +51,180 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -170,6 +251,7 @@
gem "select2-rails"
custom_excel
load
+ promotion_original_product
@@ -178,14 +260,6 @@
-
-
-
-
-
-
-
-
@@ -222,13 +296,21 @@
-
+
+
+
+
+
+
+
+
+
@@ -253,10 +335,10 @@
-
+
-
-
+
+
@@ -288,6 +370,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -321,6 +423,14 @@
+
+
+
+
+
+
+
+
@@ -352,6 +462,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -359,6 +484,14 @@
+
+
+
+
+
+
+
+
@@ -367,6 +500,17 @@
+
+
+
+
+
+
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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/assets/stylesheets/inventory_definitions.scss b/app/assets/stylesheets/inventory_definitions.scss
index 538c2918..e7fc208e 100644
--- a/app/assets/stylesheets/inventory_definitions.scss
+++ b/app/assets/stylesheets/inventory_definitions.scss
@@ -1,3 +1,272 @@
-// Place all the styles related to the inventory_definitions controller here.
-// They will automatically be included in application.css.
-// You can use Sass (SCSS) here: http://sass-lang.com/
+@import "bootstrap";
+@import "font-awesome";
+@import "theme";
+@import "jquery-ui";
+@import "bootstrap-datepicker3";
+@import "select2";
+@import "jquery.datetimepicker";
+
+/* Show it is fixed to the top */
+// body {
+// min-height: 75rem;
+// padding-top: 4.5rem;
+// }
+.card-columns {
+ font-size: 18px !important;
+}
+
+.others-payment{
+ line-height:100px;
+ text-align:center;
+ color:white;
+ width:300px;
+ height:100px;
+ font-size:18px;
+}
+
+.orders-table {
+ cursor: pointer;
+}
+
+.cashier_number{
+ width: 33%;
+ height:70px;
+ line-height:70px;
+ text-align:center;
+ background:#54A5AF;
+ // float:left;
+ // margin:2px;
+ font-size:20px;
+ color:white;
+ // cursor:pointer;
+}
+
+.del_cashier_number{
+ opacity:0.6,
+}
+
+.pay{
+ width: 98%;
+ height:211px;
+ line-height:211px;
+ text-align:center;
+ font-size:20px;
+ color:white;
+}
+
+.payment{
+ height:70px;line-height:70px;
+ align:center;
+ color:white;
+ font-size:16px;
+ margin-top:5px;
+}
+
+.cash-color{
+ background-color:#80CBC4;
+}
+
+.credit-color{
+ background-color:#FFCCBC;
+}
+
+.other-payment-color{
+ background-color:#E1BEE7;
+}
+
+.cashier_number:hover{
+ background:#A9F5F2;
+}
+
+.action-btn {
+ white-space: normal !important;
+ height: 60px;
+ margin-bottom: 5px;
+}
+
+.bottom-5 {
+ margin-bottom: 5px;
+}
+
+.fluid {
+ width: 100%;
+}
+
+.style2 {
+ border-top: 3px double #8c8b8b;
+}
+
+.long{
+ width:49%;
+}
+
+.sold {
+ background-color: red;
+}
+
+.paid {
+ background-color: green;
+}
+
+.selected-item {
+ color: #fff !important;
+ background-color: blue !important;
+}
+
+.selected-account {
+ color: #fff !important;
+ background-color: blue !important;
+}
+
+/* Reciept Style */
+#order-charges-table td {
+ border-top: none !important;
+}
+
+.charges-name {
+ width: 80%;
+ text-align: left;
+}
+
+.item-name {
+ width: 60%;
+ text-align: left;
+}
+
+.item-attr {
+ width: 20%;
+ text-align: right;
+}
+
+.item-attr-edit{
+ width: 10%;
+ text-align: left;
+}
+
+.display-none{
+ display: none;
+}
+
+.text-white{
+ color: #fff;
+}
+
+/* Colors */
+.purple {
+ background-color:#7a62d3;
+}
+
+.orange{
+ background-color:#FF7F50;
+}
+
+.red {
+ background-color:#ff0000;
+}
+
+.green{
+ background-color: #009900;
+}
+
+.orange{
+ background-color: #FF8C00;
+}
+
+.blue{
+ background-color: blue;
+}
+
+/* End Colors */
+
+.left{
+ margin-left:1px;
+}
+
+.bottom{
+ margin-bottom: 1px;
+}
+
+/*----- Reset -----*/
+
+select.form-control {
+ height: inherit !important;
+}
+
+.form-horizontal .form-group {
+ margin-right: 0px !important;
+}
+
+/* Discount */
+
+.discount-item-row {
+ cursor: pointer;
+}
+
+tr.discount-item-row:hover {
+ background-color: #e3e3e3 !important;
+}
+.required abbr{
+ color: red !important;
+}
+
+/* Jquery Confirm */
+
+.jconfirm-box-container{
+ margin-left:-40px !important;
+ margin-top:-40px !important;
+}
+
+#sxModal {
+ display: none;
+ overflow: auto;
+ width: 100%;
+ height: 100%;
+ background-color: #000;
+ background-color: rgba(0,0,0,0.4);
+ position: fixed;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ left: 0;
+ z-index: 1100;
+}
+
+#sxModal-Content {
+ position: relative;
+ left: 42%;
+ top: 30%;
+ background-color: #d9534f;
+ color: #fff;
+ text-align: center;
+ width: 200px;
+ height: 200px;
+ padding-top: 5%;
+ border-radius: 100px;
+ z-index: 1101;
+}
+
+/*Loading gif for payment*/
+
+#loading_wrapper{
+
+ position: fixed;
+ background-color: #C8C8C8 ;
+ height: 100%;
+ width: 100%;
+ left: 0;
+ opacity: 0.6;
+ top: 0;
+ z-index: 9999999;
+}
+#loading{
+ position: relative;
+ height: 100%;
+ width: 100%;
+ background-image: url('../../../image/loading-ajax.gif');
+ background-position: center center;
+ background-repeat: no-repeat;
+ opacity: 1;
+ filter: alpha(opacity=100); /* ie */
+ -moz-opacity: 1; /* mozilla */
+
+}
diff --git a/app/controllers/inventory/inventory_definitions_controller.rb b/app/controllers/inventory/inventory_definitions_controller.rb
index 7a8f17e1..33b7dd75 100644
--- a/app/controllers/inventory/inventory_definitions_controller.rb
+++ b/app/controllers/inventory/inventory_definitions_controller.rb
@@ -25,7 +25,7 @@ class Inventory::InventoryDefinitionsController < BaseInventoryController
# POST /inventory_definitions.json
def create
@inventory_definition = InventoryDefinition.new(inventory_definition_params)
-
+ @inventory_definition.created_by = current_user.id
respond_to do |format|
if @inventory_definition.save
format.html { redirect_to inventory_path, notice: 'Inventory definition was successfully created.' }
diff --git a/app/controllers/inventory/stock_checks_controller.rb b/app/controllers/inventory/stock_checks_controller.rb
index 9ff9fce7..b47e716f 100644
--- a/app/controllers/inventory/stock_checks_controller.rb
+++ b/app/controllers/inventory/stock_checks_controller.rb
@@ -2,6 +2,7 @@ class Inventory::StockChecksController < BaseInventoryController
def index
@check = StockCheck.new
+ @inventory_definitions = InventoryDefinition.active.all
end
def create
diff --git a/app/views/inventory/inventory/_inventory_list.html.erb b/app/views/inventory/inventory/_inventory_list.html.erb
index 115c80c5..e071f7ea 100644
--- a/app/views/inventory/inventory/_inventory_list.html.erb
+++ b/app/views/inventory/inventory/_inventory_list.html.erb
@@ -25,7 +25,7 @@
<%= item.item_code rescue ""%>
<%= item.min_order_level %>
<%= item.max_stock_level %>
- <%= item.created_by%>
+ <%= item.created_by %>
<%= item.created_at%>
<% end %>
diff --git a/app/views/inventory/inventory_definitions/_form.html.erb b/app/views/inventory/inventory_definitions/_form.html.erb
index 66c073ad..3c96f21d 100644
--- a/app/views/inventory/inventory_definitions/_form.html.erb
+++ b/app/views/inventory/inventory_definitions/_form.html.erb
@@ -1,56 +1,83 @@
+<%= simple_form_for([:inventory, @inventory_definition]) do |f| %>
+ <%= f.error_notification %>
-<%= simple_form_for([:inventory,@inventory_definition]) do |f| %>
- <%= f.error_notification %>
-
-
- Product
+ Item
-
+
+ Select Product
+ <% @inventory_definitions.each do |id| %>
+ <% item_name = MenuItemInstance.find_by_item_instance_code(id.item_code) %>
+ <%= item_name.item_instance_name %>
+ <% end %>
+
@@ -27,14 +33,14 @@
Qty
-
+
@@ -47,6 +53,7 @@
#
Product
Balance
+
@@ -54,49 +61,58 @@
diff --git a/app/views/layouts/_header_inventory.html.erb b/app/views/layouts/_header_inventory.html.erb
new file mode 100644
index 00000000..17a8e764
--- /dev/null
+++ b/app/views/layouts/_header_inventory.html.erb
@@ -0,0 +1,38 @@
+
+
+
+ Inventory -
+
+
+ <% if current_login_employee %>
+ <%= current_login_employee.name %> | <%= link_to 'Logout', logout_path, method: :delete, data: { confirm: 'Are you sure?' } %>
+ <% end %>
+
+
+
+
+
diff --git a/app/views/layouts/inventory.html.erb b/app/views/layouts/inventory.html.erb
index d6bbf436..8982d546 100644
--- a/app/views/layouts/inventory.html.erb
+++ b/app/views/layouts/inventory.html.erb
@@ -9,14 +9,14 @@
SmartSales : Restaurant
<%= csrf_meta_tags %>
- <%= stylesheet_link_tag 'origami', media: 'all', 'data-turbolinks-track': 'reload' %>
+ <%= stylesheet_link_tag 'inventory_definitions', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
<%= stylesheet_link_tag 'jquery-confirm', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_include_tag 'jquery-confirm', 'data-turbolinks-track': 'reload' %>
- <%= render 'layouts/header_orgiami' %>
+ <%= render 'layouts/header_inventory' %>
<% flash.each do |type, message| %>
<% if !flash["errors"]%>
diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb
index adb297d1..66b8d4c0 100644
--- a/config/initializers/assets.rb
+++ b/config/initializers/assets.rb
@@ -32,3 +32,6 @@ Rails.application.config.assets.precompile += %w( jquery-confirm.js )
# --- Image Uploader ----
Rails.application.config.assets.precompile += %w( fileinput.min.js )
+
+# --- Inventory Definition ----
+Rails.application.config.assets.precompile += %w( inventory_definitions.css )