Merge branch 'august_spring' of bitbucket.org:code2lab/sxrestaurant into august_spring

This commit is contained in:
Nweni
2017-08-22 14:12:04 +06:30
39 changed files with 1413 additions and 945 deletions

2
.idea/.generators generated
View File

@@ -5,4 +5,4 @@ You are allowed to:
2. Remove generators
3. Add installed generators
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" /><Generator name="uploader" /></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

@@ -181,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_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="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="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" />

485
.idea/workspace.xml generated
View File

@@ -2,26 +2,11 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="89ca96af-a0e4-4fe4-b9a3-9969f22d7079" name="Default" comment="">
<change type="MOVED" beforePath="$PROJECT_DIR$/app/controllers/commissioners_controller.rb" afterPath="$PROJECT_DIR$/app/controllers/origami/commissioners_controller.rb" />
<change type="MOVED" beforePath="$PROJECT_DIR$/app/controllers/commissions_controller.rb" afterPath="$PROJECT_DIR$/app/controllers/origami/commissions_controller.rb" />
<change type="MOVED" beforePath="$PROJECT_DIR$/app/views/commissioners/_commissioner.json.jbuilder" afterPath="$PROJECT_DIR$/app/views/origami/commissioners/_commissioner.json.jbuilder" />
<change type="MOVED" beforePath="$PROJECT_DIR$/app/views/commissioners/_form.html.erb" afterPath="$PROJECT_DIR$/app/views/origami/commissioners/_form.html.erb" />
<change type="MOVED" beforePath="$PROJECT_DIR$/app/views/commissioners/edit.html.erb" afterPath="$PROJECT_DIR$/app/views/origami/commissioners/edit.html.erb" />
<change type="MOVED" beforePath="$PROJECT_DIR$/app/views/commissioners/index.html.erb" afterPath="$PROJECT_DIR$/app/views/origami/commissioners/index.html.erb" />
<change type="MOVED" beforePath="$PROJECT_DIR$/app/views/commissioners/index.json.jbuilder" afterPath="$PROJECT_DIR$/app/views/origami/commissioners/index.json.jbuilder" />
<change type="MOVED" beforePath="$PROJECT_DIR$/app/views/commissioners/new.html.erb" afterPath="$PROJECT_DIR$/app/views/origami/commissioners/new.html.erb" />
<change type="MOVED" beforePath="$PROJECT_DIR$/app/views/commissioners/show.html.erb" afterPath="$PROJECT_DIR$/app/views/origami/commissioners/show.html.erb" />
<change type="MOVED" beforePath="$PROJECT_DIR$/app/views/commissioners/show.json.jbuilder" afterPath="$PROJECT_DIR$/app/views/origami/commissioners/show.json.jbuilder" />
<change type="MOVED" beforePath="$PROJECT_DIR$/app/views/commissions/_commission.json.jbuilder" afterPath="$PROJECT_DIR$/app/views/origami/commissions/_commission.json.jbuilder" />
<change type="MOVED" beforePath="$PROJECT_DIR$/app/views/commissions/_form.html.erb" afterPath="$PROJECT_DIR$/app/views/origami/commissions/_form.html.erb" />
<change type="MOVED" beforePath="$PROJECT_DIR$/app/views/commissions/edit.html.erb" afterPath="$PROJECT_DIR$/app/views/origami/commissions/edit.html.erb" />
<change type="MOVED" beforePath="$PROJECT_DIR$/app/views/commissions/index.html.erb" afterPath="$PROJECT_DIR$/app/views/origami/commissions/index.html.erb" />
<change type="MOVED" beforePath="$PROJECT_DIR$/app/views/commissions/index.json.jbuilder" afterPath="$PROJECT_DIR$/app/views/origami/commissions/index.json.jbuilder" />
<change type="MOVED" beforePath="$PROJECT_DIR$/app/views/commissions/new.html.erb" afterPath="$PROJECT_DIR$/app/views/origami/commissions/new.html.erb" />
<change type="MOVED" beforePath="$PROJECT_DIR$/app/views/commissions/show.html.erb" afterPath="$PROJECT_DIR$/app/views/origami/commissions/show.html.erb" />
<change type="MOVED" beforePath="$PROJECT_DIR$/app/views/commissions/show.json.jbuilder" afterPath="$PROJECT_DIR$/app/views/origami/commissions/show.json.jbuilder" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/config/routes.rb" afterPath="$PROJECT_DIR$/config/routes.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/views/home/index.html.erb" afterPath="$PROJECT_DIR$/app/views/home/index.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$/app/views/origami/home/show.html.erb" afterPath="$PROJECT_DIR$/app/views/origami/home/show.html.erb" />
</list>
<ignored path="$PROJECT_DIR$/.bundle/" />
<ignored path="$PROJECT_DIR$/components/" />
@@ -41,98 +26,71 @@
<file leaf-file-name="20170821093252_create_commissions.rb" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/db/migrate/20170821093252_create_commissions.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="36">
<caret line="2" column="36" lean-forward="true" selection-start-line="2" selection-start-column="36" selection-end-line="2" selection-end-column="36" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="commissioners_controller.rb" pinned="false" current-in-tab="false">
<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="true" selection-start-line="2" selection-start-column="0" selection-end-line="2" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="commissions_controller.rb" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/app/controllers/origami/commissions_controller.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1010">
<caret line="59" column="38" lean-forward="true" selection-start-line="59" selection-start-column="38" selection-end-line="59" selection-end-column="38" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="new.html.erb" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/app/views/origami/commissions/new.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="36">
<caret line="2" column="14" lean-forward="false" selection-start-line="2" selection-start-column="14" selection-end-line="2" selection-end-column="14" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="_form.html.erb" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/app/views/origami/commissions/_form.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="126">
<caret line="7" column="27" lean-forward="true" selection-start-line="7" selection-start-column="27" selection-end-line="7" selection-end-column="27" />
<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>
</file>
<file leaf-file-name="index.html.erb" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/app/views/origami/commissions/index.html.erb">
<entry file="file://$PROJECT_DIR$/app/views/origami/home/index.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="234">
<caret line="13" column="10" lean-forward="true" selection-start-line="13" selection-start-column="10" selection-end-line="13" selection-end-column="10" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="cash_outs_controller.rb" pinned="false" current-in-tab="false">
<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>
</file>
<file leaf-file-name="commissioner.rb" pinned="false" current-in-tab="false">
<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>
</file>
<file leaf-file-name="booking_order.rb" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/app/models/booking_order.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<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>
</file>
<file leaf-file-name="commission.rb" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/app/models/commission.rb">
<file leaf-file-name="show.html.erb" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/app/views/origami/home/show.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<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>
</file>
<file leaf-file-name="20170822034139_create_product_commissions.rb" pinned="false" current-in-tab="true">
<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 />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="dashboard.html.erb" pinned="false" current-in-tab="false">
<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>
</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 />
</state>
</provider>
@@ -142,11 +100,12 @@
</component>
<component name="FindInProjectRecents">
<findStrings>
<find>origami</find>
<find>table_invoice</find>
<find>sale_id</find>
<find>oqs</find>
<find>void</find>
<find>red</find>
<find>origami</find>
</findStrings>
</component>
<component name="Git.Settings">
@@ -160,7 +119,6 @@
<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/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/rooms/show.html.erb" />
<option value="$PROJECT_DIR$/app/views/origami/orders/show.html.erb" />
@@ -168,7 +126,6 @@
<option value="$PROJECT_DIR$/.idea/workspace.xml" />
<option value="$PROJECT_DIR$/app/views/home/show.html.erb" />
<option value="$PROJECT_DIR$/app/models/ability.rb" />
<option value="$PROJECT_DIR$/app/views/home/dashboard.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$/.gitignore" />
@@ -179,9 +136,21 @@
<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/commissions/_form.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>
</option>
</component>
@@ -192,10 +161,10 @@
<sorting>DEFINITION_ORDER</sorting>
</component>
<component name="ProjectFrameBounds">
<option name="x" value="1440" />
<option name="x" value="1441" />
<option name="y" value="22" />
<option name="width" value="1920" />
<option name="height" value="724" />
<option name="width" value="1919" />
<option name="height" value="722" />
</component>
<component name="ProjectLevelVcsManager">
<ConfirmationsSetting value="1" id="Add" />
@@ -215,22 +184,8 @@
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="Scratches" />
<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="ProjectPane">
<subPane>
<PATH>
@@ -343,33 +298,7 @@
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="origami" />
<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="origami" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="commissioners" />
<option name="myItemId" value="home" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
@@ -447,12 +376,27 @@
</PATH>
</subPane>
</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>
</component>
<component name="PropertiesComponent">
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
<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">
@@ -773,6 +717,9 @@
<option name="remove_strategy" value="false" />
</component>
<component name="SpringUtil" SPRING_PRE_LOADER_OPTION="true" />
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="89ca96af-a0e4-4fe4-b9a3-9969f22d7079" name="Default" comment="" />
@@ -784,35 +731,36 @@
<workItem from="1498465879846" duration="18792000" />
<workItem from="1502681128282" duration="12098000" />
<workItem from="1502780405774" duration="8876000" />
<workItem from="1503287439872" duration="5377000" />
<workItem from="1503287439872" duration="6673000" />
<workItem from="1503328001970" duration="5777000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="52112000" />
<option name="totallyTimeSpent" value="59185000" />
</component>
<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" />
<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.1773163" 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="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="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="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="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="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="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="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="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="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>
</component>
<component name="TypeScriptGeneratedFilesManager">
@@ -826,12 +774,6 @@
<watches-manager />
</component>
<component name="editorHistoryManager">
<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/payments_controller.rb" />
<entry file="file://$PROJECT_DIR$/app/models/sale_payment.rb" />
@@ -839,9 +781,7 @@
<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/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/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" />
@@ -863,18 +803,7 @@
<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/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$/.gitignore">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="344">
<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$/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">
@@ -925,6 +854,29 @@
<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>
@@ -945,90 +897,165 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/models/commissioner.rb">
<entry file="file://$PROJECT_DIR$/.gitignore">
<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$/db/migrate/20170821093252_create_commissions.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="36">
<caret line="2" column="36" lean-forward="true" 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/index.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/views/origami/commissioners/edit.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/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" />
<state relative-caret-position="471">
<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="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/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="true" 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/commissions/index.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="234">
<caret line="13" column="10" lean-forward="true" selection-start-line="13" selection-start-column="10" selection-end-line="13" selection-end-column="10" />
<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="1010">
<caret line="59" column="38" lean-forward="true" selection-start-line="59" selection-start-column="38" selection-end-line="59" selection-end-column="38" />
<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/commissions/new.html.erb">
<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="14" lean-forward="false" selection-start-line="2" selection-start-column="14" selection-end-line="2" selection-end-column="14" />
<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="27" lean-forward="true" selection-start-line="7" selection-start-column="27" selection-end-line="7" selection-end-column="27" />
<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 />
</state>
</provider>

View File

@@ -1,5 +1,5 @@
class Origami::CommissionsController < BaseOrigamiController
# before_action :set_commission, only: [:show, :edit, :update, :destroy]
before_action :set_commission, only: [:show, :edit, :update, :destroy]
# GET /commissions
# GET /commissions.json

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

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

View File

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

View File

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

View File

@@ -29,108 +29,113 @@
<% @employees.each do |employee| %>
<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>
<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>
<div class="card-block">
<h4 class="card-title">
<%= employee.name %>
</h4>
<div class="card-content">
(<%= employee.emp_id%>)
(<%= employee.emp_id %>)
</div>
<div class="card-footer">
<small><%= employee.role %></small>
<small><%= employee.role %></small>
</div>
</div>
</div>
</div>
<% end %>
</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">
<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 panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#admin">Administrator <span class="glyphicon glyphicon-plus"></span></a>
</h4>
</div>
<div id="admin" class="panel-collapse collapse in">
<div class="panel-body">
<ul class="">
<li class="">All Accept</li>
</ul>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#admin">Administrator
<span class="glyphicon glyphicon-plus"></span></a>
</h4>
</div>
<div id="admin" class="panel-collapse collapse in">
<div class="panel-body">
<ul class="">
<li class="">All Accept</li>
</ul>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#manager">Manager <span class="glyphicon glyphicon-plus"></span></a>
</h4>
</div>
<div id="manager" class="panel-collapse collapse">
<div class="panel-body">
<ul class="">
<li class="">All Accept except Membership and Payment Settings</li>
</ul>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#manager">Manager
<span class="glyphicon glyphicon-plus"></span></a>
</h4>
</div>
<div id="manager" class="panel-collapse collapse">
<div class="panel-body">
<ul class="">
<li class="">All Accept except Membership and Payment Settings</li>
</ul>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#supervisor">Supervisor <span class="glyphicon glyphicon-plus"></span></a>
</h4>
</div>
<div id="supervisor" class="panel-collapse collapse">
<div class="panel-body">
<ul class="">
<li class="">Void</li>
<li class="">FOC</li>
<li class="">Edit</li>
<li class="">Credit </li>
<li class="">and Payment </li>
</ul>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#supervisor">Supervisor
<span class="glyphicon glyphicon-plus"></span></a>
</h4>
</div>
<div id="supervisor" class="panel-collapse collapse">
<div class="panel-body">
<ul class="">
<li class="">Void</li>
<li class="">FOC</li>
<li class="">Edit</li>
<li class="">Credit</li>
<li class="">and Payment</li>
</ul>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#cashier">Cashier <span class="glyphicon glyphicon-plus"></span></a>
</h4>
</div>
<div id="cashier" class="panel-collapse collapse">
<div class="panel-body">
<ul class="">
<li class="">Orgami Panel except Edit and Void</li>
<li class="">Sale and Order </li>
<li class="">and Queue in CRM</li>
</ul>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#cashier">Cashier
<span class="glyphicon glyphicon-plus"></span></a>
</h4>
</div>
<div id="cashier" class="panel-collapse collapse">
<div class="panel-body">
<ul class="">
<li class="">Orgami Panel except Edit and Void</li>
<li class="">Sale and Order</li>
<li class="">and Queue in CRM</li>
</ul>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#accountant">Accountant <span class="glyphicon glyphicon-plus"></span></a>
</h4>
</div>
<div id="accountant" class="panel-collapse collapse">
<div class="panel-body">
<ul class="">
<li class="">Daily Sale Report</li>
<li class="">Sale Item Report</li>
<li class="">Receipt No Report</li>
<li class="">ShiftSale Report</li>
</ul>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#accountant">Accountant
<span class="glyphicon glyphicon-plus"></span></a>
</h4>
</div>
<div id="accountant" class="panel-collapse collapse">
<div class="panel-body">
<ul class="">
<li class="">Daily Sale Report</li>
<li class="">Sale Item Report</li>
<li class="">Receipt No Report</li>
<li class="">ShiftSale Report</li>
</ul>
</div>
</div>
</div>
</div> <!-- end accordion id -->
</div>
</div> <!-- end col-md-4 -->
@@ -140,6 +145,7 @@
.panel-body {
padding: 5px !important;
}
/*.card-columns {
column-count: 4;
display: inline-block;
@@ -148,6 +154,7 @@
float: right;
}
@media (min-width: 34em) {
.card-columns {
-webkit-column-count: 2;
@@ -181,25 +188,25 @@
}
</style>
<script type="text/javascript">
$(document).on('turbolinks:load', function() {
$(".empBtn").click(function(event){
event.preventDefault();
console.log($(this).data("formid"));
var item = $(this).data("formid");
$(item).submit();
$(document).on('turbolinks:load', function () {
$(".empBtn").click(function (event) {
event.preventDefault();
console.log($(this).data("formid"));
var item = $(this).data("formid");
$(item).submit();
});
// Add minus icon for collapse element which is open by default
$(".collapse.in").each(function(){
$(this).siblings(".panel-heading").find(".glyphicon").addClass("glyphicon-minus").removeClass("glyphicon-plus");
});
// Toggle plus minus icon on show hide of collapse element
$(".collapse").on('show.bs.collapse', function(){
$(this).parent().find(".glyphicon").removeClass("glyphicon-plus").addClass("glyphicon-minus");
}).on('hide.bs.collapse', function(){
$(this).parent().find(".glyphicon").removeClass("glyphicon-minus").addClass("glyphicon-plus");
});
});
});
// Add minus icon for collapse element which is open by default
$(".collapse.in").each(function () {
$(this).siblings(".panel-heading").find(".glyphicon").addClass("glyphicon-minus").removeClass("glyphicon-plus");
});
// Toggle plus minus icon on show hide of collapse element
$(".collapse").on('show.bs.collapse', function () {
$(this).parent().find(".glyphicon").removeClass("glyphicon-plus").addClass("glyphicon-minus");
}).on('hide.bs.collapse', function () {
$(this).parent().find(".glyphicon").removeClass("glyphicon-minus").addClass("glyphicon-plus");
});
});
</script>
@@ -207,6 +214,6 @@ $(document).on('turbolinks:load', function() {

View File

@@ -61,7 +61,7 @@
<a href="<%= oqs_root_path %>" role="button" aria-haspopup="true" aria-expanded="false">&nbsp;&nbsp;&nbsp;OQS</a>
</li>
<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 class="navbar-nav mr-auto">
<a href="<%= crm_customers_path %>" role="button" aria-haspopup="true" aria-expanded="false">&nbsp;&nbsp;&nbsp;CRM</a>

View File

@@ -1,14 +1,18 @@
<%= simple_form_for([:origami,@commissioner]) do |f| %>
<%= f.error_notification %>
<div class="col-md-3">
<%= simple_form_for([:origami, @commissioner]) do |f| %>
<%= f.error_notification %>
<div class="form-inputs">
<%= f.input :name %>
<%= f.collection_select :emp_id, Employee.all.order('name asc'), :emp_id, :name, {prompt: "Select an Employee"}, {class: "form-control"} %>
<%= f.input :commission_type %>
<label><%= f.check_box :is_active %> Active </label>
</div>
<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">
<%= f.button :submit %>
</div>
<% end %>
<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

@@ -1,10 +1,10 @@
<div class="span12">
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= root_path %>">Home</a></li>
<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>
</div>

View File

@@ -1,6 +1,6 @@
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= %>">Home</a></li>
<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' %>

View File

@@ -1,10 +1,10 @@
<div class="span12">
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= root_path %>">Home</a></li>
<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>
</div>

View File

@@ -1,11 +1,11 @@
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= root_path %>">Home</a></li>
<li><a href="<%= origami_commissioners_path %>">Commissioners</a></li>
<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 style="float: right">
</span>
</ul>
</ul>
</div>
<div class="card">
<div class="card-block">
@@ -14,25 +14,37 @@
<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>
<tr><td style="width:20%"><%= 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>
<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>

View File

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

View File

@@ -1,10 +1,10 @@
<div class="span12">
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= root_path %>">Home</a></li>
<li><a href="<%= origami_commissions_path %>">Commissions</a></li>
<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>
</div>

View File

@@ -1,6 +1,6 @@
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= %>">Home</a></li>
<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' %>

View File

@@ -1,10 +1,10 @@
<div class="span12">
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= root_path %>">Home</a></li>
<li><a href="<%= origami_commissions_path %>">Commissions</a></li>
<li>New</li>
</ul>
</div>
<%= render 'form', commission: @commission %>
</div>
<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

@@ -1,43 +1,45 @@
<p id="notice"><%= notice %></p>
<%= link_to 'Edit', edit_commission_path(@commission) %> |
<%= link_to 'Back', commissions_path %>
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= root_path %>">Home</a></li>
<li><a href="<%= origami_commissions_path %>">Commissions</a></li>
<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 style="float: right">
</span>
</ul>
</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>
<tr><td style="width:20%"><%= 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>
<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>

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

@@ -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

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 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 ProductCommission, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
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 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 "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