Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
soko
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bitsoko services
soko
Commits
5e8fad5c
Commit
5e8fad5c
authored
Nov 26, 2018
by
gaseema.n
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
inventory update
parent
47572003
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
3 deletions
+31
-3
inventory.js
js/inventory.js
+28
-0
products.js
js/products.js
+1
-1
sales.js
js/sales.js
+2
-2
No files found.
js/inventory.js
View file @
5e8fad5c
...
@@ -33,3 +33,31 @@ function sponpProdNamesInput() {
...
@@ -33,3 +33,31 @@ function sponpProdNamesInput() {
});
});
}
}
//Process Inventory Order
function
inventoryOrder
(
prid
)
{
var
quantity
=
document
.
getElementById
(
"prodRestNo-"
+
prid
).
value
;
var
prodPrice
=
document
.
getElementById
(
"prodPrice-"
+
prid
).
value
;
var
totalCost
=
quantity
*
prodPrice
;
if
(
totalCost
>
shopBalance
)
{
getInsufficientFundsOrderbook
(
JSON
.
stringify
(
totalCost
));
}
else
{
doFetch
({
action
:
'inventoryOrder'
,
shop
:
localStorage
.
getItem
(
'soko-active-store'
),
item
:
prid
,
quantity
:
quantity
,
price
:
prodPrice
,
}).
then
(
function
(
e
)
{
if
(
e
.
status
==
'ok'
)
{
M
.
toast
({
html
:
'Order request sent successfully'
})
}
else
{
M
.
toast
({
html
:
'Error!!! Try again later'
})
}
})
}
}
js/products.js
View file @
5e8fad5c
...
@@ -257,7 +257,7 @@ function productsUpdater() {
...
@@ -257,7 +257,7 @@ function productsUpdater() {
'<option value="4">per Week</option>'
+
'<option value="4">per Week</option>'
+
'<option value="5">per Month</option>'
+
'<option value="5">per Month</option>'
+
'<option value="6">per Litre</option>'
+
'<option value="6">per Litre</option>'
+
'</select></div></div></div><div style="width: 100%;text-align: center;margin: 20px 0px 0px;color: rgba(0,0,0,0.4);">availability</div>'
+
'<div class="row"><div class="input-field col s6">'
+
'<input placeholder="" prnm="rstQuantity" id="prodRestNo-'
+
reqs
[
i
].
id
+
'" type="number" value="'
+
reqs
[
i
].
rstQuantity
+
'" class="validate" min="0" prid="'
+
reqs
[
i
].
id
+
'" max="1000">'
+
'<label for="prodRestNo-'
+
reqs
[
i
].
id
+
'" class="active"> Quantity</label></div>'
+
'<div class="input-field col s6"><div class="select-wrapper initialized">'
+
'<select id="prodRestDur-'
+
reqs
[
i
].
id
+
'" prnm="rstDuration" class="initialized">'
+
'<option value="" disabled="" selected="'
+
reqs
[
i
].
rstDuration
+
'">duration</option>'
+
'<option value="day">per Day</option>'
+
'<option value="week">per Week</option>'
+
'<option value="month">per Month</option><option value="litre">per Litre</option>'
+
'</select></div></div></div>'
+
'<div class="row" style="text-align: right;margin: 20px 0px;">
</div>'
+
'</form></div></li><div class="divider" style="margin-top:2px;"></div
>'
);
'</select></div></div></div><div style="width: 100%;text-align: center;margin: 20px 0px 0px;color: rgba(0,0,0,0.4);">availability</div>'
+
'<div class="row"><div class="input-field col s6">'
+
'<input placeholder="" prnm="rstQuantity" id="prodRestNo-'
+
reqs
[
i
].
id
+
'" type="number" value="'
+
reqs
[
i
].
rstQuantity
+
'" class="validate" min="0" prid="'
+
reqs
[
i
].
id
+
'" max="1000">'
+
'<label for="prodRestNo-'
+
reqs
[
i
].
id
+
'" class="active"> Quantity</label></div>'
+
'<div class="input-field col s6"><div class="select-wrapper initialized">'
+
'<select id="prodRestDur-'
+
reqs
[
i
].
id
+
'" prnm="rstDuration" class="initialized">'
+
'<option value="" disabled="" selected="'
+
reqs
[
i
].
rstDuration
+
'">duration</option>'
+
'<option value="day">per Day</option>'
+
'<option value="week">per Week</option>'
+
'<option value="month">per Month</option><option value="litre">per Litre</option>'
+
'</select></div></div></div>'
+
'<div class="row" style="text-align: right;margin: 20px 0px;">
<div class="btn opacitySelectedColor processInventoryOrder" style="display: block; margin: 0px auto;" onclick="inventoryOrder('
+
reqs
[
i
].
id
+
')">purchase order</div> </div>'
+
'</form></div></li
>'
);
if
(
reqs
[
i
].
sponsored
==
"true"
)
{
if
(
reqs
[
i
].
sponsored
==
"true"
)
{
var
sprndhtml
=
""
;
var
sprndhtml
=
""
;
...
...
js/sales.js
View file @
5e8fad5c
...
@@ -41,11 +41,11 @@ function refreshSalesOrders() {
...
@@ -41,11 +41,11 @@ function refreshSalesOrders() {
pendOds
=
false
;
pendOds
=
false
;
var
storeTotalBal
=
[]
var
storeTotalBal
=
[]
for
(
var
ii
in
alOds
)
{
for
(
var
ii
in
alOds
)
{
var
storeBal
=
alOds
[
ii
].
proPrice
var
storeBal
=
alOds
[
ii
].
proPrice
;
if
(
alOds
[
ii
].
state
==
'pending'
)
{
if
(
alOds
[
ii
].
state
==
'pending'
)
{
pendOds
=
true
;
pendOds
=
true
;
}
else
if
(
alOds
[
ii
].
state
==
'complete
d
'
)
{
}
else
if
(
alOds
[
ii
].
state
==
'complete'
)
{
storeTotalBal
.
push
(
storeBal
);
storeTotalBal
.
push
(
storeBal
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment