updated for api bill controller

This commit is contained in:
Yan
2017-06-28 16:56:43 +06:30
54 changed files with 1066 additions and 163 deletions

681
.idea/workspace.xml generated
View File

@@ -2,16 +2,7 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="89ca96af-a0e4-4fe4-b9a3-9969f22d7079" name="Default" comment="">
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/.generators" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/.rakeTasks" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/misc.xml" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/modules.xml" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/sxrestaurant.iml" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/vcs.xml" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/controllers/origami/void_controller.rb" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/dump.rdb" afterPath="$PROJECT_DIR$/dump.rdb" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/config/routes.rb" afterPath="$PROJECT_DIR$/config/routes.rb" />
</list>
<ignored path="$PROJECT_DIR$/.bundle/" />
<ignored path="$PROJECT_DIR$/components/" />
@@ -27,21 +18,111 @@
</component>
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file leaf-file-name="booking.rb" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/app/models/booking.rb">
<file leaf-file-name="home_controller.rb" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/app/controllers/origami/home_controller.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="315">
<caret line="21" column="20" lean-forward="false" selection-start-line="21" selection-start-column="20" selection-end-line="21" selection-end-column="20" />
<state relative-caret-position="292">
<caret line="27" column="42" lean-forward="true" selection-start-line="27" selection-start-column="42" selection-end-line="27" selection-end-column="42" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="home_controller.rb" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/app/controllers/origami/home_controller.rb">
<file leaf-file-name="show.html.erb" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/app/views/origami/payments/show.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="387">
<caret line="40" column="40" lean-forward="false" selection-start-line="40" selection-start-column="40" selection-end-line="40" selection-end-column="40" />
<state relative-caret-position="399">
<caret line="359" column="43" lean-forward="false" selection-start-line="359" selection-start-column="43" selection-end-line="359" selection-end-column="43" />
<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/table_invoices/show.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="2160">
<caret line="144" column="16" lean-forward="false" selection-start-line="144" selection-start-column="16" selection-end-line="144" selection-end-column="16" />
<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/home/index.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="420">
<caret line="28" column="36" lean-forward="true" selection-start-line="28" selection-start-column="36" selection-end-line="28" selection-end-column="36" />
<folding>
<element signature="n#style#0;n#div#0;n#div#0;n#div#0;n#div#0;n#div#0;n#!!top" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="void_controller.rb" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/app/controllers/origami/void_controller.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="270">
<caret line="18" column="0" lean-forward="false" selection-start-line="18" selection-start-column="0" selection-end-line="18" 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/orders/show.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="420">
<caret line="28" column="128" lean-forward="false" selection-start-line="28" selection-start-column="128" selection-end-line="28" selection-end-column="128" />
<folding>
<marker date="1498539948000" expanded="true" signature="3450:4239" ph="do ... end" />
<marker date="1498539948000" expanded="true" signature="3598:4131" ph="&lt;%...%&gt;" />
<marker date="1498539948000" expanded="true" signature="3714:4114" ph="if ... end" />
<marker date="1498539948000" expanded="true" signature="4005:4027" ph="if ... end" />
<marker date="1498539948000" expanded="true" signature="4395:6842" ph="..." />
<marker date="1498539948000" expanded="true" signature="4419:6833" ph="..." />
<marker date="1498539948000" expanded="true" signature="4454:4539" ph="..." />
<marker date="1498539948000" expanded="true" signature="4571:6821" ph="..." />
<marker date="1498539948000" expanded="true" signature="4609:5000" ph="..." />
<marker date="1498539948000" expanded="true" signature="4661:4756" ph="..." />
<marker date="1498539948000" expanded="true" signature="4678:4738" ph="..." />
<marker date="1498539948000" expanded="true" signature="4713:4734" ph="..." />
<marker date="1498539948000" expanded="true" signature="4819:4984" ph="..." />
<marker date="1498539948000" expanded="true" signature="5059:5210" ph="..." />
<marker date="1498539948000" expanded="true" signature="5111:5193" ph="..." />
<marker date="1498539948000" expanded="true" signature="5243:6180" ph="..." />
<marker date="1498539948000" expanded="true" signature="5313:6164" ph="..." />
<marker date="1498539948000" expanded="true" signature="5334:5545" ph="..." />
<marker date="1498539948000" expanded="true" signature="5354:5523" ph="..." />
<marker date="1498539948000" expanded="true" signature="5566:6144" ph="..." />
<marker date="1498539948000" expanded="true" signature="5583:5749" ph="&lt;%...%&gt;" />
<marker date="1498539948000" expanded="true" signature="5817:6041" ph="..." />
<marker date="1498539948000" expanded="true" signature="6058:6123" ph="&lt;%...%&gt;" />
<marker date="1498539948000" expanded="true" signature="6215:6807" ph="..." />
<marker date="1498539948000" expanded="true" signature="6284:6791" ph="..." />
<marker date="1498539948000" expanded="true" signature="6302:6491" ph="..." />
<marker date="1498539948000" expanded="true" signature="6509:6725" ph="..." />
<marker date="1498539948000" expanded="true" signature="6908:7237" ph="..." />
<marker date="1498539948000" expanded="true" signature="6999:7127" ph="if ... end" />
<marker date="1498539948000" expanded="true" signature="7253:8136" ph="..." />
<marker date="1498539948000" expanded="true" signature="7283:7870" ph="{...}" />
<marker date="1498539948000" expanded="true" signature="7322:7434" ph="{...}" />
<marker date="1498539948000" expanded="true" signature="7471:7574" ph="{...}" />
<marker date="1498539948000" expanded="true" signature="7612:7723" ph="{...}" />
<marker date="1498539948000" expanded="true" signature="7761:7867" ph="{...}" />
<marker date="1498539948000" expanded="true" signature="7905:8012" ph="{...}" />
<marker date="1498539948000" expanded="true" signature="8047:8088" ph="{...}" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="show.html.erb" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/app/views/origami/sales/show.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="249">
<caret line="139" column="30" lean-forward="true" selection-start-line="139" selection-start-column="30" selection-end-line="139" selection-end-column="30" />
<folding />
</state>
</provider>
@@ -50,33 +131,8 @@
<file leaf-file-name="payments_controller.rb" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/app/controllers/origami/payments_controller.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="266">
<caret line="65" column="35" lean-forward="false" selection-start-line="65" selection-start-column="35" selection-end-line="65" selection-end-column="35" />
<folding>
<marker date="1498476660000" expanded="true" signature="2556:2593" ph="if ... end" />
<marker date="1498476660000" expanded="true" signature="2556:2603" ph="do ... end" />
<marker date="1498476660000" expanded="true" signature="2556:2611" ph="if ... end" />
<marker date="1498476660000" expanded="true" signature="2556:2617" ph=" ... end" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="void_controller.rb" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/app/controllers/origami/void_controller.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="375">
<caret line="25" column="5" lean-forward="true" selection-start-line="25" selection-start-column="5" selection-end-line="25" selection-end-column="5" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="routes.rb" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/config/routes.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="459">
<caret line="127" column="25" lean-forward="true" selection-start-line="127" selection-start-column="25" selection-end-line="127" selection-end-column="25" />
<state relative-caret-position="150">
<caret line="10" column="34" lean-forward="false" selection-start-line="10" selection-start-column="34" selection-end-line="10" selection-end-column="34" />
<folding />
</state>
</provider>
@@ -85,8 +141,18 @@
<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="920">
<caret line="491" column="0" lean-forward="false" selection-start-line="491" selection-start-column="0" selection-end-line="491" selection-end-column="0" />
<state relative-caret-position="30">
<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="show.html.erb" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/app/views/origami/rooms/show.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="420">
<caret line="28" column="128" lean-forward="false" selection-start-line="28" selection-start-column="128" selection-end-line="28" selection-end-column="128" />
<folding />
</state>
</provider>
@@ -97,6 +163,8 @@
<component name="FindInProjectRecents">
<findStrings>
<find>origami</find>
<find>table_invoice</find>
<find>sale_id</find>
</findStrings>
</component>
<component name="Git.Settings">
@@ -105,11 +173,17 @@
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/app/views/origami/orders/show.html.erb" />
<option value="$PROJECT_DIR$/app/controllers/origami/home_controller.rb" />
<option value="$PROJECT_DIR$/app/views/origami/home/show.html.erb" />
<option value="$PROJECT_DIR$/config/routes.rb" />
<option value="$PROJECT_DIR$/app/views/origami/table_invoices/show.html.erb" />
<option value="$PROJECT_DIR$/app/controllers/origami/table_invoices_controller.rb" />
<option value="$PROJECT_DIR$/app/controllers/origami/void_controller.rb" />
<option value="$PROJECT_DIR$/app/controllers/origami/home_controller.rb" />
<option value="$PROJECT_DIR$/app/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" />
<option value="$PROJECT_DIR$/app/views/origami/sales/show.html.erb" />
</list>
</option>
</component>
@@ -168,6 +242,264 @@
<option name="myItemId" value="" />
<option name="myItemType" value="" />
</PATH_ELEMENT>
<PATH_ELEMENT USER_OBJECT="views">
<option name="myItemId" value="" />
<option name="myItemType" value="" />
</PATH_ELEMENT>
<PATH_ELEMENT USER_OBJECT="transactions">
<option name="myItemId" value="" />
<option name="myItemType" value="" />
</PATH_ELEMENT>
</PATH>
<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_ELEMENT USER_OBJECT="app">
<option name="myItemId" value="" />
<option name="myItemType" value="" />
</PATH_ELEMENT>
<PATH_ELEMENT USER_OBJECT="views">
<option name="myItemId" value="" />
<option name="myItemType" value="" />
</PATH_ELEMENT>
</PATH>
<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_ELEMENT USER_OBJECT="app">
<option name="myItemId" value="" />
<option name="myItemType" value="" />
</PATH_ELEMENT>
<PATH_ELEMENT USER_OBJECT="views">
<option name="myItemId" value="" />
<option name="myItemType" value="" />
</PATH_ELEMENT>
<PATH_ELEMENT USER_OBJECT="reports">
<option name="myItemId" value="" />
<option name="myItemType" value="" />
</PATH_ELEMENT>
</PATH>
<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_ELEMENT USER_OBJECT="app">
<option name="myItemId" value="" />
<option name="myItemType" value="" />
</PATH_ELEMENT>
<PATH_ELEMENT USER_OBJECT="views">
<option name="myItemId" value="" />
<option name="myItemType" value="" />
</PATH_ELEMENT>
<PATH_ELEMENT USER_OBJECT="origami">
<option name="myItemId" value="" />
<option name="myItemType" value="" />
</PATH_ELEMENT>
</PATH>
<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_ELEMENT USER_OBJECT="app">
<option name="myItemId" value="" />
<option name="myItemType" value="" />
</PATH_ELEMENT>
<PATH_ELEMENT USER_OBJECT="views">
<option name="myItemId" value="" />
<option name="myItemType" value="" />
</PATH_ELEMENT>
<PATH_ELEMENT USER_OBJECT="origami">
<option name="myItemId" value="" />
<option name="myItemType" value="" />
</PATH_ELEMENT>
<PATH_ELEMENT USER_OBJECT="table_invoices">
<option name="myItemId" value="" />
<option name="myItemType" value="" />
</PATH_ELEMENT>
</PATH>
<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_ELEMENT USER_OBJECT="app">
<option name="myItemId" value="" />
<option name="myItemType" value="" />
</PATH_ELEMENT>
<PATH_ELEMENT USER_OBJECT="views">
<option name="myItemId" value="" />
<option name="myItemType" value="" />
</PATH_ELEMENT>
<PATH_ELEMENT USER_OBJECT="origami">
<option name="myItemId" value="" />
<option name="myItemType" value="" />
</PATH_ELEMENT>
<PATH_ELEMENT USER_OBJECT="sales">
<option name="myItemId" value="" />
<option name="myItemType" value="" />
</PATH_ELEMENT>
</PATH>
<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_ELEMENT USER_OBJECT="app">
<option name="myItemId" value="" />
<option name="myItemType" value="" />
</PATH_ELEMENT>
<PATH_ELEMENT USER_OBJECT="views">
<option name="myItemId" value="" />
<option name="myItemType" value="" />
</PATH_ELEMENT>
<PATH_ELEMENT USER_OBJECT="origami">
<option name="myItemId" value="" />
<option name="myItemType" value="" />
</PATH_ELEMENT>
<PATH_ELEMENT USER_OBJECT="rooms">
<option name="myItemId" value="" />
<option name="myItemType" value="" />
</PATH_ELEMENT>
</PATH>
<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_ELEMENT USER_OBJECT="app">
<option name="myItemId" value="" />
<option name="myItemType" value="" />
</PATH_ELEMENT>
<PATH_ELEMENT USER_OBJECT="views">
<option name="myItemId" value="" />
<option name="myItemType" value="" />
</PATH_ELEMENT>
<PATH_ELEMENT USER_OBJECT="origami">
<option name="myItemId" value="" />
<option name="myItemType" value="" />
</PATH_ELEMENT>
<PATH_ELEMENT USER_OBJECT="payments">
<option name="myItemId" value="" />
<option name="myItemType" value="" />
</PATH_ELEMENT>
</PATH>
<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_ELEMENT USER_OBJECT="app">
<option name="myItemId" value="" />
<option name="myItemType" value="" />
</PATH_ELEMENT>
<PATH_ELEMENT USER_OBJECT="views">
<option name="myItemId" value="" />
<option name="myItemType" value="" />
</PATH_ELEMENT>
<PATH_ELEMENT USER_OBJECT="origami">
<option name="myItemId" value="" />
<option name="myItemType" value="" />
</PATH_ELEMENT>
<PATH_ELEMENT USER_OBJECT="orders">
<option name="myItemId" value="" />
<option name="myItemType" value="" />
</PATH_ELEMENT>
</PATH>
<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_ELEMENT USER_OBJECT="app">
<option name="myItemId" value="" />
<option name="myItemType" value="" />
</PATH_ELEMENT>
<PATH_ELEMENT USER_OBJECT="views">
<option name="myItemId" value="" />
<option name="myItemType" value="" />
</PATH_ELEMENT>
<PATH_ELEMENT USER_OBJECT="origami">
<option name="myItemId" value="" />
<option name="myItemType" value="" />
</PATH_ELEMENT>
<PATH_ELEMENT USER_OBJECT="home">
<option name="myItemId" value="" />
<option name="myItemType" value="" />
</PATH_ELEMENT>
</PATH>
<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_ELEMENT USER_OBJECT="app">
<option name="myItemId" value="" />
<option name="myItemType" value="" />
</PATH_ELEMENT>
</PATH>
<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_ELEMENT USER_OBJECT="app">
<option name="myItemId" value="" />
<option name="myItemType" value="" />
</PATH_ELEMENT>
<PATH_ELEMENT USER_OBJECT="models">
<option name="myItemId" value="" />
<option name="myItemType" value="" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT USER_OBJECT="Root">
@@ -209,6 +541,28 @@
<option name="myItemType" value="" />
</PATH_ELEMENT>
</PATH>
<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_ELEMENT USER_OBJECT="app">
<option name="myItemId" value="" />
<option name="myItemType" value="" />
</PATH_ELEMENT>
<PATH_ELEMENT USER_OBJECT="controllers">
<option name="myItemId" value="" />
<option name="myItemType" value="" />
</PATH_ELEMENT>
<PATH_ELEMENT USER_OBJECT="api">
<option name="myItemId" value="" />
<option name="myItemType" value="" />
</PATH_ELEMENT>
</PATH>
</subPane>
</pane>
<pane id="Scratches" />
@@ -553,12 +907,12 @@
<option name="presentableId" value="Default" />
<updated>1498458293643</updated>
<workItem from="1498458295318" duration="2552000" />
<workItem from="1498465879846" duration="9435000" />
<workItem from="1498465879846" duration="18792000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="11987000" />
<option name="totallyTimeSpent" value="21344000" />
</component>
<component name="ToolWindowManager">
<frame x="0" y="22" width="1440" height="833" extended-state="6" />
@@ -672,38 +1026,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/views/origami/sales/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" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/views/origami/orders/show.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-609">
<caret line="135" column="51" lean-forward="true" selection-start-line="135" selection-start-column="51" selection-end-line="135" selection-end-column="51" />
<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="-171">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/models/sale_payment.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="5">
<caret line="10" column="6" lean-forward="false" selection-start-line="10" selection-start-column="6" selection-end-line="10" selection-end-column="6" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/controllers/origami/master_controller.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
@@ -712,22 +1034,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/controllers/origami/sales_controller.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="510">
<caret line="34" column="35" lean-forward="true" selection-start-line="34" selection-start-column="35" selection-end-line="34" selection-end-column="35" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/models/sale_audit.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="268">
<caret line="57" column="11" lean-forward="false" selection-start-line="57" selection-start-column="11" selection-end-line="57" selection-end-column="11" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/models/dining_facility.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="285">
@@ -760,16 +1066,27 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/controllers/origami/payments_controller.rb">
<entry file="file://$PROJECT_DIR$/app/models/printer/receipt_printer.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="266">
<caret line="65" column="35" lean-forward="false" selection-start-line="65" selection-start-column="35" selection-end-line="65" selection-end-column="35" />
<folding>
<marker date="1498476660000" expanded="true" signature="2556:2593" ph="if ... end" />
<marker date="1498476660000" expanded="true" signature="2556:2603" ph="do ... end" />
<marker date="1498476660000" expanded="true" signature="2556:2611" ph="if ... end" />
<marker date="1498476660000" expanded="true" signature="2556:2617" ph=" ... end" />
</folding>
<state relative-caret-position="327">
<caret line="74" column="38" lean-forward="true" selection-start-line="74" selection-start-column="38" selection-end-line="74" selection-end-column="38" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/controllers/origami/request_bills_controller.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="180">
<caret line="12" column="35" lean-forward="true" selection-start-line="12" selection-start-column="35" selection-end-line="12" selection-end-column="35" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/controllers/api/bill_controller.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="330">
<caret line="22" column="29" lean-forward="false" selection-start-line="22" selection-start-column="29" selection-end-line="22" selection-end-column="29" />
<folding />
</state>
</provider>
</entry>
@@ -781,34 +1098,162 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/controllers/origami/home_controller.rb">
<entry file="file://$PROJECT_DIR$/app/controllers/origami/sales_controller.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="387">
<caret line="40" column="40" lean-forward="false" selection-start-line="40" selection-start-column="40" selection-end-line="40" selection-end-column="40" />
<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/home/show.html.erb">
<entry file="file://$PROJECT_DIR$/app/controllers/origami/table_invoices_controller.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="920">
<caret line="491" column="0" lean-forward="false" selection-start-line="491" selection-start-column="0" selection-end-line="491" selection-end-column="0" />
<state relative-caret-position="255">
<caret line="17" column="7" lean-forward="true" selection-start-line="17" selection-start-column="7" selection-end-line="17" selection-end-column="7" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/config/routes.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="459">
<caret line="127" column="25" lean-forward="true" selection-start-line="127" selection-start-column="25" selection-end-line="127" selection-end-column="25" />
<state relative-caret-position="550">
<caret line="120" column="47" lean-forward="false" selection-start-line="120" selection-start-column="47" selection-end-line="120" selection-end-column="47" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/controllers/origami/payments_controller.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="150">
<caret line="10" column="34" lean-forward="false" selection-start-line="10" selection-start-column="34" selection-end-line="10" selection-end-column="34" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/models/sale_payment.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="411">
<caret line="60" column="34" lean-forward="false" selection-start-line="60" selection-start-column="34" selection-end-line="60" selection-end-column="34" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/models/sale_audit.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="432">
<caret line="57" column="11" lean-forward="false" selection-start-line="57" selection-start-column="11" selection-end-line="57" selection-end-column="11" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/controllers/origami/void_controller.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="375">
<caret line="25" column="5" lean-forward="true" selection-start-line="25" selection-start-column="5" selection-end-line="25" selection-end-column="5" />
<state relative-caret-position="270">
<caret line="18" column="0" lean-forward="false" selection-start-line="18" selection-start-column="0" selection-end-line="18" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/controllers/origami/home_controller.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="292">
<caret line="27" column="42" lean-forward="true" selection-start-line="27" selection-start-column="42" selection-end-line="27" selection-end-column="42" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/views/origami/payments/show.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="399">
<caret line="359" column="43" lean-forward="false" selection-start-line="359" selection-start-column="43" selection-end-line="359" selection-end-column="43" />
<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="420">
<caret line="28" column="36" lean-forward="true" selection-start-line="28" selection-start-column="36" selection-end-line="28" selection-end-column="36" />
<folding>
<element signature="n#style#0;n#div#0;n#div#0;n#div#0;n#div#0;n#div#0;n#!!top" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/views/origami/table_invoices/show.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="2160">
<caret line="144" column="16" lean-forward="false" selection-start-line="144" selection-start-column="16" selection-end-line="144" selection-end-column="16" />
<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="30">
<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/rooms/show.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="420">
<caret line="28" column="128" lean-forward="false" selection-start-line="28" selection-start-column="128" selection-end-line="28" selection-end-column="128" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/views/origami/orders/show.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="420">
<caret line="28" column="128" lean-forward="false" selection-start-line="28" selection-start-column="128" selection-end-line="28" selection-end-column="128" />
<folding>
<marker date="1498539948000" expanded="true" signature="3450:4239" ph="do ... end" />
<marker date="1498539948000" expanded="true" signature="3598:4131" ph="&lt;%...%&gt;" />
<marker date="1498539948000" expanded="true" signature="3714:4114" ph="if ... end" />
<marker date="1498539948000" expanded="true" signature="4005:4027" ph="if ... end" />
<marker date="1498539948000" expanded="true" signature="4395:6842" ph="..." />
<marker date="1498539948000" expanded="true" signature="4419:6833" ph="..." />
<marker date="1498539948000" expanded="true" signature="4454:4539" ph="..." />
<marker date="1498539948000" expanded="true" signature="4571:6821" ph="..." />
<marker date="1498539948000" expanded="true" signature="4609:5000" ph="..." />
<marker date="1498539948000" expanded="true" signature="4661:4756" ph="..." />
<marker date="1498539948000" expanded="true" signature="4678:4738" ph="..." />
<marker date="1498539948000" expanded="true" signature="4713:4734" ph="..." />
<marker date="1498539948000" expanded="true" signature="4819:4984" ph="..." />
<marker date="1498539948000" expanded="true" signature="5059:5210" ph="..." />
<marker date="1498539948000" expanded="true" signature="5111:5193" ph="..." />
<marker date="1498539948000" expanded="true" signature="5243:6180" ph="..." />
<marker date="1498539948000" expanded="true" signature="5313:6164" ph="..." />
<marker date="1498539948000" expanded="true" signature="5334:5545" ph="..." />
<marker date="1498539948000" expanded="true" signature="5354:5523" ph="..." />
<marker date="1498539948000" expanded="true" signature="5566:6144" ph="..." />
<marker date="1498539948000" expanded="true" signature="5583:5749" ph="&lt;%...%&gt;" />
<marker date="1498539948000" expanded="true" signature="5817:6041" ph="..." />
<marker date="1498539948000" expanded="true" signature="6058:6123" ph="&lt;%...%&gt;" />
<marker date="1498539948000" expanded="true" signature="6215:6807" ph="..." />
<marker date="1498539948000" expanded="true" signature="6284:6791" ph="..." />
<marker date="1498539948000" expanded="true" signature="6302:6491" ph="..." />
<marker date="1498539948000" expanded="true" signature="6509:6725" ph="..." />
<marker date="1498539948000" expanded="true" signature="6908:7237" ph="..." />
<marker date="1498539948000" expanded="true" signature="6999:7127" ph="if ... end" />
<marker date="1498539948000" expanded="true" signature="7253:8136" ph="..." />
<marker date="1498539948000" expanded="true" signature="7283:7870" ph="{...}" />
<marker date="1498539948000" expanded="true" signature="7322:7434" ph="{...}" />
<marker date="1498539948000" expanded="true" signature="7471:7574" ph="{...}" />
<marker date="1498539948000" expanded="true" signature="7612:7723" ph="{...}" />
<marker date="1498539948000" expanded="true" signature="7761:7867" ph="{...}" />
<marker date="1498539948000" expanded="true" signature="7905:8012" ph="{...}" />
<marker date="1498539948000" expanded="true" signature="8047:8088" ph="{...}" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/views/origami/sales/show.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="249">
<caret line="139" column="30" lean-forward="true" selection-start-line="139" selection-start-column="30" selection-end-line="139" selection-end-column="30" />
<folding />
</state>
</provider>

View File

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

View File

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

View File

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

View File

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

View File

@@ -19,7 +19,7 @@ class Api::BillController < Api::ApiController
@sale_id = booking.sale_id
end
end
elsif (params[:order_id])
@sale = Sale.new
@status, @sale_id = @sale.generate_invoice_from_order(params[:order_id], current_login_employee, get_cashier)
@@ -29,6 +29,7 @@ class Api::BillController < Api::ApiController
@sale_items = SaleItem.where("sale_id=?",@sale_id)
unique_code = "ReceiptBillPdf"
#shop detail
shop_details = Shop.find(1)

View File

@@ -2,7 +2,7 @@ class HomeController < ApplicationController
skip_before_action :authenticate, only: [:index, :show, :create, :update, :destroy]
def index
@employees = Employee.all.order("name asc")
@employees = Employee.all_emp_except_waiter.order("name asc")
@login_form = LoginForm.new()
end
@@ -19,7 +19,7 @@ class HomeController < ApplicationController
if @employee != nil
session[:session_token] = @employee.token_session
redirect_to origami_root_path
route_by_role(@employee)
else
render :show, flash[:notice] => "Invalid PIN for Employee. Please try again!"
end
@@ -37,7 +37,7 @@ class HomeController < ApplicationController
redirect_to dashboard_path
elsif @employee.role == "cashier"
session[:session_token] = @employee.token_session
redirect_to origami_root_path
route_by_role(@employee)
elsif @employee.role == "manager"
session[:session_token] = @employee.token_session
redirect_to dashboard_path
@@ -74,4 +74,25 @@ class HomeController < ApplicationController
def settings_home_params
params.require(:login_form).permit(:emp_id, :password)
end
def route_by_role(employee)
if employee.role == "administrator"
redirect_to dashboard_path
elsif employee.role == "cashier"
#check if cashier has existing open cashier
shift = ShiftSale.current_open_shift(employee)
if !shift.nil?
redirect_to origami_root_path
else
redirect_to new_origami_shift_path
end
elsif employee.role == "manager"
redirect_to oqs_root_path
elsif employee.role == "waiter"
redirect_to oqs_root_path
elsif employee.role == "crm"
redirect_to crm_root_path
end
end
end

View File

@@ -0,0 +1,10 @@
class Origami::CashMgmtController < ApplicationController
def index
end
def new
end
def create
end
end

View File

@@ -19,9 +19,9 @@ class Origami::HomeController < BaseOrigamiController
@orders = Order.get_orders()
end
def item_show
selection(params[:booking_id],1)
end
# def item_show
# selection(params[:booking_id],1)
# end
def selection(selected_id, is_ajax)
str = []
@@ -37,8 +37,8 @@ class Origami::HomeController < BaseOrigamiController
@order_details = OrderItem.get_order_items_details(params[:booking_id])
@order_details.each do |ord_detail|
str.push(ord_detail)
end
end
end
end
if is_ajax == 1
render :json => str.to_json

View File

@@ -0,0 +1,21 @@
class Origami::ShiftsController < BaseOrigamiController
def index
end
def show
end
def new
@float = Lookup.where('lookup_type=?','float')
end
def create
opening_balance = params[:opening_balance]
@shift = ShiftSale.new
@shift.create(opening_balance,current_user)
end
def edit
end
end

View File

@@ -25,7 +25,7 @@ class Origami::TableInvoicesController < BaseOrigamiController
else
sale = Sale.find(booking.sale_id)
if sale.sale_status != "completed"
if sale.sale_status != "completed" && sale.sale_status != 'void'
@sale_array.push(sale)
end
end

View File

@@ -9,6 +9,14 @@ class Origami::VoidController < BaseOrigamiController
sale.sale_status = 'void'
sale.save
bookings = sale.bookings
bookings.each do |booking|
orders = booking.orders
orders.each do |order|
# order.status = 'void'
end
end
table_avaliable = true
table = sale.bookings[0].dining_facility
table.bookings.each do |booking|

View File

@@ -0,0 +1,16 @@
class LoginForm
include ActiveModel::Model
include ActiveModel::Validations
attr_accessor :float_amount
validates_presence_of :float_amount
def persisted?
false
end
def initialize(attributes={})
super
end
end

View File

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

View File

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

View File

@@ -6,6 +6,10 @@ class Employee < ApplicationRecord
validates :emp_id, uniqueness: true, numericality: true, length: {in: 1..4}, allow_blank: true
validates :password, numericality: true, length: {in: 3..9}, allow_blank: true
def self.all_emp_except_waiter
Employee.where('role!=?','waiter')
end
def self.collection
Employee.select("id, name").map { |e| [e.name, e.id] }
end

View File

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

View File

@@ -270,7 +270,6 @@ class Sale < ApplicationRecord
end
private
def product_get_unit_price(item_code)

View File

@@ -247,6 +247,10 @@ class SalePayment < ApplicationRecord
end
self.sale.sale_status = "completed"
self.sale.save!
shift = ShiftSale.current_open_shift(self.sale.cashier_id)
if shift
shift.update(self.sale)
end
table_update_status(sObj)
rebat(sObj)
end

51
app/models/shift_sale.rb Normal file
View File

@@ -0,0 +1,51 @@
#Description
#total_revenue = sum of all sub-total from sales table
#total_discounts = sum of all discount (overall) from sales tables
#total_taxes = sum of all taxes from sales table (Service + Goverment Tax (commercial_taxes))
#grand_total = total_revenue - total_discounts + total_taxes
#nett_sales = grand_total - commercial_taxes
#cash_sales = cash payment total revenue
#credit_sales = credit payment total revenue
#others_sales = [Sum of each of other payment type --- mpu, jcb, visa,master, rebate, vochure]
#commercial_taxes = Total Goverment tax due
#cash_in = Payment receive
#Cash_out = Payment issues for misc payments
class ShiftSale < ApplicationRecord
belongs_to :cashier_terminal
belongs_to :employee
def self.current_open_shift(current_user)
#if current_user
#find open shift where is open today and is not closed and login by current cashier
today_date = DateTime.now.strftime("%Y-%m-%d")
shift = ShiftSale.where("TO_CHAR(shift_started_at, 'YYYY-MM-DD')=? and shift_started_at is not null and shift_closed_at is null and employee_id = #{current_user.id}",today_date).take
return shift
#end
end
def create(opening_balance,current_user)
self.cashier_terminal_id = CashierTerminal.first.id
self.shift_started_at = DateTime.now
self.employee_id = current_user.id
self.opening_balance = opening_balance
self.save
end
def update(sale)
saleobj = Sale.find(sale)
self.total_revenue = self.total_revenue + saleobj.total_amount
self.total_discounts = self.total_discounts + saleobj.total_discount
self.total_taxes = self.total_taxes + saleobj.total_tax
self.grand_total = self.grand_total + saleobj.grand_total
# self.nett_sales =
# self.cash_sales =
# self.credit_sales =
# self.other_sales =
# self.commercial_taxes =
self.save
end
end

View File

@@ -1,14 +1,24 @@
<style>
.pin_pad {
width:10rem;
height:10rem;
text-align: center;
vertical-align: middle;
line-height: 10rem;
margin:2px;
margin-top:4px;
margin-bottom:4px;
font-size:3rem;
width: 30%;
height:70px;
line-height:70px;
text-align:center;
background:#54A5AF;
font-size:20px;
color:white;
}
.bottom{
margin-bottom: 1px;
}
.left{
margin-left:1px;
}
.orange{
background-color:#FF7F50;
}
.purple {
background-color:#7a62d3;
}
</style>
@@ -23,21 +33,29 @@
<%= f.input :password, label: "Access PIN", required: false, class: "form-control" %>
</div>
</div>
<div class="content" style="margin:10px; margin-top:0px; text-align:center">
<button class="pin_pad" data-value="1">1</button>
<button class="pin_pad" data-value="2">2</button>
<button class="pin_pad" data-value="3">3</button>
<button class="pin_pad" data-value="4">4</button>
<button class="pin_pad" data-value="5">5</button>
<button class="pin_pad" data-value="6">6</button>
<button class="pin_pad" data-value="7">7</button>
<button class="pin_pad" data-value="8">8</button>
<button class="pin_pad" data-value="9">9</button>
<button class="pin_pad" data-value="CLR">CLR</button>
<button class="pin_pad" data-value="8">0</button>
<button class="pin_pad btn-warning" data-value="ENT">ENT</button>
<div class="content row" style="padding-left:10px;margin-left:10px; margin-top:0px; text-align:center">
<div class='col-md-12'>
<div class='row bottom'>
<div class="pin_pad " data-value="1">1</div>
<div class="pin_pad left" data-value="2">2</div>
<div class="pin_pad left" data-value="3">3</div>
</div>
<div class='row bottom'>
<div class="pin_pad" data-value="4">4</div>
<div class="pin_pad left" data-value="5">5</div>
<div class="pin_pad left" data-value="6">6</div>
</div>
<div class='row bottom'>
<div class="pin_pad" data-value="7">7</div>
<div class="pin_pad left" data-value="8">8</div>
<div class="pin_pad left" data-value="9">9</div>
</div>
<div class='row bottom'>
<div class="pin_pad orange" data-value="CLR">CLR</div>
<div class="pin_pad left" data-value="8">0</div>
<div class="pin_pad left purple" data-value="ENT">ENT</div>
</div>
</div>
<div class="footer text-center" style="margin:10px">
</div>

View File

@@ -0,0 +1,2 @@
<h1>CashMgmt#create</h1>
<p>Find me in app/views/cash_mgmt/create.html.erb</p>

View File

@@ -0,0 +1,2 @@
<h1>CashMgmt#index</h1>
<p>Find me in app/views/cash_mgmt/index.html.erb</p>

View File

@@ -0,0 +1,2 @@
<h1>CashMgmt#new</h1>
<p>Find me in app/views/cash_mgmt/new.html.erb</p>

View File

@@ -27,6 +27,7 @@
<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>
</div>
</div>
<% end %>

View File

@@ -27,6 +27,7 @@
<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>
</div>
</div>
<% end %>
@@ -289,7 +290,7 @@
<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="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" disabled>Add Order</button>
<button type="button" class="btn btn-primary btn-block" id='edit'>Edit</button>
@@ -490,9 +491,9 @@ $('#edit').on('click',function(){
})
} else {
}
}
})
})
</script>

View File

@@ -26,7 +26,7 @@
<% @complete.each do |sale| %>
<div class="card sales red text-white" data-id = "<%= sale.sale_id %>">
<div class="card-block">
<%= sale.receipt_no %>
<%= sale.receipt_no %><span style="font-size:12px;float:right;line-height:inherit;"><%= sale.sale_status %></span>
</div>
</div>
<% end %>

View File

@@ -11,7 +11,7 @@
</tr>
<tr>
<td><strong>Table No</strong> <% if @sale_data%>- <%=@sale_data.receipt_no%><% end %></td>
<td><strong>Sale Id</strong> </span><span id="sale_id"><% if @sale_data %><%=@sale_data.sale_id %><% end %></td>
<td><strong>Sale Id</strong> <span id="sale_id"><% if @sale_data %><%=@sale_data.sale_id %><% end %></span></td>
</tr>
<tr>
<td><strong>Customer :</strong> <%= @sale_data.customer.name%></td>
@@ -244,7 +244,7 @@
<button type="button" class="btn btn-primary btn-block" onclick="localStorage.removeItem('cash');window.location.href = '/origami';"> Back </button>
<button type="button" class="btn btn-primary btn-block"> FOC </button>
<button type="button" class="btn btn-primary btn-block"> Void </button>
<button type="button" class="btn btn-primary btn-block" id="void"> Void </button>
</div>
</div>
@@ -354,6 +354,23 @@ $( document ).ready(function() {
}
});
$('#void').on('click',function () {
var sure = confirm("Are you sure want to Void");
if (sure == true) {
var sale_id = $('#sale_id').text();
var ajax_url = "/origami/sale/" + sale_id + '/void';
$.ajax({
type: 'POST',
url: ajax_url,
success: function () {
window.location.href = '/origami/';
}
})
} else {
}
});
});
function update_balance(){
@@ -369,4 +386,5 @@ function update_balance(){
var result = amount_due - total;
$('#balance').text(result.toFixed(2));
}
</script>

View File

@@ -26,7 +26,7 @@
<% @complete.each do |sale| %>
<div class="card sales red text-white" data-id = "<%= sale.sale_id %>">
<div class="card-block">
<%= sale.receipt_no %>
<%= sale.receipt_no %><span style="font-size:12px;float:right;line-height:inherit;"><%= sale.sale_status %></span>
</div>
</div>
<% end %>

View File

@@ -26,7 +26,7 @@
<% @complete.each do |sale| %>
<div class="card sales red text-white" data-id = "<%= sale.sale_id %>">
<div class="card-block">
<%= sale.receipt_no %>
<%= sale.receipt_no %><span style="font-size:12px;float:right;line-height:inherit;"><%= sale.sale_status %></span>
</div>
</div>
<% end %>
@@ -185,7 +185,9 @@
<!-- Column Three -->
<div class="col-lg-1 col-md-1 col-sm-1">
<button type="button" class="btn btn-primary btn-block" id='back'>Back</button>
<button type="button" id="void" class="btn btn-primary btn-block">VOID</button>
<% if @sale.sale_status != 'void' %>
<button type="button" id="void" class="btn btn-primary btn-block">VOID</button>
<% end %>
<button type="button" id="re-print" class="btn btn-primary btn-block">Re.Print</button>
</div>
</div>

View File

@@ -0,0 +1 @@
json.status true

View File

@@ -0,0 +1,2 @@
<h1>Origami::Shifts#edit</h1>
<p>Find me in app/views/origami/shifts/edit.html.erb</p>

View File

@@ -0,0 +1,2 @@
<h1>Origami::Shifts#index</h1>
<p>Find me in app/views/origami/shifts/index.html.erb</p>

View File

@@ -0,0 +1,46 @@
<h1>Open Cashier</h1>
<br>
<div class="row">
<div class="col-md-4">
<table class='table table-striped'>
<% @float.each do |float| %>
<tr>
<th><%= float.name %></th>
<th><input class='float-value' type='text' data-value ="<%= float.value %>" value='' /></th>
</tr>
<% end %>
<tr>
<th>Total</th>
<th><div id='total'></div></th>
</tr>
</table>
<div class="row">
<div class='col-md-4'></div>
<div class='col-md-2'>
<button class='btn btn-primary' id='open_cashier'>Open Cashier</button>
</div>
</div>
</div>
</div>
<script>
var total = 0
$(document).on('focusout', '.float-value', function(event){
var input_type = $(this).attr("data-value");
var count = $(this).val();
total += input_type * count
$('#total').text(total)
})
$('#open_cashier').on('click',function(){
var amount = $('#total').text();
$.ajax({type: "POST",
url: "<%= origami_shifts_path %>",
data: "opening_balance=" + amount,
success:function(result){
if(result){
window.location.href = '/origami';
}
}
});
})
</script>

View File

@@ -0,0 +1,2 @@
<h1>Origami::Shifts#show</h1>
<p>Find me in app/views/origami/shifts/show.html.erb</p>

View File

@@ -128,6 +128,7 @@
<div class="col-lg-1 col-md-1 col-sm-1">
<button type="button" class="btn btn-primary btn-block" id='back'>Back</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>
</div>
</div>
<script>
@@ -143,5 +144,21 @@ $('#pay').on('click',function() {
});
$('#back').on('click',function(){
window.location.href = '/origami/table/<%= @table.id %>';
})
});
$('#void').on('click',function () {
var sure = confirm("Are you sure want to Void");
if (sure == true) {
var sale_id = $('#sale_id').val();
var ajax_url = "/origami/sale/" + sale_id + '/void';
$.ajax({
type: 'POST',
url: ajax_url,
success: function () {
window.location.href = '/origami/';
}
})
} else {
}
});
</script>

View File

@@ -89,7 +89,7 @@ Rails.application.routes.draw do
get 'room/:room_id' => 'rooms#show'
get 'order/:order_id' => "orders#show"
post '/:booking_id' => 'home#item_show'
# post '/:booking_id' => 'home#item_show'
get "/:id/discount" => "discounts#index"
post "/:id/discount" => "discounts#create"
@@ -98,6 +98,19 @@ Rails.application.routes.draw do
post "/:id/request_bills" => "request_bills#print",:as => "request_bill" ,:defaults => { :format => 'json' }
get '/:sale_id/reprint' => 'payments#reprint' ,:defaults => { :format => 'json' }
#---------Shift ---------------#
resources :shifts, only: [:index, :show, :new, :create, :edit, :update]
#shift - index (open/close shift landing page)
#shift - show (sales summary display)
#shift - new (open shift)
#shift - edit (close shift)
resources :cash_mgmt, only: [:new, :create]
#payment - accepting or expending money from cashier - [Cash Journal]
#payment - Incoming payments - [accept all payment types (cash, other payments (except rebate))
#payment - Outing payments - Cash only [ *Misc expeness tracking]
#--------- Payment ------------#
get 'sale/:sale_id/payment' => 'payments#show'

View File

@@ -0,0 +1,25 @@
class CreateShiftSales < ActiveRecord::Migration[5.1]
def change
create_table :shift_sales do |t|
t.references :cashier_terminal, foreign_key: true, :null => false
t.datetime :shift_started_at
t.datetime :shift_closed_at
t.references :employee, foreign_key: true #cashier
t.decimal :opening_balance, :precision => 10, :scale => 2, :null => false, :default => 0.00
t.decimal :closing_balance, :precision => 10, :scale => 2, :null => false, :default => 0.00
t.decimal :total_revenue, :precision => 10, :scale => 2, :null => false, :default => 0.00
t.decimal :total_discounts, :precision => 10, :scale => 2, :null => false, :default => 0.00
t.decimal :total_taxes, :precision => 10, :scale => 2, :null => false, :default => 0.00
t.decimal :grand_total, :precision => 10, :scale => 2, :null => false, :default => 0.00
t.decimal :nett_sales, :precision => 10, :scale => 2, :null => false, :default => 0.00
t.decimal :cash_sales, :precision => 10, :scale => 2, :null => false, :default => 0.00
t.decimal :credit_sales, :precision => 10, :scale => 2, :null => false, :default => 0.00
t.json :other_sales
t.decimal :commercial_taxes, :precision => 10, :scale => 2, :null => false, :default => 0.00
t.decimal :cash_in, :precision => 10, :scale => 2, :null => false, :default => 0.00
t.decimal :cash_out, :precision => 10, :scale => 2, :null => false, :default => 0.00
t.timestamps
end
end
end

View File

@@ -0,0 +1,15 @@
class CreatePaymentJournals < ActiveRecord::Migration[5.1]
def change
create_table :payment_journals do |t|
t.string :payment_references,:null => false
t.string :remark
t.decimal :credit_amount, :precision => 10, :scale => 2, :null => false, :default => 0.00
t.decimal :debit_amount, :precision => 10, :scale => 2, :null => false, :default => 0.00
t.string :payment_method,:null => false, :default => "CASH"
t.string :payment_status,:null => false, :default => "NEW"
t.string :payment_method_references
t.timestamps
end
end
end

View File

@@ -22,3 +22,5 @@ rails generate scaffold_controller Setup/CashierTerminal name:string is_active:b
rails generate scaffold_controller Settings/OrderQueueStation station_name:string is_active:boolean processing_items:json print_copy:boolean printer_name:string font_size:integer cut_per_item:boolean use_alternate_name:boolean created_by:string --no-migration
rails generate scaffold_controller transactions/Sale cashier:references cashier_name:string requested_by:string requested_at:datetime receipt_no:string receipt_date:datetime customer:references payment_status:string sale_status:string total_amount:decimal total_discount:decimal total_tax:decimal tax_type:string grand_total:decimal rounding_adjustment:decimal amount_received:decimal amount_changed:decimal --no-migration
rails g model shift_sale cashier_terminal:references shift_started_at:datetime shift_closed_at:datetime employee:references opening_balance:decimal closing_balance:decimal total_revenue:decimal total_discounts:decimal total_taxes:decimal grand_total:decimal nett_sales:decimal cash_sales:decimal credit_sales:decimal other_sales:decimal commercial_taxes:decimal cash_in:decimal cash_out:decimal

BIN
dump.rdb

Binary file not shown.

View File

@@ -0,0 +1,26 @@
require 'rails_helper'
RSpec.describe CashMgmtController, type: :controller do
describe "GET #index" do
it "returns http success" do
get :index
expect(response).to have_http_status(:success)
end
end
describe "GET #new" do
it "returns http success" do
get :new
expect(response).to have_http_status(:success)
end
end
describe "GET #create" do
it "returns http success" do
get :create
expect(response).to have_http_status(:success)
end
end
end

View File

@@ -0,0 +1,33 @@
require 'rails_helper'
RSpec.describe Origami::ShiftsController, type: :controller do
describe "GET #index" do
it "returns http success" do
get :index
expect(response).to have_http_status(:success)
end
end
describe "GET #show" do
it "returns http success" do
get :show
expect(response).to have_http_status(:success)
end
end
describe "GET #new" do
it "returns http success" do
get :new
expect(response).to have_http_status(:success)
end
end
describe "GET #edit" do
it "returns http success" do
get :edit
expect(response).to have_http_status(:success)
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 CashMgmtHelper. For example:
#
# describe CashMgmtHelper 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 CashMgmtHelper, type: :helper do
pending "add some examples to (or delete) #{__FILE__}"
end

View File

@@ -0,0 +1,15 @@
require 'rails_helper'
# Specs in this file have access to a helper object that includes
# the Origami::ShiftsHelper. For example:
#
# describe Origami::ShiftsHelper 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::ShiftsHelper, type: :helper do
pending "add some examples to (or delete) #{__FILE__}"
end

View File

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

View File

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

View File

@@ -0,0 +1,5 @@
require 'rails_helper'
RSpec.describe "cash_mgmt/create.html.erb", type: :view do
pending "add some examples to (or delete) #{__FILE__}"
end

View File

@@ -0,0 +1,5 @@
require 'rails_helper'
RSpec.describe "cash_mgmt/index.html.erb", type: :view do
pending "add some examples to (or delete) #{__FILE__}"
end

View File

@@ -0,0 +1,5 @@
require 'rails_helper'
RSpec.describe "cash_mgmt/new.html.erb", type: :view do
pending "add some examples to (or delete) #{__FILE__}"
end

View File

@@ -0,0 +1,5 @@
require 'rails_helper'
RSpec.describe "shifts/edit.html.erb", type: :view do
pending "add some examples to (or delete) #{__FILE__}"
end

View File

@@ -0,0 +1,5 @@
require 'rails_helper'
RSpec.describe "shifts/index.html.erb", type: :view do
pending "add some examples to (or delete) #{__FILE__}"
end

View File

@@ -0,0 +1,5 @@
require 'rails_helper'
RSpec.describe "shifts/new.html.erb", type: :view do
pending "add some examples to (or delete) #{__FILE__}"
end

View File

@@ -0,0 +1,5 @@
require 'rails_helper'
RSpec.describe "shifts/show.html.erb", type: :view do
pending "add some examples to (or delete) #{__FILE__}"
end