Merge branch 'master' into staging

This commit is contained in:
Yan
2017-09-04 18:02:49 +06:30
58 changed files with 1713 additions and 731 deletions

4
.gitignore vendored
View File

@@ -48,9 +48,9 @@ config/deploy/config/*
#Gemfile.lock
# For Redis Server log file
dump.rdb
/dump.rdb
# Fonts
# Fonts
public/fonts/*
# Ruby-Mine IDE folder

628
.idea/workspace.xml generated
View File

@@ -2,18 +2,7 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="89ca96af-a0e4-4fe4-b9a3-9969f22d7079" name="Default" comment="">
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/dump.rdb" afterPath="$PROJECT_DIR$/dump.rdb" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/.generators" afterPath="$PROJECT_DIR$/.idea/.generators" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/sxrestaurant.iml" afterPath="$PROJECT_DIR$/.idea/sxrestaurant.iml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/Gemfile" afterPath="$PROJECT_DIR$/Gemfile" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/Gemfile.lock" afterPath="$PROJECT_DIR$/Gemfile.lock" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/assets/javascripts/application.js" afterPath="$PROJECT_DIR$/app/assets/javascripts/application.js" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/assets/stylesheets/application.scss" afterPath="$PROJECT_DIR$/app/assets/stylesheets/application.scss" />
<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/views/origami/in_juties/_assign_in_juty.html.erb" afterPath="$PROJECT_DIR$/app/views/origami/in_juties/_assign_in_juty.html.erb" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/views/origami/in_juties/index_in_juty.html.erb" afterPath="$PROJECT_DIR$/app/views/origami/in_juties/index_in_juty.html.erb" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/views/settings/promotions/new.html.erb" afterPath="$PROJECT_DIR$/app/views/settings/promotions/new.html.erb" />
</list>
<ignored path="$PROJECT_DIR$/.bundle/" />
<ignored path="$PROJECT_DIR$/components/" />
@@ -28,7 +17,7 @@
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="CoverageDataManager">
<SUITE FILE_PATH="coverage/sxrestaurant@Development__sxrestaurant.coverage" NAME="Development: sxrestaurant Coverage Results" MODIFIED="1504066113816" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" MODULE_NAME="sxrestaurant" />
<SUITE FILE_PATH="coverage/sxrestaurant@Development__sxrestaurant.coverage" NAME="Development: sxrestaurant Coverage Results" MODIFIED="1504150298331" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" MODULE_NAME="sxrestaurant" />
<SUITE FILE_PATH="coverage/sxrestaurant@db_migrate__sxrestaurant.coverage" NAME="db:migrate: sxrestaurant Coverage Results" MODIFIED="1503652404616" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" MODULE_NAME="sxrestaurant" />
<SUITE FILE_PATH="coverage/sxrestaurant@Rails_console__sxrestaurant.coverage" NAME="Rails console: sxrestaurant Coverage Results" MODIFIED="1503651318886" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" MODULE_NAME="sxrestaurant" />
</component>
@@ -55,85 +44,51 @@
</component>
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file leaf-file-name="in_juties_controller.rb" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/app/controllers/origami/in_juties_controller.rb">
<file leaf-file-name="load_commissioners.html.erb" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/app/views/origami/product_commissions/load_commissioners.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="93">
<caret line="10" column="0" lean-forward="false" selection-start-line="10" selection-start-column="0" selection-end-line="10" selection-end-column="0" />
<state relative-caret-position="199">
<caret line="74" column="27" lean-forward="false" selection-start-line="74" selection-start-column="27" selection-end-line="74" selection-end-column="27" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="_form.html.erb" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/app/views/settings/promotions/_form.html.erb">
<file leaf-file-name="show.html.erb" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/app/views/origami/home/show.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-1366">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<state relative-caret-position="247">
<caret line="267" column="32" lean-forward="true" selection-start-line="267" selection-start-column="32" selection-end-line="267" selection-end-column="32" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="new.html.erb" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/app/views/settings/promotions/new.html.erb">
<file leaf-file-name="sale_edit_controller.rb" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/app/controllers/origami/sale_edit_controller.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="234">
<caret line="13" column="33" lean-forward="true" selection-start-line="13" selection-start-column="33" selection-end-line="13" selection-end-column="33" />
<state relative-caret-position="69">
<caret line="62" column="21" lean-forward="false" selection-start-line="62" selection-start-column="21" selection-end-line="62" selection-end-column="21" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="_assign_in_juty.html.erb" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/app/views/origami/in_juties/_assign_in_juty.html.erb">
<file leaf-file-name="product_commissions_controller.rb" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/app/controllers/origami/product_commissions_controller.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="197">
<caret line="15" column="133" lean-forward="false" selection-start-line="15" selection-start-column="133" selection-end-line="15" selection-end-column="133" />
<state relative-caret-position="182">
<caret line="95" column="25" lean-forward="false" selection-start-line="95" selection-start-column="25" selection-end-line="95" selection-end-column="25" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="index_in_juty.html.erb" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/app/views/origami/in_juties/index_in_juty.html.erb">
<file leaf-file-name="routes.rb" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/config/routes.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="836">
<caret line="77" column="0" lean-forward="false" selection-start-line="77" selection-start-column="0" selection-end-line="77" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="Gemfile" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/Gemfile">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="12">
<caret line="93" column="10" lean-forward="false" selection-start-line="93" selection-start-column="10" selection-end-line="93" selection-end-column="10" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="application.js" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/app/assets/javascripts/application.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="342">
<caret line="25" column="33" lean-forward="false" selection-start-line="25" selection-start-column="33" selection-end-line="25" selection-end-column="33" />
<folding>
<element signature="n#!!doc" expanded="true" />
<marker date="1504065881000" expanded="true" signature="2006:2033" ph="..." />
<marker date="1504065881000" expanded="true" signature="2829:2856" ph="..." />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="application.scss" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/app/assets/stylesheets/application.scss">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="144">
<caret line="8" column="30" lean-forward="false" selection-start-line="8" selection-start-column="30" selection-end-line="8" selection-end-column="30" />
<state relative-caret-position="280">
<caret line="183" column="9" lean-forward="false" selection-start-line="183" selection-start-column="9" selection-end-line="183" selection-end-column="9" />
<folding />
</state>
</provider>
@@ -165,6 +120,7 @@
<find>mom</find>
<find>gem &quot;select2-rails&quot;</find>
<find>custom_excel</find>
<find>load</find>
</findStrings>
</component>
<component name="Git.Settings">
@@ -173,12 +129,6 @@
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/db/migrate/20170823075203_create_in_juties.rb" />
<option value="$PROJECT_DIR$/db/migrate/20170823081747_create_in_juties.rb" />
<option value="$PROJECT_DIR$/app/views/origami/home/show.html.erb" />
<option value="$PROJECT_DIR$/app/views/origami/home/index_bk.html.erb" />
<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$/db/migrate/20170823034141_create_product_commissions.rb" />
<option value="$PROJECT_DIR$/app/models/menu_item.rb" />
@@ -196,8 +146,6 @@
<option value="$PROJECT_DIR$/app/views/settings/commissioners/new.html.erb" />
<option value="$PROJECT_DIR$/app/models/commissioner.rb" />
<option value="$PROJECT_DIR$/app/assets/stylesheets/settings.scss" />
<option value="$PROJECT_DIR$/app/controllers/settings/commissions_controller.rb" />
<option value="$PROJECT_DIR$/app/controllers/origami/product_commissions_controller.rb" />
<option value="$PROJECT_DIR$/app/views/settings/commissions/index.html.erb" />
<option value="$PROJECT_DIR$/app/models/sale.rb" />
<option value="$PROJECT_DIR$/db/migrate/20170825093252_create_commissions.rb" />
@@ -207,7 +155,6 @@
<option value="$PROJECT_DIR$/app/views/settings/commissioners/index.html.erb" />
<option value="$PROJECT_DIR$/app/controllers/settings/commissioners_controller.rb" />
<option value="$PROJECT_DIR$/app/views/settings/commissioners/show.html.erb" />
<option value="$PROJECT_DIR$/config/routes.rb" />
<option value="$PROJECT_DIR$/app/models/promotion.rb" />
<option value="$PROJECT_DIR$/app/views/layouts/_header.html.erb" />
<option value="$PROJECT_DIR$/app/models/commission.rb" />
@@ -217,13 +164,22 @@
<option value="$PROJECT_DIR$/Gemfile.lock" />
<option value="$PROJECT_DIR$/app/controllers/reports/commission_controller.rb" />
<option value="$PROJECT_DIR$/app/views/reports/commission/_commission_report_filter.html.erb" />
<option value="$PROJECT_DIR$/app/controllers/origami/in_juties_controller.rb" />
<option value="$PROJECT_DIR$/Gemfile" />
<option value="$PROJECT_DIR$/app/views/origami/in_juties/index_in_juty.html.erb" />
<option value="$PROJECT_DIR$/app/assets/javascripts/application.js" />
<option value="$PROJECT_DIR$/app/assets/stylesheets/application.scss" />
<option value="$PROJECT_DIR$/app/views/settings/promotions/new.html.erb" />
<option value="$PROJECT_DIR$/app/views/origami/in_juties/_assign_in_juty.html.erb" />
<option value="$PROJECT_DIR$/app/views/origami/in_juties/new.html.erb" />
<option value="$PROJECT_DIR$/app/views/origami/in_juties/index.html.erb" />
<option value="$PROJECT_DIR$/app/views/origami/in_juties/_edit_in_juty.html.erb" />
<option value="$PROJECT_DIR$/app/views/origami/in_juties/index_in_juty.html.erb" />
<option value="$PROJECT_DIR$/app/views/origami/in_juties/_form.html.erb" />
<option value="$PROJECT_DIR$/app/controllers/origami/in_juties_controller.rb" />
<option value="$PROJECT_DIR$/db/migrate/20170824110103_create_inventory_definitions.rb" />
<option value="$PROJECT_DIR$/.gitignore" />
<option value="$PROJECT_DIR$/app/controllers/origami/product_commissions_controller.rb" />
<option value="$PROJECT_DIR$/config/routes.rb" />
<option value="$PROJECT_DIR$/app/controllers/settings/commissions_controller.rb" />
</list>
</option>
</component>
@@ -292,6 +248,20 @@
<item name="app" type="462c0819:PsiDirectoryNode" />
<item name="controllers" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="sxrestaurant" type="b2602c69:ProjectViewProjectNode" />
<item name="sxrestaurant" type="462c0819:PsiDirectoryNode" />
<item name="app" type="462c0819:PsiDirectoryNode" />
<item name="controllers" type="462c0819:PsiDirectoryNode" />
<item name="origami" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="sxrestaurant" type="b2602c69:ProjectViewProjectNode" />
<item name="sxrestaurant" type="462c0819:PsiDirectoryNode" />
<item name="app" type="462c0819:PsiDirectoryNode" />
<item name="controllers" type="462c0819:PsiDirectoryNode" />
<item name="settings" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="sxrestaurant" type="b2602c69:ProjectViewProjectNode" />
<item name="sxrestaurant" type="462c0819:PsiDirectoryNode" />
@@ -311,22 +281,15 @@
<item name="app" type="462c0819:PsiDirectoryNode" />
<item name="views" type="462c0819:PsiDirectoryNode" />
<item name="origami" type="462c0819:PsiDirectoryNode" />
<item name="in_juties" type="462c0819:PsiDirectoryNode" />
<item name="home" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="sxrestaurant" type="b2602c69:ProjectViewProjectNode" />
<item name="sxrestaurant" type="462c0819:PsiDirectoryNode" />
<item name="app" type="462c0819:PsiDirectoryNode" />
<item name="views" type="462c0819:PsiDirectoryNode" />
<item name="reports" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="sxrestaurant" type="b2602c69:ProjectViewProjectNode" />
<item name="sxrestaurant" type="462c0819:PsiDirectoryNode" />
<item name="app" type="462c0819:PsiDirectoryNode" />
<item name="views" type="462c0819:PsiDirectoryNode" />
<item name="reports" type="462c0819:PsiDirectoryNode" />
<item name="commission" type="462c0819:PsiDirectoryNode" />
<item name="origami" type="462c0819:PsiDirectoryNode" />
<item name="product_commissions" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="sxrestaurant" type="b2602c69:ProjectViewProjectNode" />
@@ -346,10 +309,13 @@
<path>
<item name="sxrestaurant" type="b2602c69:ProjectViewProjectNode" />
<item name="sxrestaurant" type="462c0819:PsiDirectoryNode" />
<item name="app" type="462c0819:PsiDirectoryNode" />
<item name="views" type="462c0819:PsiDirectoryNode" />
<item name="settings" type="462c0819:PsiDirectoryNode" />
<item name="promotions" type="462c0819:PsiDirectoryNode" />
<item name="db" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="sxrestaurant" type="b2602c69:ProjectViewProjectNode" />
<item name="sxrestaurant" type="462c0819:PsiDirectoryNode" />
<item name="db" type="462c0819:PsiDirectoryNode" />
<item name="migrate" type="462c0819:PsiDirectoryNode" />
</path>
</expand>
<select />
@@ -368,14 +334,16 @@
<property name="com.intellij.database.dataSource.DataSourceTemplate" value="MySQL" />
</component>
<component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/app/views/settings" />
<recent name="$PROJECT_DIR$/app/controllers/settings" />
</key>
<key name="MoveFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/app/views/origami" />
<recent name="$PROJECT_DIR$/app/controllers/origami" />
</key>
<key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/app/views/origami/product_commissions" />
<recent name="$PROJECT_DIR$/app/views/settings/commissions" />
<recent name="$PROJECT_DIR$/app/views/settings" />
<recent name="$PROJECT_DIR$/app/controllers/settings" />
</key>
</component>
<component name="RunDashboard">
<option name="ruleStates">
@@ -756,12 +724,12 @@
<workItem from="1503457057830" duration="7166000" />
<workItem from="1503472116907" duration="50209000" />
<workItem from="1503843212665" duration="21267000" />
<workItem from="1503909487511" duration="36125000" />
<workItem from="1503909487511" duration="65887000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="188743000" />
<option name="totallyTimeSpent" value="218505000" />
</component>
<component name="TodoView">
<todo-panel id="selected-file">
@@ -774,21 +742,20 @@
</component>
<component name="ToolWindowManager">
<frame x="1440" y="22" width="1920" height="1058" extended-state="6" />
<editor active="true" />
<layout>
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.20181043" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32917964" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32978722" sideWeight="0.5" order="10" side_tool="true" content_ui="tabs" />
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.17412141" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3258786" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.48701972" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.34890965" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3759086" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.49013498" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.39252338" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.3561786" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3561786" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
@@ -799,162 +766,52 @@
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="1" />
</component>
<component name="Vcs.Log.History.Properties">
<option name="COLUMN_ORDER">
<list>
<option value="0" />
<option value="2" />
<option value="3" />
<option value="1" />
</list>
</option>
</component>
<component name="Vcs.Log.Tabs.Properties">
<option name="TAB_STATES">
<map>
<entry key="MAIN">
<value>
<State>
<option name="RECENTLY_FILTERED_USER_GROUPS">
<collection />
</option>
<option name="RECENTLY_FILTERED_BRANCH_GROUPS">
<collection />
</option>
<option name="COLUMN_ORDER">
<list>
<option value="0" />
<option value="1" />
<option value="2" />
<option value="3" />
</list>
</option>
</State>
</value>
</entry>
</map>
</option>
</component>
<component name="VcsContentAnnotationSettings">
<option name="myLimit" value="2678400000" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
<option name="time" value="25" />
<option name="time" value="40" />
</breakpoint-manager>
<watches-manager />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/app/views/origami/home/show.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="269">
<caret line="579" column="40" lean-forward="false" selection-start-line="579" selection-start-column="33" selection-end-line="579" selection-end-column="40" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/assets/stylesheets/origami.scss">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="386">
<caret line="176" column="16" lean-forward="true" selection-start-line="176" selection-start-column="16" selection-end-line="176" selection-end-column="16" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/assets/stylesheets/settings.scss">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="653">
<caret line="89" column="16" lean-forward="false" selection-start-line="89" selection-start-column="16" selection-end-line="89" selection-end-column="16" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/controllers/settings/commissions_controller.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="368">
<caret line="76" column="12" lean-forward="true" selection-start-line="76" selection-start-column="12" selection-end-line="76" selection-end-column="12" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/controllers/origami/product_commissions_controller.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="164">
<caret line="65" column="12" lean-forward="true" selection-start-line="65" selection-start-column="12" selection-end-line="65" selection-end-column="12" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/controllers/reports/bksaleitem_controller.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/controllers/reports/shiftsale_controller.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="72">
<caret line="4" column="0" lean-forward="true" selection-start-line="4" selection-start-column="0" selection-end-line="4" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/views/reports/shiftsale/index.xls.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="54">
<caret line="3" column="12" lean-forward="true" selection-start-line="3" selection-start-column="12" selection-end-line="3" selection-end-column="12" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/views/settings/commissions/index.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="142">
<caret line="19" column="27" lean-forward="true" selection-start-line="19" selection-start-column="27" selection-end-line="19" selection-end-column="27" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/db/migrate/20170403135934_create_orders.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="54">
<caret line="3" column="112" lean-forward="true" selection-start-line="3" selection-start-column="112" selection-end-line="3" selection-end-column="112" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/db/migrate/20170701101420_create_sales.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="36">
<caret line="2" column="37" lean-forward="true" selection-start-line="2" selection-start-column="25" selection-end-line="2" selection-end-column="37" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/db/seeds.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-3790">
<caret line="16" column="53" lean-forward="true" selection-start-line="16" selection-start-column="53" selection-end-line="16" selection-end-column="53" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/models/seed_generator.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="36">
<caret line="2" column="11" lean-forward="false" selection-start-line="2" selection-start-column="11" selection-end-line="2" selection-end-column="11" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/db/migrate/20170825093252_create_commissions.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="90">
<caret line="5" column="0" lean-forward="true" selection-start-line="5" selection-start-column="0" selection-end-line="5" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/db/migrate/20170825090115_create_commissioners.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="4" selection-end-line="1" selection-end-column="47" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/db/migrate/20170825034141_create_product_commissions.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="144">
<caret line="8" column="53" lean-forward="false" selection-start-line="8" selection-start-column="53" selection-end-line="8" selection-end-column="53" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/views/reports/shiftsale/_shift_sale_report_filter.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="113">
<caret line="24" column="48" lean-forward="false" selection-start-line="24" selection-start-column="21" selection-end-line="24" selection-end-column="48" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/views/reports/shiftsale/index.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="163">
<caret line="30" column="84" lean-forward="false" selection-start-line="30" selection-start-column="45" selection-end-line="30" selection-end-column="84" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/views/settings/commissioners/_form.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="450">
<caret line="25" column="6" lean-forward="false" selection-start-line="25" selection-start-column="6" selection-end-line="25" selection-end-column="6" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/views/origami/home/index.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="311">
@@ -995,14 +852,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/config/routes.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="489">
<caret line="102" column="31" lean-forward="false" selection-start-line="102" selection-start-column="31" selection-end-line="102" selection-end-column="31" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/controllers/api/bill_controller.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="129">
@@ -1043,14 +892,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/models/sale.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="184">
<caret line="572" column="0" lean-forward="false" selection-start-line="572" selection-start-column="0" selection-end-line="578" selection-end-column="3" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.3/lib/active_support/core_ext/object/blank.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="184">
@@ -1088,7 +929,7 @@
<state relative-caret-position="126">
<caret line="7" column="13" lean-forward="false" selection-start-line="7" selection-start-column="13" selection-end-line="7" selection-end-column="13" />
<folding>
<element signature="n#style#0;n#tr#1;n#tbody#0;n#table#0;n#div#0;n#div#0;n#div#0;n#!!top" expanded="true" />
<element signature="n#style#0;n#tr#1;n#tbody#0;n#table#0;n#div#0;n#div#0;n#div#0;n#!!top" expanded="false" />
</folding>
</state>
</provider>
@@ -1106,7 +947,7 @@
<state relative-caret-position="412">
<caret line="29" column="13" lean-forward="false" selection-start-line="29" selection-start-column="13" selection-end-line="29" selection-end-column="13" />
<folding>
<element signature="n#style#0;n#tr#1;n#tbody#0;n#table#0;n#div#0;n#div#0;n#div#3;n#!!top" expanded="true" />
<element signature="n#style#0;n#tr#1;n#tbody#0;n#table#0;n#div#0;n#div#0;n#div#3;n#!!top" expanded="false" />
</folding>
</state>
</provider>
@@ -1119,14 +960,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/views/settings/commissions/load_commissioners.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="249">
<caret line="122" column="46" lean-forward="true" selection-start-line="122" selection-start-column="46" selection-end-line="122" selection-end-column="46" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/controllers/reports/commission_controller.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="216">
@@ -1151,34 +984,14 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/views/settings/promotions/_form.html.erb">
<entry file="file://$PROJECT_DIR$/Gemfile">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-1366">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<state relative-caret-position="12">
<caret line="93" column="10" lean-forward="false" selection-start-line="93" selection-start-column="10" selection-end-line="93" selection-end-column="10" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/views/settings/promotions/new.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="234">
<caret line="13" column="33" lean-forward="true" selection-start-line="13" selection-start-column="33" selection-end-line="13" selection-end-column="33" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/assets/javascripts/application.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="342">
<caret line="25" column="33" lean-forward="false" selection-start-line="25" selection-start-column="33" selection-end-line="25" selection-end-column="33" />
<folding>
<element signature="n#!!doc" expanded="true" />
<marker date="1504065881000" expanded="true" signature="2006:2033" ph="..." />
<marker date="1504065881000" expanded="true" signature="2829:2856" ph="..." />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/assets/stylesheets/application.scss">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="144">
@@ -1187,34 +1000,235 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Gemfile">
<entry file="file://$PROJECT_DIR$/app/assets/javascripts/application.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="12">
<caret line="93" column="10" lean-forward="false" selection-start-line="93" selection-start-column="10" selection-end-line="93" selection-end-column="10" />
<state relative-caret-position="342">
<caret line="25" column="33" lean-forward="false" selection-start-line="25" selection-start-column="33" selection-end-line="25" selection-end-column="33" />
<folding>
<element signature="n#!!doc" expanded="false" />
<marker date="1504065881000" expanded="true" signature="2006:2033" ph="..." />
<marker date="1504065881000" expanded="true" signature="2829:2856" ph="..." />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/views/settings/promotions/new.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="234">
<caret line="13" column="33" lean-forward="true" selection-start-line="13" selection-start-column="33" selection-end-line="13" selection-end-column="33" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/views/settings/promotions/_form.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-1395">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/views/origami/in_juties/new.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="144">
<caret line="8" column="55" lean-forward="false" selection-start-line="8" selection-start-column="55" selection-end-line="8" selection-end-column="55" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/views/origami/in_juties/index.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="142">
<caret line="56" column="21" lean-forward="false" selection-start-line="56" selection-start-column="12" selection-end-line="56" selection-end-column="21" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/views/origami/in_juties/index_in_juty.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="836">
<caret line="77" column="0" lean-forward="false" selection-start-line="77" selection-start-column="0" selection-end-line="77" selection-end-column="0" />
<state relative-caret-position="194">
<caret line="38" column="14" lean-forward="false" selection-start-line="38" selection-start-column="14" selection-end-line="38" selection-end-column="14" />
<folding>
<element signature="e#1270#1276#0#HTML" expanded="true" />
<element signature="e#1276#1282#0#HTML" expanded="true" />
<element signature="e#1370#1376#0#HTML" expanded="true" />
<element signature="e#1376#1382#0#HTML" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/views/origami/in_juties/_form.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="68">
<caret line="15" column="54" lean-forward="false" selection-start-line="15" selection-start-column="54" selection-end-line="15" selection-end-column="54" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.3/lib/active_support/callbacks.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="197">
<caret line="131" column="0" lean-forward="false" selection-start-line="131" selection-start-column="0" selection-end-line="131" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/controllers/origami/in_juties_controller.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="93">
<caret line="10" column="0" lean-forward="false" selection-start-line="10" selection-start-column="0" selection-end-line="10" selection-end-column="0" />
<state relative-caret-position="452">
<caret line="29" column="0" lean-forward="false" selection-start-line="29" selection-start-column="0" selection-end-line="29" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/views/origami/in_juties/_assign_in_juty.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="197">
<caret line="15" column="133" lean-forward="false" selection-start-line="15" selection-start-column="133" selection-end-line="15" selection-end-column="133" />
<state relative-caret-position="-215">
<caret line="1" column="38" lean-forward="false" selection-start-line="1" selection-start-column="38" selection-end-line="1" selection-end-column="38" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/views/origami/in_juties/_edit_in_juty.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="198">
<caret line="11" column="29" lean-forward="false" selection-start-line="11" selection-start-column="29" selection-end-line="11" selection-end-column="29" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/db/migrate/20170825090115_create_commissioners.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="2" selection-end-line="1" selection-end-column="47" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/db/migrate/20170824110117_create_stock_journals.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/views/inventory/inventory_definitions/new.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="162">
<caret line="9" column="18" lean-forward="false" selection-start-line="9" selection-start-column="18" selection-end-line="9" selection-end-column="18" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/views/inventory/inventory_definitions/index.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/models/inventory_definition.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="6" lean-forward="false" selection-start-line="0" selection-start-column="6" selection-end-line="0" selection-end-column="6" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/controllers/inventory/inventory_definitions_controller.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="270">
<caret line="15" column="9" lean-forward="false" selection-start-line="15" selection-start-column="9" selection-end-line="15" selection-end-column="9" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/.gitignore">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="287">
<caret line="56" column="0" lean-forward="true" selection-start-line="56" selection-start-column="0" selection-end-line="56" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/views/inventory/inventory_definitions/_form.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="180">
<caret line="10" column="12" lean-forward="false" selection-start-line="10" selection-start-column="12" selection-end-line="10" selection-end-column="12" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/db/migrate/20170824110103_create_inventory_definitions.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="162">
<caret line="9" column="18" lean-forward="false" selection-start-line="9" selection-start-column="18" selection-end-line="9" selection-end-column="18" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/views/settings/commissions/load_commissioners.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="2988">
<caret line="166" column="35" lean-forward="false" selection-start-line="166" selection-start-column="35" selection-end-line="166" selection-end-column="35" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/config/routes.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="280">
<caret line="183" column="9" lean-forward="false" selection-start-line="183" selection-start-column="9" selection-end-line="183" selection-end-column="9" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/controllers/settings/commissions_controller.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1066">
<caret line="64" column="5" lean-forward="false" selection-start-line="64" selection-start-column="5" selection-end-line="64" selection-end-column="5" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/controllers/origami/product_commissions_controller.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="182">
<caret line="95" column="25" lean-forward="false" selection-start-line="95" selection-start-column="25" selection-end-line="95" selection-end-column="25" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/models/sale.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="224">
<caret line="265" column="6" lean-forward="false" selection-start-line="265" selection-start-column="6" selection-end-line="265" selection-end-column="6" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/controllers/origami/sale_edit_controller.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="69">
<caret line="62" column="21" lean-forward="false" selection-start-line="62" selection-start-column="21" selection-end-line="62" selection-end-column="21" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/views/origami/product_commissions/load_commissioners.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="199">
<caret line="74" column="27" lean-forward="false" selection-start-line="74" selection-start-column="27" selection-end-line="74" selection-end-column="27" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/views/origami/home/show.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="247">
<caret line="267" column="32" lean-forward="true" selection-start-line="267" selection-start-column="32" selection-end-line="267" selection-end-column="32" />
<folding />
</state>
</provider>

View File

@@ -12,6 +12,12 @@ $(function(){
qty = $(this).val();
price = $("#unit_price").text();
$("#total_price").text(qty*price);
});
$("#set_change_qty").change(function(){
qty = $(this).val();
price = $("#set_total_price").text();
$("#set_total_price").text(qty*price);
});
//show menu item list when click menu category
@@ -58,8 +64,8 @@ $(function(){
data_target = 'sx_item_detailModal'
}
row = '<div class="card">'
+'<div class="card-head" style="line-height:14px;">'
row = '<div class="card custom-card">'
+'<div class="custom-card-head card-head" style="line-height:14px;">'
+'<small class="col-md-9">'+ menu_items[field].name +'</small>'
+"<div class='col-md-3 add_icon' data-item-code='"
+ menu_items[field].code +"' data-name='"
@@ -81,12 +87,12 @@ $(function(){
+JSON.stringify(menu_items[field].options)+"' data-item-sets = '"
+JSON.stringify(menu_items[field].item_sets)+"' data-toggle='modal' data-target='."+data_target+"'>"
+"<div class='card-block'>"
+"<div class='card-block custom-card-block'>"
+"<img id='logo' src='/image/logo.png'>"
+"</div>"
+'<div class="card-footer">'
+'<div class="card-footer custom-card-footer">'
+'<small>'+ price +'</small>'
+'</div>'
+'</div>';
@@ -98,23 +104,13 @@ $(function(){
//end Ajax
}
//end show list function
//click item row for add order
//click item row for item set
$(document).on('click', '.set_item_box', function(event){
$(".instance-list").empty();
$(".options-list").empty();
data = $(this).parent().children().children('.add_icon');
item_options = $(this).data('option');
for(var field in item_options) {
value = item_options[field]["values"];
type = item_options[field]["type"];
row = "<p style='font-size:15px'>"+type+"</p>"
$(value).each(function(i){
row +="<button class='btn btn-default option_btn "+ type +"' data-type='"+type+"' data-value='"
+value[i]+"'>"+value[i]+"</button>";
});
$(".opt-list").append(row);
}
instances = $(this).data('instance');
item_sets = $(this).data('item-sets');
@@ -123,21 +119,26 @@ $(function(){
$(value).each(function(i){
$.ajax({
type: "GET",
url: '../../settings/menu_item_instances/get_instance/'+value[i]["id"],
url: '../../api/restaurant/menu_item_instances/'+value[i]["id"],
data: {id:value[i]},
success:function(result){
// var image_path = ""
console.log(result)
row = '<div class="col-md-4 instance_box" >'
+'<div class="card">'
+'<div class="card-head" style="line-height:14px;">'
success:function(result){
row = '<div class="col-md-4 " >'
+"<div class='card custom-card instance_box' data-name='"+result["name"]
+"' data-code='"+result["code"]
+"' data-price='"+result["price"]
+"' data-option='"+JSON.stringify(result["options"])
+"'>"
+'<div class="custom-card-head card-head" style="line-height:14px;">'
+'<small class="">'+result["name"]+'</small>'
+'</div>'
+'<div class="card-block">'
+'<img id="" src="/image/logo.png">'
+'<div class="card-block custom-card-block">'
+'<img id="" src="/image/logo.png" height="40px">'
+' <small style="float:" id="instance_option"></small>'
+'</div>'
+'<div class="card-footer">'
+'<div class="card-footer custom-card-footer">'
+' <small>'+result["price"]+'</small>'
// +' <small style="float:right" id="instance_option"></small>'
+'</div>'
+'</div>'
+' </div>'
@@ -146,16 +147,97 @@ $(function(){
}
});
});
}
$('#change_qty').val(1);
$('#item_instances').text(instances);
$('#title_name').text(data.attr('data-name'));
$('#item_code').text(data.attr('data-item-code'));
$('#total_price').text(data.attr('data-price'));
$('#unit_price').text(data.attr('data-price'));
$('#set_change_qty').val(1);
$('#set_item_instances').text(instances);
$('#set_name').text(data.attr('data-name'));
$('#set_item_code').text(data.attr('data-item-code'));
$('#set_total_price').text(data.attr('data-price'));
$('#set_unit_price').text(data.attr('data-price'));
});
// click instance for add item set
$(document).on('click', '.instance_box', function(event){
$(".options-list").empty();
item_options = $(this).data('option');
code = $(this).data('code');
for(var field in item_options) {
value = item_options[field]["values"];
type = item_options[field]["type"];
row = "<p style='font-size:16px;margin-bottom:3px'>"+type+"</p>"
$(value).each(function(i){
row +="<button class='btn btn-default btn-sm option_btn "+ type +"' data-type='"
+type+"' data-value='"+value[i]+"' data-code='"+code+"' data-group='set_menu'>"
+value[i]+"</button>";
});
$(".options-list").append(row);
}
if($(this).hasClass('selected-instance') == true){
sub_total = $('#set_total_price').text();
name = $(this).data('name');
price = $(this).data('price');
qty = $('#set_change_qty').val();
total = qty*price;
var total_price = +sub_total - +total;
$(this).removeClass('selected-instance');
$(".options-list").empty();
$(this).removeAttr('data-options');
$('#instance_option').text('')
}else {
sub_total = $('#set_total_price').text();
name = $(this).data('name');
price = $(this).data('price');
qty = $('#set_change_qty').val();
total = qty*price;
var total_price = +sub_total + +total;
$(this).addClass('selected-instance');
}
$('#set_total_price').text(total_price);
}); //End selecct attribute buttom
// click add order
$(document).on('click', '.set_order', function(event){
total_price = $('#set_total_price').text();
qty = parseInt($('#set_change_qty').val());
item_code = $('#set_item_code').text();
item_name = $('#set_name').text();
var items = $('.selected-instance');
attribute_arr = []
option_arr = []
var rowCount = $('.summary-items tbody tr').length+1;
$(items).each(function(i){
code = $(items[i]).attr('data-code');
name = $(items[i]).attr('data-name');
price = $(items[i]).attr('data-price');
option = $(items[i]).attr('data-options');
total = qty * price ;
option_arr.push(option);
row ="<tr class='item_box' data-price ='"
+price+ "' data-toggle='modal' data-target='#sx_itemModal' 'data-instance ='"
+name+ "' data-code='"+item_code+"' data-instance-code='"
+code+"' data-attributes='"
+attribute_arr+"' data-options ='"
+option_arr+"' data-row ='"+rowCount+ "'>"
+'<td class="item-cell-no">'+rowCount+'</td>'
+'<td class="item-cell-name" id="item_name" >' + item_name+ ' ' + name +'</td>'
+'<td class="item-cell-qty" id="item_qty">' + qty + '</td>'
+'<td class="item-cell-price" id="item_price">'
+ parseFloat(total).toFixed(2)
+'</td>'
+'</tr>';
$(".summary-items tbody").append(row);
rowCount = rowCount + 1;
});
calculate_sub_total();
}); //End add order Click
//click item row for add order
$(document).on('click', '.menu_item_box', function(event){
$('.attributes-list').empty();
@@ -214,8 +296,8 @@ $(function(){
type = item_options[field]["type"];
row = "<h4>"+type+"</h4>"
$(value).each(function(i){
row +="<button class='btn btn-default option_btn "+ type +"' data-type='"+type+"' data-value='"
+value[i]+"'>"+value[i]+"</button>";
row +="<button class='btn btn-default option_btn "+ type +"' data-type='"
+type+"' data-value='"+value[i]+"' data-group='simple_menu'>"+value[i]+"</button>";
});
$(".options-list").append(row);
}
@@ -271,13 +353,28 @@ $(function(){
$(document).on('click', '.option_btn', function(event){
value = $(this).data('value');
type = $(this).data('type');
options = $(".option_btn");
group = $(this).data('group');
options = $(".option_btn");
$(options).each(function(i){
if ($(options[i]).attr('data-type')==type){
$('.'+type).removeClass("selected-option");
}
});
$(this).addClass('selected-option');
if(group == "set_menu"){
code = $(this).data('code');
value = $(this).data('value');
instance = $(".selected-instance");
$(instance).each(function(i){
if ($(instance[i]).attr('data-code')==code){
option_arr = get_selected_attributes('selected-option');
$(instance[i]).attr('data-options',JSON.stringify(option_arr));
$(instance[i]).children().children('#instance_option').text(option_arr);
}
});
}
}); //End selecct attribute buttom
@@ -310,7 +407,7 @@ $(function(){
show_item_detail(item_data);
calculate_sub_total();
}); //End Add Icon Click
}); //End add order Click
// click plus icon for add
$(document).on('click', '.add_icon', function(event){
@@ -320,6 +417,7 @@ $(function(){
}); //End Add Icon Click
function show_item_detail(data){
console.log(data)
qty = parseInt(data.attr('data-qty'));
append = 0;
price = parseFloat(data.attr('data-price')).toFixed(2);
@@ -376,11 +474,11 @@ $(function(){
// Pay Discount for Payment
$("#create_order").on('click', function(e){
e.preventDefault();
$( "#loading_wrapper" ).show();
$("#loading_wrapper").show();
var table_id = $('#table_id').text();
var booking_id = $('#booking_id').text();
if (!booking_id.length > 0) {
console.log("hi")
var params = {'order_source': "cashier", 'order_type': "dine_in",
'customer_id': "", 'guest_info': "",'booking_id':booking_id,
'table_id': table_id,
@@ -390,7 +488,7 @@ $(function(){
var order_items = JSON.stringify(get_order_item_rows());
var ajax_url = '../addorders/create';
console.log(ajax_url)
var params = {'order_source': "cashier", 'order_type': "dine_in",
'customer_id': "", 'guest_info': "",
@@ -403,10 +501,10 @@ $(function(){
data: params,
dataType: "json",
success:function(result){
$( "#loading_wrapper" ).show();
$("#loading_wrapper").hide();
$.confirm({
title: 'Infomation!',
content: "result.status",
content: "Order has been successfully created",
buttons: {
confirm: {
text: 'Ok',
@@ -495,12 +593,13 @@ $(function(){
});
}
/* Get discount Item rows */
/* Get Item rows */
function get_order_item_rows(){
var order_items = [];
var item_row = $('.summary-items tbody tr');
$(item_row).each(function(i){
var order_item = {};
console.log($(item_row[i]).attr('data-options'));
order_item.order_item_id = $(item_row[i]).attr('data-row');
order_item.item_instance_code = $(item_row[i]).attr('data-instance-code');
order_item.quantity = $(item_row[i]).children('#item_qty').text();
@@ -509,7 +608,7 @@ $(function(){
});
return order_items;
}
// Get Selected Class
function get_selected_attributes(selected_class) {
var item_row = $('.'+selected_class);
var attribute_arr = [];

View File

@@ -4,20 +4,26 @@
@import "jquery-ui";
@import "bootstrap-datepicker3";
.card-head{
.custom-card-head{
height: 40px;
background-color: #54A5AF;
padding:5px;
color :#fff;
}
.instance_box{
margin-bottom:10px;
}
.card-block {
}
.custom-card {
border: 2px solid rgba(0, 0, 0, 0.125) !important;
}
.custom-card-footer{
padding:0.35rem 1.25rem !important;
}
.custom-card-block {
padding: 0.3rem !important;
}
}
@media (min-width: 34em) {
.card-columns {
.custom-card-columns {
-webkit-column-count: 2;
-moz-column-count: 2;
column-count: 2;
@@ -25,7 +31,7 @@
}
@media (min-width: 48em) {
.card-columns {
.custom-card-columns {
-webkit-column-count: 3;
-moz-column-count: 3;
column-count: 3;
@@ -33,7 +39,7 @@
}
@media (min-width: 62em) {
.card-columns {
.custom-card-columns {
-webkit-column-count: 4;
-moz-column-count: 4;
column-count: 4;
@@ -41,7 +47,7 @@
}
@media (min-width: 75em) {
.card-columns {
.custom-card-columns {
-webkit-column-count: 4;
-moz-column-count: 4;
column-count: 4;
@@ -67,7 +73,7 @@
border-color: #fff #fff #fff #54A5AF;
}
.modal-dialog {
.custom-modal-dialog {
left:auto;
right: auto;
width: 100%;
@@ -76,9 +82,7 @@
element.style {
padding-top: 0px !important;
}
.item-modal{
}
.selected-attribute {
color: #fff !important;
background-color: green !important;
@@ -87,18 +91,19 @@ element.style {
color: #fff !important;
background-color: green !important;
}
.selected-instance {
border: 2px solid #7a62d3 !important;
}
.attribute_btn {
white-space: normal !important;
height: 40px;
/*width: 80px;*/
margin-bottom: 5px;
margin-right: 5px;
}
.option_btn {
white-space: normal !important;
height: 40px;
/*width: 80px;*/
margin-bottom: 5px;
margin-right: 5px;
}
@@ -115,4 +120,33 @@ element.style {
height: 80px;
border: 1px solid #54A5AF;
padding: 10px;
}
.instance_box{
margin-bottom:10px;
}
/*Loading gif for payment*/
#loading_wrapper{
position: fixed;
background-color: #C8C8C8 ;
height: 100%;
width: 100%;
left: 0;
opacity: 0.6;
top: 0;
z-index: 9999999;
}
#loading{
position: relative;
height: 100%;
width: 100%;
background-image: url('../../../image/loading-ajax.gif');
background-position: center center;
background-repeat: no-repeat;
opacity: 1;
filter: alpha(opacity=100); /* ie */
-moz-opacity: 1; /* mozilla */
}

View File

@@ -0,0 +1,9 @@
class Api::Restaurant::MenuItemInstancesController < Api::ApiController
skip_before_action :authenticate
#Description
# Pull the default menu details and also other available (active) menus
# Input Params - order_id
def show
@id = MenuItemInstance.find(params[:id])
end
end

View File

@@ -1,6 +1,6 @@
class Inventory::InventoryController < BaseInventoryController
def index
@products = InventoryDefinition.all.active.order('created_at desc')
end
end

View File

@@ -28,7 +28,7 @@ class Inventory::InventoryDefinitionsController < BaseInventoryController
respond_to do |format|
if @inventory_definition.save
format.html { redirect_to @inventory_definition, notice: 'Inventory definition was successfully created.' }
format.html { redirect_to inventory_path, notice: 'Inventory definition was successfully created.' }
format.json { render :show, status: :created, location: @inventory_definition }
else
format.html { render :new }
@@ -69,6 +69,6 @@ class Inventory::InventoryDefinitionsController < BaseInventoryController
# Never trust parameters from the scary internet, only allow the white list through.
def inventory_definition_params
params.fetch(:inventory_definition, {})
params.require(:inventory_definition).permit(:item_code, :min_order_level, :max_stock_level)
end
end

View File

@@ -1,4 +1,4 @@
class StockCheckItemsController < ApplicationController
class Inventory::StockCheckItemsController < BaseInventoryController
before_action :set_stock_check_item, only: [:show, :edit, :update, :destroy]
# GET /stock_check_items
@@ -28,7 +28,7 @@ class StockCheckItemsController < ApplicationController
respond_to do |format|
if @stock_check_item.save
format.html { redirect_to @stock_check_item, notice: 'Stock check item was successfully created.' }
format.html { redirect_to inventory_stock_checks_path, notice: 'Stock check item was successfully created.' }
format.json { render :show, status: :created, location: @stock_check_item }
else
format.html { render :new }
@@ -69,6 +69,6 @@ class StockCheckItemsController < ApplicationController
# Never trust parameters from the scary internet, only allow the white list through.
def stock_check_item_params
params.fetch(:stock_check_item, {})
params.require(:stock_check_item).permit(:item_code, :stock_count)
end
end

View File

@@ -1,74 +1,114 @@
class StockChecksController < ApplicationController
before_action :set_stock_check, only: [:show, :edit, :update, :destroy]
class Inventory::StockChecksController < BaseInventoryController
def index
@check = StockCheck.new
end
def create
item_list = JSON.parse(params[:stock_item])
reason = params[:reason]
check = StockCheck.new
@check = check.create(current_user, reason, item_list)
end
def show
@check = StockCheck.find(params[:id])
end
def save_to_journal
check = params[:data]
stockCheck = StockCheck.find(check)
stockCheck.stock_check_items.each do |item|
StockJournal.from_stock_check(item)
end
end
def print_stock_check
stock_id = params[:stock_check_id] # sale_id
stockcheck = StockCheck.find(stock_id)
stockcheck_items = stockcheck.stock_check_items
member_info = nil
unique_code = "StockPrint"
shop_details = Shop.find(1)
checker = Employee.find(stockcheck.check_by)
print_settings=PrintSetting.find_by_unique_code(unique_code)
printer = Printer::ReceiptPrinter.new(print_settings)
printer.print_stock_check_result(print_settings,stockcheck, stockcheck_items,checker.name, shop_details)
end
# 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
# 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

@@ -37,6 +37,7 @@ class Origami::AddordersController < BaseOrigamiController
def create
Rails.logger.debug "Order Source - " + params[:order_source].to_s
Rails.logger.debug "Table ID - " + params[:table_id].to_s
puts params[:order_items]
items_arr = []
JSON.parse(params[:order_items]).each { |i|
items = {"order_item_id": i["order_item_id"],"item_instance_code": i["item_instance_code"],"quantity": i["quantity"],"options": i["options"]}

View File

@@ -1,5 +1,5 @@
class Origami::InJutiesController < BaseOrigamiController
before_action :set_in_juty, only: [:show, :edit, :update, :edit_in_juty, :update_for_in_juty , :destroy ,:destroy_in_juty]
before_action :set_in_juty, only: %i[show edit update edit_in_juty update_for_in_juty destroy destroy_in_juty]
# GET /in_juties
# GET /in_juties.json
@@ -8,11 +8,12 @@ class Origami::InJutiesController < BaseOrigamiController
end
def index_in_juty
@juty_in= InJuty.where("dinning_id=?",params[:table_id])
@juty_in = InJuty.where('dinning_id=?', params[:table_id])
@table = DiningFacility.find(params[:table_id])
@in_juty = InJuty.new
@in_juty = InJuty.new
@juties_in = Kaminari.paginate_array(@juty_in).page(params[:page]).per(10)
end
# GET /in_juties/1
# GET /in_juties/1.json
def show
@@ -20,12 +21,15 @@ class Origami::InJutiesController < BaseOrigamiController
# GET /in_juties/new
def new
# this one use for new
@in_juty = InJuty.new
@table = DiningFacility.find(params[:table_id])
@commissioner = @in_juty.commissioner
render partial: 'form'
end
# GET /in_juties/1/edit
def edit
end
def edit_in_juty
@@ -33,13 +37,15 @@ class Origami::InJutiesController < BaseOrigamiController
@table = DiningFacility.find(params[:table_id])
@commissioner = @in_juty.commissioner
render json: {in_juty: @in_juty, commissioner: @commissioner}
# render json: {in_juty: @in_juty, commissioner: @commissioner}
render partial: 'form'
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
@@ -57,32 +63,53 @@ class Origami::InJutiesController < BaseOrigamiController
end
def create_for_in_juty
# this one use for create and update
in_juty = in_juty_params
in_time = DateTime.new in_juty['in_time(1i)'].to_i, in_juty['in_time(2i)'].to_i, in_juty['in_time(3i)'].to_i, in_juty['in_time(4i)'].to_i, in_juty['in_time(5i)'].to_i
in_time = in_time.change(offset: '+06:30')
out_time = DateTime.new in_juty['out_time(1i)'].to_i, in_juty['out_time(2i)'].to_i, in_juty['out_time(3i)'].to_i, in_juty['out_time(4i)'].to_i, in_juty['out_time(5i)'].to_i
out_time = out_time.change(offset: '+06:30')
@in_juty = InJuty.new
in_juty_id = in_juty[:id]
unless in_juty_id.nil?
@in_juty = InJuty.find(in_juty_id.to_i)
end
@in_juty.dinning_id = in_juty_params[:dinning_id]
@in_juty.commissioner_ids = in_juty_params[:commissioner_ids]
@in_juty.in_time = in_juty_params[:in_time]
@in_juty.out_time = in_juty_params[:out_time]
@in_juty.in_time = in_time
@in_juty.out_time = out_time
respond_to do |format|
if @in_juty.save
format.html { redirect_to origami_index_in_juty_path(in_juty_params[:dinning_id]), notice: 'In juty was successfully created.' }
format.json { render :show, status: :created, location: @in_juty }
if in_juty_id.nil?
format.html { redirect_to origami_index_in_juty_path(in_juty_params[:dinning_id]), notice: 'In juty was successfully created.' }
format.json { render :show, status: :created, location: @in_juty }
else
format.html { redirect_to origami_index_in_juty_path(in_juty_params[:dinning_id]), notice: 'In juty was successfully updated.' }
format.json { render :show, status: :created, location: @in_juty }
end
else
format.html { render :new }
format.json { render json: @in_juty.errors, status: :unprocessable_entity }
end
end
end
# PATCH/PUT /in_juties/1
# PATCH/PUT /in_juties/1.json
def update
in_juty = in_juty_params
in_time = DateTime.new in_juty['in_time(1i)'].to_i, in_juty['in_time(2i)'].to_i, in_juty['in_time(3i)'].to_i, in_juty['in_time(4i)'].to_i, in_juty['in_time(5i)'].to_i
in_time = in_time.change(offset: '+06:30')
out_time = DateTime.new in_juty['out_time(1i)'].to_i, in_juty['out_time(2i)'].to_i, in_juty['out_time(3i)'].to_i, in_juty['out_time(4i)'].to_i, in_juty['out_time(5i)'].to_i
out_time = out_time.change(offset: '+06:30')
@in_juty.commissioner_ids = in_juty_params[:commissioner_ids]
@in_juty.in_time = in_time
@in_juty.out_time = out_time
respond_to do |format|
if @in_juty.update(in_juty_params)
format.html { redirect_to origami_in_juty_path(@in_juty), notice: 'In juty was successfully updated.' }
if @in_juty.save
format.html { redirect_to origami_index_in_juty_path(in_juty_params[:dinning_id]), notice: 'In juty was successfully updated.' }
format.json { render :show, status: :ok, location: @in_juty }
else
format.html { render :edit }
@@ -91,28 +118,32 @@ class Origami::InJutiesController < BaseOrigamiController
end
end
def update_for_in_juty
@in_juty.commissioner_ids = in_juty_params[:commissioner_ids]
@in_juty.in_time = in_juty_params[:in_time]
@in_juty.out_time = in_juty_params[:out_time]
respond_to do |format|
if @in_juty.save
format.html { redirect_to origami_index_in_juty_path(in_juty_params[:dinning_id]), notice: 'In juty was successfully updated.' }
format.json { render :show, status: :ok, location: @in_juty }
else
format.html { render :edit }
format.json { render json: @in_juty.errors, status: :unprocessable_entity }
end
end
def update_for_in_juty
in_juty = in_juty_params
in_time = DateTime.new in_juty['in_time(1i)'].to_i, in_juty['in_time(2i)'].to_i, in_juty['in_time(3i)'].to_i, in_juty['in_time(4i)'].to_i, in_juty['in_time(5i)'].to_i
in_time = in_time.change(offset: '+06:30')
out_time = DateTime.new in_juty['out_time(1i)'].to_i, in_juty['out_time(2i)'].to_i, in_juty['out_time(3i)'].to_i, in_juty['out_time(4i)'].to_i, in_juty['out_time(5i)'].to_i
out_time = out_time.change(offset: '+06:30')
@in_juty.commissioner_ids = in_juty_params[:commissioner_ids]
@in_juty.in_time = in_time
@in_juty.out_time = out_time
respond_to do |format|
if @in_juty.save
format.html { redirect_to origami_index_in_juty_path(in_juty_params[:dinning_id]), notice: 'In juty was successfully updated.' }
format.json { render :show, status: :ok, location: @in_juty }
else
format.html { render :edit }
format.json { render json: @in_juty.errors, status: :unprocessable_entity }
end
end
end
# DELETE /in_juties/1
# DELETE /in_juties/1.json
def destroy
@in_juty.destroy
respond_to do |format|
format.html { redirect_to origami_in_juties_path, notice: 'In juty was successfully destroyed.' }
format.html { redirect_to origami_in_juties_path, notice: 'In juty was successfully removed.' }
format.json { head :no_content }
end
end
@@ -122,19 +153,20 @@ class Origami::InJutiesController < BaseOrigamiController
@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.html { redirect_to origami_index_in_juty_path(@table_id), notice: 'In juty was successfully removed.' }
format.json { head :no_content }
end
end
private
# Use callbacks to share common setup or constraints between actions.
def set_in_juty
@in_juty = InJuty.find(params[:id])
end
# Never trust parameters from the scary internet, only allow the white list through.
def in_juty_params
params.require(:in_juty).permit(:id,:dinning_id,:commissioner_ids,:in_time,:out_time)
end
# Use callbacks to share common setup or constraints between actions.
def set_in_juty
@in_juty = InJuty.find(params[:id])
end
# Never trust parameters from the scary internet, only allow the white list through.
def in_juty_params
params.require(:in_juty).permit(:id, :dinning_id, :commissioner_ids, :in_time, :out_time)
end
end

View File

@@ -61,6 +61,26 @@ class Origami::ProductCommissionsController < ApplicationController
end
end
def load_commissioners
sale_id = params[:sale_id]
@table_id = params[:table_id]
@saleobj = Sale.find(sale_id)
@commissioners = []
end
def select_sale_item
sale_item_id = params[:sale_item_id]
@selected_sale_item = SaleItem.find_by_sale_item_id(sale_item_id)
@product_commission = ProductCommission.find_by_sale_item_id(@selected_sale_item.id)
unless @product_commission.nil?
selected_commissioner = @product_commission.commissioner
end
@commissioners = Commissioner.active.all
render json: {commissioner: @commissioners, selected_commissioner: selected_commissioner}
end
def set_commissioner_to_sale_item
# byebug
deselect = false

View File

@@ -64,31 +64,6 @@ class Settings::CommissionsController < ApplicationController
end
end
def load_commissioners
sale_id = params[:sale_id]
@table_id = params[:table_id]
@saleobj = Sale.find(sale_id)
@commissioners = []
end
def select_sale_item
# byebug
sale_item_id = params[:sale_item_id]
@selected_sale_item = SaleItem.find_by_sale_item_id(sale_item_id)
@product_commission = ProductCommission.find_by_sale_item_id(@selected_sale_item.id)
unless @product_commission.nil?
selected_commissioner = @product_commission.commissioner
end
@commissioners = Commissioner.active.all
# respond_to do |format|
# format.json {render json: {[@commissioners],[@selected_sale_item]}}
# # format.html {render @commissioners}
# end
render json: {commissioner: @commissioners, selected_commissioner: selected_commissioner}
end
private
# Use callbacks to share common setup or constraints between actions.
def set_commission

View File

@@ -76,6 +76,17 @@ class Settings::PromotionsController < ApplicationController
end
end
def find_item_instance
item = MenuItem.find_by_item_code(params[:item_code])
if item.nil?
product = Product.where("item_code = ?",params[:item_code]).pluck(:name,:item_code)
render json: product
else
menu_instance = MenuItemInstance.where("menu_item_id = ?",item.id).pluck(:item_instance_name,:item_instance_code)
render json: menu_instance
end
end
private
# Use callbacks to share common setup or constraints between actions.
def set_promotion

View File

@@ -0,0 +1,9 @@
class InventoryJob < ApplicationJob
queue_as :default
def perform(sale_id)
saleObj = Sale.find(sale_id)
InventoryDefinition.calculate_product_count(saleObj)
end
end

View File

@@ -1,2 +1,41 @@
class InventoryDefinition < ApplicationRecord
scope :active, -> {where(:is_active => true)}
def self.calculate_product_count(saleObj)
saleObj.sale_items.each do |item|
found, inventory_definition = find_product_in_inventory(item)
if found
check_balance(item,inventory_definition)
end
end
end
def self.find_product_in_inventory(item)
product = InventoryDefinition.find_by_item_code(item.product_code)
if product.nil?
return false, nil
else
return true, product
end
end
def self.check_balance(item,inventory_definition) # item => saleItemOBj
stock = StockJournal.where('item_code=?', item.product_code).order('created_at desc').take
unless stock.nil?
modify_balance(item, stock, inventory_definition)
else
StockJournal.add_to_journal(item, 0, "out of stock", inventory_definition)
end
end
def self.modify_balance(item, stock, inventory_definition) #saleitemObj
if stock.balance.to_i >= item.qty
puts ">> stock is greater than orde qty"
StockJournal.add_to_journal(item, stock.balance, "ok", inventory_definition)
else
puts " << stock is less than order qty"
StockJournal.add_to_journal(item, stock.balance, "out of stock", inventory_definition)
end
end
end

View File

@@ -19,6 +19,7 @@ class MenuItem < ApplicationRecord
scope :simple_menu_item, -> { where(type: 'SimpleMenuItem') }
scope :set_menu_item, -> { where(type: 'SetMenuItem') }
scope :active, -> { where(is_available: true) }
# Item Image Uploader
mount_uploader :image_path, MenuItemImageUploader

View File

@@ -1,6 +1,7 @@
class MenuItemAttribute < ApplicationRecord
validates_presence_of :attribute_type, :name, :value
def self.collection
MenuItemAttribute.select("name").map { |e| [e.name, e.name] }
MenuItemAttribute.select("id, name").map { |e| [e.name, e.id] }
# MenuItemAttribute.select("name").map { |e| [e.name, e.name] }
end
end

View File

@@ -74,7 +74,7 @@ class Printer::ReceiptPrinter < Printer::PrinterWorker
# print as print copies in printer setting
count = printer_settings.print_copies
begin
begin
if count == 1
pdf.render_file "tmp/receipt_bill_#{sale_data.receipt_no}.pdf"
self.print("tmp/receipt_bill_#{sale_data.receipt_no}.pdf")
@@ -84,9 +84,16 @@ class Printer::ReceiptPrinter < Printer::PrinterWorker
end
count -= 1
end until count == 0
end until count == 0
end
# stock check
def print_stock_check_result(print_settings,stockcheck, stockcheck_items,checker_name, shop_details)
pdf = StockResultPdf.new(print_settings,stockcheck, stockcheck_items,checker_name, shop_details)
pdf.render_file "tmp/print_stock_check_result.pdf"
self.print("tmp/print_stock_check_result.pdf")
end
#Queue No Print
def print_queue_no(printer_settings,queue)
#Use CUPS service

View File

@@ -23,7 +23,7 @@ class Promotion < ApplicationRecord
end
def self.is_between_promo_datetime(current_day,current_time) #database is not local time
promoList = Promotion.where("(date_format(promo_start_date, 'YYYY-MM-DD') <=? AND date_format(promo_end_date, 'YYYY-MM-DD') >=?) AND (promo_start_hour < ? AND promo_end_hour > ?)", current_day, current_day, current_time, current_time)
promoList = Promotion.where("(TO_CHAR(promo_start_date, 'YYYY-MM-DD') <=? AND TO_CHAR(promo_end_date, 'YYYY-MM-DD') >=?) AND (promo_start_hour < ? AND promo_end_hour > ?)", current_day, current_day, current_time, current_time)
return promoList
end
@@ -45,8 +45,8 @@ class Promotion < ApplicationRecord
end
def self.find_promo_item(promo, orderitem, sale_id)
item_code = OrderItem.find_by_item_instance_code(orderitem[0]).item_code
if promo.original_product.to_s == item_code
# item_code = OrderItem.find_by_item_instance_code(orderitem[0]).item_code
if promo.original_product.to_s == orderitem[0]
if promo.min_qty.to_i > orderitem[1].to_i
return false
else
@@ -77,7 +77,7 @@ class Promotion < ApplicationRecord
def self.check_giveaway_product(promo, orderitem)
promo.promotion_products.each do |promo_product|
if promo_product.item_code == OrderItem.find_by_item_instance_code(orderitem).item_code
if promo_product.item_code == orderitem
return true, promo_product
else
return false, promo_product
@@ -113,12 +113,11 @@ class Promotion < ApplicationRecord
charge_qty += qty
end
item = OrderItem.find_by_item_instance_code(orderitem[0])
byebug
# if promo_product == OrderItem.find_by_item_instance_code(orderitem[0]).item_code
# item = OrderItem.find_by_item_instance_code(orderitem[0])
# else
# item = OrderItem.find_by_item_code(promo_product)
# end
if promo_product == OrderItem.find_by_item_instance_code(orderitem[0]).item_code
item = OrderItem.find_by_item_instance_code(orderitem[0])
else
item = OrderItem.find_by_item_code(promo_product)
end
update_existing_item(foc_qty, item, sale_id, "promotion", item.price)
puts "Charged - " + charge_qty.to_s
@@ -127,12 +126,13 @@ class Promotion < ApplicationRecord
# AA - 10 # 3 # BB # orderList, #S34345
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
byebug
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_instance_code(promo_product,orderID)
item = OrderItem.find_by_item_instance_code(promo_product)
update_existing_item(promotion_qty, item, sale_id, "promotion", item.price)
end
@@ -152,7 +152,6 @@ class Promotion < ApplicationRecord
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)
@@ -163,7 +162,7 @@ class Promotion < ApplicationRecord
puts " same: " + same.to_s + " promo_product: " + promo_product.item_code.to_s + " foc_min_qty: " + foc_min_qty.to_s + " orderitem: " + orderitem.to_s
if same
foc_qty = orderitem[1].to_i / foc_min_qty
foc_qty = orderitem[1].to_i / foc_min_qty
item = OrderItem.find_by_item_instance_code(orderitem[0])
update_existing_item(foc_qty, item, sale_id, "promotion nett off", promo_product.net_off)
else
@@ -213,7 +212,7 @@ class Promotion < ApplicationRecord
saleObj = Sale.find_by_sale_id(sale_id)
itemList = combine_item(saleObj)
itemList.each do |item|
if OrderItem.find_by_item_instance_code(item[0]).item_code == promo_item
if item[0] == promo_item
return item[1]
end
end

View File

@@ -118,6 +118,8 @@ class Sale < ApplicationRecord
create_saleitem_diningcharges(charges, diningprice, booking.dining_facility.name, dining_time)
end
InventoryJob.perform_now(self.id)
return true, self.id
end

View File

@@ -1,2 +1,17 @@
class StockCheck < ApplicationRecord
has_many :stock_check_items
def create(user, eason, item_list)
self.reason = reason
self.check_by = user.id
self.check_start = Time.now
self.check_end = Time.now
self.save
item_list.each do |item|
stockItem = StockCheckItem.new
stockItem.create(self.id,item)
end
return self
end
end

View File

@@ -1,2 +1,36 @@
class StockCheckItem < ApplicationRecord
belongs_to :stock_check
def create(stock_id, item)
journal_id, balance = StockCheckItem.find_journal(item['sku'])
remark, different = StockCheckItem.stock_different(item['qty'], balance )
self.stock_check_id = stock_id
self.item_code = item['sku']
self.stock_count = item['qty']
self.stock_journal_id = journal_id
self.stock_balance = balance
self.different = different
self.remark = remark
self.save
end
def self.find_journal(item_code)
journal = StockJournal.where('item_code=?', item_code).order('created_at desc').take
if journal
return journal.id, journal.balance
else
return nil, 0
end
end
def self.stock_different(stock_check_qty, journal_balance)
if stock_check_qty.to_i == journal_balance.to_i
return 'match', stock_check_qty
elsif stock_check_qty.to_i > journal_balance.to_i
return 'missing order item', stock_check_qty.to_i - journal_balance.to_i
elsif stock_check_qty.to_i < journal_balance.to_i
return 'missing stock', stock_check_qty.to_i - journal_balance.to_i
end
end
end

View File

@@ -1,2 +1,39 @@
class StockJournal < ApplicationRecord
SALES_TRANS = "sale"
STOCK_CHECK_TRANS = "stock_check"
def self.add_to_journal(item, balance, stock_message, inventory_definition) # item => saleObj | balance => Stock journal
balance = calculate_balance(balance, item.qty)
journal = StockJournal.new
journal.item_code = item.product_code
journal.inventory_definition_id = inventory_definition.id
journal.debit = item.qty
journal.balance = balance
journal.remark = stock_message
journal.trans_ref = item.id
journal.trans_type = StockJournal::SALES_TRANS
journal.save
end
def self.calculate_balance(balance, qty)
return balance.to_i - qty.to_i
end
def self.from_stock_check(item)
definition_id = InventoryDefinition.find_by_item_code(item.item_code)
journal = StockJournal.new
journal.item_code = item.item_code
journal.inventory_definition_id = definition_id.id
journal.debit = 0
journal.credit = item.stock_count
journal.balance = item.stock_count
journal.remark = StockJournal::STOCK_CHECK_TRANS
journal.trans_ref = item.id
journal.trans_type = StockJournal::STOCK_CHECK_TRANS
journal.save
end
end

View File

@@ -0,0 +1,92 @@
class StockResultPdf < Prawn::Document
attr_accessor :label_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:total_width,:item_description_width,:text_width
def initialize(printer_settings,stockcheck, stockcheck_items,checker_name, shop_details)
self.page_width = printer_settings.page_width #PrintSetting.where("name = ?","Close Cashier").first.page_width
self.page_height = printer_settings.page_height
self.margin = 5
self.price_width = 40
self.qty_width = 20
self.total_width = 40
self.item_width = self.page_width - ((self.price_width + self.qty_width + self.total_width))
self.item_height = 15
self.item_description_width = (self.page_width-20) / 2
self.label_width = 100
self.text_width = (self.page_width - 80) - self.price_width / 3
# @item_width = self.page_width.to_i / 2
# @qty_width = @item_width.to_i / 3
# @double = @qty_width * 1.3
# @half_qty = @qty_width / 2
#setting page margin and width
super(:margin => [printer_settings.heading_space, self.margin, self.margin, self.margin], :page_size => [self.page_width, self.page_height])
# font "public/fonts/#{font_name}".to_s + ".ttf".to_s
# font "public/fonts/Zawgyi-One.ttf"
# font "public/fonts/padauk.ttf"
self.header_font_size = 10
self.item_font_size = 8
header( shop_details)
stroke_horizontal_rule
detail(stockcheck,stockcheck_items, checker_name)
end
def header (shop_details)
move_down 7
text "#{shop_details.name}", :left_margin => -10, :size => self.header_font_size,:align => :center
move_down 5
text "#{shop_details.address}", :size => self.item_font_size,:align => :center
# move_down self.item_height
move_down 5
text "#{shop_details.phone_no}", :size => self.item_font_size,:align => :center
move_down 5
stroke_horizontal_rule
end
def detail(stockcheck, stockcheck_items, checker_name)
move_down 7
y_position = cursor
bounding_box([0,y_position], :width =>self.label_width, :height => self.item_height) do
text "Checker : ", :size => self.item_font_size,:align => :left
end
bounding_box([self.label_width,y_position], :width => self.label_width, :height => self.item_height) do
text "#{checker_name}" , :size => self.item_font_size,:align => :left
end
y_position = cursor
bounding_box([0,y_position], :width =>self.label_width, :height => self.item_height) do
text "Check Start Time : ", :size => self.item_font_size,:align => :left
end
bounding_box([self.label_width,y_position], :width => self.label_width, :height => self.item_height) do
text "#{ stockcheck.check_start.utc.getlocal.strftime('%d-%m-%Y %I:%M %p') }" , :size => self.item_font_size,:align => :left
end
y_position = cursor
bounding_box([0,y_position], :width =>self.label_width, :height => self.item_height) do
text "Check End Time ", :size => self.item_font_size,:align => :left
end
bounding_box([self.label_width,y_position], :width => self.label_width, :height => self.item_height) do
text "#{ stockcheck.check_start.utc.getlocal.strftime('%d-%m-%Y %I:%M %p') }" , :size => self.item_font_size,:align => :left
end
if stockcheck_items.length > 0
stockcheck_items.each do |st|
move_down 5
y_position = cursor
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
text "#{ st.item_code }", :size => self.item_font_size,:align => :left
end
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
text "#{st.stock_count.to_i}" , :size => self.item_font_size,:align => :right
end
end
end
move_down 5
stroke_horizontal_rule
end
end

View File

@@ -89,7 +89,14 @@ json.options opt_format
# json.promotion_price = item_instance.promotion_price
# json.item_attributes = item_instance.item_attributes
json.instances item.menu_item_instances do |is|
json.instances item.menu_item_instances do |is|
# Convert id to name for attributes
instance_attr = []
is.item_attributes do |ia|
mItemAttr = MenuItemAttribute.find(is)
instance_attr.push(ia.name)
end
json.id is.id
json.code is.item_instance_code
json.name is.item_instance_name
@@ -98,7 +105,7 @@ json.options opt_format
json.is_default is.is_default
json.is_on_promotion is.is_on_promotion
json.promotion_price is.promotion_price
json.values is.item_attributes
json.values instance_attr
# json.item_sets is.item_sets
end

View File

@@ -0,0 +1,39 @@
if(@id)
menu_item = MenuItem.find(@id.menu_item_id)
# Format for option json
opt_format = []
# Format for attributes json
menu_item.item_options.each do|opt|
menu_opt = MenuItemOption.find(opt)
if opt_format.count == 0
opt_format.push({ type: menu_opt.option_type, values: [menu_opt.name] })
next
end
opt_format.each do |of|
if menu_opt.option_type.in? opt_format.map {|k| k[:type]}
if menu_opt.option_type == of[:type]
of[:values].push(menu_opt.name)
end
else
new_opt = {type: menu_opt.option_type, values: [ menu_opt.name ] }
opt_format.push(new_opt)
break
end
end
end
json.success true
json.id @id.id
json.name @id.item_instance_name
json.code @id.item_instance_code
json.item_id @id.menu_item_id
json.attributes @id.item_attributes
json.price @id.price
json.is_default @id.is_default
json.options opt_format
else
json.success false
end

View File

@@ -195,7 +195,7 @@
</div>
</div> -->
<div class="card" id="backend" onclick="location.href='<%= inventory_inventory_path %>'">
<div class="card" id="backend" onclick="location.href='<%= inventory_path %>'">
<div class="card-content dashboard-nav">Inventory</div>
</div>
</div>

View File

@@ -0,0 +1,40 @@
<div class="row">
<div class="col-md-8"><h2> Inventoy Product Lists</h2></div>
<div class="col-md-4"><button id='new_inventory_product' class='btn btn-primary' style='margin-top:15px;'>New Inventory Product</button></div>
</div>
<div class="row">
<div class="col-md-12">
<table class="table table-striped">
<tr>
<th>#</th>
<th>Product</th>
<th>Min Order</th>
<th>Max Stock</th>
<th>Created by</th>
<th>Created Time</th>
</tr>
<%
count = 0
@products.each do |item|
count += 1
%>
<tr>
<td><%= count %></td>
<td><%= item.item_code rescue ""%></td>
<td><%= item.min_order_level %></td>
<td><%= item.max_stock_level %></td>
<td><%= item.created_by%></td>
<td><%= item.created_at%></td>
</tr>
<% end %>
</table>
</div>
</div>
<script>
$('#new_inventory_product').on('click',function(){
window.location.href = '/inventory/inventory_definitions/new';
})
</script>

View File

@@ -1,17 +1,22 @@
# Hello Inventory
<div class="row">
<div class="col-lg-8 col-md-8 col-sm-8">
<div class="row">
<div class="col-lg-10 col-md-10 col-sm-10">
<%= render 'inventory_list' %>
</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>
<div class="col-lg-2 col-md-2 col-sm-2">
<%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>
<button id="back" type="button" class="btn btn-block btn-primary"> Back </button>
<%end%>
<button id="stock_taking" type="button" class="btn btn-block btn-primary"> New Stock Taking </button>
<button id="stock_check_report" type="button" class="btn btn-block btn-primary"> Stock Check Report</button>
</div>
</div>
<script>
$('#stock_taking').on('click',function(){
window.location.href = '/inventory/stock_checks';
})
$('#stock_check_report').on('click', function(){
window.location.href = '';
})
</script>

View File

@@ -1,10 +1,15 @@
<%= simple_form_for(@inventory_definition) do |f| %>
<%= simple_form_for([:inventory,@inventory_definition]) do |f| %>
<%= f.error_notification %>
<div class="form-inputs">
<%= f.input :item_code %>
<%= f.input :min_order_level %>
<%= f.input :max_stock_level %>
</div>
<div class="form-actions">
<%= f.button :submit %>
</div>
<% end %>

View File

@@ -1,5 +1,11 @@
<h1>New Inventory Definition</h1>
<%= render 'form', inventory_definition: @inventory_definition %>
<%= link_to 'Back', inventory_definitions_path %>
<div class="span12">
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= root_path %>">Home</a></li>
<li><a href="<%= inventory_path %>">Product Inventory</a></li>
<li>New</li>
</ul>
</div>
<%= render 'form', inventory: @inventory_definition %>
</div>

View File

@@ -1,10 +0,0 @@
<%= 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

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

View File

@@ -0,0 +1 @@
json.stock_id @check.id

View File

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

View File

@@ -1,25 +1,102 @@
<p id="notice"><%= notice %></p>
<div class="row">
<div class="col-md-6">
<div class="row">
<div class="col-md-12">
<h1>Stock Checks</h1>
</div>
</div>
<div class="row">
<div class="col-md-12">
<input type='text' id='stock_check_reason' class='form-control' placeholder="Set Stock Check Reason" value=''></input>
</div>
</div>
<br>
<div class="row">
<div class="col-md-2"></div>
<div class="col-md-2">
Product
</div>
<div class="col-md-7">
<input type='text' class='form-control' placeholder="Product Name" id='product_sku' value=''></input>
</div>
</div>
<br>
<div class="row">
<div class="col-md-2"></div>
<div class="col-md-2">
Qty
</div>
<div class="col-md-7">
<input type='text' class='form-control' placeholder="Qty" id='product_qty' value=''></input>
</div>
</div>
<br>
<div class="row">
<div class="col-md-4"></div>
<div class="col-md-7">
<button class="btn btn-primary form-control" id='save_to_stock_check'> Save </button>
</div>
</div>
</div>
<table>
<thead>
<tr>
<th colspan="3"></th>
</tr>
</thead>
<div class="col-md-5">
<div class="row">
<div class="col-md-12">
<table class="table table-striped" id='stock_item'>
<tr>
<th>#</th>
<th>Product</th>
<th>Balance</th>
</tr>
</table>
</div>
</div>
</div>
<div class="col-md-1">
<div class="row">
<button class="btn btn-primary pull-right form-control" style='margin-bottom:2px;' id='finish'> Finish </button>
</div>
</div>
</div>
<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>
<script>
var count = 0
<br>
$('#save_to_stock_check').on('click', function(){
count += 1;
product_sku = $('#product_sku').val();
product_qty = $('#product_qty').val();
var tr = '<tr>'
+ '<td>'+ count +'</td>'
+ '<td><input type=text value="'+ product_sku +'" id="item_sku_'+ count +'" name='+count+'></input></td>'
+ '<td><input type=text value="'+ product_qty +'" id="item_qty_'+ count +'" name='+count+'></input></td>'
+ '</tr>'
$('#stock_item').append(tr)
$('#product_sku').val('');
$('#product_qty').val('');
})
<%= link_to 'New Stock Check', new_stock_check_path %>
$('#finish').on('click',function(){
var reason = $('#stock_check_reason').val();
var arr = [];
var jsonStr = ''
for(var i = 1; i <= count; i++){
itemname = $('#item_sku_'+i ).val();
itemqty = $('#item_qty_'+i ).val();
arr.push({sku:itemname, qty:itemqty})
jsonStr = JSON.stringify(arr)
}
console.log(jsonStr)
$.ajax({
type: 'Post',
url: '<%= inventory_stock_check_save_path %>',
data:'stock_item='+ jsonStr + '&reason='+ reason,
success:function(data){
alert(data['stock_id'])
window.location.href = '/inventory/stock_checks/'+ data['stock_id'];
}
})
})
</script>

View File

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

View File

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

View File

@@ -1,4 +1,83 @@
<p id="notice"><%= notice %></p>
<div class="row">
<input type='hidden' id='stock_check_id' value='<%= @check.id %>'/>
<div class="col-md-10">
<div class="row">
<div class="col-md-2">
Check by
</div>
<div class="col-md-8">
<%= @check.check_by %>
</div>
</div>
<div class="row">
<div class="col-md-2">
Check At
</div>
<div class="col-md-8">
<%= @check.created_at %></div>
</div>
<div class="row">
<div class="col-md-2">
Reason
</div>
<div class="col-md-8">
<%= @check.reason %>
</div>
</div>
<br>
<div class="row">
<table class="table table-striped col-md-12">
<tr>
<th>#</th>
<th>Product</th>
<th>Stock Count</th>
<th>Stock Balance</th>
<th>Different</th>
<th>Remark</th>
</tr>
<%
count = 0
@check.stock_check_items.each do |item|
count += 1
%>
<tr>
<td><%= count %></td>
<td><%= item.item_code %></td>
<td><%= item.stock_count %></td>
<td><%= item.stock_balance %></td>
<td><%= item.different %></td>
<td><%= item.remark %></td>
</tr>
<% end %>
</table>
</div>
</div>
<div class="col-md-2">
<button id="back" type="button" class="btn btn-block btn-primary"> Back </button>
<button id="save_to_journal" type="button" class="btn btn-block btn-primary"> Save to Journal </button>
<button id="print" type="button" class="btn btn-block btn-primary"> Print </button>
</div>
</div>
<%= link_to 'Edit', edit_stock_check_path(@stock_check) %> |
<%= link_to 'Back', stock_checks_path %>
<script>
$('#save_to_journal').on('click', function(){
check_id = $('#stock_check_id').val();
$.ajax({
type: 'post',
url: '<%= inventory_save_to_journal_path %>',
data: 'data='+ check_id,
success: function(){
alert('success')
}
})
})
$('#print').on('click',function(){
check_id = $('#stock_check_id').val();
$.ajax({
type: 'post',
url: '<%= inventory_print_stock_check_path %>',
data: 'stock_check_id='+ check_id
})
})
</script>

View File

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

View File

@@ -9,7 +9,7 @@
<title>SmartSales : Restaurant</title>
<%= csrf_meta_tags %>
<%= stylesheet_link_tag 'inventory', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= stylesheet_link_tag 'origami', 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' %>

View File

@@ -13,7 +13,7 @@
</ul>
</div>
<div class="col-md-7 col-lg-7 col-sm-7">
<div class="card-columns menu_items_list" style="column-gap: 10px;">
<div class="card-columns custom-card-columns menu_items_list" style="column-gap: 10px;">
<!-- append data -->
</div>
</div>
@@ -43,7 +43,7 @@
</tbody>
</table>
</div>
<div class="card-footer">
<div class="card-footer custom-card-footer">
<table class="table" id="order-charges-table" border="0">
<tr>
<td class="charges-name"><strong>Sub Total:</strong></td>
@@ -57,7 +57,7 @@
<!-- Modal -->
<div class=" modal" id="sx_itemModal" tabindex="-1" role="dialog" aria-labelledby="sx_itemModalLabel" aria-hidden="true" style="">
<div class="modal-dialog" role="document">
<div class="modal-dialog custom-modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
@@ -96,7 +96,7 @@
<!-- Menu Item modal -->
<div class="item-modal modal sx_item_detailModal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-dialog custom-modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header" style="background-color: #54A5AF;">
<h4 class="modal-title" style="color:#fff;" id="title_name"></h4>
@@ -144,42 +144,44 @@
<!-- Large modal -->
<div class=" modal sx_item_set_detailModal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true" >
<div class="modal-dialog modal-lg">
<div class="modal-dialog custom-modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header" style="background-color: #54A5AF;">
<h4 class="modal-title" style="color:#fff;" id="title_name"></h4>
<h4 class="modal-title" style="color:#fff;" id="set_name"></h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" style="font-size: 20px;color:#fff;">&times;</button>
</div>
<div class="modal-body">
<div class="row set-item">
<div class="col-md-5">
<div class="col-md-4">
<p style="text-align: center;"> <%= image_tag "logo.png" ,width: '', height: '', :id => 'logo' %></p>
<div class="form-group">
<label class="col-md-6" style="margin-top:5px">Quantity</label>
<input type="number" name="qty" class="form-control col-md-5 input-number change_qty" id="change_qty" value="" min="1" max="100">
<input type="number" name="qty" class="form-control col-md-5 input-number change_qty" id="set_change_qty" value="" min="1" max="100">
</div>
<p class="hidden" id="unit_price"></p>
<p class="hidden" id="instance_code"></p>
<p class="hidden" id="instance_name"></p>
<p class="hidden" id="promotion_price"></p>
<p class="hidden" id="item_instances"></p>
<p class="hidden" id="item_code"></p>
<p class="hidden" id="set_unit_price"></p>
<p class="hidden" id="set_instance_code"></p>
<p class="hidden" id="set_instance_name"></p>
<p class="hidden" id="set_promotion_price"></p>
<p class="hidden" id="set_item_instances"></p>
<p class="hidden" id="set_item_code"></p>
<p></p>
<div class="opt-list">
<h4>Options</h4>
<br><br><br><br>
<div class="options-list">
</div>
</div>
<div class="col-md-7">
<div class="col-md-8">
<div class="instance-list"></div>
</div>
</div>
</div>
<div class="modal-footer">
<div class="mr-auto">
<h4 class=" pull-left">Total : <span id="total_price"></span></h4>
<h4 class=" pull-left">Total : <span id="set_total_price"></span></h4>
</div>
<button type="button" class="btn btn-primary" data-dismiss="modal" id="close">Close</button>
<button type="button" class="btn btn-success add_to_order" data-dismiss="modal" id="add_to_order">Add to Order</button>
<button type="button" class="btn btn-success set_order" data-dismiss="modal" id="set_order">Add to Order</button>
</div>
</div>
</div>

View File

@@ -18,7 +18,7 @@
<%= f.input :in_time, :placeholder => "From Date", :class => "form-control" %>
<%= f.input :out_time, :placeholder => "From Date", :class => "form-control" %>
<%= f.input :out_time, :placeholder => "To Date", :class => "form-control" %>
</div><br>

View File

@@ -1,13 +1,14 @@
<%= simple_form_for([:origami,@in_juty]) do |f| %>
<%= f.error_notification %>
<%= simple_form_for([:origami, @in_juty]) do |f| %>
<%= f.error_notification %>
<div class="form-inputs">
<%= f.collection_select :commissioner_ids, Commissioner.all, :id, :name, {prompt: 'Select Commissioner'}, {class: 'form-control'} %><br/><br/>
<%= f.input :in_time %>
<%= f.input :out_time %>
</div>
<div class="form-inputs">
<%= f.collection_select :commissioner_ids, Commissioner.all, :id, :name, {prompt: 'Select Commissioner'}, {class: 'form-control'} %>
<br/><br/>
<%= f.input :in_time %>
<%= f.input :out_time %>
</div>
<div class="form-actions">
<%= f.button :submit %>
</div>
<% end %>
<div class="form-actions">
<%= f.button :submit %>
</div>
<% end %>

View File

@@ -1,33 +1,43 @@
<div class="col-md-3">
<%= simple_form_for([:origami,@in_juty]) do |f| %>
<%= f.error_notification %>
<%= simple_form_for @in_juty, :url => origami_index_in_juty_path(@table.id), :method => :post do |f| %>
<span class="patch_method"></span>
<%= f.error_notification %>
<%= f.hidden_field :id, :class => "form-control col-md-6 " %>
<div class="form-inputs">
<%= f.hidden_field :dinning_id, :value => @table.id, :class => "form-control col-md-4 " %>
<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/>
<%= f.input :in_time, :placeholder => "From Date", :class => "form-control" %>
<%= f.input :out_time, :placeholder => "To Date", :class => "form-control" %>
</div><br>
<div class="form-group">
<% f.button :submit, "Create", :class => 'btn btn-primary ', :id => 'create' %>
<% f.button :submit, "Update", :class => 'btn btn-primary ', :disabled => '', :id => 'update' %>
<% f.button :button, "Reset", :class => 'btn btn-danger ', :id => 'reset' %>
</div>
<div class="form-actions">
<%= f.button :submit, :class => 'btn btn-primary' %>
</div>
<div class="form-inputs">
<%= f.label :dinning_id %>
<%= f.collection_select :dinning_id, DiningFacility.all, :id, :name, {prompt: 'Select Dining Facilities'}, {class: 'form-control'} %><br/>
<%= f.label :commissioner_ids %>
<%= f.collection_select :commissioner_ids, Commissioner.all, :id, :name, {prompt: 'Select Commissioner'}, {class: 'form-control'} %><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">
<%= link_to 'Back', origami_in_juties_path, class: 'btn btn-success' %>
<%= f.button :submit, class: 'btn btn-info' %>
</div>
<% end %>
</div>
<script type="text/javascript">
$(function() {
$('.datepicker').datepicker({
format : 'dd-mm-yyyy',
autoclose: true
});
$('.datepicker').attr('ReadOnly','true');
$('.datepicker').css('cursor','pointer');
});
$(document).ready(function () {
</script>
});
</script>

View File

@@ -1,38 +1,91 @@
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= origami_root_path %>">Home</a></li>
<li>In Juties</li>
<span style="float: right">
<div class="row">
<div class="col-md-8">
<table class="table table-striped">
<thead>
<tr>
<th>Select</th>
<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 class="injuty_tr" data-ref="<%= in_juty.id %>">
<td>
<input type="radio" style="width:20px;" name="checkbox" class="checkbox_check"></td>
<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 '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>
<%= paginate @juties_in %>
</div>
<div class="col-md-4 partial">
<%= render 'form', in_juty: @in_juty, table: @table %>
</div>
<span style="float: right">
<%= link_to t('.new', :default => t("helpers.links.new")), new_origami_in_juty_path, :class => 'btn btn-primary btn-sm' %>
</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="3"></th>
</tr>
</thead>
<tbody>
<% @in_juties.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 'Show', origami_in_juty_path(in_juty) %></td>
<td><%= link_to 'Edit', edit_origami_in_juty_path(in_juty) %></td>
<td><%= link_to 'Destroy', origami_in_juty_path(in_juty), method: :delete, data: {confirm: 'Are you sure?'} %></td>
</tr>
<% end %>
</tbody>
</table>
<div class="col-md-1">
<button type="button" class="btn btn-primary btn-block" id='back'>Back</button>
</div>
<script type="text/javascript">
$(document).on('click', ".injuty_tr", function () {
$(this).closest('tr').find('.checkbox_check').prop("checked", true);
var in_juty_id = $(this).attr('data-ref');
var table_id = "<%= @table.id %>";
var url = "/origami/assign_in_juty/table/" + table_id + "/in_juty/" + in_juty_id + "/edit";
$.ajax({
type: "GET",
url: url,
data: {},
success: function (data) {
debugger;
$('.partial').empty().append(data);
// $('#in_juty_id').val(data.in_juty.id);
// $('#in_juty_commissioner_ids').val(data.commissioner.id);
// $('#in_juty_in_time').val(data.in_juty.in_time);
// $('#in_juty_out_time').val(data.in_juty.out_time);
//
// $('#update').removeAttr('disabled').val('');
// $('#update').attr('value', 'Update');
// $('#create').attr('disabled', 'disabled');
//
// $("#new_in_juty").attr('class', 'simple_form edit_in_juty');
// var id = "edit_in_juty_" + in_juty_id;
// $("#new_in_juty").attr('id', id);
//
// $(".edit_in_juty").attr('id', id);
// $(".edit_in_juty").attr('action', '/origami/edit_in_juty/' + $('#in_juty_id').val());
// $(".edit_in_juty").attr('action', '/origami/edit_in_juty/' + $('#in_juty_id').val());
// $(".patch_method").html('<input type="hidden" name="_method" value="patch">');
// setInterval(function () {
// $('.partial').load('/controller_name/action_name');
// }, 3000);
}
});
});
$('#back').on('click', function () {
window.location.href = '/origami/table/' + "<%= @table.id %>";
})
</script>

View File

@@ -22,7 +22,7 @@
<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 'Destroy', origami_destroy_in_juty_path(in_juty.dining_facility.id, in_juty), method: :delete, data: {confirm: 'Are you sure?'} %></td>
<td><%= link_to 'Remove', origami_destroy_in_juty_path(in_juty.dining_facility.id, in_juty), method: :delete, data: {confirm: 'Are you sure?'} %></td>
</tr>
<% end %>
</tbody>
@@ -30,11 +30,16 @@
<%= paginate @juties_in %>
</div>
<div class="col-md-4">
<%= render 'assign_in_juty', in_juty: @in_juty, table: @table %>
<div class="col-md-4 partial">
<%= render 'form', in_juty: @in_juty, table: @table %>
</div>
</div>
<div class="row">
&nbsp;&nbsp;<button type="button" class="col-md-1 btn btn-primary btn-block" id='back'>Back</button>&nbsp;&nbsp;
<button class="col-md-1 btn btn-info" id="reset">New</button>
</div>
<script type="text/javascript">
$(document).on('click', ".injuty_tr", function () {
@@ -50,29 +55,48 @@
data: {},
success: function (data) {
debugger;
$('.partial').empty().append(data);
// $('#in_juty_id').val(data.in_juty.id);
// $('#in_juty_commissioner_ids').val(data.commissioner.id);
// $('#in_juty_in_time').val(data.in_juty.in_time);
// $('#in_juty_out_time').val(data.in_juty.out_time);
//
// $('#update').removeAttr('disabled').val('');
// $('#update').attr('value', 'Update');
// $('#create').attr('disabled', 'disabled');
//
// $("#new_in_juty").attr('class', 'simple_form edit_in_juty');
// var id = "edit_in_juty_" + in_juty_id;
// $("#new_in_juty").attr('id', id);
//
// $(".edit_in_juty").attr('id', id);
// $(".edit_in_juty").attr('action', '/origami/edit_in_juty/' + $('#in_juty_id').val());
// $(".edit_in_juty").attr('action', '/origami/edit_in_juty/' + $('#in_juty_id').val());
// $(".patch_method").html('<input type="hidden" name="_method" value="patch">');
$('#in_juty_id').val(data.in_juty.id);
$('#in_juty_commissioner_ids').val(data.commissioner.id);
$('#in_juty_in_time').val(data.in_juty.in_time);
$('#in_juty_out_time').val(data.in_juty.out_time);
$('#update').removeAttr('disabled').val('');
$('#update').attr('value', 'Update');
$('#create').attr('disabled', 'disabled');
$("#new_in_juty").attr('class', 'simple_form edit_in_juty');
var id = "edit_in_juty_" + in_juty_id;
$("#new_in_juty").attr('id', id);
$(".edit_in_juty").attr('id', id);
$(".edit_in_juty").attr('action', '/origami/edit_in_juty/' + $('#in_juty_id').val());
$(".edit_in_juty").attr('action', '/origami/edit_in_juty/' + $('#in_juty_id').val());
$(".patch_method").html('<input type="hidden" name="_method" value="patch">');
// setInterval(function () {
// $('.partial').load('/controller_name/action_name');
// }, 3000);
}
});
});
$('#back').on('click', function () {
window.location.href = '/origami/table/' + "<%= @table.id %>";
})
});
$('#reset').click(function () {
var url = "<%= new_origami_in_juty_path %>";
$.ajax({
type: "GET",
url: url,
data: { table_id: <%= @table.id %> },
success: function (data) {
$('.partial').empty().append(data);
$('.injuty_tr > td > .checkbox_check').prop("checked", false);
}
});
});
</script>

View File

@@ -6,5 +6,5 @@
<li>New</li>
</ul>
</div>
<%= render 'form', in_juty: @in_juty %>
<%= render 'form', in_juty: @in_juty, table: @table %>
</div>

View File

@@ -1,4 +1,28 @@
if(@id)
menu_item = MenuItem.find(@id.menu_item_id)
# Format for option json
opt_format = []
# Format for attributes json
menu_item.item_options.each do|opt|
menu_opt = MenuItemOption.find(opt)
if opt_format.count == 0
opt_format.push({ type: menu_opt.option_type, values: [menu_opt.name] })
next
end
opt_format.each do |of|
if menu_opt.option_type.in? opt_format.map {|k| k[:type]}
if menu_opt.option_type == of[:type]
of[:values].push(menu_opt.name)
end
else
new_opt = {type: menu_opt.option_type, values: [ menu_opt.name ] }
opt_format.push(new_opt)
break
end
end
end
json.success true
json.id @id.id
json.name @id.item_instance_name
@@ -8,6 +32,8 @@ if(@id)
json.attributes @id.item_attributes
json.price @id.price
json.is_default @id.is_default
json.options opt_format
else
json.success false
end

View File

@@ -39,9 +39,18 @@
<% end %>
</div>
</div>
<div class="row">
<div class="col-md-12"><%= f.input :promo_day %></div>
<div class="row checkboxes">
<%= f.hidden_field :promo_day, :value => "", :class => "form-control col-md-1" %>
<div class="col-md-1"><input class="select" type="checkbox" name="Sunday" value="0" id="0"> Sun</div>
<div class="col-md-1"><input class="select" type="checkbox" name="Monday" value="1" id="1">Mon</div>
<div class="col-md-1"><input class="select" type="checkbox" name="Tuesday" value="2" id="2"> Tue</div>
<div class="col-md-1"><input class="select" type="checkbox" name="Wednesday" value="3" id="3"> Wed</div>
<div class="col-md-1"><input class="select" type="checkbox" name="Thursday" value="4" id="4">Thu</div>
<div class="col-md-1"><input class="select" type="checkbox" name="Friday" value="5" id="5">Fri</div>
<div class="col-md-1"><input class="select" type="checkbox" name="Saturday" value="6" id="6">Sat</div>
</div>
<div class="row">
<div class="col-md-6">
<%= f.input :promo_type,input_html: { class: "" },
@@ -49,32 +58,79 @@
</div>
</div>
<div class="row">
<div class="col-md-6"><%= f.input :original_product,collection: MenuItem.order("name desc").pluck(:name,:item_code),input_html: { selected: 2 } %></div>
<% arr = MenuItem.active.order("name desc").pluck(:name,:item_code) %>
<% Product.order("name desc").pluck(:name,:item_code).each do |p| %>
<% arr.push(p) %>
<% end %>
<div class="col-md-3">
<label class="control-label"><abbr title="required">*</abbr> Item</label>
<select class="form-control item_code_place">
<% if !@promotion.original_product.nil? %>
<% menuiteminstance = MenuItemInstance.find_by_item_instance_code(@promotion.original_product) %>
<% if menuiteminstance.nil?%>
<% code = @promotion.original_product %>
<% else %>
<% code = menuiteminstance.menu_item.item_code %>
<% end %>
<% end %>
<% arr.each do |a| %>
<% if a[1] == code %>
<option value="<%= a[1]%>" selected><%= a[0] %></option>
<% else %>
<option value="<%= a[1]%>"><%= a[0] %></option>
<% end %>
<% end %>
</select>
</div>
<% sample = [] %>
<% if !@promotion.original_product.nil? %>
<% if !MenuItemInstance.find_by_item_instance_code(@promotion.original_product).nil? %>
<% sample = MenuItemInstance.where("item_instance_code=?",@promotion.original_product).pluck(:item_instance_name,:item_instance_code)%>
<% else %>
<% sample = Product.where("item_code=?",@promotion.original_product).pluck(:name,:item_code)%>
<% end %>
<% end %>
<div class="col-md-3"><%= f.input :original_product,collection: sample %></div>
<!-- <div class="col-md-6"><%= f.input :original_product,collection: MenuItemInstance.order("item_instance_name desc").pluck(:item_instance_name,:item_instance_code),input_html: { selected: 2 } %></div> -->
<div class="col-md-6"><%= f.input :min_qty %></div>
</div>
<br>
<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-4" 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 class="col-md-1" style="text-align:center">Percentage</div>
<div class="col-md-1" 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>
<% arr = MenuItem.active.order("name desc").pluck(:name,:item_code) %>
<% Product.order("name desc").pluck(:name,:item_code).each do |p| %>
<% arr.push(p) %>
<% end %>
<div class="col-md-2" style="text-align:left">
<select class="form-control item_code_place1">
<% arr.each do |a| %>
<option value="<%= a[1 ]%>"><%= a[0] %></option>
<% end %>
</select>
</div>
<% sample = [] %>
<div class="col-md-2" style="text-align:left"><%= pro.input :item_code, :class => 'promoproduct', collection: sample,input_html: { selected: 2 }, label: false %></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 class="col-md-1"><%= pro.input :percentage , label: false %></div>
<div class="col-md-1" 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 class="col-md-12" style="text-align:right;"><%= f.link_to_add "Add Product", :promotion_products, :class => 'btn btn-primary addProduct' %></div>
</div>
</div>
</div>
@@ -86,6 +142,8 @@
</div>
<% end %>
<script>
$(document).ready(function(){
$('#promotion_promo_start_date').datetimepicker({
timepicker:false,
@@ -103,5 +161,89 @@ $(document).ready(function(){
datepicker:false,
format:'H:m'
});
var form = document.getElementById("new_promotion");
var inputs = form.getElementsByTagName("input");
var arr = [];
var count = 0;
var day = "[";
$(".select").click(function() {
// debugger;
day = "[";
for (var j = 8; j <=15; j += 1){
if (inputs[j].type === "checkbox" && inputs[j].checked)
{
if(day == "["){
day = day + (inputs[j].value);
}
else{
day = day + "," + (inputs[j].value);
}
}
if(j==15)
{
day = day + "]";
}
}
document.getElementById("promotion_promo_day").value = '';
document.getElementById("promotion_promo_day").value = day;
});
$("#promotion_original_product").select2();
$(".item_code_place").select2();
$(".item_code_place").on('change', function(event) {
var ajax_url = "<%= settings_find_item_instance_path %>";
var item_code = this.value;
$.ajax({
type: "GET",
url: ajax_url,
data: 'item_code=' + item_code,
success: function (result) {
$("#promotion_original_product").empty();
var itemlist;
for (var i = 0; i < result.length; i++) {
itemlist += "<option value ="+result[i][1]+">"+result[i][0]+"</option>"
}
$("#promotion_original_product").append(itemlist);
$("#promotion_original_product").select2();
}
});
});
$(".promotion_promotion_products_item_code select").select2();
$(".item_code_place1").select2();
callforpromoproduct();
$(".addProduct").on('click', function(event) {
setTimeout(function(){
$(".promotion_promotion_products_item_code select").select2();
callforpromoproduct();
}, 0);
});
function callforpromoproduct(){
$(".item_code_place1").select2();
$(".item_code_place1").on('change', function(event) {
id = $(this).parent().next().find("select").attr("id");
var ajax_url = "<%= settings_find_item_instance_path %>";
var item_code = this.value;
$.ajax({
type: "GET",
url: ajax_url,
data: 'item_code=' + item_code,
success: function (result) {
$("#"+id).empty();
var itemlist;
for (var i = 0; i < result.length; i++) {
itemlist += "<option value ="+result[i][1]+">"+result[i][0]+"</option>"
}
$("#"+id).append(itemlist);
$("#"+id).select2();
}
});
});
}
});
</script>

View File

@@ -39,7 +39,13 @@
<td><%= pro.promo_end_hour.utc.strftime("%I:%M %P") rescue "-" %></td>
<td><%= pro.promo_day %></td>
<td>
<%= MenuItem.find_by_item_code(pro.original_product).name rescue "-"%>
<% item = MenuItemInstance.find_by_item_instance_code(pro.original_product)%>
<% if item.nil? %>
<%= Product.find_by_item_code(pro.original_product).name rescue "-" %>
<% else %>
<%= item.menu_item.name rescue "-" %>
- <%= item.item_instance_name rescue "-" %>
<% end %>
</td>
<% if Employee.exists?(pro.created_by) %>
<td><%= Employee.find(pro.created_by).name %></td>

View File

@@ -10,7 +10,11 @@
<%= render 'form', promotion: @promotion %>
</div>
<script>
$("#promotion_promo_code").val(Math.random().toString(36).slice(5) + Math.random().toString(36).slice(5));
var r_id = Math.random().toString(36).slice(5);
if(r_id.length > 16){
r_id = r_id.substring(0, 15);
}
$("#promotion_promo_code").val(r_id);
// $( "#fromtime" ).timepicker();
// $( "#totime" ).timepicker({ 'scrollDefault': 'now' });
</script>

View File

@@ -36,6 +36,7 @@ Rails.application.routes.draw do
resources :menu_item_attributes, only: [:index]
resources :menu_item_options, only: [:index]
resources :menu_sold_out, only: [:index]
resources :menu_item_instances, only: [:show]
get "item_sets" => "item_sets#index"
end
@@ -184,6 +185,12 @@ Rails.application.routes.draw do
resources :commissioners
resources :in_juties
# product_commission
get 'table/:table_id/sale/:sale_id/load_commissioners' => 'product_commissions#load_commissioners', as: 'load_commissioners'
post 'select_sale_item' => 'product_commissions#select_sale_item', as: 'select_sale_item'
post 'select_commissioner' => 'product_commissions#set_commissioner_to_sale_item', as: 'select_commissioner'
end
#--------- Waiter/Ordering Station ------------#
@@ -297,6 +304,7 @@ Rails.application.routes.draw do
resources :promotions do
resources :promotion_products
end
get '/find_item_instance' => 'promotions#find_item_instance', as:'find_item_instance'
# commission
resources :commissions
@@ -304,15 +312,9 @@ Rails.application.routes.draw do
get '/get_transactions_by_commissioner' => 'commissioners#get_transaction_by_commissioner', as:'get_transaction_by_commissioner'
get 'menu_item_instances/get_instance/:id' => 'menu_item_instances#get_instance',:as => "show_instance"
# get 'menu_item_instances/get_instance/:id' => 'menu_item_instances#get_instance',:as => "show_instance"
end
# commissions
get 'origami/table/:table_id/sale/:sale_id/load_commissioners' => 'settings/commissions#load_commissioners', as: 'load_commissioners'
post 'origami/select_sale_item' => 'settings/commissions#select_sale_item', as: 'select_sale_item'
# product_commission
post 'origami/select_commissioner' => 'origami/product_commissions#set_commissioner_to_sale_item', as: 'select_commissioner'
#--------- Transactions Sections ------------#
namespace :transactions do
resources :sales
@@ -340,9 +342,13 @@ Rails.application.routes.draw do
# ----------- Inventory ---------------------------
namespace :inventory do
get 'inventory' => 'inventory#index'
resources :stock_check_items
resources :stock_checks
get '/' => 'inventory#index'
get '/stock_checks' => 'stock_checks#index'
post 'save_stock' => 'stock_checks#create', as:'stock_check_save'
get '/stock_checks/:id' => 'stock_checks#show'
post 'save_to_journal' => 'stock_checks#save_to_journal', as: 'save_to_journal'
post 'print_stock_check' => 'stock_checks#print_stock_check', as: 'print_stock_check'
# resources :stock_checks
resources :stock_journals
resources :inventory_definitions
end

View File

@@ -1,9 +1,12 @@
class CreateInventoryDefinitions < ActiveRecord::Migration[5.1]
# rake db:migrate:down VERSION=20170824110103
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.integer :created_by
t.boolean :is_active, :default => true
t.timestamps
end
end

View File

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

BIN
dump.rdb

Binary file not shown.