merge with august_spring

This commit is contained in:
Yan
2017-08-22 14:52:14 +06:30
102 changed files with 2910 additions and 748 deletions

2
.idea/.generators generated
View File

@@ -5,4 +5,4 @@ You are allowed to:
2. Remove generators 2. Remove generators
3. Add installed generators 3. Add installed generators
To add new installed generators automatically delete this file and reload the project. To add new installed generators automatically delete this file and reload the project.
--><GeneratorsGroup><Generator name="assets" /><Generator name="cancan:ability" /><Generator name="channel" /><Generator name="coffee:assets" /><Generator name="controller" /><Generator name="factory_girl:model" /><Generator name="generator" /><Generator name="helper" /><Generator name="integration_test" /><Generator name="jbuilder" /><Generator name="job" /><Generator name="js:assets" /><Generator name="kaminari:config" /><Generator name="kaminari:views" /><Generator name="mailer" /><Generator name="migration" /><Generator name="model" /><Generator name="resource" /><Generator name="rspec:controller" /><Generator name="rspec:feature" /><Generator name="rspec:helper" /><Generator name="rspec:install" /><Generator name="rspec:integration" /><Generator name="rspec:job" /><Generator name="rspec:mailer" /><Generator name="rspec:model" /><Generator name="rspec:observer" /><Generator name="rspec:request" /><Generator name="rspec:scaffold" /><Generator name="rspec:view" /><Generator name="scaffold" /><Generator name="scaffold_controller" /><Generator name="sidekiq:worker" /><Generator name="simple_form:install" /><Generator name="system_test" /><Generator name="task" /><Generator name="test_unit:controller" /><Generator name="test_unit:generator" /><Generator name="test_unit:helper" /><Generator name="test_unit:integration" /><Generator name="test_unit:job" /><Generator name="test_unit:mailer" /><Generator name="test_unit:model" /><Generator name="test_unit:plugin" /><Generator name="test_unit:scaffold" /><Generator name="test_unit:system" /></GeneratorsGroup></Settings> --><GeneratorsGroup><Generator name="assets" /><Generator name="cancan:ability" /><Generator name="channel" /><Generator name="coffee:assets" /><Generator name="controller" /><Generator name="factory_girl:model" /><Generator name="generator" /><Generator name="helper" /><Generator name="integration_test" /><Generator name="jbuilder" /><Generator name="job" /><Generator name="js:assets" /><Generator name="kaminari:config" /><Generator name="kaminari:views" /><Generator name="mailer" /><Generator name="migration" /><Generator name="model" /><Generator name="nested_form:install" /><Generator name="resource" /><Generator name="rspec:controller" /><Generator name="rspec:feature" /><Generator name="rspec:helper" /><Generator name="rspec:install" /><Generator name="rspec:integration" /><Generator name="rspec:job" /><Generator name="rspec:mailer" /><Generator name="rspec:model" /><Generator name="rspec:observer" /><Generator name="rspec:request" /><Generator name="rspec:scaffold" /><Generator name="rspec:view" /><Generator name="scaffold" /><Generator name="scaffold_controller" /><Generator name="sidekiq:worker" /><Generator name="simple_form:install" /><Generator name="system_test" /><Generator name="task" /><Generator name="test_unit:controller" /><Generator name="test_unit:generator" /><Generator name="test_unit:helper" /><Generator name="test_unit:integration" /><Generator name="test_unit:job" /><Generator name="test_unit:mailer" /><Generator name="test_unit:model" /><Generator name="test_unit:plugin" /><Generator name="test_unit:scaffold" /><Generator name="test_unit:system" /><Generator name="uploader" /></GeneratorsGroup></Settings>

View File

@@ -142,6 +142,7 @@
<orderEntry type="library" scope="PROVIDED" name="bundler (v1.14.6, rbenv: 2.3.3) [gem]" level="application" /> <orderEntry type="library" scope="PROVIDED" name="bundler (v1.14.6, rbenv: 2.3.3) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="byebug (v9.0.6, rbenv: 2.3.3) [gem]" level="application" /> <orderEntry type="library" scope="PROVIDED" name="byebug (v9.0.6, rbenv: 2.3.3) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="cancancan (v1.17.0, rbenv: 2.3.3) [gem]" level="application" /> <orderEntry type="library" scope="PROVIDED" name="cancancan (v1.17.0, rbenv: 2.3.3) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="carrierwave (v1.1.0, rbenv: 2.3.3) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="chronic (v0.10.2, rbenv: 2.3.3) [gem]" level="application" /> <orderEntry type="library" scope="PROVIDED" name="chronic (v0.10.2, rbenv: 2.3.3) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="coffee-rails (v4.2.2, rbenv: 2.3.3) [gem]" level="application" /> <orderEntry type="library" scope="PROVIDED" name="coffee-rails (v4.2.2, rbenv: 2.3.3) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="coffee-script (v2.4.1, rbenv: 2.3.3) [gem]" level="application" /> <orderEntry type="library" scope="PROVIDED" name="coffee-script (v2.4.1, rbenv: 2.3.3) [gem]" level="application" />
@@ -180,6 +181,7 @@
<orderEntry type="library" scope="PROVIDED" name="multi_json (v1.12.1, rbenv: 2.3.3) [gem]" level="application" /> <orderEntry type="library" scope="PROVIDED" name="multi_json (v1.12.1, rbenv: 2.3.3) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="multi_xml (v0.6.0, rbenv: 2.3.3) [gem]" level="application" /> <orderEntry type="library" scope="PROVIDED" name="multi_xml (v0.6.0, rbenv: 2.3.3) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="mysql2 (v0.4.6, rbenv: 2.3.3) [gem]" level="application" /> <orderEntry type="library" scope="PROVIDED" name="mysql2 (v0.4.6, rbenv: 2.3.3) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="nested_form (v0.3.2, rbenv: 2.3.3) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="nio4r (v2.1.0, rbenv: 2.3.3) [gem]" level="application" /> <orderEntry type="library" scope="PROVIDED" name="nio4r (v2.1.0, rbenv: 2.3.3) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="nokogiri (v1.8.0, rbenv: 2.3.3) [gem]" level="application" /> <orderEntry type="library" scope="PROVIDED" name="nokogiri (v1.8.0, rbenv: 2.3.3) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="pdf-core (v0.7.0, rbenv: 2.3.3) [gem]" level="application" /> <orderEntry type="library" scope="PROVIDED" name="pdf-core (v0.7.0, rbenv: 2.3.3) [gem]" level="application" />

564
.idea/workspace.xml generated
View File

@@ -2,12 +2,11 @@
<project version="4"> <project version="4">
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="89ca96af-a0e4-4fe4-b9a3-9969f22d7079" name="Default" comment=""> <list default="true" id="89ca96af-a0e4-4fe4-b9a3-9969f22d7079" name="Default" comment="">
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.gitignore" afterPath="$PROJECT_DIR$/.gitignore" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" /> <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/controllers/origami/sale_edit_controller.rb" afterPath="$PROJECT_DIR$/app/controllers/origami/sale_edit_controller.rb" /> <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/views/home/dashboard.html.erb" afterPath="$PROJECT_DIR$/app/views/home/dashboard.html.erb" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/models/sale.rb" afterPath="$PROJECT_DIR$/app/models/sale.rb" /> <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/views/home/index.html.erb" afterPath="$PROJECT_DIR$/app/views/home/index.html.erb" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/views/origami/sale_edit/edit.html.erb" afterPath="$PROJECT_DIR$/app/views/origami/sale_edit/edit.html.erb" /> <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/views/layouts/_header.html.erb" afterPath="$PROJECT_DIR$/app/views/layouts/_header.html.erb" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/config/routes.rb" afterPath="$PROJECT_DIR$/config/routes.rb" /> <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/views/origami/home/show.html.erb" afterPath="$PROJECT_DIR$/app/views/origami/home/show.html.erb" />
</list> </list>
<ignored path="$PROJECT_DIR$/.bundle/" /> <ignored path="$PROJECT_DIR$/.bundle/" />
<ignored path="$PROJECT_DIR$/components/" /> <ignored path="$PROJECT_DIR$/components/" />
@@ -21,53 +20,77 @@
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" /> <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" /> <option name="LAST_RESOLUTION" value="IGNORE" />
</component> </component>
<component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
<component name="FileEditorManager"> <component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300"> <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file leaf-file-name="sale_edit_controller.rb" pinned="false" current-in-tab="false"> <file leaf-file-name="20170821093252_create_commissions.rb" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/app/controllers/origami/sale_edit_controller.rb"> <entry file="file://$PROJECT_DIR$/db/migrate/20170821093252_create_commissions.rb">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="372"> <state relative-caret-position="198">
<caret line="40" column="60" lean-forward="true" selection-start-line="40" selection-start-column="60" selection-end-line="40" selection-end-column="60" /> <caret line="11" column="0" lean-forward="false" selection-start-line="11" selection-start-column="0" selection-end-line="11" selection-end-column="0" />
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
<file leaf-file-name=".gitignore" pinned="false" current-in-tab="true"> <file leaf-file-name="index.html.erb" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/.gitignore"> <entry file="file://$PROJECT_DIR$/app/views/origami/home/index.html.erb">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="254"> <state relative-caret-position="-1931">
<caret line="51" column="8" lean-forward="true" selection-start-line="51" selection-start-column="8" selection-end-line="51" selection-end-column="8" /> <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 /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
<file leaf-file-name="sale.rb" pinned="false" current-in-tab="false"> <file leaf-file-name="show.html.erb" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/app/models/sale.rb"> <entry file="file://$PROJECT_DIR$/app/views/origami/home/show.html.erb">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="321"> <state relative-caret-position="178">
<caret line="270" column="45" lean-forward="true" selection-start-line="270" selection-start-column="45" selection-end-line="270" selection-end-column="45" /> <caret line="367" column="0" lean-forward="false" selection-start-line="367" selection-start-column="0" selection-end-line="367" selection-end-column="0" />
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
<file leaf-file-name="edit.html.erb" pinned="false" current-in-tab="false"> <file leaf-file-name="20170822034139_create_product_commissions.rb" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/app/views/origami/sale_edit/edit.html.erb"> <entry file="file://$PROJECT_DIR$/db/migrate/20170822034139_create_product_commissions.rb">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="213"> <state relative-caret-position="126">
<caret line="58" column="112" lean-forward="false" selection-start-line="58" selection-start-column="112" selection-end-line="58" selection-end-column="112" /> <caret line="7" column="28" lean-forward="true" selection-start-line="7" selection-start-column="28" selection-end-line="7" selection-end-column="28" />
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
<file leaf-file-name="routes.rb" pinned="false" current-in-tab="false"> <file leaf-file-name="dashboard.html.erb" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/config/routes.rb"> <entry file="file://$PROJECT_DIR$/app/views/home/dashboard.html.erb">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="204"> <state relative-caret-position="144">
<caret line="83" column="43" lean-forward="false" selection-start-line="83" selection-start-column="43" selection-end-line="83" selection-end-column="43" /> <caret line="8" column="35" lean-forward="false" selection-start-line="8" selection-start-column="35" selection-end-line="8" selection-end-column="35" />
<folding>
<element signature="n#style#0;n#div#0;n#div#2;n#!!top" expanded="true" />
<element signature="n#style#0;n#div#3;n#!!top" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="index.html.erb" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/app/views/home/index.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-1679">
<caret line="12" column="26" lean-forward="false" selection-start-line="12" selection-start-column="26" selection-end-line="12" selection-end-column="26" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="_header.html.erb" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/app/views/layouts/_header.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="28">
<caret line="68" column="0" lean-forward="false" selection-start-line="68" selection-start-column="0" selection-end-line="68" selection-end-column="0" />
<folding /> <folding />
</state> </state>
</provider> </provider>
@@ -77,11 +100,12 @@
</component> </component>
<component name="FindInProjectRecents"> <component name="FindInProjectRecents">
<findStrings> <findStrings>
<find>origami</find>
<find>table_invoice</find> <find>table_invoice</find>
<find>sale_id</find> <find>sale_id</find>
<find>oqs</find> <find>oqs</find>
<find>void</find> <find>void</find>
<find>red</find>
<find>origami</find>
</findStrings> </findStrings>
</component> </component>
<component name="Git.Settings"> <component name="Git.Settings">
@@ -95,7 +119,6 @@
<option value="$PROJECT_DIR$/app/controllers/origami/void_controller.rb" /> <option value="$PROJECT_DIR$/app/controllers/origami/void_controller.rb" />
<option value="$PROJECT_DIR$/app/controllers/origami/home_controller.rb" /> <option value="$PROJECT_DIR$/app/controllers/origami/home_controller.rb" />
<option value="$PROJECT_DIR$/app/views/origami/payments/show.html.erb" /> <option value="$PROJECT_DIR$/app/views/origami/payments/show.html.erb" />
<option value="$PROJECT_DIR$/app/views/origami/home/show.html.erb" />
<option value="$PROJECT_DIR$/app/views/origami/home/index.html.erb" /> <option value="$PROJECT_DIR$/app/views/origami/home/index.html.erb" />
<option value="$PROJECT_DIR$/app/views/origami/rooms/show.html.erb" /> <option value="$PROJECT_DIR$/app/views/origami/rooms/show.html.erb" />
<option value="$PROJECT_DIR$/app/views/origami/orders/show.html.erb" /> <option value="$PROJECT_DIR$/app/views/origami/orders/show.html.erb" />
@@ -103,12 +126,31 @@
<option value="$PROJECT_DIR$/.idea/workspace.xml" /> <option value="$PROJECT_DIR$/.idea/workspace.xml" />
<option value="$PROJECT_DIR$/app/views/home/show.html.erb" /> <option value="$PROJECT_DIR$/app/views/home/show.html.erb" />
<option value="$PROJECT_DIR$/app/models/ability.rb" /> <option value="$PROJECT_DIR$/app/models/ability.rb" />
<option value="$PROJECT_DIR$/app/views/home/dashboard.html.erb" />
<option value="$PROJECT_DIR$/config/routes.rb" />
<option value="$PROJECT_DIR$/app/models/sale.rb" />
<option value="$PROJECT_DIR$/app/views/origami/sale_edit/edit.html.erb" /> <option value="$PROJECT_DIR$/app/views/origami/sale_edit/edit.html.erb" />
<option value="$PROJECT_DIR$/app/controllers/origami/sale_edit_controller.rb" /> <option value="$PROJECT_DIR$/app/controllers/origami/sale_edit_controller.rb" />
<option value="$PROJECT_DIR$/.gitignore" /> <option value="$PROJECT_DIR$/.gitignore" />
<option value="$PROJECT_DIR$/db/migrate/20170818051922_create_commissioner.rb" />
<option value="$PROJECT_DIR$/app/models/sale.rb" />
<option value="$PROJECT_DIR$/db/migrate/20170818090115_create_commissioners.rb" />
<option value="$PROJECT_DIR$/db/migrate/20170821093252_create_commissions.rb" />
<option value="$PROJECT_DIR$/config/routes.rb" />
<option value="$PROJECT_DIR$/app/controllers/origami/commissioners_controller.rb" />
<option value="$PROJECT_DIR$/app/controllers/origami/commissions_controller.rb" />
<option value="$PROJECT_DIR$/app/views/origami/commissioners/_form.html.erb" />
<option value="$PROJECT_DIR$/app/views/origami/commissions/_form.html.erb" />
<option value="$PROJECT_DIR$/app/views/origami/commissioners/show.html.erb" />
<option value="$PROJECT_DIR$/app/views/origami/commissions/show.html.erb" />
<option value="$PROJECT_DIR$/app/views/origami/commissioners/edit.html.erb" />
<option value="$PROJECT_DIR$/app/views/origami/commissioners/index.html.erb" />
<option value="$PROJECT_DIR$/app/views/origami/commissioners/new.html.erb" />
<option value="$PROJECT_DIR$/app/views/origami/commissions/edit.html.erb" />
<option value="$PROJECT_DIR$/app/views/origami/commissions/index.html.erb" />
<option value="$PROJECT_DIR$/app/views/origami/commissions/new.html.erb" />
<option value="$PROJECT_DIR$/app/views/origami/home/show.html.erb" />
<option value="$PROJECT_DIR$/db/migrate/20170822034139_create_product_commissions.rb" />
<option value="$PROJECT_DIR$/app/views/home/index.html.erb" />
<option value="$PROJECT_DIR$/app/views/layouts/_header.html.erb" />
<option value="$PROJECT_DIR$/app/views/home/dashboard.html.erb" />
</list> </list>
</option> </option>
</component> </component>
@@ -119,10 +161,10 @@
<sorting>DEFINITION_ORDER</sorting> <sorting>DEFINITION_ORDER</sorting>
</component> </component>
<component name="ProjectFrameBounds"> <component name="ProjectFrameBounds">
<option name="x" value="1440" /> <option name="x" value="1441" />
<option name="y" value="22" /> <option name="y" value="22" />
<option name="width" value="1920" /> <option name="width" value="1919" />
<option name="height" value="724" /> <option name="height" value="722" />
</component> </component>
<component name="ProjectLevelVcsManager"> <component name="ProjectLevelVcsManager">
<ConfirmationsSetting value="1" id="Add" /> <ConfirmationsSetting value="1" id="Add" />
@@ -143,20 +185,6 @@
</navigator> </navigator>
<panes> <panes>
<pane id="RailsProjectView" /> <pane id="RailsProjectView" />
<pane id="Scope">
<subPane subId="Project Files">
<PATH>
<PATH_ELEMENT USER_OBJECT="Root">
<option name="myItemId" value="" />
<option name="myItemType" value="" />
</PATH_ELEMENT>
<PATH_ELEMENT USER_OBJECT="sxrestaurant">
<option name="myItemId" value="" />
<option name="myItemType" value="" />
</PATH_ELEMENT>
</PATH>
</subPane>
</pane>
<pane id="Scratches" /> <pane id="Scratches" />
<pane id="ProjectPane"> <pane id="ProjectPane">
<subPane> <subPane>
@@ -170,6 +198,70 @@
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT> </PATH_ELEMENT>
</PATH> </PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="sxrestaurant" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="sxrestaurant" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="lib" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="sxrestaurant" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="sxrestaurant" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="lib" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="tasks" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="sxrestaurant" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="sxrestaurant" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="db" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="sxrestaurant" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="sxrestaurant" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="db" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="migrate" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH> <PATH>
<PATH_ELEMENT> <PATH_ELEMENT>
<option name="myItemId" value="sxrestaurant" /> <option name="myItemId" value="sxrestaurant" />
@@ -183,6 +275,64 @@
<option name="myItemId" value="app" /> <option name="myItemId" value="app" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT> </PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="views" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="sxrestaurant" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="sxrestaurant" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="app" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="views" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="home" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="sxrestaurant" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="sxrestaurant" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="app" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="sxrestaurant" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="sxrestaurant" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="app" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="models" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH> </PATH>
<PATH> <PATH>
<PATH_ELEMENT> <PATH_ELEMENT>
@@ -226,12 +376,33 @@
</PATH> </PATH>
</subPane> </subPane>
</pane> </pane>
<pane id="Scope">
<subPane subId="Project Files">
<PATH>
<PATH_ELEMENT USER_OBJECT="Root">
<option name="myItemId" value="" />
<option name="myItemType" value="" />
</PATH_ELEMENT>
<PATH_ELEMENT USER_OBJECT="sxrestaurant">
<option name="myItemId" value="" />
<option name="myItemType" value="" />
</PATH_ELEMENT>
</PATH>
</subPane>
</pane>
</panes> </panes>
</component> </component>
<component name="PropertiesComponent"> <component name="PropertiesComponent">
<property name="WebServerToolWindowFactoryState" value="false" /> <property name="WebServerToolWindowFactoryState" value="false" />
<property name="last_opened_file_path" value="$PROJECT_DIR$" /> <property name="last_opened_file_path" value="$PROJECT_DIR$" />
<property name="add_unversioned_files" value="$PROJECT_DIR$/config/database.yml" /> <property name="add_unversioned_files" value="$PROJECT_DIR$/config/database.yml" />
<property name="SearchEverywhereHistoryKey" value="header&#9;FILE&#9;file:///Users/zinlinphyo/Documents/projectX/code2lab/ror/sxrestaurant/app/views/layouts/_header.html.erb" />
</component>
<component name="RecentsManager">
<key name="MoveFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/app/views/origami" />
<recent name="$PROJECT_DIR$/app/controllers/origami" />
</key>
</component> </component>
<component name="RunDashboard"> <component name="RunDashboard">
<option name="ruleStates"> <option name="ruleStates">
@@ -546,6 +717,9 @@
<option name="remove_strategy" value="false" /> <option name="remove_strategy" value="false" />
</component> </component>
<component name="SpringUtil" SPRING_PRE_LOADER_OPTION="true" /> <component name="SpringUtil" SPRING_PRE_LOADER_OPTION="true" />
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager"> <component name="TaskManager">
<task active="true" id="Default" summary="Default task"> <task active="true" id="Default" summary="Default task">
<changelist id="89ca96af-a0e4-4fe4-b9a3-9969f22d7079" name="Default" comment="" /> <changelist id="89ca96af-a0e4-4fe4-b9a3-9969f22d7079" name="Default" comment="" />
@@ -556,35 +730,37 @@
<workItem from="1498458295318" duration="2552000" /> <workItem from="1498458295318" duration="2552000" />
<workItem from="1498465879846" duration="18792000" /> <workItem from="1498465879846" duration="18792000" />
<workItem from="1502681128282" duration="12098000" /> <workItem from="1502681128282" duration="12098000" />
<workItem from="1502780405774" duration="2251000" /> <workItem from="1502780405774" duration="8876000" />
<workItem from="1503287439872" duration="6673000" />
<workItem from="1503328001970" duration="5777000" />
</task> </task>
<servers /> <servers />
</component> </component>
<component name="TimeTrackingManager"> <component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="40110000" /> <option name="totallyTimeSpent" value="59185000" />
</component> </component>
<component name="ToolWindowManager"> <component name="ToolWindowManager">
<frame x="1440" y="22" width="1920" height="724" extended-state="0" /> <frame x="1441" y="22" width="1919" height="722" extended-state="0" />
<editor active="true" /> <editor active="true" />
<layout> <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.17518637" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" /> <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.18007459" 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.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" /> <window_info id="TODO" 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="6" 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="7" side_tool="true" 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="7" 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.33" sideWeight="0.5" order="3" side_tool="false" 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.33" sideWeight="0.5" order="3" 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.4924012" 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.49237806" 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.33" 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="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.33" sideWeight="0.5" order="7" 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.33" sideWeight="0.5" order="7" 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="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="false" show_stripe_button="true" weight="0.4" 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="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="7" 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="7" 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="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="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" /> <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" />
<window_info id="Run" 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="2" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" /> <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32911393" sideWeight="0.5" order="1" 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.32911393" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" 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="Ant Build" active="false" anchor="right" 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="Debug" 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="3" side_tool="false" content_ui="tabs" />
</layout> </layout>
</component> </component>
<component name="TypeScriptGeneratedFilesManager"> <component name="TypeScriptGeneratedFilesManager">
@@ -598,29 +774,6 @@
<watches-manager /> <watches-manager />
</component> </component>
<component name="editorHistoryManager"> <component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/app/views/origami/home/show.html.erb" />
<entry file="file://$PROJECT_DIR$/app/views/origami/rooms/show.html.erb" />
<entry file="file://$PROJECT_DIR$/app/views/origami/orders/show.html.erb" />
<entry file="file://$PROJECT_DIR$/app/views/origami/sales/show.html.erb" />
<entry file="file://$PROJECT_DIR$/app/controllers/origami/sales_controller.rb" />
<entry file="file://$PROJECT_DIR$/app/models/sale_payment.rb" />
<entry file="file://$PROJECT_DIR$/app/controllers/origami/void_controller.rb" />
<entry file="file://$PROJECT_DIR$/app/views/origami/home/index.html.erb" />
<entry file="file://$PROJECT_DIR$/app/views/origami/home/show.html.erb" />
<entry file="file://$PROJECT_DIR$/app/views/origami/sales/show.html.erb" />
<entry file="file://$PROJECT_DIR$/app/views/origami/orders/show.html.erb" />
<entry file="file://$PROJECT_DIR$/app/controllers/application_controller.rb" />
<entry file="file://$PROJECT_DIR$/app/views/origami/customers/index.html.erb" />
<entry file="file://$PROJECT_DIR$/app/controllers/origami/master_controller.rb" />
<entry file="file://$PROJECT_DIR$/app/models/dining_facility.rb" />
<entry file="file://$PROJECT_DIR$/app/controllers/origami/movetable_controller.rb" />
<entry file="file://$PROJECT_DIR$/app/controllers/origami/orders_controller.rb" />
<entry file="file://$PROJECT_DIR$/app/views/origami/payments/create.json.jbuilder" />
<entry file="file://$PROJECT_DIR$/app/models/printer/receipt_printer.rb" />
<entry file="file://$PROJECT_DIR$/app/controllers/origami/request_bills_controller.rb" />
<entry file="file://$PROJECT_DIR$/app/controllers/api/bill_controller.rb" />
<entry file="file://$PROJECT_DIR$/app/models/booking.rb" />
<entry file="file://$PROJECT_DIR$/app/controllers/origami/sales_controller.rb" />
<entry file="file://$PROJECT_DIR$/app/controllers/origami/table_invoices_controller.rb" /> <entry file="file://$PROJECT_DIR$/app/controllers/origami/table_invoices_controller.rb" />
<entry file="file://$PROJECT_DIR$/app/controllers/origami/payments_controller.rb" /> <entry file="file://$PROJECT_DIR$/app/controllers/origami/payments_controller.rb" />
<entry file="file://$PROJECT_DIR$/app/models/sale_payment.rb" /> <entry file="file://$PROJECT_DIR$/app/models/sale_payment.rb" />
@@ -628,9 +781,7 @@
<entry file="file://$PROJECT_DIR$/app/controllers/origami/void_controller.rb" /> <entry file="file://$PROJECT_DIR$/app/controllers/origami/void_controller.rb" />
<entry file="file://$PROJECT_DIR$/app/controllers/origami/home_controller.rb" /> <entry file="file://$PROJECT_DIR$/app/controllers/origami/home_controller.rb" />
<entry file="file://$PROJECT_DIR$/app/views/origami/payments/show.html.erb" /> <entry file="file://$PROJECT_DIR$/app/views/origami/payments/show.html.erb" />
<entry file="file://$PROJECT_DIR$/app/views/origami/home/index.html.erb" />
<entry file="file://$PROJECT_DIR$/app/views/origami/table_invoices/show.html.erb" /> <entry file="file://$PROJECT_DIR$/app/views/origami/table_invoices/show.html.erb" />
<entry file="file://$PROJECT_DIR$/app/views/origami/home/show.html.erb" />
<entry file="file://$PROJECT_DIR$/app/views/origami/rooms/show.html.erb" /> <entry file="file://$PROJECT_DIR$/app/views/origami/rooms/show.html.erb" />
<entry file="file://$PROJECT_DIR$/app/views/origami/orders/show.html.erb" /> <entry file="file://$PROJECT_DIR$/app/views/origami/orders/show.html.erb" />
<entry file="file://$PROJECT_DIR$/app/views/origami/sales/show.html.erb" /> <entry file="file://$PROJECT_DIR$/app/views/origami/sales/show.html.erb" />
@@ -652,46 +803,259 @@
<entry file="file://$PROJECT_DIR$/config/database.yml" /> <entry file="file://$PROJECT_DIR$/config/database.yml" />
<entry file="file://$PROJECT_DIR$/app/views/home/destroy.html.erb" /> <entry file="file://$PROJECT_DIR$/app/views/home/destroy.html.erb" />
<entry file="file://$PROJECT_DIR$/app/views/home/create.html.erb" /> <entry file="file://$PROJECT_DIR$/app/views/home/create.html.erb" />
<entry file="file://$PROJECT_DIR$/app/views/home/index.html.erb" />
<entry file="file://$PROJECT_DIR$/app/views/home/show.html.erb" />
<entry file="file://$PROJECT_DIR$/app/views/home/dashboard.html.erb" />
<entry file="file://$PROJECT_DIR$/app/models/ability.rb" /> <entry file="file://$PROJECT_DIR$/app/models/ability.rb" />
<entry file="file://$PROJECT_DIR$/config/routes.rb"> <entry file="file://$PROJECT_DIR$/db/migrate/20170818051922_create_commissioner.rb" />
<entry file="file://$PROJECT_DIR$/app/views/origami/sale_edit/edit.html.erb">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="204"> <state relative-caret-position="218">
<caret line="83" column="43" lean-forward="false" selection-start-line="83" selection-start-column="43" selection-end-line="83" selection-end-column="43" /> <caret line="38" column="17" lean-forward="true" selection-start-line="38" selection-start-column="17" selection-end-line="38" selection-end-column="17" />
<folding />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/app/models/sale.rb"> <entry file="file://$PROJECT_DIR$/app/models/sale.rb">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="321"> <state relative-caret-position="303">
<caret line="270" column="45" lean-forward="true" selection-start-line="270" selection-start-column="45" selection-end-line="270" selection-end-column="45" /> <caret line="269" column="45" lean-forward="false" selection-start-line="269" selection-start-column="45" selection-end-line="269" selection-end-column="45" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/views/origami/sale_edit/edit.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="213">
<caret line="58" column="112" lean-forward="false" selection-start-line="58" selection-start-column="112" selection-end-line="58" selection-end-column="112" />
<folding />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/app/controllers/origami/sale_edit_controller.rb"> <entry file="file://$PROJECT_DIR$/app/controllers/origami/sale_edit_controller.rb">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="372"> <state relative-caret-position="372">
<caret line="40" column="60" lean-forward="true" selection-start-line="40" selection-start-column="60" selection-end-line="40" selection-end-column="60" /> <caret line="40" column="60" lean-forward="false" selection-start-line="40" selection-start-column="60" selection-end-line="40" selection-end-column="60" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/db/migrate/20170403155230_create_employees.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="270">
<caret line="15" column="0" lean-forward="false" selection-start-line="15" selection-start-column="0" selection-end-line="15" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/db/migrate/20170818090115_create_commissioners.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="126">
<caret line="7" column="26" lean-forward="true" selection-start-line="3" selection-start-column="6" selection-end-line="7" selection-end-column="26" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/config/routes.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="241">
<caret line="171" column="26" lean-forward="false" selection-start-line="171" selection-start-column="15" selection-end-line="171" selection-end-column="26" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/models/cashier_terminal.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/origami/commissioners_controller.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="36">
<caret line="2" column="0" lean-forward="false" selection-start-line="2" selection-start-column="0" selection-end-line="2" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/controllers/origami/cash_outs_controller.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="57" lean-forward="false" selection-start-line="0" selection-start-column="36" selection-end-line="0" selection-end-column="57" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/models/commissioner.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="38" lean-forward="false" selection-start-line="0" selection-start-column="38" selection-end-line="0" selection-end-column="38" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/models/booking_order.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/models/commission.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 /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/.gitignore"> <entry file="file://$PROJECT_DIR$/.gitignore">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="254"> <state relative-caret-position="471">
<caret line="51" column="8" lean-forward="true" selection-start-line="51" selection-start-column="8" selection-end-line="51" selection-end-column="8" /> <caret line="56" column="0" lean-forward="false" 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/origami/commissioners/_form.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="234">
<caret line="13" column="8" lean-forward="false" selection-start-line="13" selection-start-column="8" selection-end-line="13" selection-end-column="83" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/controllers/origami/commissions_controller.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-16">
<caret line="2" column="0" lean-forward="false" selection-start-line="2" selection-start-column="0" selection-end-line="2" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/views/origami/commissioners/edit.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="54">
<caret line="3" column="40" lean-forward="false" selection-start-line="3" selection-start-column="40" selection-end-line="3" selection-end-column="40" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/views/origami/commissioners/index.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="36">
<caret line="2" column="36" lean-forward="false" selection-start-line="2" selection-start-column="36" selection-end-line="2" selection-end-column="36" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/views/origami/commissioners/new.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="54">
<caret line="3" column="40" lean-forward="false" selection-start-line="3" selection-start-column="40" selection-end-line="3" selection-end-column="40" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/views/origami/commissioners/show.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="36">
<caret line="2" column="38" lean-forward="false" selection-start-line="2" selection-start-column="38" selection-end-line="2" selection-end-column="38" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/views/origami/commissions/_form.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="198">
<caret line="11" column="28" lean-forward="false" selection-start-line="11" selection-start-column="28" selection-end-line="11" selection-end-column="28" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/views/origami/commissions/edit.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="72">
<caret line="4" column="23" lean-forward="false" selection-start-line="4" selection-start-column="23" selection-end-line="4" selection-end-column="23" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/views/origami/commissions/index.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="36">
<caret line="2" column="36" lean-forward="false" selection-start-line="2" selection-start-column="36" selection-end-line="2" selection-end-column="36" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/views/origami/commissions/show.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="72">
<caret line="4" column="38" lean-forward="false" selection-start-line="4" selection-start-column="38" selection-end-line="4" selection-end-column="38" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/views/origami/commissions/new.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="90">
<caret line="5" column="18" lean-forward="false" selection-start-line="5" selection-start-column="18" selection-end-line="5" selection-end-column="18" />
<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="-1931">
<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/home/show.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="178">
<caret line="367" column="0" lean-forward="false" selection-start-line="367" selection-start-column="0" selection-end-line="367" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/db/migrate/20170821093252_create_commissions.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="198">
<caret line="11" column="0" lean-forward="false" selection-start-line="11" selection-start-column="0" selection-end-line="11" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/views/home/show.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-1142">
<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/home/index.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-1679">
<caret line="12" column="26" lean-forward="false" selection-start-line="12" selection-start-column="26" selection-end-line="12" selection-end-column="26" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/views/layouts/_header.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="28">
<caret line="68" column="0" lean-forward="false" selection-start-line="68" selection-start-column="0" selection-end-line="68" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/views/home/dashboard.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="144">
<caret line="8" column="35" lean-forward="false" selection-start-line="8" selection-start-column="35" selection-end-line="8" selection-end-column="35" />
<folding>
<element signature="n#style#0;n#div#0;n#div#2;n#!!top" expanded="true" />
<element signature="n#style#0;n#div#3;n#!!top" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/db/migrate/20170822034139_create_product_commissions.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="126">
<caret line="7" column="28" lean-forward="true" selection-start-line="7" selection-start-column="28" selection-end-line="7" selection-end-column="28" />
<folding /> <folding />
</state> </state>
</provider> </provider>

View File

@@ -31,6 +31,7 @@ gem 'coffee-rails', '~> 4.2'
# See https://github.com/rails/execjs#readme for more supported runtimes # See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby # gem 'therubyracer', platforms: :ruby
gem 'simple_form' gem 'simple_form'
gem 'nested_form'
gem 'bootstrap', '~> 4.0.0.alpha3' gem 'bootstrap', '~> 4.0.0.alpha3'
gem 'tether-rails' gem 'tether-rails'
gem "font-awesome-rails" gem "font-awesome-rails"

View File

@@ -123,6 +123,7 @@ GEM
multi_json (1.12.1) multi_json (1.12.1)
multi_xml (0.6.0) multi_xml (0.6.0)
mysql2 (0.4.6) mysql2 (0.4.6)
nested_form (0.3.2)
nio4r (2.1.0) nio4r (2.1.0)
nokogiri (1.8.0) nokogiri (1.8.0)
mini_portile2 (~> 2.2.0) mini_portile2 (~> 2.2.0)
@@ -269,6 +270,7 @@ DEPENDENCIES
kaminari (~> 1.0.1) kaminari (~> 1.0.1)
listen (~> 3.0.5) listen (~> 3.0.5)
mysql2 (>= 0.3.18, < 0.5) mysql2 (>= 0.3.18, < 0.5)
nested_form
pg pg
prawn prawn
prawn-table prawn-table

View File

@@ -11,6 +11,7 @@
// about supported directives. // about supported directives.
// //
//= require jquery //= require jquery
//= require jquery_nested_form
//= require tether //= require tether
//= require bootstrap //= require bootstrap
//= require jquery_ujs //= require jquery_ujs
@@ -48,6 +49,26 @@ $(document).on('turbolinks:load', function() {
'</div>\n', '</div>\n',
} }
}); });
$("#product_image_path").fileinput({
previewFileType: "image",
allowedFileExtensions: ["jpg", "gif", "png"],
browseClass: "btn btn-success",
browseLabel: "Pick Image",
browseIcon: "<i class=\"fa fa-image\"></i> ",
removeClass: "btn btn-danger",
removeLabel: "Delete",
removeIcon: "<i class=\"fa fa-trash\"></i> ",
showUpload: false,
// uploadClass: "btn btn-info",
// uploadLabel: "Upload",
// uploadIcon: "<i class=\"fa fa-upload\"></i> ",
previewTemplates: {
image: '<div class="file-preview-frame" id="{previewId}" data-fileindex="{fileindex}">\n' +
' <img src="{data}" class="file-preview-image" title="{caption}" alt="{caption}" style="width: 200px;height: 200px;">\n' +
'</div>\n',
}
});
}); });
$(document).on("focus", "[data-behaviour~='datepicker']", function(e){ $(document).on("focus", "[data-behaviour~='datepicker']", function(e){
@@ -60,7 +81,3 @@ function export_to(path)
var form_params = $("#frm_report").serialize(); var form_params = $("#frm_report").serialize();
window.location = path+"?"+ form_params; window.location = path+"?"+ form_params;
} }

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,75 @@
class Origami::CommissionersController < BaseOrigamiController
before_action :set_commissioner, only: [:show, :edit, :update, :destroy]
# GET /commissioners
# GET /commissioners.json
def index
@commissioners = Commissioner.all
end
# GET /commissioners/1
# GET /commissioners/1.json
def show
end
# GET /commissioners/new
def new
@commissioner = Commissioner.new
@employee = Employee.all.order('name asc')
end
# GET /commissioners/1/edit
def edit
end
# POST /commissioners
# POST /commissioners.json
def create
@commissioner = Commissioner.new(commissioner_params)
@commissioner.created_by = current_user.id
respond_to do |format|
if @commissioner.save
format.html { redirect_to origami_commissioners_path , notice: 'Commissioner was successfully created.' }
format.json { render :show, status: :created, location: @commissioner }
else
format.html { render :new }
format.json { render json: @commissioner.errors, status: :unprocessable_entity }
end
end
end
# PATCH/PUT /commissioners/1
# PATCH/PUT /commissioners/1.json
def update
respond_to do |format|
if @commissioner.update(commissioner_params)
format.html { redirect_to origami_commissioner_path(@commissioner) , notice: 'Commissioner was successfully updated.' }
format.json { render :show, status: :ok, location: @commissioner }
else
format.html { render :edit }
format.json { render json: @commissioner.errors, status: :unprocessable_entity }
end
end
end
# DELETE /commissioners/1
# DELETE /commissioners/1.json
def destroy
@commissioner.destroy
respond_to do |format|
format.html { redirect_to origami_commissioners_path , notice: 'Commissioner was successfully destroyed.' }
format.json { head :no_content }
end
end
private
# Use callbacks to share common setup or constraints between actions.
def set_commissioner
@commissioner = Commissioner.find(params[:id])
end
# Never trust parameters from the scary internet, only allow the white list through.
def commissioner_params
params.require(:commissioner).permit(:name,:emp_id,:created_by,:commission_type, :is_active)
end
end

View File

@@ -0,0 +1,74 @@
class Origami::CommissionsController < BaseOrigamiController
before_action :set_commission, only: [:show, :edit, :update, :destroy]
# GET /commissions
# GET /commissions.json
def index
@commissions = Commission.all
end
# GET /commissions/1
# GET /commissions/1.json
def show
end
# GET /commissions/new
def new
@commission = Commission.new
end
# GET /commissions/1/edit
def edit
end
# POST /commissions
# POST /commissions.json
def create
@commission = Commission.new(commission_params)
respond_to do |format|
if @commission.save
format.html { redirect_to origami_commissions_path , notice: 'Commission was successfully created.' }
format.json { render :show, status: :created, location: @commission }
else
format.html { render :new }
format.json { render json: @commission.errors, status: :unprocessable_entity }
end
end
end
# PATCH/PUT /commissions/1
# PATCH/PUT /commissions/1.json
def update
respond_to do |format|
if @commission.update(commission_params)
format.html { redirect_to origami_commission_path(@commission), notice: 'Commission was successfully updated.' }
format.json { render :show, status: :ok, location: @commission }
else
format.html { render :edit }
format.json { render json: @commission.errors, status: :unprocessable_entity }
end
end
end
# DELETE /commissions/1
# DELETE /commissions/1.json
def destroy
@commission.destroy
respond_to do |format|
format.html { redirect_to origami_commissions_path, notice: 'Commission was successfully destroyed.' }
format.json { head :no_content }
end
end
private
# Use callbacks to share common setup or constraints between actions.
def set_commission
@commission = Commission.find(params[:id])
end
# Never trust parameters from the scary internet, only allow the white list through.
def commission_params
params.require(:commission).permit(:product_id,:amount,:commission_type, :is_active)
end
end

View File

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

View File

@@ -22,7 +22,7 @@ class Origami::VoucherController < BaseOrigamiController
def create def create
cash = params[:amount] cash = params[:amount]
sale_id = params[:sale_id] sale_id = params[:sale_id]
sale_id = params[:refnumber] voucher_no = params[:refnumber]
if(Sale.exists?(sale_id)) if(Sale.exists?(sale_id))
customer_data= Customer.find_by_customer_id(sale_data.customer_id) customer_data= Customer.find_by_customer_id(sale_data.customer_id)
if customer_data if customer_data
@@ -37,11 +37,12 @@ class Origami::VoucherController < BaseOrigamiController
auth_token = member_actions.auth_token.to_s auth_token = member_actions.auth_token.to_s
# membership_data = SalePayment.get_paypar_account(url,membership_setting.auth_token,@membership_id,@campaign_type_id,merchant_uid,auth_token) # membership_data = SalePayment.get_paypar_account(url,membership_setting.auth_token,@membership_id,@campaign_type_id,merchant_uid,auth_token)
# if membership_data["status"]==true # if membership_data["status"]==true
# app_token: token,membership_id:membership_id,
# campaign_type_id:campaign_type_id,merchant_uid:merchant_uid,
# auth_token:auth_token
begin begin
response = HTTParty.get(url, response = HTTParty.get(url,
:body => { app_token: token,membership_id:membership_id, :body => { voucher_no: voucher_no,membership_id:membership_id
campaign_type_id:campaign_type_id,merchant_uid:merchant_uid,
auth_token:auth_token
}.to_json, }.to_json,
:headers => { :headers => {
'Content-Type' => 'application/json', 'Content-Type' => 'application/json',

View File

@@ -0,0 +1,77 @@
class Settings::PromotionProductsController < ApplicationController
before_action :set_promotion, only: [:show, :edit, :update, :destroy,:new]
before_action :set_promotion_product, only: [:show, :edit, :update, :destroy]
# GET /promotion_products
# GET /promotion_products.json
def index
@promotion_products = PromotionProduct.all
end
# GET /promotion_products/1
# GET /promotion_products/1.json
def show
end
# GET /promotion_products/new
def new
@promotion_product = PromotionProduct.new
end
# GET /promotion_products/1/edit
def edit
end
# POST /promotion_products
# POST /promotion_products.json
def create
@promotion_product = PromotionProduct.new(promotion_params)
respond_to do |format|
if @promotion_product.save
format.html { redirect_to edit_settings_promotion_path(@promotion), notice: 'PromotionProduct was successfully created.' }
format.json { render :show, status: :created, location: @promotion_product }
else
format.html { render :new }
format.json { render json: @promotion_product.errors, status: :unprocessable_entity }
end
end
end
# PATCH/PUT /promotion_products/1
# PATCH/PUT /promotion_products/1.json
def update
respond_to do |format|
if @promotion_product.update(promotion_params)
format.html { redirect_to edit_settings_promotion_path(@promotion), notice: 'PromotionProduct was successfully updated.' }
format.json { render :show, status: :ok, location: @promotion_product }
else
format.html { render :edit }
format.json { render json: @promotion_product.errors, status: :unprocessable_entity }
end
end
end
# DELETE /promotion_products/1
# DELETE /promotion_products/1.json
def destroy
@promotion_product.destroy
respond_to do |format|
format.html { redirect_to edit_settings_promotion_path(@promotion) , notice: 'PromotionProduct was successfully destroyed.' }
format.json { head :no_content }
end
end
private
# Use callbacks to share common setup or constraints between actions.
def set_promotion
@promotion = Promotion.find(params[:promotion_id])
end
def set_promotion_product
@promotion_product = PromotionProduct.find(params[:id])
end
# Never trust parameters from the scary internet, only allow the white list through.
def promotion_params
params.require(:promotion_product).permit(:promo_code, :promo_start_date, :promo_end_date, :promo_start_hour,:promo_end_hour ,:promo_day, :promo_type,:original_product ,:min_qty ,:created_by)
end
end

View File

@@ -71,6 +71,7 @@ class Settings::PromotionsController < ApplicationController
# Never trust parameters from the scary internet, only allow the white list through. # Never trust parameters from the scary internet, only allow the white list through.
def promotion_params def promotion_params
params.require(:promotion).permit(:promo_code, :promo_start_date, :promo_end_date, :promo_start_hour,:promo_end_hour ,:promo_day, :promo_type,:original_product ,:min_qty ,:created_by) params.require(:promotion).permit(:promo_code, :promo_start_date, :promo_end_date, :promo_start_hour,:promo_end_hour ,:promo_day, :promo_type,:original_product ,:min_qty ,:created_by,
:promotion_products_attributes => [:item_code, :min_qty, :net_off, :net_price, :percentage, :_destroy])
end end
end end

View File

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

View File

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

View File

@@ -0,0 +1,2 @@
module Origami::ProductCommissionsHelper
end

2
app/models/commission.rb Normal file
View File

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

View File

@@ -0,0 +1,3 @@
class Commissioner < ApplicationRecord
has_many :employees
end

View File

@@ -1,6 +1,6 @@
class Employee < ApplicationRecord class Employee < ApplicationRecord
has_secure_password has_secure_password
belongs_to :commissioner
has_many :shit_sales has_many :shit_sales
validates_presence_of :name, :role validates_presence_of :name, :role
validates_presence_of :password, :on => [:create] validates_presence_of :password, :on => [:create]

View File

@@ -1,3 +1,6 @@
class Product < ApplicationRecord class Product < ApplicationRecord
validates_presence_of :name validates_presence_of :name
# Product Image Uploader
mount_uploader :image_path, ProductImageUploader
end end

View File

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

View File

@@ -1,2 +1,12 @@
class Promotion < ApplicationRecord class Promotion < ApplicationRecord
validates_presence_of :promo_code,:promo_start_date,:promo_end_date,:promo_start_hour,:promo_end_hour,:promo_day,:promo_type,:original_product,:min_qty
has_many :promotion_products
accepts_nested_attributes_for :promotion_products , :allow_destroy => true
PROMO_TYPE1 = "Quantity"
PROMO_TYPE2 = "Net_off"
PROMO_TYPE3 = "Net_price"
PROMO_TYPE4 = "Percentage"
end end

View File

@@ -0,0 +1,3 @@
class PromotionProduct < ApplicationRecord
belongs_to :promotion
end

View File

@@ -0,0 +1,58 @@
class ProductImageUploader < CarrierWave::Uploader::Base
# Include RMagick or MiniMagick support:
# include CarrierWave::RMagick
# include CarrierWave::MiniMagick
# Choose what kind of storage to use for this uploader:
storage :file
# storage :fog
def root
Rails.root.join 'public/'
end
# Override the directory where uploaded files will be stored.
# This is a sensible default for uploaders that are meant to be mounted:
def store_dir
"image/product_images"
# "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end
# def cache_dir
# '/tmp/images'
# end
# Provide a default URL as a default if there hasn't been a file uploaded:
# def default_url(*args)
# # For Rails 3.1+ asset pipeline compatibility:
# # ActionController::Base.helpers.asset_path("fallback/" + [version_name, "default.png"].compact.join('_'))
#
# "/images/fallback/" + [version_name, "default.png"].compact.join('_')
# end
# Process files as they are uploaded:
# process scale: [200, 300]
#
# def scale(width, height)
# # do something
# end
# Create different versions of your uploaded files:
# version :thumb do
# process resize_to_fit: [50, 50]
# end
# Add a white list of extensions which are allowed to be uploaded.
# For images you might use something like this:
def extension_whitelist
%w(jpg jpeg gif png)
end
# Override the filename of the uploaded files:
# Avoid using model.id or version_name here, see uploader/store.rb for details.
# def filename
# "something.jpg" if original_filename
# end
end

View File

@@ -30,7 +30,7 @@
<div class="col-md-12"> <div class="col-md-12">
<div class="card" id="origami" onclick="location.href='<%= origami_root_path %>'"> <div class="card" id="origami" onclick="location.href='<%= origami_root_path %>'">
<div class="card-content"> <div class="card-content">
<span class="card-title">Origami</span> <span class="card-title">Cashier</span>
</div> </div>
</div> </div>
</div> </div>
@@ -66,8 +66,7 @@
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
<h4 class="panel-title"> <h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#admin">Administrator Administrator
<span class="glyphicon glyphicon-plus"></span></a>
</h4> </h4>
</div> </div>
<div id="admin" class="panel-collapse collapse in"> <div id="admin" class="panel-collapse collapse in">
@@ -105,7 +104,7 @@
</ul> </ul>
<ul class="col-md-4"> <ul class="col-md-4">
<li>OQS</li><br> <li>OQS</li><br>
<li>Origami</li><br> <li>Cashier</li><br>
<li>CRM</li> <li>CRM</li>
</ul> </ul>
</div> </div>
@@ -115,8 +114,7 @@
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
<h4 class="panel-title"> <h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#manager">Manager Manager
<span class="glyphicon glyphicon-plus"></span></a>
</h4> </h4>
</div> </div>
<div id="admin" class="panel-collapse collapse in"> <div id="admin" class="panel-collapse collapse in">
@@ -152,7 +150,7 @@
</ul> </ul>
<ul class="col-md-4"> <ul class="col-md-4">
<li>OQS</li><br> <li>OQS</li><br>
<li>Origami</li><br> <li>Cashier</li><br>
<li>CRM</li> <li>CRM</li>
</ul> </ul>
</div> </div>
@@ -162,8 +160,7 @@
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
<h4 class="panel-title"> <h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#supervisor">Supervisor Supervisor
<span class="glyphicon glyphicon-plus"></span></a>
</h4> </h4>
</div> </div>
<div id="supervisor" class="panel-collapse collapse in"> <div id="supervisor" class="panel-collapse collapse in">
@@ -185,14 +182,13 @@
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
<h4 class="panel-title"> <h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#cashier">Cashier Cashier
<span class="glyphicon glyphicon-plus"></span></a>
</h4> </h4>
</div> </div>
<div id="cashier" class="panel-collapse collapse in"> <div id="cashier" class="panel-collapse collapse in">
<div class="panel-body"> <div class="panel-body">
<ul class=""> <ul class="">
<li class="">Orgami Panel except Edit and Void</li> <li class="">Cashier Panel except Edit and Void</li>
<li class="">Sale and Order</li> <li class="">Sale and Order</li>
<li class="">and Queue in CRM</li> <li class="">and Queue in CRM</li>
</ul> </ul>
@@ -203,8 +199,7 @@
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
<h4 class="panel-title"> <h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#accountant">Accountant Accountant
<span class="glyphicon glyphicon-plus"></span></a>
</h4> </h4>
</div> </div>
<div id="accountant" class="panel-collapse collapse in"> <div id="accountant" class="panel-collapse collapse in">
@@ -223,7 +218,7 @@
</div> </div>
</div> <!-- end col-md-4 --> </div> <!-- end col-md-4 -->
<div class="footer"> <div class="footer" style="background-color: inherit">
<div class="card"> <div class="card">
<div class="page-header center-text"> <div class="page-header center-text">
<h4 class="footer-header"> <h4 class="footer-header">

View File

@@ -29,108 +29,113 @@
<% @employees.each do |employee| %> <% @employees.each do |employee| %>
<div data-formid="#form_<%= employee.emp_id %>" class="empBtn card card-inverse card-primary mb-3 text-center" style=""> <div data-formid="#form_<%= employee.emp_id %>" class="empBtn card card-inverse card-primary mb-3 text-center" style="">
<form id="form_<%=employee.emp_id%>" action="<%= emp_login_path(employee.emp_id) %>" method="PATCH"></form> <form id="form_<%= employee.emp_id %>" action="<%= emp_login_path(employee.emp_id) %>" method="PATCH"></form>
<div class="card-block"> <div class="card-block">
<h4 class="card-title"> <h4 class="card-title">
<%= employee.name %> <%= employee.name %>
</h4> </h4>
<div class="card-content"> <div class="card-content">
(<%= employee.emp_id%>) (<%= employee.emp_id %>)
</div> </div>
<div class="card-footer"> <div class="card-footer">
<small><%= employee.role %></small> <small><%= employee.role %></small>
</div> </div>
</div> </div>
</div> </div>
<% end %> <% end %>
</div> </div>
</div> </div>
<div class="col-md-4 col-lg-4" > <div class="col-md-4 col-lg-4">
<div class="card" style="max-height:550px; overflow:auto;padding: 15px"> <div class="card" style="max-height:550px; overflow:auto;padding: 15px">
<h4 class="card-title">Role Features</h4> <h4 class="card-title">Role Features</h4>
<!-- <p><strong>Note:</strong> The <strong>data-parent</strong> attribute makes sure that all collapsible elements under the specified parent will be closed when one of the collapsible item is shown.</p> --> <!-- <p><strong>Note:</strong> The <strong>data-parent</strong> attribute makes sure that all collapsible elements under the specified parent will be closed when one of the collapsible item is shown.</p> -->
<div class="panel-group" id="accordion"> <div class="panel-group" id="accordion">
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
<h4 class="panel-title"> <h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#admin">Administrator <span class="glyphicon glyphicon-plus"></span></a> <a data-toggle="collapse" data-parent="#accordion" href="#admin">Administrator
</h4> <span class="glyphicon glyphicon-plus"></span></a>
</div> </h4>
<div id="admin" class="panel-collapse collapse in"> </div>
<div class="panel-body"> <div id="admin" class="panel-collapse collapse in">
<ul class=""> <div class="panel-body">
<li class="">All Accept</li> <ul class="">
</ul> <li class="">All Accept</li>
</div> </ul>
</div> </div>
</div> </div>
<div class="panel panel-default"> </div>
<div class="panel-heading"> <div class="panel panel-default">
<h4 class="panel-title"> <div class="panel-heading">
<a data-toggle="collapse" data-parent="#accordion" href="#manager">Manager <span class="glyphicon glyphicon-plus"></span></a> <h4 class="panel-title">
</h4> <a data-toggle="collapse" data-parent="#accordion" href="#manager">Manager
</div> <span class="glyphicon glyphicon-plus"></span></a>
<div id="manager" class="panel-collapse collapse"> </h4>
<div class="panel-body"> </div>
<ul class=""> <div id="manager" class="panel-collapse collapse">
<li class="">All Accept except Membership and Payment Settings</li> <div class="panel-body">
</ul> <ul class="">
</div> <li class="">All Accept except Membership and Payment Settings</li>
</ul>
</div> </div>
</div> </div>
<div class="panel panel-default"> </div>
<div class="panel-heading"> <div class="panel panel-default">
<h4 class="panel-title"> <div class="panel-heading">
<a data-toggle="collapse" data-parent="#accordion" href="#supervisor">Supervisor <span class="glyphicon glyphicon-plus"></span></a> <h4 class="panel-title">
</h4> <a data-toggle="collapse" data-parent="#accordion" href="#supervisor">Supervisor
</div> <span class="glyphicon glyphicon-plus"></span></a>
<div id="supervisor" class="panel-collapse collapse"> </h4>
<div class="panel-body"> </div>
<ul class=""> <div id="supervisor" class="panel-collapse collapse">
<li class="">Void</li> <div class="panel-body">
<li class="">FOC</li> <ul class="">
<li class="">Edit</li> <li class="">Void</li>
<li class="">Credit </li> <li class="">FOC</li>
<li class="">and Payment </li> <li class="">Edit</li>
</ul> <li class="">Credit</li>
</div> <li class="">and Payment</li>
</ul>
</div> </div>
</div> </div>
<div class="panel panel-default"> </div>
<div class="panel-heading"> <div class="panel panel-default">
<h4 class="panel-title"> <div class="panel-heading">
<a data-toggle="collapse" data-parent="#accordion" href="#cashier">Cashier <span class="glyphicon glyphicon-plus"></span></a> <h4 class="panel-title">
</h4> <a data-toggle="collapse" data-parent="#accordion" href="#cashier">Cashier
</div> <span class="glyphicon glyphicon-plus"></span></a>
<div id="cashier" class="panel-collapse collapse"> </h4>
<div class="panel-body"> </div>
<ul class=""> <div id="cashier" class="panel-collapse collapse">
<li class="">Orgami Panel except Edit and Void</li> <div class="panel-body">
<li class="">Sale and Order </li> <ul class="">
<li class="">and Queue in CRM</li> <li class="">Orgami Panel except Edit and Void</li>
</ul> <li class="">Sale and Order</li>
</div> <li class="">and Queue in CRM</li>
</ul>
</div> </div>
</div> </div>
<div class="panel panel-default"> </div>
<div class="panel-heading"> <div class="panel panel-default">
<h4 class="panel-title"> <div class="panel-heading">
<a data-toggle="collapse" data-parent="#accordion" href="#accountant">Accountant <span class="glyphicon glyphicon-plus"></span></a> <h4 class="panel-title">
</h4> <a data-toggle="collapse" data-parent="#accordion" href="#accountant">Accountant
</div> <span class="glyphicon glyphicon-plus"></span></a>
<div id="accountant" class="panel-collapse collapse"> </h4>
<div class="panel-body"> </div>
<ul class=""> <div id="accountant" class="panel-collapse collapse">
<li class="">Daily Sale Report</li> <div class="panel-body">
<li class="">Sale Item Report</li> <ul class="">
<li class="">Receipt No Report</li> <li class="">Daily Sale Report</li>
<li class="">ShiftSale Report</li> <li class="">Sale Item Report</li>
</ul> <li class="">Receipt No Report</li>
</div> <li class="">ShiftSale Report</li>
</ul>
</div> </div>
</div> </div>
</div>
</div> <!-- end accordion id --> </div> <!-- end accordion id -->
</div> </div>
</div> <!-- end col-md-4 --> </div> <!-- end col-md-4 -->
@@ -140,6 +145,7 @@
.panel-body { .panel-body {
padding: 5px !important; padding: 5px !important;
} }
/*.card-columns { /*.card-columns {
column-count: 4; column-count: 4;
display: inline-block; display: inline-block;
@@ -148,6 +154,7 @@
float: right; float: right;
} }
@media (min-width: 34em) { @media (min-width: 34em) {
.card-columns { .card-columns {
-webkit-column-count: 2; -webkit-column-count: 2;
@@ -181,25 +188,25 @@
} }
</style> </style>
<script type="text/javascript"> <script type="text/javascript">
$(document).on('turbolinks:load', function() { $(document).on('turbolinks:load', function () {
$(".empBtn").click(function(event){ $(".empBtn").click(function (event) {
event.preventDefault(); event.preventDefault();
console.log($(this).data("formid")); console.log($(this).data("formid"));
var item = $(this).data("formid"); var item = $(this).data("formid");
$(item).submit(); $(item).submit();
}); });
// Add minus icon for collapse element which is open by default // Add minus icon for collapse element which is open by default
$(".collapse.in").each(function(){ $(".collapse.in").each(function () {
$(this).siblings(".panel-heading").find(".glyphicon").addClass("glyphicon-minus").removeClass("glyphicon-plus"); $(this).siblings(".panel-heading").find(".glyphicon").addClass("glyphicon-minus").removeClass("glyphicon-plus");
}); });
// Toggle plus minus icon on show hide of collapse element // Toggle plus minus icon on show hide of collapse element
$(".collapse").on('show.bs.collapse', function(){ $(".collapse").on('show.bs.collapse', function () {
$(this).parent().find(".glyphicon").removeClass("glyphicon-plus").addClass("glyphicon-minus"); $(this).parent().find(".glyphicon").removeClass("glyphicon-plus").addClass("glyphicon-minus");
}).on('hide.bs.collapse', function(){ }).on('hide.bs.collapse', function () {
$(this).parent().find(".glyphicon").removeClass("glyphicon-minus").addClass("glyphicon-plus"); $(this).parent().find(".glyphicon").removeClass("glyphicon-minus").addClass("glyphicon-plus");
}); });
}); });
</script> </script>

View File

@@ -28,6 +28,8 @@
<li><%= link_to "Print Setting", print_settings_path, :tabindex =>"-1" %></li> <li><%= link_to "Print Setting", print_settings_path, :tabindex =>"-1" %></li>
<hr class="hr_advance" /> <hr class="hr_advance" />
<li><%= link_to "Employees", settings_employees_path, :tabindex =>"-1" %></li> <li><%= link_to "Employees", settings_employees_path, :tabindex =>"-1" %></li>
<li><%= link_to "Commissions", origami_commissions_path , :tabindex =>"-1" %></li>
<li><%= link_to "Commissioners", origami_commissioners_path , :tabindex =>"-1" %></li>
<hr class="hr_advance" /> <hr class="hr_advance" />
<li><%= link_to "Accounts", settings_accounts_path, :tabindex =>"-1" %></li> <li><%= link_to "Accounts", settings_accounts_path, :tabindex =>"-1" %></li>
<hr class="hr_advance" /> <hr class="hr_advance" />
@@ -59,7 +61,7 @@
<a href="<%= oqs_root_path %>" role="button" aria-haspopup="true" aria-expanded="false">&nbsp;&nbsp;&nbsp;OQS</a> <a href="<%= oqs_root_path %>" role="button" aria-haspopup="true" aria-expanded="false">&nbsp;&nbsp;&nbsp;OQS</a>
</li> </li>
<li class="navbar-nav mr-auto"> <li class="navbar-nav mr-auto">
<a href="<%= origami_root_path %>" role="button" aria-haspopup="true" aria-expanded="false">&nbsp;&nbsp;&nbsp;Origami</a> <a href="<%= origami_root_path %>" role="button" aria-haspopup="true" aria-expanded="false">&nbsp;&nbsp;&nbsp;Cashier</a>
</li> </li>
<li class="navbar-nav mr-auto"> <li class="navbar-nav mr-auto">
<a href="<%= crm_customers_path %>" role="button" aria-haspopup="true" aria-expanded="false">&nbsp;&nbsp;&nbsp;CRM</a> <a href="<%= crm_customers_path %>" role="button" aria-haspopup="true" aria-expanded="false">&nbsp;&nbsp;&nbsp;CRM</a>

View File

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

View File

@@ -0,0 +1,18 @@
<div class="col-md-3">
<%= simple_form_for([:origami, @commissioner]) do |f| %>
<%= f.error_notification %>
<div class="form-inputs">
<%= f.input :name %>
<%= f.label :emp_id %>
<%= f.collection_select :emp_id, Employee.all.order('name asc'), :emp_id, :name, {prompt: "Select an Employee"}, {class: "form-control"} %><br/>
<%= f.input :commission_type %>
<label><%= f.check_box :is_active %> Active </label>
</div>
<div class="form-actions">
<%= link_to 'Back', origami_commissioners_path, class: 'btn btn-success' %>
<%= f.button :submit, class: 'btn btn-info' %>
</div>
<% end %>
</div>

View File

@@ -0,0 +1,10 @@
<div class="span12">
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= origami_root_path %>">Home</a></li>
<li><a href="<%= origami_commissioners_path %>">Commissioners</a></li>
<li>Edit</li>
</ul>
</div>
<%= render 'form', commissioner: @commissioner %>
</div>

View File

@@ -0,0 +1,44 @@
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= origami_root_path %>">Home</a></li>
<li>Commissioner</li>
<span style="float: right">
<%= link_to t('.new', :default => t("helpers.links.new")), new_origami_commissioner_path ,:class => 'btn btn-primary btn-sm' %>
</span>
</ul>
</div>
<br>
<div class="card">
<table class="table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Employee Name</th>
<th>Commission type</th>
<th>Active</th>
<th colspan="3"></th>
</tr>
</thead>
<tbody>
<% @commissioners.each do |commissioner| %>
<tr>
<td><%= commissioner.name %></td>
<td>
<% if Employee.exists? %>
<% employee = Employee.where('emp_id=?',commissioner.emp_id) %>
<%= employee[0].name %>
<% end %>
</td>
<td><%= commissioner.commission_type %></td>
<td><%= commissioner.is_active %></td>
<td><%= link_to 'Show', origami_commissioner_path(commissioner) %></td>
<td><%= link_to 'Edit', edit_origami_commissioner_path(commissioner) %></td>
<td><%= link_to 'Destroy', origami_commissioner_path(commissioner), method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</tbody>
</table>
</div>

View File

@@ -0,0 +1 @@
json.array! @commissioners, partial: 'commissioners/commissioner', as: :commissioner

View File

@@ -0,0 +1,10 @@
<div class="span12">
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= origami_root_path %>">Home</a></li>
<li><a href="<%= origami_commissioners_path %>">Commissioners</a></li>
<li>New</li>
</ul>
</div>
<%= render 'form', commissioner: @commissioner %>
</div>

View File

@@ -0,0 +1,51 @@
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= origami_root_path %>">Home</a></li>
<li><a href="<%= origami_commissioners_path %>">Commissioners</a></li>
<span style="float: right">
</span>
</ul>
</div>
<div class="card">
<div class="card-block">
<h4 class="card-title">Commissioner</h4>
<table class="table">
<tbody>
<tr>
<td style="width:20%">Name</td>
<td><%= @commissioner.name %></td>
</tr>
<tr>
<td style="width:20%">Employee Name</td>
<td>
<% if Employee.exists? %>
<% employee = Employee.where('emp_id=?', @commissioner.emp_id) %>
<%= employee[0].name %>
<% end %>
</td>
</tr>
<tr>
<td style="width:20%">Commission Type</td>
<td><%= @commissioner.commission_type %></td>
</tr>
<tr>
<td style="width:20%">Active</td>
<td><%= @commissioner.is_active %></td>
</tr>
<tr>
<td style="width:20%">Created By</td>
<td><%= Employee.find(@commissioner.created_by).name %></td>
</tr>
</tbody>
</table>
<%= link_to 'Back', origami_commissioners_path, class: 'btn btn-success' %>
<%= link_to 'Edit', edit_origami_commissioner_path(@commissioner), class: 'btn btn-info' %>
<%= link_to 'Destroy', origami_commissioner_path(@commissioner), method: :delete, data: {confirm: 'Are you sure?'}, class: 'btn btn-danger' %>
</div>
</div>
</div>

View File

@@ -0,0 +1 @@
json.partial! "commissioners/commissioner", commissioner: @commissioner

View File

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

View File

@@ -0,0 +1,17 @@
<div class="col-md-3">
<%= simple_form_for([:origami,@commission]) do |f| %>
<%= f.error_notification %>
<div class="form-inputs">
<%= f.label :product_id %>
<%= f.collection_select :product_id, Product.all.order('name asc'), :id, :name, {prompt: "Select a Product"}, {class: "form-control"} %><br/>
<%= f.input :amount %>
<%= f.input :commission_type, :collection => [:percentage, :net_amount] %>
<label><%= f.check_box :is_active %> Active </label>
</div>
<div class="form-actions">
<%= link_to 'Back', origami_commissions_path, class: 'btn btn-success' %>
<%= f.button :submit, class: 'btn btn-info' %>
</div>
<% end %>
</div>

View File

@@ -0,0 +1,10 @@
<div class="span12">
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= origami_root_path %>">Home</a></li>
<li><a href="<%= origami_commissions_path %>">Commissions</a></li>
<li>Edit</li>
</ul>
</div>
<%= render 'form', commission: @commission %>
</div>

View File

@@ -0,0 +1,44 @@
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= origami_root_path %>">Home</a></li>
<li>Commissions</li>
<span style="float: right">
<%= link_to t('.new', :default => t("helpers.links.new")), new_origami_commission_path ,:class => 'btn btn-primary btn-sm' %>
</span>
</ul>
</div>
<br>
<div class="card">
<table class="table table-striped">
<thead>
<tr>
<th>Product Name</th>
<th>Amount</th>
<th>Commission type</th>
<th>Active</th>
<th colspan="3"></th>
</tr>
</thead>
<tbody>
<% @commissions.each do |commission| %>
<tr>
<td>
<% if Product.exists? %>
<% product = Product.find(commission.product_id) %>
<%= product.name %>
<% end %>
</td>
<td><%= commission.amount %></td>
<td><%= commission.commission_type %></td>
<td><%= commission.is_active %></td>
<td><%= link_to 'Show', origami_commission_path(commission) %></td>
<td><%= link_to 'Edit', edit_origami_commission_path(commission) %></td>
<td><%= link_to 'Destroy', origami_commission_path(commission), method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</tbody>
</table>
</div>

View File

@@ -0,0 +1 @@
json.array! @commissions, partial: 'commissions/commission', as: :commission

View File

@@ -0,0 +1,10 @@
<div class="span12">
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= origami_root_path %>">Home</a></li>
<li><a href="<%= origami_commissions_path %>">Commissions</a></li>
<li>New</li>
</ul>
</div>
<%= render 'form', commission: @commission %>
</div>

View File

@@ -0,0 +1,46 @@
<p id="notice"><%= notice %></p>
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= origami_root_path %>">Home</a></li>
<li><a href="<%= origami_commissions_path %>">Commissions</a></li>
<span style="float: right">
</span>
</ul>
</div>
<div class="card">
<div class="card-block">
<h4 class="card-title">Commission</h4>
<table class="table">
<tbody>
<tr>
<td style="width:20%">Product Name</td>
<td>
<% if Product.exists? %>
<% product = Product.find(@commission.product_id) %>
<%= product.name %>
<% end %>
</td>
</tr>
<tr>
<td style="width:20%">Amount</td>
<td><%= @commission.amount %></td>
</tr>
<tr>
<td style="width:20%">Commission Type</td>
<td><%= @commission.commission_type %></td>
</tr>
<tr>
<td style="width:20%">Active</td>
<td><%= @commission.is_active %></td>
</tr>
</tbody>
</table>
<%= link_to 'Back', origami_commissions_path, class: 'btn btn-success' %>
<%= link_to 'Edit', edit_origami_commission_path(@commission), class: 'btn btn-info' %>
<%= link_to 'Destroy', origami_commission_path(@commission), method: :delete, class: 'btn btn-danger', data: {confirm: 'Are you sure?'} %>
</div>
</div>
</div>

View File

@@ -0,0 +1 @@
json.partial! "commissions/commission", commission: @commission

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

@@ -0,0 +1,6 @@
<h1>Editing Product Commission</h1>
<%= render 'form', product_commission: @product_commission %>
<%= link_to 'Show', @product_commission %> |
<%= link_to 'Back', product_commissions_path %>

View File

@@ -0,0 +1,25 @@
<p id="notice"><%= notice %></p>
<h1>Product Commissions</h1>
<table>
<thead>
<tr>
<th colspan="3"></th>
</tr>
</thead>
<tbody>
<% @product_commissions.each do |product_commission| %>
<tr>
<td><%= link_to 'Show', product_commission %></td>
<td><%= link_to 'Edit', edit_product_commission_path(product_commission) %></td>
<td><%= link_to 'Destroy', product_commission, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</tbody>
</table>
<br>
<%= link_to 'New Product Commission', new_product_commission_path %>

View File

@@ -0,0 +1 @@
json.array! @product_commissions, partial: 'product_commissions/product_commission', as: :product_commission

View File

@@ -0,0 +1,5 @@
<h1>New Product Commission</h1>
<%= render 'form', product_commission: @product_commission %>
<%= link_to 'Back', product_commissions_path %>

View File

@@ -0,0 +1,4 @@
<p id="notice"><%= notice %></p>
<%= link_to 'Edit', edit_product_commission_path(@product_commission) %> |
<%= link_to 'Back', product_commissions_path %>

View File

@@ -0,0 +1 @@
json.partial! "product_commissions/product_commission", product_commission: @product_commission

View File

@@ -1,16 +1,33 @@
<%= simple_form_for([:settings,@settings_product]) do |f| %> <%= simple_form_for([:settings,@settings_product]) do |f| %>
<%= f.error_notification %> <%= f.error_notification %>
<div class="col-md-8">
<div class="form-inputs"> <div class="form-group">
<%= f.input :item_code, :input_html => { :id => 'item_code' } %> <%= f.input :item_code, :input_html => { :id => 'item_code' } %>
<%= f.input :name %> <%= f.input :name %>
<%= f.input :alt_name %> <%= f.input :alt_name %>
<%= f.input :unit_price %> <%= f.input :unit_price %>
<%= f.input :image_path %>
<%= f.input :description %> <%= f.input :description %>
<%= f.input :information %> <%= f.input :information %>
<label><%= f.check_box :taxable %>Taxable</label> <label><%= f.check_box :taxable %>Taxable</label>
</div> </div>
</div>
<label>Product Image</label>
<div class="col-md-4">
<div class="panel padding-10">
<div class="form-group">
<div class="menu-item-img">
<% if f.object.image_path? %>
<p><%= f.object.name %></p>
<%= image_tag f.object.image_path.url, :class => "img-thumbnail" %>
<% else %>
<p>Sample Image</p>
<%= image_tag "/image/menu_images/default.png", :class => "img-thumbnail" %>
<% end %>
</div>
<%= f.file_field :image_path, :class => "img-thumbnail" %>
</div>
</div>
<div class="form-actions"> <div class="form-actions">
<%= f.button :submit %> <%= f.button :submit %>

View File

@@ -0,0 +1,32 @@
<%= simple_form_for([:settings,@promotion,@promotion_product]) do |f| %>
<%= f.error_notification %>
<div class="form-inputs">
<div class="div-border">
<div class="row">
<div class="col-md-12"><%= f.input :item_code %></div>
</div>
<% if @promotion.promo_type == Promotion::PROMO_TYPE1 %>
<div class="row">
<div class="col-md-12"><%= f.input :min_qty %></div>
</div>
<% elsif @promotion.promo_type == Promotion::PROMO_TYPE2 %>
<div class="row">
<div class="col-md-12"><%= f.input :net_off %></div>
</div>
<% elsif @promotion.promo_type == Promotion::PROMO_TYPE3 %>
<div class="row">
<div class="col-md-12"><%= f.input :net_price %></div>
</div>
<% elsif @promotion.promo_type == Promotion::PROMO_TYPE4 %>
<div class="row">
<div class="col-md-12"><%= f.input :percentage %></div>
</div>
<% end %>
</div>
</div>
<div class="form-actions">
<%= f.button :submit %>
</div>
<% end %>

View File

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

View File

@@ -0,0 +1,11 @@
<div class="span12">
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= root_path %>">Home</a></li>
<li><a href="<%= edit_settings_promotion_path(@promotion) %>">Promotions</a></li>
<li>Promotion Products</li>
<li>Edit</li>
</ul>
</div>
<%= render 'form', promotion_products: @promotion_product %>
</div>

View File

@@ -0,0 +1,47 @@
<p id="notice"><%= notice %></p>
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= root_path %>">Home</a></li>
<li><a href="<%= settings_promotions_path %>">Promotions</a></li>
<li>PromotionProducts</li>
<span style="float: right">
<%= link_to t('.new', :default => t("helpers.links.new")),new_settings_promotion_promotion_product_path,:class => 'btn btn-primary btn-sm' %>
</span>
</ul>
</div>
<br>
<div class="card">
<table class="table table-striped">
<thead>
<tr>
<th>Promotion Code</th>
<th>Item Code</th>
<th>Minimum Quantity</th>
<th>Net Off</th>
<th>Net Price</th>
<th>Percentage</th>
<th>Created At</th>
<th colspan="2"></th>
</tr>
</thead>
<tbody>
<% @promotion_products.each do |pro| %>
<tr>
<td><%= link_to pro.promotion.promo_code, settings_promotion_promotion_path(pro.promotion) %></td>
<td><%= pro.item_code %></td>
<td><%= pro.min_qty %></td>
<td><%= pro.net_off rescue "-" %></td>
<td><%= pro.net_price rescue "-" %></td>
<td><%= pro.percentage %></td>
<td><%= pro.created_at.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") %></td>
<td><%= link_to 'Edit', edit_settings_promotion_promotion_product_path(pro) %></td>
<td><%= link_to 'Destroy', settings_promotion_promotion_product_path(pro), method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</tbody>
</table>
</div>

View File

@@ -0,0 +1 @@
json.array! @promotions, partial: 'promotions/promotion', as: :promotion

View File

@@ -0,0 +1,15 @@
<div class="span12">
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= root_path %>">Home</a></li>
<li><a href="<%= edit_settings_promotion_path(@promotion) %>">Promotion</a></li>
<!-- <li><a href="<%= settings_promotion_promotion_products_path %>">Promotion Products</a></li> -->
<li>New</li>
</ul>
</div>
<%= render 'form', promotion_products: @promotion_product %>
</div>
<script>
$("#promotion_promo_code").val(Math.random().toString(36).slice(5) + Math.random().toString(36).slice(5));
</script>

View File

@@ -0,0 +1,28 @@
<div class="span12">
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= root_path %>">Home</a></li>
<li><a href="<%= settings_promotion_path(@promotion) %>">Promotion</a></li>
<li>Promotion Products</li>
</ul>
</div>
</div>
<div class="card">
<div class="card-block">
<h4 class="card-title">Promotion Product</h4>
<table class="table">
<tbody>
<tr><td style="width:20%">Promotion Code</td><td><%= @promotion_product.promo_code %></td></tr>
<tr><td style="width:20%">Item Code</td><td><%= @promotion_product.item_code %></td></tr>
<tr><td style="width:20%">Min Qty</td><td><%= @promotion_product.min_qty %></td></tr>
<tr><td style="width:20%">Net off</td><td><%= @promotion_product.net_off %></td></tr>
<tr><td style="width:20%">Net Price</td><td><%= @promotion_product.net_price %></td></tr>
<tr><td style="width:20%">Percentage</td><td><%= @promotion_product.percentage %></td></tr>
<tr><td style="width:20%"><%= link_to 'Edit', edit_settings_promotion_product_path(@promotion_product) %></td><td><%= link_to 'Destroy', settings_promotion_product_path(@promotion_product), method: :delete, data: { confirm: 'Are you sure?' } %></td></tr>
</tbody>
</table>
</div>
</div>

View File

@@ -0,0 +1 @@
json.partial! "promotions/promotion", promotion: @promotion

View File

@@ -1,4 +1,4 @@
<%= simple_form_for([:settings,@promotion]) do |f| %> <%= simple_nested_form_for([:settings,@promotion]) do |f| %>
<%= f.error_notification %> <%= f.error_notification %>
<div class="form-inputs"> <div class="form-inputs">
@@ -32,13 +32,28 @@
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<%= f.input :promo_type,input_html: { class: "" }, <%= f.input :promo_type,input_html: { class: "" },
collection: %w{Quantity Net_off Net_price Percentage},:class => 'form-control' ,:label => "" %> collection: %w{Quantity Net_off Net_price Percentage},:class => 'form-control' ,:label => "Promotion Type" %>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-6"><%= f.input :original_product,collection: MenuItem.order("name desc"),input_html: { selected: 2 } %></div> <div class="col-md-6"><%= f.input :original_product,collection: MenuItem.order("name desc"),input_html: { selected: 2 } %></div>
<div class="col-md-6"><%= f.input :min_qty %></div> <div class="col-md-6"><%= f.input :min_qty %></div>
</div> </div>
<br>
<p><%= f.link_to_add "Add Product", :promotion_products, :class => 'btn btn-primary' %></p>
<br>
<%= f.fields_for :promotion_products do |p| %>
<div class="row">
<div class="col-md-1"><%= p.input :item_code , :class => "form-control" %></div>
<div class="col-md-1"><%= p.input :min_qty , :class => "form-control" %></div>
<div class="col-md-1"><%= p.input :net_off , :class => "form-control" %></div>
<div class="col-md-1"><%= p.input :net_price , :class => "form-control" %></div>
<div class="col-md-1"><%= p.input :percentage , :class => "form-control" %></div>
<div class="col-md-1" style='padding-top:30px;'><%= p.link_to_remove "X"%></div>
</div>
<% end %>
</div> </div>
</div> </div>

View File

@@ -1,4 +1,28 @@
<p id="notice"><%= notice %></p>
<%= link_to 'Edit', edit_promotion_path(@promotion) %> | <div class="span12">
<%= link_to 'Back', promotions_path %> <div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= root_path %>">Home</a></li>
<li><a href="<%= settings_promotions_path %>">Promotions</a></li>
</ul>
</div>
</div>
<div class="card">
<div class="card-block">
<h4 class="card-title">Promotion</h4>
<table class="table">
<tbody>
<tr><td style="width:20%">Promotion code</td><td><%= @promotion.promo_code %></td></tr>
<tr><td style="width:20%">Promotion Start Date</td><td><%= @promotion.promo_start_date %></td></tr>
<tr><td style="width:20%">Promotion End Date</td><td><%= @promotion.promo_end_date %></td></tr>
<tr><td style="width:20%">Promotion Start Hour</td><td><%= @promotion.promo_start_hour %></td></tr>
<tr><td style="width:20%">Promotion Start Hour</td><td><%= @promotion.promo_end_hour %></td></tr>
<tr><td style="width:20%"><%= link_to 'Edit', edit_settings_promotion_path(@promotion) %></td><td><%= link_to 'Destroy', settings_promotion_path(@promotion), method: :delete, data: { confirm: 'Are you sure?' } %></td></tr>
</tbody>
</table>
</div>
</div>

View File

@@ -169,6 +169,8 @@ Rails.application.routes.draw do
post '/:sale_id/get_customer' => "customers#get_customer" post '/:sale_id/get_customer' => "customers#get_customer"
resources :addorders resources :addorders
resources :commissions
resources :commissioners
end end
#--------- Waiter/Ordering Station ------------# #--------- Waiter/Ordering Station ------------#
@@ -279,7 +281,9 @@ Rails.application.routes.draw do
end end
#promotion #promotion
resources :promotions resources :promotions do
resources :promotion_products
end
end end
@@ -322,6 +326,6 @@ Rails.application.routes.draw do
#----------- Print Setup --------# #----------- Print Setup --------#
resources :print_settings resources :print_settings
resources :commissioners
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
end end

View File

@@ -0,0 +1,12 @@
class CreateCommissioners < ActiveRecord::Migration[5.1]
def change
create_table :commissioners do |t|
t.string :name, :null => false
t.string :emp_id
t.string :created_by
t.string :commission_type
t.boolean :is_active
t.timestamps
end
end
end

View File

@@ -0,0 +1,11 @@
class CreateCommissions < ActiveRecord::Migration[5.1]
def change
create_table :commissions do |t|
t.integer :product_id, null: false
t.integer :amount
t.string :commission_type
t.boolean :is_active
t.timestamps
end
end
end

View File

@@ -0,0 +1,12 @@
class CreateProductCommissions < ActiveRecord::Migration[5.1]
def change
create_table :product_commissions do |t|
t.string :product_code
t.integer :commission_id
t.integer :qty
t.string :sale_id
t.string :sale_item_id
t.timestamps
end
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 368 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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