create productCommission
This commit is contained in:
300
.idea/workspace.xml
generated
300
.idea/workspace.xml
generated
@@ -2,20 +2,11 @@
|
||||
<project version="4">
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="89ca96af-a0e4-4fe4-b9a3-9969f22d7079" name="Default" comment="">
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/.generators" afterPath="$PROJECT_DIR$/.idea/.generators" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/sxrestaurant.iml" afterPath="$PROJECT_DIR$/.idea/sxrestaurant.iml" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/controllers/origami/commissions_controller.rb" afterPath="$PROJECT_DIR$/app/controllers/origami/commissions_controller.rb" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/views/origami/commissioners/_form.html.erb" afterPath="$PROJECT_DIR$/app/views/origami/commissioners/_form.html.erb" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/views/origami/commissioners/edit.html.erb" afterPath="$PROJECT_DIR$/app/views/origami/commissioners/edit.html.erb" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/views/origami/commissioners/index.html.erb" afterPath="$PROJECT_DIR$/app/views/origami/commissioners/index.html.erb" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/views/origami/commissioners/new.html.erb" afterPath="$PROJECT_DIR$/app/views/origami/commissioners/new.html.erb" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/views/origami/commissioners/show.html.erb" afterPath="$PROJECT_DIR$/app/views/origami/commissioners/show.html.erb" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/views/origami/commissions/_form.html.erb" afterPath="$PROJECT_DIR$/app/views/origami/commissions/_form.html.erb" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/views/origami/commissions/edit.html.erb" afterPath="$PROJECT_DIR$/app/views/origami/commissions/edit.html.erb" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/views/origami/commissions/index.html.erb" afterPath="$PROJECT_DIR$/app/views/origami/commissions/index.html.erb" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/views/origami/commissions/new.html.erb" afterPath="$PROJECT_DIR$/app/views/origami/commissions/new.html.erb" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/views/origami/commissions/show.html.erb" afterPath="$PROJECT_DIR$/app/views/origami/commissions/show.html.erb" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/views/home/dashboard.html.erb" afterPath="$PROJECT_DIR$/app/views/home/dashboard.html.erb" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/views/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/" />
|
||||
@@ -32,101 +23,74 @@
|
||||
<component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
|
||||
<component name="FileEditorManager">
|
||||
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
|
||||
<file leaf-file-name="edit.html.erb" pinned="false" current-in-tab="false">
|
||||
<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="true" selection-start-line="4" selection-start-column="23" selection-end-line="4" selection-end-column="23" />
|
||||
<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="-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>
|
||||
</file>
|
||||
<file leaf-file-name="_form.html.erb" pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/app/views/origami/commissions/_form.html.erb">
|
||||
<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="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>
|
||||
</file>
|
||||
<file leaf-file-name="new.html.erb" pinned="false" current-in-tab="true">
|
||||
<entry file="file://$PROJECT_DIR$/app/views/origami/commissions/new.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" />
|
||||
<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/commissioners/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="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" />
|
||||
<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="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="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/origami/commissions/index.html.erb">
|
||||
<entry file="file://$PROJECT_DIR$/app/views/home/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" />
|
||||
<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="new.html.erb" pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/app/views/origami/commissioners/new.html.erb">
|
||||
<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="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>
|
||||
</file>
|
||||
<file leaf-file-name="edit.html.erb" pinned="false" current-in-tab="false">
|
||||
<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>
|
||||
</file>
|
||||
<file leaf-file-name="show.html.erb" pinned="false" current-in-tab="false">
|
||||
<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>
|
||||
</file>
|
||||
<file leaf-file-name="show.html.erb" pinned="false" current-in-tab="false">
|
||||
<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" />
|
||||
<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>
|
||||
@@ -136,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">
|
||||
@@ -154,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" />
|
||||
@@ -162,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" />
|
||||
@@ -183,6 +146,11 @@
|
||||
<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>
|
||||
</option>
|
||||
</component>
|
||||
@@ -330,59 +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="commissions" />
|
||||
<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>
|
||||
@@ -480,6 +396,7 @@
|
||||
<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	FILE	file:///Users/zinlinphyo/Documents/projectX/code2lab/ror/sxrestaurant/app/views/layouts/_header.html.erb" />
|
||||
</component>
|
||||
<component name="RecentsManager">
|
||||
<key name="MoveFile.RECENT_KEYS">
|
||||
@@ -800,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="" />
|
||||
@@ -812,12 +732,12 @@
|
||||
<workItem from="1502681128282" duration="12098000" />
|
||||
<workItem from="1502780405774" duration="8876000" />
|
||||
<workItem from="1503287439872" duration="6673000" />
|
||||
<workItem from="1503328001970" duration="3047000" />
|
||||
<workItem from="1503328001970" duration="5777000" />
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
<component name="TimeTrackingManager">
|
||||
<option name="totallyTimeSpent" value="56455000" />
|
||||
<option name="totallyTimeSpent" value="59185000" />
|
||||
</component>
|
||||
<component name="ToolWindowManager">
|
||||
<frame x="1441" y="22" width="1919" height="722" extended-state="0" />
|
||||
@@ -828,19 +748,19 @@
|
||||
<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.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">
|
||||
@@ -854,8 +774,6 @@
|
||||
<watches-manager />
|
||||
</component>
|
||||
<component name="editorHistoryManager">
|
||||
<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" />
|
||||
@@ -863,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" />
|
||||
@@ -887,9 +803,6 @@
|
||||
<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$/db/migrate/20170818051922_create_commissioner.rb" />
|
||||
<entry file="file://$PROJECT_DIR$/app/views/origami/sale_edit/edit.html.erb">
|
||||
@@ -992,14 +905,6 @@
|
||||
</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/origami/commissioners/_form.html.erb">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="234">
|
||||
@@ -1059,7 +964,7 @@
|
||||
<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="true" selection-start-line="4" selection-start-column="23" selection-end-line="4" selection-end-column="23" />
|
||||
<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>
|
||||
@@ -1082,8 +987,75 @@
|
||||
</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="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" />
|
||||
<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 />
|
||||
</state>
|
||||
</provider>
|
||||
|
||||
74
app/controllers/origami/product_commissions_controller.rb
Normal file
74
app/controllers/origami/product_commissions_controller.rb
Normal 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
|
||||
2
app/helpers/origami/product_commissions_helper.rb
Normal file
2
app/helpers/origami/product_commissions_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module Origami::ProductCommissionsHelper
|
||||
end
|
||||
2
app/models/product_commission.rb
Normal file
2
app/models/product_commission.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
class ProductCommission < ApplicationRecord
|
||||
end
|
||||
@@ -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,7 +218,7 @@
|
||||
</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">
|
||||
|
||||
@@ -30,13 +30,13 @@
|
||||
<% @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>
|
||||
<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>
|
||||
@@ -47,7 +47,7 @@
|
||||
</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> -->
|
||||
@@ -55,7 +55,8 @@
|
||||
<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>
|
||||
<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">
|
||||
@@ -69,7 +70,8 @@
|
||||
<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>
|
||||
<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">
|
||||
@@ -83,7 +85,8 @@
|
||||
<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>
|
||||
<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">
|
||||
@@ -92,8 +95,8 @@
|
||||
<li class="">Void</li>
|
||||
<li class="">FOC</li>
|
||||
<li class="">Edit</li>
|
||||
<li class="">Credit </li>
|
||||
<li class="">and Payment </li>
|
||||
<li class="">Credit</li>
|
||||
<li class="">and Payment</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -101,14 +104,15 @@
|
||||
<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>
|
||||
<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="">Sale and Order</li>
|
||||
<li class="">and Queue in CRM</li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -117,7 +121,8 @@
|
||||
<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>
|
||||
<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">
|
||||
@@ -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,8 +188,8 @@
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
$(document).on('turbolinks:load', function() {
|
||||
$(".empBtn").click(function(event){
|
||||
$(document).on('turbolinks:load', function () {
|
||||
$(".empBtn").click(function (event) {
|
||||
event.preventDefault();
|
||||
console.log($(this).data("formid"));
|
||||
var item = $(this).data("formid");
|
||||
@@ -190,16 +197,16 @@ $(document).on('turbolinks:load', function() {
|
||||
|
||||
});
|
||||
// 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");
|
||||
});
|
||||
// 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");
|
||||
}).on('hide.bs.collapse', function(){
|
||||
}).on('hide.bs.collapse', function () {
|
||||
$(this).parent().find(".glyphicon").removeClass("glyphicon-minus").addClass("glyphicon-plus");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
<a href="<%= oqs_root_path %>" role="button" aria-haspopup="true" aria-expanded="false"> OQS</a>
|
||||
</li>
|
||||
<li class="navbar-nav mr-auto">
|
||||
<a href="<%= origami_root_path %>" role="button" aria-haspopup="true" aria-expanded="false"> Origami</a>
|
||||
<a href="<%= origami_root_path %>" role="button" aria-haspopup="true" aria-expanded="false"> Cashier</a>
|
||||
</li>
|
||||
<li class="navbar-nav mr-auto">
|
||||
<a href="<%= crm_customers_path %>" role="button" aria-haspopup="true" aria-expanded="false"> CRM</a>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<div class="tab-pane" id="completed" role="tabpanel" style="max-height:600px; overflow:auto">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<% @complete.each do |sale| %>
|
||||
<div class="card sales red text-white" data-id = "<%= sale.sale_id %>">
|
||||
<div class="card sales red text-white" data-id="<%= sale.sale_id %>">
|
||||
<div class="card-block">
|
||||
<%= sale.receipt_no %>
|
||||
<span style="font-size:12px;float:right;line-height:inherit;"><%= sale.sale_status %></span>
|
||||
@@ -101,7 +101,7 @@
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
|
||||
<% @orders.each do |order| %>
|
||||
<div class="card orders red text-white" data-id = "<%= order.order_id %>">
|
||||
<div class="card orders red text-white" data-id="<%= order.order_id %>">
|
||||
<div class="card-block">
|
||||
<%= order.order_id %>
|
||||
</div>
|
||||
@@ -116,11 +116,12 @@
|
||||
|
||||
<!-- Column Two -->
|
||||
<div class="col-lg-5 col-md-5 col-sm-5">
|
||||
<div class="card" >
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
|
||||
<% if @status_order == 'order' && @status_sale != 'sale' %>
|
||||
<div id="save_order_id" data-order="<%= @obj_order.order_id %>"><strong id="order-title">ORDER DETAILS </strong> | Table <%= @dining.name rescue "" %></div>
|
||||
<div id="save_order_id" data-order="<%= @obj_order.order_id %>">
|
||||
<strong id="order-title">ORDER DETAILS </strong> | Table <%= @dining.name rescue "" %></div>
|
||||
<% elsif @status_sale == 'sale' %>
|
||||
<div><strong id="order-title">INVOICE DETAILS </strong> | Table <%= @dining.name rescue "" %></div>
|
||||
<% end %>
|
||||
@@ -138,7 +139,8 @@
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-6 col-sm-6 text-right">
|
||||
|
||||
<p>Date: <span id="receipt_date"><%= @date.utc.getlocal.strftime("%d/%m/%Y - %I:%M %p") rescue '-'%></span></p>
|
||||
<p>Date: <span id="receipt_date"><%= @date.utc.getlocal.strftime("%d/%m/%Y - %I:%M %p") rescue '-' %></span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -147,10 +149,10 @@
|
||||
<% if @status_sale == 'sale' %>
|
||||
<p class="hidden customer-id"><%= @sale_array[0].customer_id rescue '' %></p>
|
||||
<p>Customer : <%= @sale_array[0].customer.name rescue '' %></p>
|
||||
<%else%>
|
||||
<% else %>
|
||||
<p class="hidden customer-id"><%= @customer.customer_id rescue "" %></p>
|
||||
<p>Customer : <%= @customer.name rescue "" %></p>
|
||||
<%end%>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-text" style="min-height:500px; max-height:500px; overflow-x:scroll">
|
||||
@@ -160,8 +162,10 @@
|
||||
|
||||
<th>#</th>
|
||||
<th class="item-name">Items</th>
|
||||
<th class="item-attr">QTY</td>
|
||||
<th class="item-attr">Price</td>
|
||||
<th class="item-attr">QTY
|
||||
</td>
|
||||
<th class="item-attr">Price
|
||||
</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -195,7 +199,7 @@
|
||||
if @status_order == 'order' && @status_sale != 'sale'
|
||||
unless @order_items.nil?
|
||||
count = 0
|
||||
@order_items.each do |order_item |
|
||||
@order_items.each do |order_item|
|
||||
count += 1
|
||||
sub_total = sub_total + (order_item.price * order_item.qty)
|
||||
|
||||
@@ -223,26 +227,28 @@
|
||||
<td class="item-attr"><strong id="order-sub-total"><%= sub_total %></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<%if @obj_sale != nil && @obj_sale.discount_type == 'member_discount'%>
|
||||
<% if @obj_sale != nil && @obj_sale.discount_type == 'member_discount' %>
|
||||
<td class="charges-name"><strong>Member Discount:</strong></td>
|
||||
<%else%>
|
||||
<% else %>
|
||||
<td class="charges-name"><strong>Discount:</strong></td>
|
||||
<%end%>
|
||||
<% end %>
|
||||
|
||||
<td class="item-attr"><strong id="order-discount">(<%= @obj_sale.total_discount rescue 0%>)</strong></td>
|
||||
<td class="item-attr"><strong id="order-discount">(<%= @obj_sale.total_discount rescue 0 %>)</strong></td>
|
||||
</tr>
|
||||
<% if @status_sale == "sale" %>
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Tax:</strong></td>
|
||||
<td class="item-attr"><strong id="order-Tax"><%= @obj_sale.total_tax rescue 0%></strong></td>
|
||||
<td class="item-attr"><strong id="order-Tax"><%= @obj_sale.total_tax rescue 0 %></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Rounding Adj:</strong></td>
|
||||
<td class="item-attr"><strong id="order-round-adj"><%= @obj_sale.rounding_adjustment rescue 0%></strong></td>
|
||||
<td class="item-attr">
|
||||
<strong id="order-round-adj"><%= @obj_sale.rounding_adjustment rescue 0 %></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Grand Total:</strong></td>
|
||||
<td class="item-attr"><strong id="order-grand-total"><%= @obj_sale.grand_total rescue 0%></strong></td>
|
||||
<td class="item-attr"><strong id="order-grand-total"><%= @obj_sale.grand_total rescue 0 %></strong>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<tr class="rebate_amount"></tr>
|
||||
@@ -258,7 +264,7 @@
|
||||
<table class="table table-striped">
|
||||
<%
|
||||
count = 0
|
||||
@order_items.each do |order_item |
|
||||
@order_items.each do |order_item|
|
||||
count += 1
|
||||
%>
|
||||
|
||||
@@ -273,7 +279,7 @@
|
||||
end
|
||||
%>
|
||||
</table>
|
||||
<button class='btn btn-primary' id='add_invoice'> Add to existing invoice </button>
|
||||
<button class='btn btn-primary' id='add_invoice'> Add to existing invoice</button>
|
||||
<% end %>
|
||||
<% if @sale_array.size > 1 %>
|
||||
<br><br>
|
||||
@@ -287,7 +293,11 @@
|
||||
<table class="table table-striped">
|
||||
<tr>
|
||||
<td>Receipt No - <%= sale.receipt_no %></td>
|
||||
<td><button class='btn btn-sm btn-primary invoicedetails' id="<%= sale.sale_id %>">Show Detail </button></td>
|
||||
<td>
|
||||
<button class='btn btn-sm btn-primary invoicedetails' id="<%= sale.sale_id %>">Show
|
||||
Detail
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<%
|
||||
@@ -304,28 +314,29 @@
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<!-- Waiter Buttons -->
|
||||
|
||||
<button type="button" class="btn btn-primary btn-block" id='back' >Back</button>
|
||||
<button type="button" id="add_order" class="btn btn-primary btn-block" >Add Order</button>
|
||||
<button type="button" class="btn btn-primary btn-block" id='back'>Back</button>
|
||||
<button type="button" id="add_order" class="btn btn-primary btn-block">Add Order</button>
|
||||
<% if @dining.bookings.length >= 1 %>
|
||||
<button type="button" id="customer" class="btn btn-primary btn-block" >Customer</button>
|
||||
<button type="button" id="customer" class="btn btn-primary btn-block">Customer</button>
|
||||
<% if @status_order == 'order' && @status_sale != 'sale' %>
|
||||
<button type="button" class="btn btn-primary btn-block" disabled >Edit</button>
|
||||
<button type="button" class="btn btn-primary btn-block" disabled>Edit</button>
|
||||
<button type="button" id="discount" class="btn btn-primary btn-block" disabled>Discount</button>
|
||||
<button type="button" id="other-charges" class="btn btn-primary btn-block" disabled>Charges</button>
|
||||
<button type="button" class="btn btn-primary btn-block" id='move'>Move</button>
|
||||
<button type="button" id="request_bills" class="btn btn-primary btn-block">Req.Bill</button>
|
||||
<button type="button" id="first_bill" class="btn btn-primary btn-block" disabled>First Bill</button>
|
||||
<button type="button" id="pay" class="btn btn-primary btn-block" disabled>Pay</button>
|
||||
<button type="button" class="btn btn-primary btn-block" disabled> Void </button>
|
||||
<button type="button" class="btn btn-primary btn-block" disabled> Void</button>
|
||||
<% else %>
|
||||
<button type="button" class="btn btn-primary btn-block" id='edit'>Edit</button>
|
||||
<button type="button" id="discount" class="btn btn-primary btn-block" >Discount</button>
|
||||
<button type="button" id="other-charges" class="btn btn-primary btn-block" >Charges</button>
|
||||
<button type="button" id="discount" class="btn btn-primary btn-block">Discount</button>
|
||||
<button type="button" id="other-charges" class="btn btn-primary btn-block">Charges</button>
|
||||
<button type="button" id="commissions" class="btn btn-primary btn-block">Commissions</button>
|
||||
<button type="button" class="btn btn-primary btn-block" id='move' disabled="">Move</button>
|
||||
<button type="button" id="request_bills" class="btn btn-primary btn-block" disabled> Req.Bill</button>
|
||||
<button type="button" id="first_bill" class="btn btn-primary btn-block">First Bill</button>
|
||||
<button type="button" id="pay" class="btn btn-primary btn-block">Pay</button>
|
||||
<button type="button" id="void" class="btn btn-primary btn-block" > Void </button>
|
||||
<button type="button" id="void" class="btn btn-primary btn-block"> Void</button>
|
||||
<% end %>
|
||||
<!-- Cashier Buttons -->
|
||||
|
||||
@@ -334,43 +345,43 @@
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$(document).ready(function () {
|
||||
|
||||
$('.invoicedetails').on('click',function(){
|
||||
$('.invoicedetails').on('click', function () {
|
||||
var dining_id = "<%= @dining.id %>";
|
||||
var sale_id = this.id;
|
||||
window.location.href = '/origami/table/'+ dining_id + "/table_invoice/"+sale_id;
|
||||
window.location.href = '/origami/table/' + dining_id + "/table_invoice/" + sale_id;
|
||||
})
|
||||
$(".tables").on('click', function(){
|
||||
$(".tables").on('click', function () {
|
||||
|
||||
var customer_id=$(".customer-id").text();
|
||||
var customer_id = $(".customer-id").text();
|
||||
show_customer_details(customer_id);
|
||||
|
||||
var dining_id = $(this).attr("data-id");
|
||||
window.location.href = '/origami/table/' + dining_id;
|
||||
});
|
||||
|
||||
$(".sales").on('click',function(){
|
||||
$(".sales").on('click', function () {
|
||||
|
||||
var customer_id=$(".customer-id").text();
|
||||
var customer_id = $(".customer-id").text();
|
||||
show_customer_details(customer_id);
|
||||
|
||||
var sale_id = $(this).attr("data-id");
|
||||
window.location.href = '/origami/sale/' + sale_id;
|
||||
});
|
||||
|
||||
$(".rooms").on('click', function(){
|
||||
$(".rooms").on('click', function () {
|
||||
|
||||
var customer_id=$(".customer-id").text();
|
||||
var customer_id = $(".customer-id").text();
|
||||
show_customer_details(customer_id);
|
||||
|
||||
var dining_id = $(this).attr("data-id");
|
||||
window.location.href = '/origami/room/' + dining_id;
|
||||
});
|
||||
|
||||
$(".orders").on('click',function(){
|
||||
$(".orders").on('click', function () {
|
||||
|
||||
var customer_id=$(".customer-id").text();
|
||||
var customer_id = $(".customer-id").text();
|
||||
show_customer_details(customer_id);
|
||||
|
||||
var order_id = $(this).attr("data-id");
|
||||
@@ -378,36 +389,36 @@ $(document).ready(function(){
|
||||
});
|
||||
|
||||
// bind customer to order or sale
|
||||
$("#customer").on('click', function(){
|
||||
$("#customer").on('click', function () {
|
||||
var sale = $('#sale_id').val();
|
||||
if (sale) {
|
||||
var sale_id = sale
|
||||
}else{
|
||||
} else {
|
||||
var sale_id = $('#save_order_id').attr('data-order');
|
||||
}
|
||||
var table_id = $('.tables').attr("data-id");
|
||||
|
||||
window.location.href = '/origami/'+ sale_id + "/customers"
|
||||
window.location.href = '/origami/' + sale_id + "/customers"
|
||||
|
||||
});
|
||||
|
||||
$('#re-print').click(function() {
|
||||
$('#re-print').click(function () {
|
||||
var sale_id = $('#sale_id').val();
|
||||
window.location.href = '/origami/'+ sale_id + "/reprint"
|
||||
window.location.href = '/origami/' + sale_id + "/reprint"
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
// Add Other Charges
|
||||
$('#other-charges').click(function() {
|
||||
$('#other-charges').click(function () {
|
||||
var sale = $('#sale_id').val();
|
||||
if (sale!="") {
|
||||
if (sale != "") {
|
||||
var sale_id = sale
|
||||
}else{
|
||||
} else {
|
||||
var sale_id = $('#save_order_id').attr('data-order');
|
||||
}
|
||||
|
||||
if(sale_id!=""){
|
||||
if (sale_id != "") {
|
||||
window.location.href = '/origami/' + sale_id + '/other_charges'
|
||||
}
|
||||
else {
|
||||
@@ -418,15 +429,15 @@ $(document).ready(function(){
|
||||
});
|
||||
|
||||
// Discount for Payment
|
||||
$('#discount').click(function() {
|
||||
$('#discount').click(function () {
|
||||
var sale = $('#sale_id').val();
|
||||
if (sale!="") {
|
||||
if (sale != "") {
|
||||
var sale_id = sale
|
||||
}else{
|
||||
} else {
|
||||
var sale_id = $('#save_order_id').attr('data-order');
|
||||
}
|
||||
|
||||
if(sale_id!=""){
|
||||
if (sale_id != "") {
|
||||
window.location.href = '/origami/' + sale_id + '/discount'
|
||||
}
|
||||
else {
|
||||
@@ -435,47 +446,47 @@ $(document).ready(function(){
|
||||
|
||||
return false;
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// Print for first bill
|
||||
$("#first_bill").on('click', function(){
|
||||
// Print for first bill
|
||||
$("#first_bill").on('click', function () {
|
||||
var sale_id = $('#sale_id').val();
|
||||
var ajax_url = "/origami/sale/"+ sale_id + "/first_bill";
|
||||
var ajax_url = "/origami/sale/" + sale_id + "/first_bill";
|
||||
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: ajax_url,
|
||||
success:function(result){
|
||||
success: function (result) {
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
$('#pay').on('click',function() {
|
||||
$('#pay').on('click', function () {
|
||||
var sale_id = $('#sale_id').val();
|
||||
|
||||
var url = '/origami/sale/'+ sale_id + "/rounding_adj" ;
|
||||
var url = '/origami/sale/' + sale_id + "/rounding_adj";
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: '/origami/sale/'+ sale_id + "/rounding_adj",
|
||||
success:function(result){
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment";
|
||||
url: '/origami/sale/' + sale_id + "/rounding_adj",
|
||||
success: function (result) {
|
||||
window.location.href = '/origami/sale/' + sale_id + "/payment";
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
// Bill Request
|
||||
$('#request_bills').click(function() {
|
||||
// Bill Request
|
||||
$('#request_bills').click(function () {
|
||||
var order_id = $('#save_order_id').attr('data-order');
|
||||
var ajax_url = "/origami/" + order_id + "/request_bills";
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: ajax_url,
|
||||
// data: 'order_id='+ order_id,
|
||||
success:function(result){
|
||||
if(!result.status){
|
||||
success: function (result) {
|
||||
if (!result.status) {
|
||||
$.confirm({
|
||||
title: 'Infomation!',
|
||||
content: result.error_message,
|
||||
@@ -483,7 +494,7 @@ $('#request_bills').click(function() {
|
||||
confirm: {
|
||||
text: 'Ok',
|
||||
btnClass: 'btn-green',
|
||||
action: function(){
|
||||
action: function () {
|
||||
window.location.href = '/origami';
|
||||
}
|
||||
}
|
||||
@@ -495,34 +506,34 @@ $('#request_bills').click(function() {
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
$('#move').on('click',function(){
|
||||
$('#move').on('click', function () {
|
||||
var dining_id = "<%= @dining.id %>"
|
||||
window.location.href = '/origami/table/'+ dining_id + "/movetable";
|
||||
})
|
||||
window.location.href = '/origami/table/' + dining_id + "/movetable";
|
||||
})
|
||||
|
||||
$('#back').on('click',function(){
|
||||
$('#back').on('click', function () {
|
||||
window.location.href = '/origami/';
|
||||
})
|
||||
})
|
||||
|
||||
$('#add_invoice').on('click',function(){
|
||||
$('#add_invoice').on('click', function () {
|
||||
var dining_id = "<%= @dining.id %>"
|
||||
var sale_id = "<%= @obj_sale.sale_id rescue "" %>"
|
||||
var ajax_url = "/origami/sale/append_order";
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: ajax_url,
|
||||
data: 'dining_id='+ dining_id + "&sale_id=" + sale_id,
|
||||
success:function(result){
|
||||
data: 'dining_id=' + dining_id + "&sale_id=" + sale_id,
|
||||
success: function (result) {
|
||||
alert("Invoice updated")
|
||||
window.location.reload();
|
||||
}
|
||||
});
|
||||
})
|
||||
})
|
||||
|
||||
//show cusotmer rebate amount
|
||||
function show_customer_details(customer_id){
|
||||
//show cusotmer rebate amount
|
||||
function show_customer_details(customer_id) {
|
||||
var url = '<%= @show_customer_details_path %>'
|
||||
//Start Ajax
|
||||
$.ajax({
|
||||
@@ -530,24 +541,24 @@ function show_customer_details(customer_id){
|
||||
url: url,
|
||||
data: {},
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
success: function (data) {
|
||||
$("#customer_name").text(data["customer"].name);
|
||||
if (data["response_data"]["data"].length) {
|
||||
$.each(data["response_data"]["data"], function (i) {
|
||||
if(data["response_data"]["data"][i]["accountable_type"] == "RebateAccount"){
|
||||
if (data["response_data"]["data"][i]["accountable_type"] == "RebateAccount") {
|
||||
var balance = data["response_data"]["data"][i]["balance"];
|
||||
if (data["response_data"]["status"]==true) {
|
||||
if (data["response_data"]["status"] == true) {
|
||||
$('.rebate_amount').removeClass('hide');
|
||||
row =
|
||||
'<td class="charges-name">' + "Rebate Balance" +'</td>'
|
||||
+'<td class="item-attr">' + balance + '</td>';
|
||||
'<td class="charges-name">' + "Rebate Balance" + '</td>'
|
||||
+ '<td class="item-attr">' + balance + '</td>';
|
||||
|
||||
$(".rebate_amount").html(row);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}else{
|
||||
} else {
|
||||
$('.rebate_amount').addClass('hide');
|
||||
}
|
||||
}
|
||||
@@ -555,13 +566,13 @@ function show_customer_details(customer_id){
|
||||
//End Ajax
|
||||
}
|
||||
|
||||
$('#edit').on('click',function(){
|
||||
$('#edit').on('click', function () {
|
||||
var dining_id = "<%= @dining.id %>"
|
||||
var sale_id = "<%= @obj_sale.sale_id rescue "" %>"
|
||||
window.location.href = '/origami/table/'+ dining_id + "/sale/"+ sale_id + "/edit";
|
||||
window.location.href = '/origami/table/' + dining_id + "/sale/" + sale_id + "/edit";
|
||||
});
|
||||
|
||||
$('#void').on('click',function () {
|
||||
$('#void').on('click', function () {
|
||||
var sure = confirm("Are you sure want to Void");
|
||||
if (sure == true) {
|
||||
var sale_id = $('#sale_id').val();
|
||||
@@ -578,8 +589,8 @@ function show_customer_details(customer_id){
|
||||
}
|
||||
});
|
||||
|
||||
$('#add_order').on('click',function(){
|
||||
$('#add_order').on('click', function () {
|
||||
var dining_id = "<%= @dining.id %>"
|
||||
window.location.href = '/origami/addorders/'+ dining_id;
|
||||
window.location.href = '/origami/addorders/' + dining_id;
|
||||
});
|
||||
</script>
|
||||
|
||||
10
app/views/origami/product_commissions/_form.html.erb
Normal file
10
app/views/origami/product_commissions/_form.html.erb
Normal 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 %>
|
||||
@@ -0,0 +1,2 @@
|
||||
json.extract! product_commission, :id, :created_at, :updated_at
|
||||
json.url product_commission_url(product_commission, format: :json)
|
||||
6
app/views/origami/product_commissions/edit.html.erb
Normal file
6
app/views/origami/product_commissions/edit.html.erb
Normal 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 %>
|
||||
25
app/views/origami/product_commissions/index.html.erb
Normal file
25
app/views/origami/product_commissions/index.html.erb
Normal 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 %>
|
||||
@@ -0,0 +1 @@
|
||||
json.array! @product_commissions, partial: 'product_commissions/product_commission', as: :product_commission
|
||||
5
app/views/origami/product_commissions/new.html.erb
Normal file
5
app/views/origami/product_commissions/new.html.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
<h1>New Product Commission</h1>
|
||||
|
||||
<%= render 'form', product_commission: @product_commission %>
|
||||
|
||||
<%= link_to 'Back', product_commissions_path %>
|
||||
4
app/views/origami/product_commissions/show.html.erb
Normal file
4
app/views/origami/product_commissions/show.html.erb
Normal 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 %>
|
||||
1
app/views/origami/product_commissions/show.json.jbuilder
Normal file
1
app/views/origami/product_commissions/show.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.partial! "product_commissions/product_commission", product_commission: @product_commission
|
||||
12
db/migrate/20170822034139_create_product_commissions.rb
Normal file
12
db/migrate/20170822034139_create_product_commissions.rb
Normal 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
|
||||
141
spec/controllers/origami/product_commissions_controller_spec.rb
Normal file
141
spec/controllers/origami/product_commissions_controller_spec.rb
Normal 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
|
||||
15
spec/helpers/origami/product_commissions_helper_spec.rb
Normal file
15
spec/helpers/origami/product_commissions_helper_spec.rb
Normal 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
|
||||
5
spec/models/product_commission_spec.rb
Normal file
5
spec/models/product_commission_spec.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe ProductCommission, type: :model do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
||||
10
spec/requests/origami/origami_product_commissions_spec.rb
Normal file
10
spec/requests/origami/origami_product_commissions_spec.rb
Normal 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
|
||||
39
spec/routing/origami/product_commissions_routing_spec.rb
Normal file
39
spec/routing/origami/product_commissions_routing_spec.rb
Normal 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
|
||||
14
spec/views/origami/product_commissions/edit.html.erb_spec.rb
Normal file
14
spec/views/origami/product_commissions/edit.html.erb_spec.rb
Normal 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
|
||||
@@ -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
|
||||
14
spec/views/origami/product_commissions/new.html.erb_spec.rb
Normal file
14
spec/views/origami/product_commissions/new.html.erb_spec.rb
Normal 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
|
||||
11
spec/views/origami/product_commissions/show.html.erb_spec.rb
Normal file
11
spec/views/origami/product_commissions/show.html.erb_spec.rb
Normal 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
|
||||
Reference in New Issue
Block a user