fix conflit

This commit is contained in:
Zin Lin Phyo
2017-08-25 13:46:50 +06:30
116 changed files with 2373 additions and 111 deletions

356
.idea/workspace.xml generated
View File

@@ -2,21 +2,121 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="89ca96af-a0e4-4fe4-b9a3-9969f22d7079" name="Default" comment="">
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/db/migrate/20170823034141_create_product_commissions.rb" />
<change type="DELETED" beforePath="$PROJECT_DIR$/app/views/origami/commissions/_commissioners.html.erb" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/db/migrate/20170822034139_create_product_commissions.rb" afterPath="" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/sxrestaurant.iml" afterPath="$PROJECT_DIR$/.idea/sxrestaurant.iml" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/assets/javascripts/inventory_definitions.coffee" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/assets/javascripts/stock_check_items.coffee" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/assets/javascripts/stock_checks.coffee" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/assets/javascripts/stock_journals.coffee" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/assets/stylesheets/inventory_definitions.scss" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/assets/stylesheets/stock_check_items.scss" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/assets/stylesheets/stock_checks.scss" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/assets/stylesheets/stock_journals.scss" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/controllers/base_inventory_controller.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/controllers/inventory/inventory_controller.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/controllers/inventory/inventory_definitions_controller.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/controllers/inventory/stock_check_items_controller.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/controllers/inventory/stock_checks_controller.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/controllers/inventory/stock_journals_controller.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/helpers/inventory_definitions_helper.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/helpers/stock_check_items_helper.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/helpers/stock_checks_helper.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/helpers/stock_journals_helper.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/models/inventory_definition.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/models/stock_check.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/models/stock_check_item.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/models/stock_journal.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/views/inventory/inventory/index.html.erb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/views/inventory/inventory_definitions/_form.html.erb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/views/inventory/inventory_definitions/_inventory_definition.json.jbuilder" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/views/inventory/inventory_definitions/edit.html.erb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/views/inventory/inventory_definitions/index.html.erb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/views/inventory/inventory_definitions/index.json.jbuilder" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/views/inventory/inventory_definitions/new.html.erb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/views/inventory/inventory_definitions/show.html.erb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/views/inventory/inventory_definitions/show.json.jbuilder" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/views/inventory/stock_check_items/_form.html.erb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/views/inventory/stock_check_items/_stock_check_item.json.jbuilder" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/views/inventory/stock_check_items/edit.html.erb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/views/inventory/stock_check_items/index.html.erb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/views/inventory/stock_check_items/index.json.jbuilder" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/views/inventory/stock_check_items/new.html.erb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/views/inventory/stock_check_items/show.html.erb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/views/inventory/stock_check_items/show.json.jbuilder" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/views/inventory/stock_checks/_form.html.erb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/views/inventory/stock_checks/_stock_check.json.jbuilder" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/views/inventory/stock_checks/edit.html.erb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/views/inventory/stock_checks/index.html.erb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/views/inventory/stock_checks/index.json.jbuilder" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/views/inventory/stock_checks/new.html.erb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/views/inventory/stock_checks/show.html.erb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/views/inventory/stock_checks/show.json.jbuilder" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/views/inventory/stock_journals/_form.html.erb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/views/inventory/stock_journals/_stock_journal.json.jbuilder" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/views/inventory/stock_journals/edit.html.erb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/views/inventory/stock_journals/index.html.erb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/views/inventory/stock_journals/index.json.jbuilder" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/views/inventory/stock_journals/new.html.erb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/views/inventory/stock_journals/show.html.erb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/views/inventory/stock_journals/show.json.jbuilder" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/views/layouts/inventory.html.erb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/views/origami/in_juties/_assign_in_juty.html.erb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/views/origami/in_juties/_edit_in_juty.html.erb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/views/origami/in_juties/assign_in_juty.html.erb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/views/origami/in_juties/edit_in_juty.html.erb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/views/origami/in_juties/index_in_juty.html.erb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/db/migrate/20170824110103_create_inventory_definitions.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/db/migrate/20170824110117_create_stock_journals.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/db/migrate/20170824110125_create_stock_checks.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/db/migrate/20170824110130_create_stock_check_items.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/spec/controllers/inventory_definitions_controller_spec.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/spec/controllers/stock_check_items_controller_spec.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/spec/controllers/stock_checks_controller_spec.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/spec/controllers/stock_journals_controller_spec.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/spec/helpers/inventory_definitions_helper_spec.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/spec/helpers/stock_check_items_helper_spec.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/spec/helpers/stock_checks_helper_spec.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/spec/helpers/stock_journals_helper_spec.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/spec/models/inventory_definition_spec.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/spec/models/stock_check_item_spec.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/spec/models/stock_check_spec.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/spec/models/stock_journal_spec.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/spec/requests/inventory_definitions_spec.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/spec/requests/stock_check_items_spec.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/spec/requests/stock_checks_spec.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/spec/requests/stock_journals_spec.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/spec/routing/inventory_definitions_routing_spec.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/spec/routing/stock_check_items_routing_spec.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/spec/routing/stock_checks_routing_spec.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/spec/routing/stock_journals_routing_spec.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/spec/views/inventory_definitions/edit.html.erb_spec.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/spec/views/inventory_definitions/index.html.erb_spec.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/spec/views/inventory_definitions/new.html.erb_spec.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/spec/views/inventory_definitions/show.html.erb_spec.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/spec/views/stock_check_items/edit.html.erb_spec.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/spec/views/stock_check_items/index.html.erb_spec.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/spec/views/stock_check_items/new.html.erb_spec.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/spec/views/stock_check_items/show.html.erb_spec.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/spec/views/stock_checks/edit.html.erb_spec.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/spec/views/stock_checks/index.html.erb_spec.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/spec/views/stock_checks/new.html.erb_spec.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/spec/views/stock_checks/show.html.erb_spec.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/spec/views/stock_journals/edit.html.erb_spec.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/spec/views/stock_journals/index.html.erb_spec.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/spec/views/stock_journals/new.html.erb_spec.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/spec/views/stock_journals/show.html.erb_spec.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/test/system/inventory_definitions_test.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/test/system/stock_check_items_test.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/test/system/stock_checks_test.rb" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/test/system/stock_journals_test.rb" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/controllers/origami/commissions_controller.rb" afterPath="$PROJECT_DIR$/app/controllers/origami/commissions_controller.rb" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/controllers/origami/product_commissions_controller.rb" afterPath="$PROJECT_DIR$/app/controllers/origami/product_commissions_controller.rb" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/models/commission.rb" afterPath="$PROJECT_DIR$/app/models/commission.rb" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/models/commissioner.rb" afterPath="$PROJECT_DIR$/app/models/commissioner.rb" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/models/menu_item.rb" afterPath="$PROJECT_DIR$/app/models/menu_item.rb" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/models/product_commission.rb" afterPath="$PROJECT_DIR$/app/models/product_commission.rb" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/controllers/origami/in_juties_controller.rb" afterPath="$PROJECT_DIR$/app/controllers/origami/in_juties_controller.rb" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/controllers/settings/promotions_controller.rb" afterPath="$PROJECT_DIR$/app/controllers/settings/promotions_controller.rb" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/models/promotion.rb" afterPath="$PROJECT_DIR$/app/models/promotion.rb" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/models/promotion_product.rb" afterPath="$PROJECT_DIR$/app/models/promotion_product.rb" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/models/sale.rb" afterPath="$PROJECT_DIR$/app/models/sale.rb" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/models/sale_item.rb" afterPath="$PROJECT_DIR$/app/models/sale_item.rb" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/views/origami/commissions/load_commissioners.html.erb" afterPath="$PROJECT_DIR$/app/views/origami/commissions/load_commissioners.html.erb" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/views/origami/home/index_bk.html.erb" afterPath="$PROJECT_DIR$/app/views/origami/home/index_bk.html.erb" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/views/home/dashboard.html.erb" afterPath="$PROJECT_DIR$/app/views/home/dashboard.html.erb" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/views/origami/home/show.html.erb" afterPath="$PROJECT_DIR$/app/views/origami/home/show.html.erb" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/views/settings/promotions/_form.html.erb" afterPath="$PROJECT_DIR$/app/views/settings/promotions/_form.html.erb" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/views/settings/promotions/index.html.erb" afterPath="$PROJECT_DIR$/app/views/settings/promotions/index.html.erb" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/config/routes.rb" afterPath="$PROJECT_DIR$/config/routes.rb" />
</list>
<ignored path="$PROJECT_DIR$/.bundle/" />
@@ -37,7 +137,7 @@
<entry file="file://$PROJECT_DIR$/app/views/origami/commissions/load_commissioners.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="353">
<caret line="174" column="74" lean-forward="true" selection-start-line="174" selection-start-column="74" selection-end-line="174" selection-end-column="74" />
<caret line="174" column="74" lean-forward="false" selection-start-line="174" selection-start-column="74" selection-end-line="174" selection-end-column="74" />
<folding>
<element signature="n#style#0;n#div#0;n#div#0;n#!!top" expanded="true" />
<element signature="n#style#0;n#div#0;n#div#1;n#div#0;n#div#0;n#div#0;n#!!top" expanded="true" />
@@ -60,17 +160,27 @@
<entry file="file://$PROJECT_DIR$/app/controllers/origami/product_commissions_controller.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="356">
<caret line="79" column="24" lean-forward="true" selection-start-line="79" selection-start-column="24" selection-end-line="79" selection-end-column="24" />
<caret line="79" column="24" lean-forward="false" selection-start-line="79" selection-start-column="24" selection-end-line="79" selection-end-column="24" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="20170823034141_create_product_commissions.rb" pinned="false" current-in-tab="true">
<file leaf-file-name="20170823034141_create_product_commissions.rb" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/db/migrate/20170823034141_create_product_commissions.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="18">
<caret line="1" column="47" lean-forward="true" selection-start-line="1" selection-start-column="47" selection-end-line="1" selection-end-column="47" />
<state relative-caret-position="288">
<caret line="16" column="0" lean-forward="false" selection-start-line="16" selection-start-column="0" selection-end-line="16" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="routes.rb" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/config/routes.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="253">
<caret line="93" column="85" lean-forward="false" selection-start-line="93" selection-start-column="85" selection-end-line="93" selection-end-column="85" />
<folding />
</state>
</provider>
@@ -86,16 +196,6 @@
</provider>
</entry>
</file>
<file leaf-file-name="commission.rb" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/app/models/commission.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="54">
<caret line="3" column="31" lean-forward="false" selection-start-line="3" selection-start-column="31" selection-end-line="3" selection-end-column="31" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="product_commission.rb" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/app/models/product_commission.rb">
<provider selected="true" editor-type-id="text-editor">
@@ -110,8 +210,89 @@
<entry file="file://$PROJECT_DIR$/app/models/sale.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="108">
<caret line="6" column="25" lean-forward="true" selection-start-line="6" selection-start-column="25" selection-end-line="6" selection-end-column="25" />
<folding />
<caret line="6" column="25" lean-forward="false" selection-start-line="6" selection-start-column="25" selection-end-line="6" selection-end-column="25" />
<folding>
<marker date="1503645309000" expanded="true" signature="5437:5922" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="6728:6996" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="7108:7855" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="7289:7471" ph="do ... end" />
<marker date="1503645309000" expanded="true" signature="7692:7778" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="7783:7833" ph="##..." />
<marker date="1503645309000" expanded="true" signature="7883:8538" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="8038:8270" ph="do ... end" />
<marker date="1503645309000" expanded="true" signature="8054:8262" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="8618:9999" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="9025:9954" ph="do ... end" />
<marker date="1503645309000" expanded="true" signature="9067:9946" ph="do ... end" />
<marker date="1503645309000" expanded="true" signature="9088:9936" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="9383:9718" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="9729:9854" ph="##..." />
<marker date="1503645309000" expanded="true" signature="10049:11455" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="10474:11409" ph="do ... end" />
<marker date="1503645309000" expanded="true" signature="10516:11401" ph="do ... end" />
<marker date="1503645309000" expanded="true" signature="10537:11391" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="10837:11172" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="11184:11309" ph="##..." />
<marker date="1503645309000" expanded="true" signature="11496:11696" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="11561:11669" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="11729:12193" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="11851:11970" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="11975:12187" ph="##..." />
<marker date="1503645309000" expanded="true" signature="12216:12279" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="12357:12776" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="12379:12770" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="12811:13358" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="12816:12987" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="12993:13351" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="13415:14192" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="13420:13595" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="13601:13705" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="13711:14185" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="14233:15031" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="14238:14300" ph="##..." />
<marker date="1503645309000" expanded="true" signature="14393:15000" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="14491:14990" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="14662:14977" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="15070:18882" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="16561:18853" ph="do ... end" />
<marker date="1503645309000" expanded="true" signature="17801:18844" ph="do ... end" />
<marker date="1503645309000" expanded="true" signature="18946:19825" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="19868:20061" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="19872:20057" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="20105:20589" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="20616:21494" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="21566:27367" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="21817:27214" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="23253:23473" ph="do ... end" />
<marker date="1503645309000" expanded="true" signature="25119:25339" ph="do ... end" />
<marker date="1503645309000" expanded="true" signature="26886:27106" ph="do ... end" />
<marker date="1503645309000" expanded="true" signature="27452:28880" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="27514:27943" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="27576:27935" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="27970:28876" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="28955:29679" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="29205:29675" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="29719:30523" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="29941:30202" ph="##..." />
<marker date="1503645309000" expanded="true" signature="30208:30444" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="30599:32496" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="30603:31016" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="30659:31010" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="31020:32492" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="32911:32984" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="33007:33197" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="33051:33175" ph="do ... end" />
<marker date="1503645309000" expanded="true" signature="33068:33167" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="33222:33405" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="33268:33381" ph="do ... end" />
<marker date="1503645309000" expanded="true" signature="33285:33373" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="33429:33641" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="33474:33618" ph="do ... end" />
<marker date="1503645309000" expanded="true" signature="33491:33610" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="33667:33853" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="33708:33831" ph="do ... end" />
<marker date="1503645309000" expanded="true" signature="33728:33822" ph="if ... end" />
</folding>
</state>
</provider>
</entry>
@@ -203,7 +384,6 @@
<option value="$PROJECT_DIR$/db/migrate/20170822034139_create_product_commissions.rb" />
<option value="$PROJECT_DIR$/db/migrate/20170823034140_create_product_commissions.rb" />
<option value="$PROJECT_DIR$/app/views/origami/commissions/_commissioners.html.erb" />
<option value="$PROJECT_DIR$/config/routes.rb" />
<option value="$PROJECT_DIR$/db/migrate/20170823034141_create_product_commissions.rb" />
<option value="$PROJECT_DIR$/app/models/product_commission.rb" />
<option value="$PROJECT_DIR$/app/models/commission.rb" />
@@ -214,6 +394,7 @@
<option value="$PROJECT_DIR$/app/controllers/origami/commissions_controller.rb" />
<option value="$PROJECT_DIR$/app/controllers/origami/product_commissions_controller.rb" />
<option value="$PROJECT_DIR$/app/views/origami/commissions/load_commissioners.html.erb" />
<option value="$PROJECT_DIR$/config/routes.rb" />
</list>
</option>
</component>
@@ -674,12 +855,12 @@
<workItem from="1503328001970" duration="20307000" />
<workItem from="1503406983258" duration="261000" />
<workItem from="1503457057830" duration="7166000" />
<workItem from="1503472116907" duration="36775000" />
<workItem from="1503472116907" duration="36940000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="117917000" />
<option name="totallyTimeSpent" value="118082000" />
</component>
<component name="ToolWindowManager">
<frame x="1442" y="22" width="1920" height="721" extended-state="0" />
@@ -1008,14 +1189,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/config/routes.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="235">
<caret line="92" column="85" lean-forward="true" selection-start-line="92" selection-start-column="85" selection-end-line="92" selection-end-column="85" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/models/promotion.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
@@ -1059,8 +1232,89 @@
<entry file="file://$PROJECT_DIR$/app/models/sale.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="108">
<caret line="6" column="25" lean-forward="true" selection-start-line="6" selection-start-column="25" selection-end-line="6" selection-end-column="25" />
<folding />
<caret line="6" column="25" lean-forward="false" selection-start-line="6" selection-start-column="25" selection-end-line="6" selection-end-column="25" />
<folding>
<marker date="1503645309000" expanded="true" signature="5437:5922" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="6728:6996" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="7108:7855" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="7289:7471" ph="do ... end" />
<marker date="1503645309000" expanded="true" signature="7692:7778" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="7783:7833" ph="##..." />
<marker date="1503645309000" expanded="true" signature="7883:8538" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="8038:8270" ph="do ... end" />
<marker date="1503645309000" expanded="true" signature="8054:8262" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="8618:9999" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="9025:9954" ph="do ... end" />
<marker date="1503645309000" expanded="true" signature="9067:9946" ph="do ... end" />
<marker date="1503645309000" expanded="true" signature="9088:9936" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="9383:9718" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="9729:9854" ph="##..." />
<marker date="1503645309000" expanded="true" signature="10049:11455" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="10474:11409" ph="do ... end" />
<marker date="1503645309000" expanded="true" signature="10516:11401" ph="do ... end" />
<marker date="1503645309000" expanded="true" signature="10537:11391" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="10837:11172" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="11184:11309" ph="##..." />
<marker date="1503645309000" expanded="true" signature="11496:11696" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="11561:11669" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="11729:12193" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="11851:11970" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="11975:12187" ph="##..." />
<marker date="1503645309000" expanded="true" signature="12216:12279" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="12357:12776" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="12379:12770" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="12811:13358" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="12816:12987" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="12993:13351" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="13415:14192" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="13420:13595" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="13601:13705" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="13711:14185" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="14233:15031" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="14238:14300" ph="##..." />
<marker date="1503645309000" expanded="true" signature="14393:15000" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="14491:14990" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="14662:14977" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="15070:18882" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="16561:18853" ph="do ... end" />
<marker date="1503645309000" expanded="true" signature="17801:18844" ph="do ... end" />
<marker date="1503645309000" expanded="true" signature="18946:19825" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="19868:20061" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="19872:20057" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="20105:20589" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="20616:21494" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="21566:27367" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="21817:27214" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="23253:23473" ph="do ... end" />
<marker date="1503645309000" expanded="true" signature="25119:25339" ph="do ... end" />
<marker date="1503645309000" expanded="true" signature="26886:27106" ph="do ... end" />
<marker date="1503645309000" expanded="true" signature="27452:28880" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="27514:27943" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="27576:27935" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="27970:28876" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="28955:29679" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="29205:29675" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="29719:30523" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="29941:30202" ph="##..." />
<marker date="1503645309000" expanded="true" signature="30208:30444" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="30599:32496" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="30603:31016" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="30659:31010" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="31020:32492" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="32911:32984" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="33007:33197" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="33051:33175" ph="do ... end" />
<marker date="1503645309000" expanded="true" signature="33068:33167" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="33222:33405" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="33268:33381" ph="do ... end" />
<marker date="1503645309000" expanded="true" signature="33285:33373" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="33429:33641" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="33474:33618" ph="do ... end" />
<marker date="1503645309000" expanded="true" signature="33491:33610" ph="if ... end" />
<marker date="1503645309000" expanded="true" signature="33667:33853" ph=" ... end" />
<marker date="1503645309000" expanded="true" signature="33708:33831" ph="do ... end" />
<marker date="1503645309000" expanded="true" signature="33728:33822" ph="if ... end" />
</folding>
</state>
</provider>
</entry>
@@ -1083,7 +1337,7 @@
<entry file="file://$PROJECT_DIR$/app/views/origami/commissions/load_commissioners.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="353">
<caret line="174" column="74" lean-forward="true" selection-start-line="174" selection-start-column="74" selection-end-line="174" selection-end-column="74" />
<caret line="174" column="74" lean-forward="false" selection-start-line="174" selection-start-column="74" selection-end-line="174" selection-end-column="74" />
<folding>
<element signature="n#style#0;n#div#0;n#div#0;n#!!top" expanded="true" />
<element signature="n#style#0;n#div#0;n#div#1;n#div#0;n#div#0;n#div#0;n#!!top" expanded="true" />
@@ -1094,15 +1348,23 @@
<entry file="file://$PROJECT_DIR$/app/controllers/origami/product_commissions_controller.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="356">
<caret line="79" column="24" lean-forward="true" selection-start-line="79" selection-start-column="24" selection-end-line="79" selection-end-column="24" />
<caret line="79" column="24" lean-forward="false" selection-start-line="79" selection-start-column="24" selection-end-line="79" selection-end-column="24" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/db/migrate/20170823034141_create_product_commissions.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="18">
<caret line="1" column="47" lean-forward="true" selection-start-line="1" selection-start-column="47" selection-end-line="1" selection-end-column="47" />
<state relative-caret-position="288">
<caret line="16" column="0" lean-forward="false" selection-start-line="16" selection-start-column="0" selection-end-line="16" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/config/routes.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="253">
<caret line="93" column="85" lean-forward="false" selection-start-line="93" selection-start-column="85" selection-end-line="93" selection-end-column="85" />
<folding />
</state>
</provider>

View File

@@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/

View File

@@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/

View File

@@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/

View File

@@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/

View File

@@ -0,0 +1,3 @@
// 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/

View File

@@ -0,0 +1,3 @@
// Place all the styles related to the stock_check_items controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/

View File

@@ -0,0 +1,3 @@
// Place all the styles related to the stock_checks controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/

View File

@@ -0,0 +1,3 @@
// Place all the styles related to the stock_journals controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/

View File

@@ -0,0 +1,17 @@
class BaseInventoryController < ActionController::Base
include LoginVerification
layout "inventory"
#before_action :check_installation
protect_from_forgery with: :exception
rescue_from CanCan::AccessDenied do |exception|
flash[:warning] = exception.message
redirect_to root_path
end
def current_user
@current_user ||= Employee.find_by_token_session(session[:session_token]) if session[:session_token]
end
end

View File

@@ -0,0 +1,6 @@
class Inventory::InventoryController < BaseInventoryController
def index
end
end

View File

@@ -0,0 +1,74 @@
class Inventory::InventoryDefinitionsController < BaseInventoryController
before_action :set_inventory_definition, only: [:show, :edit, :update, :destroy]
# GET /inventory_definitions
# GET /inventory_definitions.json
def index
@inventory_definitions = InventoryDefinition.all
end
# GET /inventory_definitions/1
# GET /inventory_definitions/1.json
def show
end
# GET /inventory_definitions/new
def new
@inventory_definition = InventoryDefinition.new
end
# GET /inventory_definitions/1/edit
def edit
end
# POST /inventory_definitions
# POST /inventory_definitions.json
def create
@inventory_definition = InventoryDefinition.new(inventory_definition_params)
respond_to do |format|
if @inventory_definition.save
format.html { redirect_to @inventory_definition, notice: 'Inventory definition was successfully created.' }
format.json { render :show, status: :created, location: @inventory_definition }
else
format.html { render :new }
format.json { render json: @inventory_definition.errors, status: :unprocessable_entity }
end
end
end
# PATCH/PUT /inventory_definitions/1
# PATCH/PUT /inventory_definitions/1.json
def update
respond_to do |format|
if @inventory_definition.update(inventory_definition_params)
format.html { redirect_to @inventory_definition, notice: 'Inventory definition was successfully updated.' }
format.json { render :show, status: :ok, location: @inventory_definition }
else
format.html { render :edit }
format.json { render json: @inventory_definition.errors, status: :unprocessable_entity }
end
end
end
# DELETE /inventory_definitions/1
# DELETE /inventory_definitions/1.json
def destroy
@inventory_definition.destroy
respond_to do |format|
format.html { redirect_to inventory_definitions_url, notice: 'Inventory definition was successfully destroyed.' }
format.json { head :no_content }
end
end
private
# Use callbacks to share common setup or constraints between actions.
def set_inventory_definition
@inventory_definition = InventoryDefinition.find(params[:id])
end
# Never trust parameters from the scary internet, only allow the white list through.
def inventory_definition_params
params.fetch(:inventory_definition, {})
end
end

View File

@@ -0,0 +1,74 @@
class StockCheckItemsController < ApplicationController
before_action :set_stock_check_item, only: [:show, :edit, :update, :destroy]
# GET /stock_check_items
# GET /stock_check_items.json
def index
@stock_check_items = StockCheckItem.all
end
# GET /stock_check_items/1
# GET /stock_check_items/1.json
def show
end
# GET /stock_check_items/new
def new
@stock_check_item = StockCheckItem.new
end
# GET /stock_check_items/1/edit
def edit
end
# POST /stock_check_items
# POST /stock_check_items.json
def create
@stock_check_item = StockCheckItem.new(stock_check_item_params)
respond_to do |format|
if @stock_check_item.save
format.html { redirect_to @stock_check_item, notice: 'Stock check item was successfully created.' }
format.json { render :show, status: :created, location: @stock_check_item }
else
format.html { render :new }
format.json { render json: @stock_check_item.errors, status: :unprocessable_entity }
end
end
end
# PATCH/PUT /stock_check_items/1
# PATCH/PUT /stock_check_items/1.json
def update
respond_to do |format|
if @stock_check_item.update(stock_check_item_params)
format.html { redirect_to @stock_check_item, notice: 'Stock check item was successfully updated.' }
format.json { render :show, status: :ok, location: @stock_check_item }
else
format.html { render :edit }
format.json { render json: @stock_check_item.errors, status: :unprocessable_entity }
end
end
end
# DELETE /stock_check_items/1
# DELETE /stock_check_items/1.json
def destroy
@stock_check_item.destroy
respond_to do |format|
format.html { redirect_to stock_check_items_url, notice: 'Stock check item was successfully destroyed.' }
format.json { head :no_content }
end
end
private
# Use callbacks to share common setup or constraints between actions.
def set_stock_check_item
@stock_check_item = StockCheckItem.find(params[:id])
end
# Never trust parameters from the scary internet, only allow the white list through.
def stock_check_item_params
params.fetch(:stock_check_item, {})
end
end

View File

@@ -0,0 +1,74 @@
class StockChecksController < ApplicationController
before_action :set_stock_check, only: [:show, :edit, :update, :destroy]
# GET /stock_checks
# GET /stock_checks.json
def index
@stock_checks = StockCheck.all
end
# GET /stock_checks/1
# GET /stock_checks/1.json
def show
end
# GET /stock_checks/new
def new
@stock_check = StockCheck.new
end
# GET /stock_checks/1/edit
def edit
end
# POST /stock_checks
# POST /stock_checks.json
def create
@stock_check = StockCheck.new(stock_check_params)
respond_to do |format|
if @stock_check.save
format.html { redirect_to @stock_check, notice: 'Stock check was successfully created.' }
format.json { render :show, status: :created, location: @stock_check }
else
format.html { render :new }
format.json { render json: @stock_check.errors, status: :unprocessable_entity }
end
end
end
# PATCH/PUT /stock_checks/1
# PATCH/PUT /stock_checks/1.json
def update
respond_to do |format|
if @stock_check.update(stock_check_params)
format.html { redirect_to @stock_check, notice: 'Stock check was successfully updated.' }
format.json { render :show, status: :ok, location: @stock_check }
else
format.html { render :edit }
format.json { render json: @stock_check.errors, status: :unprocessable_entity }
end
end
end
# DELETE /stock_checks/1
# DELETE /stock_checks/1.json
def destroy
@stock_check.destroy
respond_to do |format|
format.html { redirect_to stock_checks_url, notice: 'Stock check was successfully destroyed.' }
format.json { head :no_content }
end
end
private
# Use callbacks to share common setup or constraints between actions.
def set_stock_check
@stock_check = StockCheck.find(params[:id])
end
# Never trust parameters from the scary internet, only allow the white list through.
def stock_check_params
params.fetch(:stock_check, {})
end
end

View File

@@ -0,0 +1,74 @@
class StockJournalsController < ApplicationController
before_action :set_stock_journal, only: [:show, :edit, :update, :destroy]
# GET /stock_journals
# GET /stock_journals.json
def index
@stock_journals = StockJournal.all
end
# GET /stock_journals/1
# GET /stock_journals/1.json
def show
end
# GET /stock_journals/new
def new
@stock_journal = StockJournal.new
end
# GET /stock_journals/1/edit
def edit
end
# POST /stock_journals
# POST /stock_journals.json
def create
@stock_journal = StockJournal.new(stock_journal_params)
respond_to do |format|
if @stock_journal.save
format.html { redirect_to @stock_journal, notice: 'Stock journal was successfully created.' }
format.json { render :show, status: :created, location: @stock_journal }
else
format.html { render :new }
format.json { render json: @stock_journal.errors, status: :unprocessable_entity }
end
end
end
# PATCH/PUT /stock_journals/1
# PATCH/PUT /stock_journals/1.json
def update
respond_to do |format|
if @stock_journal.update(stock_journal_params)
format.html { redirect_to @stock_journal, notice: 'Stock journal was successfully updated.' }
format.json { render :show, status: :ok, location: @stock_journal }
else
format.html { render :edit }
format.json { render json: @stock_journal.errors, status: :unprocessable_entity }
end
end
end
# DELETE /stock_journals/1
# DELETE /stock_journals/1.json
def destroy
@stock_journal.destroy
respond_to do |format|
format.html { redirect_to stock_journals_url, notice: 'Stock journal was successfully destroyed.' }
format.json { head :no_content }
end
end
private
# Use callbacks to share common setup or constraints between actions.
def set_stock_journal
@stock_journal = StockJournal.find(params[:id])
end
# Never trust parameters from the scary internet, only allow the white list through.
def stock_journal_params
params.fetch(:stock_journal, {})
end
end

View File

@@ -1,5 +1,5 @@
class Origami::InJutiesController < BaseOrigamiController
before_action :set_in_juty, only: [:show, :edit, :update, :destroy]
before_action :set_in_juty, only: [:show, :edit, :update, :edit_in_juty, :update_for_in_juty , :destroy ,:destroy_in_juty]
# GET /in_juties
# GET /in_juties.json
@@ -7,6 +7,11 @@ class Origami::InJutiesController < BaseOrigamiController
@in_juties = InJuty.all
end
def index_in_juty
@juties_in= InJuty.where("dinning_id=?",params[:table_id])
@table = params[:table_id]
end
# GET /in_juties/1
# GET /in_juties/1.json
def show
@@ -21,6 +26,14 @@ class Origami::InJutiesController < BaseOrigamiController
def edit
end
def edit_in_juty
@table = DiningFacility.find(params[:table_id])
end
def assign_in_juty
@in_juty = InJuty.new
@table = DiningFacility.find(params[:table_id])
end
# POST /in_juties
# POST /in_juties.json
def create
@@ -37,6 +50,15 @@ class Origami::InJutiesController < BaseOrigamiController
end
end
def create_for_in_juty
@in_juty = InJuty.new
@in_juty.dinning_id = params[:dining_id]
@in_juty.commissioner_ids = params[:commissioner_ids]
@in_juty.in_time = params[:in_time]
@in_juty.out_time = params[:out_time]
@in_juty.save
end
# PATCH/PUT /in_juties/1
# PATCH/PUT /in_juties/1.json
def update
@@ -51,6 +73,15 @@ class Origami::InJutiesController < BaseOrigamiController
end
end
def update_for_in_juty
@in_juty.dinning_id = params[:dining_id]
@in_juty.commissioner_ids = params[:commissioner_ids]
@in_juty.in_time = params[:in_time]
@in_juty.out_time = params[:out_time]
@in_juty.save
end
# DELETE /in_juties/1
# DELETE /in_juties/1.json
def destroy
@@ -61,6 +92,16 @@ class Origami::InJutiesController < BaseOrigamiController
end
end
def destroy_in_juty
@table_id = params[:table_id]
@in_juty.destroy
respond_to do |format|
format.html { redirect_to origami_index_in_juty_path(@table_id), notice: 'In juty was successfully destroyed.' }
format.json { head :no_content }
end
end
private
# Use callbacks to share common setup or constraints between actions.
def set_in_juty

View File

@@ -4,7 +4,7 @@ class Settings::PromotionsController < ApplicationController
# GET /promotions
# GET /promotions.json
def index
@promotions = Promotion.all
@promotions = Promotion.all.order("created_at asc")
end
# GET /promotions/1
@@ -85,6 +85,6 @@ class Settings::PromotionsController < ApplicationController
# Never trust parameters from the scary internet, only allow the white list through.
def promotion_params
params.require(:promotion).permit(:promo_code, :promo_start_date, :promo_end_date, :promo_start_hour,:promo_end_hour ,:promo_day, :promo_type,:original_product ,:min_qty ,:created_by,
:promotion_products_attributes => [:item_code, :min_qty, :net_off, :net_price, :percentage, :_destroy])
:promotion_products_attributes => [:id,:item_code, :min_qty, :net_off, :net_price, :percentage, :_destroy])
end
end

View File

@@ -0,0 +1,2 @@
module InventoryDefinitionsHelper
end

View File

@@ -0,0 +1,2 @@
module StockCheckItemsHelper
end

View File

@@ -0,0 +1,2 @@
module StockChecksHelper
end

View File

@@ -0,0 +1,2 @@
module StockJournalsHelper
end

View File

@@ -0,0 +1,2 @@
class InventoryDefinition < ApplicationRecord
end

View File

@@ -3,7 +3,7 @@ class Promotion < ApplicationRecord
has_many :promotion_products
accepts_nested_attributes_for :promotion_products , :allow_destroy => true
accepts_nested_attributes_for :promotion_products , :allow_destroy => true , update_only: true
PROMO_TYPE1 = "Quantity"
PROMO_TYPE2 = "Net_off" # 3000 => - 500 => 2500 [total]
@@ -120,6 +120,10 @@ class Promotion < ApplicationRecord
def self.give_promotion_second_product(orderitem_count, foc_min_qty, promo_product, orderitem, sale_id)
puts "..... orderitem_count: " + orderitem_count.to_s + " / foc_min_qty: " + foc_min_qty.to_s + " /promo_product: " + promo_product + " orderitem: " + orderitem.to_s
promotion_qty = orderitem_count.to_i / foc_min_qty.to_i # get foc item qty
foc_qty = find_second_item_qty(sale_id, promo_product)
if (foc_qty < promotion_qty)
promotion_qty = foc_qty
end
item = OrderItem.find_by_item_code(promo_product)
update_existing_item(promotion_qty, item, sale_id, "promotion", item.price)
end
@@ -135,13 +139,15 @@ class Promotion < ApplicationRecord
sale_item.qty = foc_qty * (-1)
sale_item.unit_price = item_price * (-1)
sale_item.taxable_price = item_price
sale_item.taxable_price = item_price * (-1)
sale_item.price = foc_qty * item_price * (-1)
sale_item.is_taxable = item.taxable
sale_item.is_taxable = false
sale_item.sale_id = sale_id
sale_item.save
sale = Sale.find(sale_id).
sale.compute_by_sale_items(sale.id, sale.sale_items, sale.total_discount)
end
@@ -204,6 +210,6 @@ class Promotion < ApplicationRecord
end
def self.calculate_discount(total, discount)
self (total.to_i * discount.to_i) / 100
return (total.to_i * discount.to_i) / 100
end
end

View File

@@ -1,3 +1,4 @@
class PromotionProduct < ApplicationRecord
validates_presence_of :item_code
belongs_to :promotion
end

View File

@@ -184,6 +184,7 @@ class Sale < ApplicationRecord
sale_item.sale_id = self.id
sale_item.price = diningprice
sale_item.save
self.compute
end
def update_item (item)
@@ -215,10 +216,11 @@ class Sale < ApplicationRecord
sales_items.each do |item|
#compute each item and added to total
puts "item.sales_item_id ddd"
puts item.sale_item_id
subtotal_price = subtotal_price + item.price
total_taxable = total_taxable + (item.taxable_price * item.qty)
end
apply_tax (total_taxable)
self.total_amount = subtotal_price
self.total_discount = total_discount

View File

@@ -0,0 +1,2 @@
class StockCheck < ApplicationRecord
end

View File

@@ -0,0 +1,2 @@
class StockCheckItem < ApplicationRecord
end

View File

@@ -0,0 +1,2 @@
class StockJournal < ApplicationRecord
end

View File

@@ -55,6 +55,17 @@
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="card" id="backend" onclick="location.href='<%= inventory_inventory_path %>'">
<div class="card-content">
<span class="card-title">Inventory</span>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-8 col-lg-8">
@@ -274,4 +285,3 @@
}
</style>

View File

@@ -0,0 +1,17 @@
# Hello Inventory
<div class="row">
<div class="col-lg-8 col-md-8 col-sm-8">
</div>
<div class="col-lg-4 col-md-4 col-sm-4">
<button id="refreshbutton" type="button" class="btn btn-block"> Inventory Product Lists</button>
<button id="cash_in" type="button" class="btn btn-block btn-primary"> Stock Taking </button>
<button id="cash_out" type="button" class="btn btn-block btn-primary"> Stock Check Report</button>
<%if current_login_employee.role == "administrator" || current_login_employee.role == "manager" %>
<button id="back" type="button" class="btn btn-block btn-primary"><i class="fa fa-home fa-lg"></i> Back
</button>
<%end%>
</div>
</div>

View File

@@ -0,0 +1,10 @@
<%= simple_form_for(@inventory_definition) do |f| %>
<%= f.error_notification %>
<div class="form-inputs">
</div>
<div class="form-actions">
<%= f.button :submit %>
</div>
<% end %>

View File

@@ -0,0 +1,2 @@
json.extract! inventory_definition, :id, :created_at, :updated_at
json.url inventory_definition_url(inventory_definition, format: :json)

View File

@@ -0,0 +1,6 @@
<h1>Editing Inventory Definition</h1>
<%= render 'form', inventory_definition: @inventory_definition %>
<%= link_to 'Show', @inventory_definition %> |
<%= link_to 'Back', inventory_definitions_path %>

View File

@@ -0,0 +1,25 @@
<p id="notice"><%= notice %></p>
<h1>Inventory Definitions</h1>
<table>
<thead>
<tr>
<th colspan="3"></th>
</tr>
</thead>
<tbody>
<% @inventory_definitions.each do |inventory_definition| %>
<tr>
<td><%= link_to 'Show', inventory_definition %></td>
<td><%= link_to 'Edit', edit_inventory_definition_path(inventory_definition) %></td>
<td><%= link_to 'Destroy', inventory_definition, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</tbody>
</table>
<br>
<%= link_to 'New Inventory Definition', new_inventory_definition_path %>

View File

@@ -0,0 +1 @@
json.array! @inventory_definitions, partial: 'inventory_definitions/inventory_definition', as: :inventory_definition

View File

@@ -0,0 +1,5 @@
<h1>New Inventory Definition</h1>
<%= render 'form', inventory_definition: @inventory_definition %>
<%= link_to 'Back', inventory_definitions_path %>

View File

@@ -0,0 +1,4 @@
<p id="notice"><%= notice %></p>
<%= link_to 'Edit', edit_inventory_definition_path(@inventory_definition) %> |
<%= link_to 'Back', inventory_definitions_path %>

View File

@@ -0,0 +1 @@
json.partial! "inventory_definitions/inventory_definition", inventory_definition: @inventory_definition

View File

@@ -0,0 +1,10 @@
<%= simple_form_for(@stock_check_item) do |f| %>
<%= f.error_notification %>
<div class="form-inputs">
</div>
<div class="form-actions">
<%= f.button :submit %>
</div>
<% end %>

View File

@@ -0,0 +1,2 @@
json.extract! stock_check_item, :id, :created_at, :updated_at
json.url stock_check_item_url(stock_check_item, format: :json)

View File

@@ -0,0 +1,6 @@
<h1>Editing Stock Check Item</h1>
<%= render 'form', stock_check_item: @stock_check_item %>
<%= link_to 'Show', @stock_check_item %> |
<%= link_to 'Back', stock_check_items_path %>

View File

@@ -0,0 +1,25 @@
<p id="notice"><%= notice %></p>
<h1>Stock Check Items</h1>
<table>
<thead>
<tr>
<th colspan="3"></th>
</tr>
</thead>
<tbody>
<% @stock_check_items.each do |stock_check_item| %>
<tr>
<td><%= link_to 'Show', stock_check_item %></td>
<td><%= link_to 'Edit', edit_stock_check_item_path(stock_check_item) %></td>
<td><%= link_to 'Destroy', stock_check_item, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</tbody>
</table>
<br>
<%= link_to 'New Stock Check Item', new_stock_check_item_path %>

View File

@@ -0,0 +1 @@
json.array! @stock_check_items, partial: 'stock_check_items/stock_check_item', as: :stock_check_item

View File

@@ -0,0 +1,5 @@
<h1>New Stock Check Item</h1>
<%= render 'form', stock_check_item: @stock_check_item %>
<%= link_to 'Back', stock_check_items_path %>

View File

@@ -0,0 +1,4 @@
<p id="notice"><%= notice %></p>
<%= link_to 'Edit', edit_stock_check_item_path(@stock_check_item) %> |
<%= link_to 'Back', stock_check_items_path %>

View File

@@ -0,0 +1 @@
json.partial! "stock_check_items/stock_check_item", stock_check_item: @stock_check_item

View File

@@ -0,0 +1,10 @@
<%= simple_form_for(@stock_check) do |f| %>
<%= f.error_notification %>
<div class="form-inputs">
</div>
<div class="form-actions">
<%= f.button :submit %>
</div>
<% end %>

View File

@@ -0,0 +1,2 @@
json.extract! stock_check, :id, :created_at, :updated_at
json.url stock_check_url(stock_check, format: :json)

View File

@@ -0,0 +1,6 @@
<h1>Editing Stock Check</h1>
<%= render 'form', stock_check: @stock_check %>
<%= link_to 'Show', @stock_check %> |
<%= link_to 'Back', stock_checks_path %>

View File

@@ -0,0 +1,25 @@
<p id="notice"><%= notice %></p>
<h1>Stock Checks</h1>
<table>
<thead>
<tr>
<th colspan="3"></th>
</tr>
</thead>
<tbody>
<% @stock_checks.each do |stock_check| %>
<tr>
<td><%= link_to 'Show', stock_check %></td>
<td><%= link_to 'Edit', edit_stock_check_path(stock_check) %></td>
<td><%= link_to 'Destroy', stock_check, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</tbody>
</table>
<br>
<%= link_to 'New Stock Check', new_stock_check_path %>

View File

@@ -0,0 +1 @@
json.array! @stock_checks, partial: 'stock_checks/stock_check', as: :stock_check

View File

@@ -0,0 +1,5 @@
<h1>New Stock Check</h1>
<%= render 'form', stock_check: @stock_check %>
<%= link_to 'Back', stock_checks_path %>

View File

@@ -0,0 +1,4 @@
<p id="notice"><%= notice %></p>
<%= link_to 'Edit', edit_stock_check_path(@stock_check) %> |
<%= link_to 'Back', stock_checks_path %>

View File

@@ -0,0 +1 @@
json.partial! "stock_checks/stock_check", stock_check: @stock_check

View File

@@ -0,0 +1,10 @@
<%= simple_form_for(@stock_journal) do |f| %>
<%= f.error_notification %>
<div class="form-inputs">
</div>
<div class="form-actions">
<%= f.button :submit %>
</div>
<% end %>

View File

@@ -0,0 +1,2 @@
json.extract! stock_journal, :id, :created_at, :updated_at
json.url stock_journal_url(stock_journal, format: :json)

View File

@@ -0,0 +1,6 @@
<h1>Editing Stock Journal</h1>
<%= render 'form', stock_journal: @stock_journal %>
<%= link_to 'Show', @stock_journal %> |
<%= link_to 'Back', stock_journals_path %>

View File

@@ -0,0 +1,25 @@
<p id="notice"><%= notice %></p>
<h1>Stock Journals</h1>
<table>
<thead>
<tr>
<th colspan="3"></th>
</tr>
</thead>
<tbody>
<% @stock_journals.each do |stock_journal| %>
<tr>
<td><%= link_to 'Show', stock_journal %></td>
<td><%= link_to 'Edit', edit_stock_journal_path(stock_journal) %></td>
<td><%= link_to 'Destroy', stock_journal, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</tbody>
</table>
<br>
<%= link_to 'New Stock Journal', new_stock_journal_path %>

View File

@@ -0,0 +1 @@
json.array! @stock_journals, partial: 'stock_journals/stock_journal', as: :stock_journal

View File

@@ -0,0 +1,5 @@
<h1>New Stock Journal</h1>
<%= render 'form', stock_journal: @stock_journal %>
<%= link_to 'Back', stock_journals_path %>

View File

@@ -0,0 +1,4 @@
<p id="notice"><%= notice %></p>
<%= link_to 'Edit', edit_stock_journal_path(@stock_journal) %> |
<%= link_to 'Back', stock_journals_path %>

View File

@@ -0,0 +1 @@
json.partial! "stock_journals/stock_journal", stock_journal: @stock_journal

View File

@@ -0,0 +1,34 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
<meta name="description" content=""/>
<meta name="author" content=""/>
<title>SmartSales : Restaurant</title>
<%= csrf_meta_tags %>
<%= stylesheet_link_tag 'inventory', 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' %>
</head>
<body>
<%= render 'layouts/header_orgiami' %>
<div class="container-fluid">
<% flash.each do |type, message| %>
<% if !flash["errors"]%>
<div class="alert fade in">
<button class="close" aria-hidden="true" data-dismiss="alert" type="button">×</button>
<%=message%>
</div>
<% end %>
<% end %>
<%= yield %>
</div>
</body>
</html>

View File

@@ -333,6 +333,7 @@
<button type="button" id="discount" class="btn btn-primary btn-block">Discount</button>
<button type="button" id="other-charges" class="btn btn-primary btn-block">Charges</button>
<button type="button" id="commissions" class="btn btn-primary btn-block">Commissions</button>
<button type="button" id="in_juties" class="btn btn-primary btn-block">In Juties</button>
<button type="button" class="btn btn-primary btn-block" id='move' disabled="">Move</button>
<button type="button" id="request_bills" class="btn btn-primary btn-block" disabled> Req.Bill</button>
<button type="button" id="first_bill" class="btn btn-primary btn-block">First Bill</button>
@@ -579,6 +580,11 @@
window.location.href = '/origami/table/' + dining_id + "/sale/" + sale_id + "/load_commissioners";
});
$('#in_juties').on('click', function () {
var dining_id = "<%= @dining.id %>"
window.location.href = '/origami/assign_in_juty/'+ dining_id;
});
$('#void').on('click', function () {
var sure = confirm("Are you sure want to Void");
if (sure == true) {

View File

@@ -0,0 +1,58 @@
<div class="col-md-3">
<%= simple_form_for([:origami,@in_juty]) do |f| %>
<%= f.error_notification %>
<div class="form-inputs">
<label>Dining Name:</label>
<%= @table.name %>
<br/>
<br/>
<label>Commissioner Name:</label>
<%= f.collection_select :commissioner_ids, Commissioner.all, :id, :name, {prompt: 'Select Commissioner'}, {class: 'form-control'} %><br/><br/>
<label>In time</label>
<%= f.text_field :in_time, :value=>DateTime.now.strftime("%Y-%m-%d / %I:%M %p"),:class=>"form-control datepicker"%><br/>
<label>Out time</label>
<%= f.text_field :out_time, :value=>DateTime.now.strftime("%Y-%m-%d / %I:%M %p"),:class=>"form-control datepicker"%>
</div><br>
<div class="form-actions">
<div class='row'>
<div class="col-md-2">
<%= link_to 'Back', origami_index_in_juty_path(@table.id), class: 'btn btn-success' %>
</div>
<div class="col-md-10">
<button type="button" class="btn btn-primary btn-block" id='in_juty'>Create In Juty</button>
</div>
</div>
</div>
<% end %>
</div>
<script type="text/javascript">
$(function() {
$('.datepicker').datepicker({
format : 'dd-mm-yyyy',
autoclose: true
});
$('.datepicker').attr('ReadOnly','true');
$('.datepicker').css('cursor','pointer');
});
$('#in_juty').on('click', function () {
var ajax_url = "/origami/assign_in_juty";
var commissioner_ids = $('#in_juty_commissioner_ids').val();
var in_time = $('#in_juty_in_time').val();
var out_time = $('#in_juty_out_time').val();
var dining_id = '<%= @table.id %>'
$.ajax({
type: "POST",
url: ajax_url,
data: 'dining_id=' + dining_id + "&commissioner_ids=" + commissioner_ids +'&in_time=' + in_time + "&out_time=" + out_time,
success: function (result) {
window.location.href = '/origami/assign_in_juty/'+ dining_id;
}
});
})
</script>

View File

@@ -0,0 +1,59 @@
<div class="col-md-3">
<%= simple_form_for([:origami,@in_juty]) do |f| %>
<%= f.error_notification %>
<div class="form-inputs">
<label>Dining Name:</label>
<%= @table.name %>
<br/>
<br/>
<label>Commissioner Name:</label>
<%= f.collection_select :commissioner_ids, Commissioner.all, :id, :name, {class: 'form-control'} ,:value => @in_juty.commissioner.name %><br/><br/>
<label>In time</label>
<%= f.text_field :in_time, :value=>DateTime.now.strftime("%Y-%m-%d / %I:%M %p"),:class=>"form-control datepicker" ,:value => @in_juty.in_time %><br/>
<label>Out time</label>
<%= f.text_field :out_time, :value=>DateTime.now.strftime("%Y-%m-%d / %I:%M %p"),:class=>"form-control datepicker" ,:value => @in_juty.out_time %>
</div><br>
<div class="form-actions">
<div class='row'>
<div class="col-md-2">
<%= link_to 'Back', origami_index_in_juty_path(@table.id), class: 'btn btn-success' %>
</div>
<div class="col-md-10">
<button type="button" class="btn btn-primary btn-block" id='in_juty'>Update In Juty</button>
</div>
</div>
</div>
<% end %>
</div>
<script type="text/javascript">
$(function() {
$('.datepicker').datepicker({
format : 'dd-mm-yyyy',
autoclose: true
});
$('.datepicker').attr('ReadOnly','true');
$('.datepicker').css('cursor','pointer');
});
$('#in_juty').on('click', function () {
var id = '<%= @in_juty.id %>'
var ajax_url = "/origami/edit_in_juty/" + id;
var commissioner_ids = $('#in_juty_commissioner_ids').val();
var in_time = $('#in_juty_in_time').val();
var out_time = $('#in_juty_out_time').val();
var dining_id = '<%= @table.id %>'
$.ajax({
type: "PUT",
url: ajax_url,
data: 'dining_id=' + dining_id + "&commissioner_ids=" + commissioner_ids +'&in_time=' + in_time + "&out_time=" + out_time + "&table_id=" + dining_id,
success: function (result) {
window.location.href = '/origami/assign_in_juty/'+ dining_id;
}
});
})
</script>

View File

@@ -0,0 +1,6 @@
<div class="span12">
<div class="page-header">
<h3>Create In Juty</h3>
</div>
<%= render 'assign_in_juty', in_juty: @in_juty %>
</div>

View File

@@ -0,0 +1,6 @@
<div class="span12">
<div class="page-header">
<h3>Update In Juty</h3>
</div>
<%= render 'edit_in_juty', in_juty: @in_juty %>
</div>

View File

@@ -0,0 +1,48 @@
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= origami_root_path %>">Home</a></li>
<li>In Juties</li>
<span style="float: right">
<%= link_to t('.new', :default => t("helpers.links.new")), origami_assign_in_juty_path, :class => 'btn btn-primary btn-sm', :flag => 'new' %>
</span>
</ul>
</div>
<br>
<div class="card">
<table class="table table-striped">
<thead>
<tr>
<th>Dining Facility Name</th>
<th>Commissioner Ids</th>
<th>In time</th>
<th>Out time</th>
<th colspan="2"></th>
</tr>
</thead>
<tbody>
<% @juties_in.each do |in_juty| %>
<tr>
<td><%= in_juty.dining_facility.name rescue '-' %></td>
<td><%= in_juty.commissioner.name rescue '-' %></td>
<td><%= in_juty.in_time.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") rescue '-' %></td>
<td><%= in_juty.out_time.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") rescue '-' %></td>
<td><%= link_to 'Back', origami_path(in_juty.dining_facility.id) %></td>
<td><%= link_to 'Edit', origami_edit_in_juty_path(in_juty.dining_facility.id,in_juty) %></td>
<td><%= link_to 'Destroy', origami_destroy_in_juty_path(in_juty.dining_facility.id,in_juty),method: :delete, data: {confirm: 'Are you sure?'} %></td>
</tr>
<% end %>
</tbody>
</table>
</div>
<script type="text/javascript">
$('#destroy').on('click', function () {
var dining_id = '<%= @table %>'
alert(dining_id);
})
</script>

View File

@@ -10,18 +10,18 @@
</div>
<div class="row">
<div class="col-md-6">
<span>Promo Start Date</span>
<span>* Promo Start Date</span>
<%= f.date_field :promo_start_date, :placeholder => "From Date" , :class => "form-control"%>
<br>
</div>
<div class="col-md-6">
<span>Promo End Date</span>
<span>* Promo End Date</span>
<%= f.date_field :promo_end_date ,:placeholder => "To Date" , :class => "form-control"%>
</div>
</div>
<div class="row">
<div class="col-md-6">
<!-- <%= f.input :promo_start_hour %> -->
<!-- <span>* Promo Start Hour</span> -->
<% if !@promotion.promo_start_hour.nil?%>
<%= f.input :promo_start_hour, as: :string, input_html: { :value => @promotion.promo_start_hour.utc.strftime('%H:%M') } %>
<% else %>
@@ -31,7 +31,7 @@
<%= text_field_tag :promo_start_hour , nil, :placeholder => "From Time", :id => "fromtime", :class => 'form-control' %> -->
</div>
<div class="col-md-6">
<!-- <%= f.input :promo_end_hour %> -->
<!-- <span>* Promo End Hour</span> -->
<% if !@promotion.promo_end_hour.nil?%>
<%= f.input :promo_end_hour, as: :string, input_html: {:value => @promotion.promo_end_hour.utc.strftime('%H:%M') } %>
<% else %>
@@ -49,60 +49,38 @@
</div>
</div>
<div class="row">
<div class="col-md-6"><%= f.input :original_product,collection: MenuItem.order("name desc"),input_html: { selected: 2 } %></div>
<div class="col-md-6"><%= f.input :original_product,collection: MenuItem.order("name desc").pluck(:name,:item_code),input_html: { selected: 2 } %></div>
<div class="col-md-6"><%= f.input :min_qty %></div>
</div>
<br>
<br>
<table class="table" style="border : 1px solid #555555 !important;margin:0px">
<tbody>
<tr>
<!-- <td>Promotion Code</td> -->
<td>Item Code</td>
<td>Min Qty</td>
<td>Net off</td>
<td>Net Price</td>
<td>Percentage</td>
<td colspan="2"></td>
</tr>
<!-- <% @promotion.promotion_products.each do |pp| %>
<tr>
<!-- <td><%= pp.promotion_id %></td>
<td><%= pp.item_code %></td>
<td><%= pp.min_qty %></td>
<td><%= pp.net_off %></td>
<td><%= pp.net_price %></td>
<td><%= pp.percentage %></td>
<td><%= link_to 'Edit', edit_settings_promotion_promotion_product_path(@promotion,pp) %></td>
<td><%= link_to 'Destroy', settings_promotion_promotion_product_path(@promotion,pp), method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %> -->
</tbody>
</table>
<%= f.fields_for :promotion_products do |pro| %>
<table class="table" style="margin:0px">
<tbody>
<tr>
<!-- <td></td> -->
<td><%= pro.input :item_code, label: false%></td>
<td><%= pro.input :min_qty , label: false%></td>
<td><%= pro.input :net_off , label: false %></td>
<td><%= pro.input :net_price , label: false %></td>
<td><%= pro.input :percentage , label: false %></td>
<td><%= pro.link_to_remove "X" %></td>
<td></td>
</tr>
</tbody>
</table>
<% end %>
<%= f.link_to_add "Add Product", :promotion_products, :class => 'btn btn-primary' %>
<div class="" style="border: 1px solid #cccccc;padding:1%">
<div class="row">
<div class="col-md-2" style="text-align:center">Item Code</div>
<div class="col-md-2" style="text-align:center">Min Qty</div>
<div class="col-md-2" style="text-align:center">Net off</div>
<div class="col-md-2" style="text-align:center">Net Price</div>
<div class="col-md-2" style="text-align:center">Percentage</div>
<div class="col-md-2" style="text-align:center"></div>
</div>
<div class="row"></div >
<%= f.fields_for :promotion_products do |pro| %>
<div class="row">
<div class="col-md-2"><%= pro.input :item_code, label: false,collection: MenuItem.order("name desc").pluck(:name,:item_code)%></div>
<div class="col-md-2"><%= pro.input :min_qty , label: false%></div>
<div class="col-md-2"><%= pro.input :net_off , label: false %></div>
<div class="col-md-2"><%= pro.input :net_price , label: false %></div>
<div class="col-md-2"><%= pro.input :percentage , label: false %></div>
<div class="col-md-2" style="text-align:right"><%= pro.link_to_remove "X" %></div>
</div>
<% end %>
<div class="row">
<div class="col-md-12" style="text-align:right;"><%= f.link_to_add "Add Product", :promotion_products, :class => 'btn btn-primary' %></div>
</div>
</div>
</div>
</div>
<br>
<div class="form-actions">
<%= f.button :submit %>
</div>

View File

@@ -39,9 +39,7 @@
<td><%= pro.promo_end_hour.utc.strftime("%I:%M %P") rescue "-" %></td>
<td><%= pro.promo_day %></td>
<td>
<% if MenuItem.exists?(pro.original_product) %>
<%= MenuItem.find(pro.original_product).name %>
<% end %>
<%= MenuItem.find_by_item_code(pro.original_product).name rescue "-"%>
</td>
<% if Employee.exists?(pro.created_by) %>
<td><%= Employee.find(pro.created_by).name %></td>

View File

@@ -2,6 +2,7 @@ require 'sidekiq/web'
Rails.application.routes.draw do
root 'home#index'
mount Sidekiq::Web => '/kiq'
@@ -91,6 +92,13 @@ Rails.application.routes.draw do
post 'select_sale_item' => 'commissions#select_sale_item'
# product_commission
post 'select_commissioner' => 'product_commissions#set_commissioner_to_sale_item'
# in_juties
get '/table/:table_id/assign_in_juty' => 'in_juties#assign_in_juty', as: 'assign_in_juty'
post 'assign_in_juty' => 'in_juties#create_for_in_juty', as: 'create_for_in_juty'
get 'assign_in_juty/:table_id' => 'in_juties#index_in_juty', as: 'index_in_juty'
get 'table/:table_id/in_juty/:id/edit' => 'in_juties#edit_in_juty' ,as: 'edit_in_juty'
put '/edit_in_juty/:id' => 'in_juties#update_for_in_juty', as: 'update_for_in_juty'
delete 'table/:table_id/destroy_in_juty/:id' => 'in_juties#destroy_in_juty', as: 'destroy_in_juty'
get 'table/:dining_id/movetable' => "movetable#move_dining"
get 'table/:dining_id/moveroom' => "moveroom#move_dining"
@@ -316,6 +324,15 @@ Rails.application.routes.draw do
get "receipt_no/get_shift_by_date", to: "receipt_no#get_shift_by_date", as: "get_shift_by_date"
end
# ----------- Inventory ---------------------------
namespace :inventory do
get 'inventory' => 'inventory#index'
resources :stock_check_items
resources :stock_checks
resources :stock_journals
resources :inventory_definitions
end
#mount_compendium at: '/report' #, controller: 'reports'
#--------- Reports ------------#

View File

@@ -0,0 +1,10 @@
class CreateInventoryDefinitions < ActiveRecord::Migration[5.1]
def change
create_table :inventory_definitions do |t|
t.string :item_code
t.integer :min_order_level, :default => 0
t.integer :max_stock_level, :default => 0
t.timestamps
end
end
end

View File

@@ -0,0 +1,15 @@
class CreateStockJournals < ActiveRecord::Migration[5.1]
def change
create_table :stock_journals do |t|
t.string :item_code, :null => false
t.integer :inventory_definition_id, :null => false
t.integer :credit, :default => 0
t.integer :debit, :default => 0
t.integer :balance, :default => 0
t.string :remark
t.string :trans_ref, :null => false
t.string :trans_type
t.timestamps
end
end
end

View File

@@ -0,0 +1,11 @@
class CreateStockChecks < ActiveRecord::Migration[5.1]
def change
create_table :stock_checks do |t|
t.integer :check_by
t.datetime :check_start
t.datetime :check_end
t.string :reason
t.timestamps
end
end
end

View File

@@ -0,0 +1,14 @@
class CreateStockCheckItems < ActiveRecord::Migration[5.1]
def change
create_table :stock_check_items do |t|
t.integer :stock_check_id, :null => false
t.string :item_code, :null => false
t.integer :stock_count, :default => 0
t.integer :stock_journal_id
t.integer :stock_balance
t.integer :different
t.string :remark
t.timestamps
end
end
end

View File

@@ -0,0 +1,141 @@
require 'rails_helper'
# This spec was generated by rspec-rails when you ran the scaffold generator.
# It demonstrates how one might use RSpec to specify the controller code that
# was generated by Rails when you ran the scaffold generator.
#
# It assumes that the implementation code is generated by the rails scaffold
# generator. If you are using any extension libraries to generate different
# controller code, this generated spec may or may not pass.
#
# It only uses APIs available in rails and/or rspec-rails. There are a number
# of tools you can use to make these specs even more expressive, but we're
# sticking to rails and rspec-rails APIs to keep things simple and stable.
#
# Compared to earlier versions of this generator, there is very limited use of
# stubs and message expectations in this spec. Stubs are only used when there
# is no simpler way to get a handle on the object needed for the example.
# Message expectations are only used when there is no simpler way to specify
# that an instance is receiving a specific message.
#
# Also compared to earlier versions of this generator, there are no longer any
# expectations of assigns and templates rendered. These features have been
# removed from Rails core in Rails 5, but can be added back in via the
# `rails-controller-testing` gem.
RSpec.describe InventoryDefinitionsController, type: :controller do
# This should return the minimal set of attributes required to create a valid
# InventoryDefinition. As you add validations to InventoryDefinition, be sure to
# adjust the attributes here as well.
let(:valid_attributes) {
skip("Add a hash of attributes valid for your model")
}
let(:invalid_attributes) {
skip("Add a hash of attributes invalid for your model")
}
# This should return the minimal set of values that should be in the session
# in order to pass any filters (e.g. authentication) defined in
# InventoryDefinitionsController. Be sure to keep this updated too.
let(:valid_session) { {} }
describe "GET #index" do
it "returns a success response" do
inventory_definition = InventoryDefinition.create! valid_attributes
get :index, params: {}, session: valid_session
expect(response).to be_success
end
end
describe "GET #show" do
it "returns a success response" do
inventory_definition = InventoryDefinition.create! valid_attributes
get :show, params: {id: inventory_definition.to_param}, session: valid_session
expect(response).to be_success
end
end
describe "GET #new" do
it "returns a success response" do
get :new, params: {}, session: valid_session
expect(response).to be_success
end
end
describe "GET #edit" do
it "returns a success response" do
inventory_definition = InventoryDefinition.create! valid_attributes
get :edit, params: {id: inventory_definition.to_param}, session: valid_session
expect(response).to be_success
end
end
describe "POST #create" do
context "with valid params" do
it "creates a new InventoryDefinition" do
expect {
post :create, params: {inventory_definition: valid_attributes}, session: valid_session
}.to change(InventoryDefinition, :count).by(1)
end
it "redirects to the created inventory_definition" do
post :create, params: {inventory_definition: valid_attributes}, session: valid_session
expect(response).to redirect_to(InventoryDefinition.last)
end
end
context "with invalid params" do
it "returns a success response (i.e. to display the 'new' template)" do
post :create, params: {inventory_definition: invalid_attributes}, session: valid_session
expect(response).to be_success
end
end
end
describe "PUT #update" do
context "with valid params" do
let(:new_attributes) {
skip("Add a hash of attributes valid for your model")
}
it "updates the requested inventory_definition" do
inventory_definition = InventoryDefinition.create! valid_attributes
put :update, params: {id: inventory_definition.to_param, inventory_definition: new_attributes}, session: valid_session
inventory_definition.reload
skip("Add assertions for updated state")
end
it "redirects to the inventory_definition" do
inventory_definition = InventoryDefinition.create! valid_attributes
put :update, params: {id: inventory_definition.to_param, inventory_definition: valid_attributes}, session: valid_session
expect(response).to redirect_to(inventory_definition)
end
end
context "with invalid params" do
it "returns a success response (i.e. to display the 'edit' template)" do
inventory_definition = InventoryDefinition.create! valid_attributes
put :update, params: {id: inventory_definition.to_param, inventory_definition: invalid_attributes}, session: valid_session
expect(response).to be_success
end
end
end
describe "DELETE #destroy" do
it "destroys the requested inventory_definition" do
inventory_definition = InventoryDefinition.create! valid_attributes
expect {
delete :destroy, params: {id: inventory_definition.to_param}, session: valid_session
}.to change(InventoryDefinition, :count).by(-1)
end
it "redirects to the inventory_definitions list" do
inventory_definition = InventoryDefinition.create! valid_attributes
delete :destroy, params: {id: inventory_definition.to_param}, session: valid_session
expect(response).to redirect_to(inventory_definitions_url)
end
end
end

View File

@@ -0,0 +1,141 @@
require 'rails_helper'
# This spec was generated by rspec-rails when you ran the scaffold generator.
# It demonstrates how one might use RSpec to specify the controller code that
# was generated by Rails when you ran the scaffold generator.
#
# It assumes that the implementation code is generated by the rails scaffold
# generator. If you are using any extension libraries to generate different
# controller code, this generated spec may or may not pass.
#
# It only uses APIs available in rails and/or rspec-rails. There are a number
# of tools you can use to make these specs even more expressive, but we're
# sticking to rails and rspec-rails APIs to keep things simple and stable.
#
# Compared to earlier versions of this generator, there is very limited use of
# stubs and message expectations in this spec. Stubs are only used when there
# is no simpler way to get a handle on the object needed for the example.
# Message expectations are only used when there is no simpler way to specify
# that an instance is receiving a specific message.
#
# Also compared to earlier versions of this generator, there are no longer any
# expectations of assigns and templates rendered. These features have been
# removed from Rails core in Rails 5, but can be added back in via the
# `rails-controller-testing` gem.
RSpec.describe StockCheckItemsController, type: :controller do
# This should return the minimal set of attributes required to create a valid
# StockCheckItem. As you add validations to StockCheckItem, be sure to
# adjust the attributes here as well.
let(:valid_attributes) {
skip("Add a hash of attributes valid for your model")
}
let(:invalid_attributes) {
skip("Add a hash of attributes invalid for your model")
}
# This should return the minimal set of values that should be in the session
# in order to pass any filters (e.g. authentication) defined in
# StockCheckItemsController. Be sure to keep this updated too.
let(:valid_session) { {} }
describe "GET #index" do
it "returns a success response" do
stock_check_item = StockCheckItem.create! valid_attributes
get :index, params: {}, session: valid_session
expect(response).to be_success
end
end
describe "GET #show" do
it "returns a success response" do
stock_check_item = StockCheckItem.create! valid_attributes
get :show, params: {id: stock_check_item.to_param}, session: valid_session
expect(response).to be_success
end
end
describe "GET #new" do
it "returns a success response" do
get :new, params: {}, session: valid_session
expect(response).to be_success
end
end
describe "GET #edit" do
it "returns a success response" do
stock_check_item = StockCheckItem.create! valid_attributes
get :edit, params: {id: stock_check_item.to_param}, session: valid_session
expect(response).to be_success
end
end
describe "POST #create" do
context "with valid params" do
it "creates a new StockCheckItem" do
expect {
post :create, params: {stock_check_item: valid_attributes}, session: valid_session
}.to change(StockCheckItem, :count).by(1)
end
it "redirects to the created stock_check_item" do
post :create, params: {stock_check_item: valid_attributes}, session: valid_session
expect(response).to redirect_to(StockCheckItem.last)
end
end
context "with invalid params" do
it "returns a success response (i.e. to display the 'new' template)" do
post :create, params: {stock_check_item: invalid_attributes}, session: valid_session
expect(response).to be_success
end
end
end
describe "PUT #update" do
context "with valid params" do
let(:new_attributes) {
skip("Add a hash of attributes valid for your model")
}
it "updates the requested stock_check_item" do
stock_check_item = StockCheckItem.create! valid_attributes
put :update, params: {id: stock_check_item.to_param, stock_check_item: new_attributes}, session: valid_session
stock_check_item.reload
skip("Add assertions for updated state")
end
it "redirects to the stock_check_item" do
stock_check_item = StockCheckItem.create! valid_attributes
put :update, params: {id: stock_check_item.to_param, stock_check_item: valid_attributes}, session: valid_session
expect(response).to redirect_to(stock_check_item)
end
end
context "with invalid params" do
it "returns a success response (i.e. to display the 'edit' template)" do
stock_check_item = StockCheckItem.create! valid_attributes
put :update, params: {id: stock_check_item.to_param, stock_check_item: invalid_attributes}, session: valid_session
expect(response).to be_success
end
end
end
describe "DELETE #destroy" do
it "destroys the requested stock_check_item" do
stock_check_item = StockCheckItem.create! valid_attributes
expect {
delete :destroy, params: {id: stock_check_item.to_param}, session: valid_session
}.to change(StockCheckItem, :count).by(-1)
end
it "redirects to the stock_check_items list" do
stock_check_item = StockCheckItem.create! valid_attributes
delete :destroy, params: {id: stock_check_item.to_param}, session: valid_session
expect(response).to redirect_to(stock_check_items_url)
end
end
end

View File

@@ -0,0 +1,141 @@
require 'rails_helper'
# This spec was generated by rspec-rails when you ran the scaffold generator.
# It demonstrates how one might use RSpec to specify the controller code that
# was generated by Rails when you ran the scaffold generator.
#
# It assumes that the implementation code is generated by the rails scaffold
# generator. If you are using any extension libraries to generate different
# controller code, this generated spec may or may not pass.
#
# It only uses APIs available in rails and/or rspec-rails. There are a number
# of tools you can use to make these specs even more expressive, but we're
# sticking to rails and rspec-rails APIs to keep things simple and stable.
#
# Compared to earlier versions of this generator, there is very limited use of
# stubs and message expectations in this spec. Stubs are only used when there
# is no simpler way to get a handle on the object needed for the example.
# Message expectations are only used when there is no simpler way to specify
# that an instance is receiving a specific message.
#
# Also compared to earlier versions of this generator, there are no longer any
# expectations of assigns and templates rendered. These features have been
# removed from Rails core in Rails 5, but can be added back in via the
# `rails-controller-testing` gem.
RSpec.describe StockChecksController, type: :controller do
# This should return the minimal set of attributes required to create a valid
# StockCheck. As you add validations to StockCheck, be sure to
# adjust the attributes here as well.
let(:valid_attributes) {
skip("Add a hash of attributes valid for your model")
}
let(:invalid_attributes) {
skip("Add a hash of attributes invalid for your model")
}
# This should return the minimal set of values that should be in the session
# in order to pass any filters (e.g. authentication) defined in
# StockChecksController. Be sure to keep this updated too.
let(:valid_session) { {} }
describe "GET #index" do
it "returns a success response" do
stock_check = StockCheck.create! valid_attributes
get :index, params: {}, session: valid_session
expect(response).to be_success
end
end
describe "GET #show" do
it "returns a success response" do
stock_check = StockCheck.create! valid_attributes
get :show, params: {id: stock_check.to_param}, session: valid_session
expect(response).to be_success
end
end
describe "GET #new" do
it "returns a success response" do
get :new, params: {}, session: valid_session
expect(response).to be_success
end
end
describe "GET #edit" do
it "returns a success response" do
stock_check = StockCheck.create! valid_attributes
get :edit, params: {id: stock_check.to_param}, session: valid_session
expect(response).to be_success
end
end
describe "POST #create" do
context "with valid params" do
it "creates a new StockCheck" do
expect {
post :create, params: {stock_check: valid_attributes}, session: valid_session
}.to change(StockCheck, :count).by(1)
end
it "redirects to the created stock_check" do
post :create, params: {stock_check: valid_attributes}, session: valid_session
expect(response).to redirect_to(StockCheck.last)
end
end
context "with invalid params" do
it "returns a success response (i.e. to display the 'new' template)" do
post :create, params: {stock_check: invalid_attributes}, session: valid_session
expect(response).to be_success
end
end
end
describe "PUT #update" do
context "with valid params" do
let(:new_attributes) {
skip("Add a hash of attributes valid for your model")
}
it "updates the requested stock_check" do
stock_check = StockCheck.create! valid_attributes
put :update, params: {id: stock_check.to_param, stock_check: new_attributes}, session: valid_session
stock_check.reload
skip("Add assertions for updated state")
end
it "redirects to the stock_check" do
stock_check = StockCheck.create! valid_attributes
put :update, params: {id: stock_check.to_param, stock_check: valid_attributes}, session: valid_session
expect(response).to redirect_to(stock_check)
end
end
context "with invalid params" do
it "returns a success response (i.e. to display the 'edit' template)" do
stock_check = StockCheck.create! valid_attributes
put :update, params: {id: stock_check.to_param, stock_check: invalid_attributes}, session: valid_session
expect(response).to be_success
end
end
end
describe "DELETE #destroy" do
it "destroys the requested stock_check" do
stock_check = StockCheck.create! valid_attributes
expect {
delete :destroy, params: {id: stock_check.to_param}, session: valid_session
}.to change(StockCheck, :count).by(-1)
end
it "redirects to the stock_checks list" do
stock_check = StockCheck.create! valid_attributes
delete :destroy, params: {id: stock_check.to_param}, session: valid_session
expect(response).to redirect_to(stock_checks_url)
end
end
end

View File

@@ -0,0 +1,141 @@
require 'rails_helper'
# This spec was generated by rspec-rails when you ran the scaffold generator.
# It demonstrates how one might use RSpec to specify the controller code that
# was generated by Rails when you ran the scaffold generator.
#
# It assumes that the implementation code is generated by the rails scaffold
# generator. If you are using any extension libraries to generate different
# controller code, this generated spec may or may not pass.
#
# It only uses APIs available in rails and/or rspec-rails. There are a number
# of tools you can use to make these specs even more expressive, but we're
# sticking to rails and rspec-rails APIs to keep things simple and stable.
#
# Compared to earlier versions of this generator, there is very limited use of
# stubs and message expectations in this spec. Stubs are only used when there
# is no simpler way to get a handle on the object needed for the example.
# Message expectations are only used when there is no simpler way to specify
# that an instance is receiving a specific message.
#
# Also compared to earlier versions of this generator, there are no longer any
# expectations of assigns and templates rendered. These features have been
# removed from Rails core in Rails 5, but can be added back in via the
# `rails-controller-testing` gem.
RSpec.describe StockJournalsController, type: :controller do
# This should return the minimal set of attributes required to create a valid
# StockJournal. As you add validations to StockJournal, be sure to
# adjust the attributes here as well.
let(:valid_attributes) {
skip("Add a hash of attributes valid for your model")
}
let(:invalid_attributes) {
skip("Add a hash of attributes invalid for your model")
}
# This should return the minimal set of values that should be in the session
# in order to pass any filters (e.g. authentication) defined in
# StockJournalsController. Be sure to keep this updated too.
let(:valid_session) { {} }
describe "GET #index" do
it "returns a success response" do
stock_journal = StockJournal.create! valid_attributes
get :index, params: {}, session: valid_session
expect(response).to be_success
end
end
describe "GET #show" do
it "returns a success response" do
stock_journal = StockJournal.create! valid_attributes
get :show, params: {id: stock_journal.to_param}, session: valid_session
expect(response).to be_success
end
end
describe "GET #new" do
it "returns a success response" do
get :new, params: {}, session: valid_session
expect(response).to be_success
end
end
describe "GET #edit" do
it "returns a success response" do
stock_journal = StockJournal.create! valid_attributes
get :edit, params: {id: stock_journal.to_param}, session: valid_session
expect(response).to be_success
end
end
describe "POST #create" do
context "with valid params" do
it "creates a new StockJournal" do
expect {
post :create, params: {stock_journal: valid_attributes}, session: valid_session
}.to change(StockJournal, :count).by(1)
end
it "redirects to the created stock_journal" do
post :create, params: {stock_journal: valid_attributes}, session: valid_session
expect(response).to redirect_to(StockJournal.last)
end
end
context "with invalid params" do
it "returns a success response (i.e. to display the 'new' template)" do
post :create, params: {stock_journal: invalid_attributes}, session: valid_session
expect(response).to be_success
end
end
end
describe "PUT #update" do
context "with valid params" do
let(:new_attributes) {
skip("Add a hash of attributes valid for your model")
}
it "updates the requested stock_journal" do
stock_journal = StockJournal.create! valid_attributes
put :update, params: {id: stock_journal.to_param, stock_journal: new_attributes}, session: valid_session
stock_journal.reload
skip("Add assertions for updated state")
end
it "redirects to the stock_journal" do
stock_journal = StockJournal.create! valid_attributes
put :update, params: {id: stock_journal.to_param, stock_journal: valid_attributes}, session: valid_session
expect(response).to redirect_to(stock_journal)
end
end
context "with invalid params" do
it "returns a success response (i.e. to display the 'edit' template)" do
stock_journal = StockJournal.create! valid_attributes
put :update, params: {id: stock_journal.to_param, stock_journal: invalid_attributes}, session: valid_session
expect(response).to be_success
end
end
end
describe "DELETE #destroy" do
it "destroys the requested stock_journal" do
stock_journal = StockJournal.create! valid_attributes
expect {
delete :destroy, params: {id: stock_journal.to_param}, session: valid_session
}.to change(StockJournal, :count).by(-1)
end
it "redirects to the stock_journals list" do
stock_journal = StockJournal.create! valid_attributes
delete :destroy, params: {id: stock_journal.to_param}, session: valid_session
expect(response).to redirect_to(stock_journals_url)
end
end
end

View File

@@ -0,0 +1,15 @@
require 'rails_helper'
# Specs in this file have access to a helper object that includes
# the InventoryDefinitionsHelper. For example:
#
# describe InventoryDefinitionsHelper do
# describe "string concat" do
# it "concats two strings with spaces" do
# expect(helper.concat_strings("this","that")).to eq("this that")
# end
# end
# end
RSpec.describe InventoryDefinitionsHelper, type: :helper do
pending "add some examples to (or delete) #{__FILE__}"
end

View File

@@ -0,0 +1,15 @@
require 'rails_helper'
# Specs in this file have access to a helper object that includes
# the StockCheckItemsHelper. For example:
#
# describe StockCheckItemsHelper do
# describe "string concat" do
# it "concats two strings with spaces" do
# expect(helper.concat_strings("this","that")).to eq("this that")
# end
# end
# end
RSpec.describe StockCheckItemsHelper, type: :helper do
pending "add some examples to (or delete) #{__FILE__}"
end

View File

@@ -0,0 +1,15 @@
require 'rails_helper'
# Specs in this file have access to a helper object that includes
# the StockChecksHelper. For example:
#
# describe StockChecksHelper do
# describe "string concat" do
# it "concats two strings with spaces" do
# expect(helper.concat_strings("this","that")).to eq("this that")
# end
# end
# end
RSpec.describe StockChecksHelper, type: :helper do
pending "add some examples to (or delete) #{__FILE__}"
end

View File

@@ -0,0 +1,15 @@
require 'rails_helper'
# Specs in this file have access to a helper object that includes
# the StockJournalsHelper. For example:
#
# describe StockJournalsHelper do
# describe "string concat" do
# it "concats two strings with spaces" do
# expect(helper.concat_strings("this","that")).to eq("this that")
# end
# end
# end
RSpec.describe StockJournalsHelper, type: :helper do
pending "add some examples to (or delete) #{__FILE__}"
end

View File

@@ -0,0 +1,5 @@
require 'rails_helper'
RSpec.describe InventoryDefinition, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end

View File

@@ -0,0 +1,5 @@
require 'rails_helper'
RSpec.describe StockCheckItem, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end

View File

@@ -0,0 +1,5 @@
require 'rails_helper'
RSpec.describe StockCheck, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end

View File

@@ -0,0 +1,5 @@
require 'rails_helper'
RSpec.describe StockJournal, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end

View File

@@ -0,0 +1,10 @@
require 'rails_helper'
RSpec.describe "InventoryDefinitions", type: :request do
describe "GET /inventory_definitions" do
it "works! (now write some real specs)" do
get inventory_definitions_path
expect(response).to have_http_status(200)
end
end
end

View File

@@ -0,0 +1,10 @@
require 'rails_helper'
RSpec.describe "StockCheckItems", type: :request do
describe "GET /stock_check_items" do
it "works! (now write some real specs)" do
get stock_check_items_path
expect(response).to have_http_status(200)
end
end
end

View File

@@ -0,0 +1,10 @@
require 'rails_helper'
RSpec.describe "StockChecks", type: :request do
describe "GET /stock_checks" do
it "works! (now write some real specs)" do
get stock_checks_path
expect(response).to have_http_status(200)
end
end
end

View File

@@ -0,0 +1,10 @@
require 'rails_helper'
RSpec.describe "StockJournals", type: :request do
describe "GET /stock_journals" do
it "works! (now write some real specs)" do
get stock_journals_path
expect(response).to have_http_status(200)
end
end
end

View File

@@ -0,0 +1,39 @@
require "rails_helper"
RSpec.describe InventoryDefinitionsController, type: :routing do
describe "routing" do
it "routes to #index" do
expect(:get => "/inventory_definitions").to route_to("inventory_definitions#index")
end
it "routes to #new" do
expect(:get => "/inventory_definitions/new").to route_to("inventory_definitions#new")
end
it "routes to #show" do
expect(:get => "/inventory_definitions/1").to route_to("inventory_definitions#show", :id => "1")
end
it "routes to #edit" do
expect(:get => "/inventory_definitions/1/edit").to route_to("inventory_definitions#edit", :id => "1")
end
it "routes to #create" do
expect(:post => "/inventory_definitions").to route_to("inventory_definitions#create")
end
it "routes to #update via PUT" do
expect(:put => "/inventory_definitions/1").to route_to("inventory_definitions#update", :id => "1")
end
it "routes to #update via PATCH" do
expect(:patch => "/inventory_definitions/1").to route_to("inventory_definitions#update", :id => "1")
end
it "routes to #destroy" do
expect(:delete => "/inventory_definitions/1").to route_to("inventory_definitions#destroy", :id => "1")
end
end
end

View File

@@ -0,0 +1,39 @@
require "rails_helper"
RSpec.describe StockCheckItemsController, type: :routing do
describe "routing" do
it "routes to #index" do
expect(:get => "/stock_check_items").to route_to("stock_check_items#index")
end
it "routes to #new" do
expect(:get => "/stock_check_items/new").to route_to("stock_check_items#new")
end
it "routes to #show" do
expect(:get => "/stock_check_items/1").to route_to("stock_check_items#show", :id => "1")
end
it "routes to #edit" do
expect(:get => "/stock_check_items/1/edit").to route_to("stock_check_items#edit", :id => "1")
end
it "routes to #create" do
expect(:post => "/stock_check_items").to route_to("stock_check_items#create")
end
it "routes to #update via PUT" do
expect(:put => "/stock_check_items/1").to route_to("stock_check_items#update", :id => "1")
end
it "routes to #update via PATCH" do
expect(:patch => "/stock_check_items/1").to route_to("stock_check_items#update", :id => "1")
end
it "routes to #destroy" do
expect(:delete => "/stock_check_items/1").to route_to("stock_check_items#destroy", :id => "1")
end
end
end

View File

@@ -0,0 +1,39 @@
require "rails_helper"
RSpec.describe StockChecksController, type: :routing do
describe "routing" do
it "routes to #index" do
expect(:get => "/stock_checks").to route_to("stock_checks#index")
end
it "routes to #new" do
expect(:get => "/stock_checks/new").to route_to("stock_checks#new")
end
it "routes to #show" do
expect(:get => "/stock_checks/1").to route_to("stock_checks#show", :id => "1")
end
it "routes to #edit" do
expect(:get => "/stock_checks/1/edit").to route_to("stock_checks#edit", :id => "1")
end
it "routes to #create" do
expect(:post => "/stock_checks").to route_to("stock_checks#create")
end
it "routes to #update via PUT" do
expect(:put => "/stock_checks/1").to route_to("stock_checks#update", :id => "1")
end
it "routes to #update via PATCH" do
expect(:patch => "/stock_checks/1").to route_to("stock_checks#update", :id => "1")
end
it "routes to #destroy" do
expect(:delete => "/stock_checks/1").to route_to("stock_checks#destroy", :id => "1")
end
end
end

View File

@@ -0,0 +1,39 @@
require "rails_helper"
RSpec.describe StockJournalsController, type: :routing do
describe "routing" do
it "routes to #index" do
expect(:get => "/stock_journals").to route_to("stock_journals#index")
end
it "routes to #new" do
expect(:get => "/stock_journals/new").to route_to("stock_journals#new")
end
it "routes to #show" do
expect(:get => "/stock_journals/1").to route_to("stock_journals#show", :id => "1")
end
it "routes to #edit" do
expect(:get => "/stock_journals/1/edit").to route_to("stock_journals#edit", :id => "1")
end
it "routes to #create" do
expect(:post => "/stock_journals").to route_to("stock_journals#create")
end
it "routes to #update via PUT" do
expect(:put => "/stock_journals/1").to route_to("stock_journals#update", :id => "1")
end
it "routes to #update via PATCH" do
expect(:patch => "/stock_journals/1").to route_to("stock_journals#update", :id => "1")
end
it "routes to #destroy" do
expect(:delete => "/stock_journals/1").to route_to("stock_journals#destroy", :id => "1")
end
end
end

View File

@@ -0,0 +1,14 @@
require 'rails_helper'
RSpec.describe "inventory_definitions/edit", type: :view do
before(:each) do
@inventory_definition = assign(:inventory_definition, InventoryDefinition.create!())
end
it "renders the edit inventory_definition form" do
render
assert_select "form[action=?][method=?]", inventory_definition_path(@inventory_definition), "post" do
end
end
end

View File

@@ -0,0 +1,14 @@
require 'rails_helper'
RSpec.describe "inventory_definitions/index", type: :view do
before(:each) do
assign(:inventory_definitions, [
InventoryDefinition.create!(),
InventoryDefinition.create!()
])
end
it "renders a list of inventory_definitions" do
render
end
end

View File

@@ -0,0 +1,14 @@
require 'rails_helper'
RSpec.describe "inventory_definitions/new", type: :view do
before(:each) do
assign(:inventory_definition, InventoryDefinition.new())
end
it "renders new inventory_definition form" do
render
assert_select "form[action=?][method=?]", inventory_definitions_path, "post" do
end
end
end

View File

@@ -0,0 +1,11 @@
require 'rails_helper'
RSpec.describe "inventory_definitions/show", type: :view do
before(:each) do
@inventory_definition = assign(:inventory_definition, InventoryDefinition.create!())
end
it "renders attributes in <p>" do
render
end
end

Some files were not shown because too many files have changed in this diff Show More