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
42fbfd7a
Commit
42fbfd7a
authored
Nov 30, 2018
by
gaseema.n
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
inventory update
parent
0f72c5a6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
31 deletions
+28
-31
index.html
index.html
+4
-0
packaging.js
js/packaging.js
+21
-28
products.js
js/products.js
+3
-3
No files found.
index.html
View file @
42fbfd7a
...
...
@@ -3236,6 +3236,10 @@
</div>
<!--------- Inventory PAGE Start --------->
<div
class=
"col s12 m4 l4 inventoryPage"
style=
"display: none; overflow-x: hidden !important; height: 91vh !important; overflow-y: scroll !important;padding-bottom: 20px;"
>
<div
id=
"inventoryEmpty"
style=
"display: block;"
>
<div
style=
" width: 100px; margin-left: auto; margin-right: auto; margin-top: 25px;"
><svg
xmlns=
"http://www.w3.org/2000/svg"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
version=
"1.1"
viewBox=
"0 0 16 16"
><path
fill=
"#444444"
d=
"M8 1c3.9 0 7 3.1 7 7s-3.1 7-7 7-7-3.1-7-7 3.1-7 7-7zM8 0c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8v0z"
></path><path
fill=
"#444444"
d=
"M7 6c0 0.552-0.448 1-1 1s-1-0.448-1-1c0-0.552 0.448-1 1-1s1 0.448 1 1z"
></path><path
fill=
"#444444"
d=
"M11 6c0 0.552-0.448 1-1 1s-1-0.448-1-1c0-0.552 0.448-1 1-1s1 0.448 1 1z"
></path><path
fill=
"#444444"
d=
"M11.3 12.3c-0.7-1.1-2-1.8-3.3-1.8s-2.6 0.7-3.3 1.8l-0.8-0.6c0.9-1.4 2.4-2.2 4.1-2.2s3.2 0.8 4.1 2.2l-0.8 0.6z"
></path></svg></div>
<p
style=
" text-align: center; color: #4e4b4b; font-weight: bold;"
>
Ooops!!! Your inventory is empty
</p>
</div>
<ul
class=
"sponsoredPrd-collapsible collapsible collapsible-accordion chStoreUpdate"
data-collapsible=
"accordion"
style=
"background:white; margin: 10px;"
>
</ul>
<div
class=
"fixed-action-btn direction-top active"
>
<a
onclick=
"$('#spnsrdModal').modal('open')"
class=
"btn-floating opacitySelectedColor"
style=
"width: 55px; height: 55px; border-radius: 50%; line-height: 55px; font-size: 2em;"
>
...
...
js/packaging.js
View file @
42fbfd7a
...
...
@@ -281,39 +281,32 @@ function fetchPackagingOrders() {
var
orderData
=
e
.
data
;
console
.
log
(
orderData
.
length
)
var
allItems
=
0
if
(
orderData
.
length
<
1
)
{
$
(
'.packagingContainer'
).
html
(
'<div id="checkStoreOwner" style="display: block;"> <div style=" width: 100px; display: block; margin-left: auto; margin-right: auto; margin-top: 25px;"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="0 0 16 16"><path fill="#444444" d="M8 1c3.9 0 7 3.1 7 7s-3.1 7-7 7-7-3.1-7-7 3.1-7 7-7zM8 0c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8v0z"></path><path fill="#444444" d="M7 6c0 0.552-0.448 1-1 1s-1-0.448-1-1c0-0.552 0.448-1 1-1s1 0.448 1 1z"></path><path fill="#444444" d="M11 6c0 0.552-0.448 1-1 1s-1-0.448-1-1c0-0.552 0.448-1 1-1s1 0.448 1 1z"></path><path fill="#444444" d="M11.3 12.3c-0.7-1.1-2-1.8-3.3-1.8s-2.6 0.7-3.3 1.8l-0.8-0.6c0.9-1.4 2.4-2.2 4.1-2.2s3.2 0.8 4.1 2.2l-0.8 0.6z"></path></svg></div><p style=" text-align: center; color: #4e4b4b; font-weight: bold;">Ooops!!! You do not have access to store settings</p></div>'
)
}
else
{
for
(
order
in
orderData
)
{
if
(
orderData
[
order
].
type
==
"paperBag"
)
{
orderData
[
order
].
type
=
"Paper Bag"
}
else
{
orderData
[
order
].
type
=
"Wrapping Bag"
}
var
items
=
JSON
.
parse
(
orderData
[
order
].
items
.
replace
(
'"{'
,
'{'
).
replace
(
'}"'
,
'}'
));
var
itemsSize
=
Object
.
keys
(
items
)
var
testArray
=
new
Array
();
for
(
sizes
in
items
)
{
// $('.packagingSizes').append(items[sizes])
testArray
.
push
(
items
[
sizes
])
}
packagingArrayItems
(
testArray
,
itemsSize
)
function
packagingArrayItems
(
itm
,
size
)
{
var
nums
=
itm
var
sum
=
0
;
for
(
var
i
=
0
;
i
<
nums
.
length
;
i
++
)
{
for
(
order
in
orderData
)
{
if
(
orderData
[
order
].
type
==
"paperBag"
)
{
orderData
[
order
].
type
=
"Paper Bag"
}
else
{
orderData
[
order
].
type
=
"Wrapping Bag"
}
var
items
=
JSON
.
parse
(
orderData
[
order
].
items
.
replace
(
'"{'
,
'{'
).
replace
(
'}"'
,
'}'
));
var
itemsSize
=
Object
.
keys
(
items
)
var
testArray
=
new
Array
();
for
(
sizes
in
items
)
{
// $('.packagingSizes').append(items[sizes])
testArray
.
push
(
items
[
sizes
])
}
packagingArrayItems
(
testArray
,
itemsSize
)
function
packagingArrayItems
(
itm
,
size
)
{
var
nums
=
itm
var
sum
=
0
;
sum
+=
parseInt
(
nums
[
i
]);
for
(
var
i
=
0
;
i
<
nums
.
length
;
i
++
)
{
}
sum
+=
parseInt
(
nums
[
i
]);
console
.
log
();
$
(
'.packagingContainer'
).
append
(
'<div class="row" style="width: 100%; display: block; margin-left: auto; margin-right: auto;"><div class="col s12 m6"> <div class="card"> <span class="card-title" style="border-bottom: solid #cecbcb 1px; display: block; padding: 5px 10px; font-size: 1em; font-weight: bold;">'
+
orderData
[
order
].
type
+
'</span> <div class="card-content" style="padding: 10px;"><div class="packagingSizes"></div> <p style="font-weight: bold; color: #545252;">Status: <span style="font-weight: normal;">'
+
orderData
[
order
].
status
+
'</span></p><p style="font-weight: bold; color: #545252;">No. of Items: <span style="font-weight: normal;">'
+
sum
+
'</span></p><p style="font-weight: bold; color: #545252;">Total Price: <span style="font-weight: normal;">0 kes</span></p></div></div></div></div>'
);
}
$
(
'.packagingContainer'
).
append
(
'<div class="row" style="width: 100%; display: block; margin-left: auto; margin-right: auto;"><div class="col s12 m6"> <div class="card"> <span class="card-title" style="border-bottom: solid #cecbcb 1px; display: block; padding: 5px 10px; font-size: 1em; font-weight: bold;">'
+
orderData
[
order
].
type
+
'</span> <div class="card-content" style="padding: 10px;"><div class="packagingSizes"></div> <p style="font-weight: bold; color: #545252;">Status: <span style="font-weight: normal;">'
+
orderData
[
order
].
status
+
'</span></p><p style="font-weight: bold; color: #545252;">No. of Items: <span style="font-weight: normal;">'
+
sum
+
'</span></p><p style="font-weight: bold; color: #545252;">Total Price: <span style="font-weight: normal;">0 kes</span></p></div></div></div></div>'
);
}
}
}
...
...
js/products.js
View file @
42fbfd7a
...
...
@@ -243,7 +243,7 @@ function productsUpdater() {
globalProductList
.
push
(
reqs
[
i
])
prodUID
=
reqs
if
(
reqs
[
i
].
sponsored
==
"true"
)
{
console
.
log
(
reqs
[
i
])
$
(
'#inventoryEmpty'
).
css
(
'display'
,
'none'
);
var
totalPrice
=
reqs
[
i
].
rstQuantity
*
reqs
[
i
].
price
$
(
".sponsoredPrd-collapsible"
).
append
(
'<li class="prdList" prid="'
+
reqs
[
i
].
id
+
'" style="margin: 0px 0px 10px 0p !important; background: rgb(255, 255, 255);">'
+
'<div class="prodImgDskt" id="prodImg-holda-'
+
reqs
[
i
].
id
+
'" style="background-size: cover;background-repeat: no-repeat;background-position: center;background-image:url('
+
reqs
[
i
].
imagePath
.
replace
(
'.png'
,
'-35.webp'
)
+
');width: 70px;height: 70px;float: left; margin: 10px"></div><div class="collapsible-header" style="padding: 5px 10px;line-height: 0;width: calc(100% - 90px);display:inline-block;border-bottom:none;"><div class="row"><div class="col s10"><p style="margin:0px;line-height:1.8rem;font-weight:bold; white-space: nowrap; width: 85%; overflow: hidden; text-overflow: ellipsis;">'
+
reqs
[
i
].
name
+
' <br><span style="font-weight:400;color:#7e7e7e;">'
+
reqs
[
i
].
description
+
'<br> Ksh. '
+
reqs
[
i
].
price
+
'</span></p></div><div class="col s2"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Layer_1" x="0px" y="0px" viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;margin-top:10px;" xml:space="preserve"><path style="fill: rgba(29, 125, 116, 0.85);" d="M426.639,426.049l1.732-34.191c0.315-6.146,4.255-11.659,10.084-13.865l31.907-12.211 c13.944-5.278,24.58-16.544,29.07-30.647c4.648-14.102,2.679-29.306-5.514-41.754l-18.593-28.833c-3.467-5.2-3.466-11.818,0-17.017 l18.671-28.756c8.036-12.447,10.084-27.731,5.515-41.912c-4.648-14.102-15.127-25.21-29.149-30.566l-31.985-12.29 c-5.751-2.127-9.612-7.563-9.927-13.708l-1.891-34.192c0.079-0.71-0.078-1.339-0.157-2.049 c-1.182-14.102-8.509-26.786-19.932-35.214c-12.054-8.588-27.022-11.423-41.518-7.642l-33.167,8.902 c-5.908,1.654-12.211-0.393-16.071-5.2l-21.586-26.628C284.754,6.696,270.809,0,255.999,0c-14.811,0-28.756,6.696-38.051,18.198 l-21.664,26.707c-3.86,4.805-10.163,6.853-16.071,5.2l-33.167-8.902c-14.339-3.781-29.464-0.945-41.518,7.642 c-12.054,8.902-19.38,22.374-20.089,37.263l-1.891,34.191c-0.158,6.146-4.176,11.58-9.927,13.708l-31.986,12.29 c-13.865,5.357-24.501,16.465-29.149,30.567c-4.569,14.181-2.521,29.463,5.593,41.99l18.75,28.677 c3.309,5.2,3.309,11.818-0.078,17.095L18.08,293.382c-8.114,12.368-10.163,27.653-5.515,41.754 c4.491,14.102,15.205,25.447,29.07,30.647l32.064,12.211c5.672,2.206,9.612,7.721,9.927,13.865l1.734,34.192 c0,1.417,0.158,2.835,0.393,4.175c1.813,13.157,8.902,25.132,19.774,32.853c12.054,8.902,27.258,11.659,41.596,7.72l33.01-8.902 c5.988-1.575,12.29,0.472,16.229,5.357l21.586,26.628c9.217,11.58,23.162,18.119,38.13,18.119c14.811,0,28.755-6.539,38.13-18.119 l21.428-26.628c3.94-4.884,10.242-6.933,16.229-5.357l33.167,8.902c14.181,3.94,29.385,1.182,41.439-7.721 C418.525,454.488,425.851,441.017,426.639,426.049z"></path><path style="fill: #1d7d74;" d="M406.471,463.076c-12.054,8.902-27.258,11.659-41.439,7.721l-33.167-8.902 c-5.987-1.575-12.29,0.472-16.229,5.357l-21.428,26.628c-9.375,11.58-23.32,18.119-38.13,18.119 c-14.968,0-28.913-6.539-38.13-18.119l-21.586-26.628c-3.94-4.884-10.241-6.933-16.229-5.357l-33.01,8.902 c-14.338,3.94-29.542,1.182-41.596-7.72c-10.873-7.721-17.962-19.696-19.774-32.853L426.718,89.259l1.732,31.04 c0.315,6.144,4.176,11.58,9.927,13.708l31.985,12.29c14.022,5.357,24.501,16.465,29.149,30.566 c4.569,14.181,2.521,29.464-5.515,41.912l-18.671,28.756c-3.466,5.2-3.467,11.818,0,17.017l18.593,28.833 c8.193,12.448,10.163,27.653,5.514,41.754c-4.49,14.103-15.126,25.368-29.07,30.647l-31.907,12.211 c-5.83,2.206-9.769,7.721-10.084,13.865l-1.732,34.191C425.851,441.017,418.525,454.488,406.471,463.076z"></path><path style="fill: #ffab40;" d="M188.424,232.848c-18.431,0-33.424-14.993-33.424-33.424S169.993,166,188.424,166 s33.424,14.993,33.424,33.424S206.855,232.848,188.424,232.848z M188.424,199.445h0.109H188.424z M188.424,199.445h0.109H188.424z M188.424,199.431l0.109-0.001L188.424,199.431z M188.424,199.431l0.109-0.001L188.424,199.431z M188.424,199.431L188.424,199.431 L188.424,199.431z M188.424,199.431l0.109-0.001L188.424,199.431z M188.424,199.431l0.109-0.001L188.424,199.431z M188.424,199.431 l0.109-0.001L188.424,199.431z"></path><path style="fill:#F9A926;" d="M310.979,355.403c-18.431,0-33.424-14.993-33.424-33.424c0-18.431,14.993-33.424,33.424-33.424 s33.424,14.993,33.424,33.424C344.403,340.41,329.41,355.403,310.979,355.403z M310.979,322h0.109H310.979z M310.979,322h0.109 H310.979z M310.979,321.986l0.109-0.001L310.979,321.986z M310.979,321.986l0.109-0.001L310.979,321.986z M310.979,321.986 L310.979,321.986L310.979,321.986z M310.979,321.986l0.109-0.001L310.979,321.986z M310.979,321.986l0.109-0.001L310.979,321.986z M310.979,321.986l0.109-0.001L310.979,321.986z"></path><path style="fill:#FFC033;" d="M161.461,354.516c-6.524-6.524-6.528-17.106,0-23.634l157.562-157.562 c6.528-6.528,17.11-6.524,23.634,0c6.524,6.524,6.528,17.106,0,23.634L185.095,354.516 C178.568,361.043,167.985,361.04,161.461,354.516z"></path><path style="fill:#F9A926;" d="M185.095,354.516l157.562-157.562c6.528-6.528,6.524-17.11,0-23.634L161.461,354.516 C167.985,361.04,178.568,361.043,185.095,354.516z"></path></svg></div></div><div class="divider" style="background-color: #ffffff;"></div><span style="font-size:1em; font-weight:400; color:#616161;">'
+
'<i class="{{product.icon}}"></i><p style="margin:0px;display:none;">'
+
reqs
[
i
].
quantity
+
' available</p><div class="divider" style="background-color: #ffffff;"></div></span></div><div class="collapsible-body" style="padding:0px;"><div style="width: 100%;text-align: center;margin: 20px 0px 0px;color: rgba(0,0,0,0.4);text-transform:uppercase;">sale information</div>'
+
'<form class="col s12" style="padding: 20px 30px;"><div class="row"><div class="input-field col s12">'
+
'<input disabled id="prodName-'
+
reqs
[
i
].
id
+
'" prnm="name" type="text" class="validate" prid="'
+
reqs
[
i
].
id
+
'" value="'
+
reqs
[
i
].
name
+
'"><label for="prodName-'
+
reqs
[
i
].
id
+
'" class="">Name</label></div></div>'
+
'<div class="row"><div class="input-field col s12"><input disabled prnm="description" placeholder="" value="'
+
reqs
[
i
].
description
+
'" id="prodDesc-'
+
reqs
[
i
].
id
+
'" type="text" class="validate" prid="'
+
reqs
[
i
].
id
+
'" min="0">'
+
'<label for="description" class="">Description</label></div></div><div class="row">'
+
...
...
@@ -807,8 +807,8 @@ function loadProdCategory() {
function
calculateInventoryPrice
(
e
)
{
var
productQty
=
$
(
'#prodRestNo-'
+
e
).
val
();
var
productPrice
=
$
(
'#prodPrice-'
+
e
).
val
();
if
(
baseCd
==
undefined
)
{
var
productPrice
=
$
(
'#prodPrice-'
+
e
).
val
();
if
(
baseCd
==
undefined
)
{
baseCd
=
"kes"
}
...
...
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