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
ee6d8f00
Commit
ee6d8f00
authored
Dec 10, 2018
by
gaseema.n
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
inventory update
parent
6a92ca70
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
8 deletions
+16
-8
index.html
index.html
+1
-0
inventory.js
js/inventory.js
+15
-8
No files found.
index.html
View file @
ee6d8f00
...
@@ -1522,6 +1522,7 @@
...
@@ -1522,6 +1522,7 @@
</div>
</div>
</div>
</div>
</div>
</div>
<div
style=
" text-align: center; padding-bottom: 10px; font-weight: bold;"
>
Prices valid until
<span
id=
"invetoryEndDate"
>
21st December
</span></div>
</div>
</div>
<!-- newPromo Modal Start -->
<!-- newPromo Modal Start -->
<div
id=
"newPromoModal"
class=
"modal modal-fixed-footer"
>
<div
id=
"newPromoModal"
class=
"modal modal-fixed-footer"
>
...
...
js/inventory.js
View file @
ee6d8f00
...
@@ -26,19 +26,26 @@ function sponpProdNamesInput() {
...
@@ -26,19 +26,26 @@ function sponpProdNamesInput() {
var
itemName
=
sponProds
[
iii
].
name
;
var
itemName
=
sponProds
[
iii
].
name
;
var
itemPrice
=
sponProds
[
iii
].
price
;
var
itemPrice
=
sponProds
[
iii
].
price
;
var
itemId
=
sponProds
[
iii
].
id
;
var
itemId
=
sponProds
[
iii
].
id
;
if
(
itemName
.
toLowerCase
()
==
"eggs"
)
{
if
(
itemName
.
toLowerCase
()
==
"eggs"
)
{
$
(
'.inventoryItemsToAdd'
).
append
(
'<form action="#" style="padding-right: 20px;"> <p> <label> <input class="inventoryItems" type="checkbox" pid="'
+
itemId
+
'" id="inventoryItem'
+
itemId
+
'"/> <span><img src="/images/inventory/eggs.jpeg" style=" width: 25px; height: 25px; object-fit: cover; border-radius: 50%; float: left; margin-right: 10px;">'
+
itemName
+
' @ 270 per tray</span> </label> </p></form>'
);
$
(
'.inventoryItemsToAdd'
).
append
(
'<form action="#" style="padding-right: 20px;"> <p> <label> <input class="inventoryItems" type="checkbox" pid="'
+
itemId
+
'" id="inventoryItem'
+
itemId
+
'"/> <span><img src="/images/inventory/eggs.jpeg" style=" width: 25px; height: 25px; object-fit: cover; border-radius: 50%; float: left; margin-right: 10px;">'
+
itemName
+
' @ 270 per tray</span> </label> </p></form>'
);
}
}
if
(
itemName
.
toLowerCase
()
==
"potatoes"
)
{
if
(
itemName
.
toLowerCase
()
==
"potatoes"
)
{
$
(
'.inventoryItemsToAdd'
).
append
(
'<form action="#" style="padding-right: 20px;"> <p> <label> <input class="inventoryItems" type="checkbox" pid="'
+
itemId
+
'" id="inventoryItem'
+
itemId
+
'"/> <span><img src="/images/inventory/potatoes.jpg" style=" width: 25px; height: 25px; object-fit: cover; border-radius: 50%; float: left; margin-right: 10px;">'
+
itemName
+
' @ 37 per kg</span> </label> </p></form>'
);
$
(
'.inventoryItemsToAdd'
).
append
(
'<form action="#" style="padding-right: 20px;"> <p> <label> <input class="inventoryItems" type="checkbox" pid="'
+
itemId
+
'" id="inventoryItem'
+
itemId
+
'"/> <span><img src="/images/inventory/potatoes.jpg" style=" width: 25px; height: 25px; object-fit: cover; border-radius: 50%; float: left; margin-right: 10px;">'
+
itemName
+
' @ 37 per kg</span> </label> </p></form>'
);
}
}
if
(
invetoryItemsInStore
.
includes
(
itemId
)
==
true
)
{
if
(
invetoryItemsInStore
.
includes
(
itemId
)
==
true
)
{
$
(
'#inventoryItem'
+
itemId
+
''
).
attr
(
'checked'
,
true
);
$
(
'#inventoryItem'
+
itemId
+
''
).
attr
(
'checked'
,
true
);
}
}
}
}
});
});
function
daysRemaining
()
{
var
eventdate
=
moment
(
"2018-12-14"
);
var
todaysdate
=
moment
();
return
eventdate
.
diff
(
todaysdate
,
'days'
);
}
document
.
getElementById
(
'invetoryEndDate'
).
innerHTML
=
daysRemaining
();
}
}
//Process Inventory Order
//Process Inventory Order
...
@@ -74,7 +81,7 @@ function inventoryOrder(prid) {
...
@@ -74,7 +81,7 @@ function inventoryOrder(prid) {
$
(
document
).
on
(
'click touchstart'
,
'.inventoryItems'
,
function
(
e
)
{
$
(
document
).
on
(
'click touchstart'
,
'.inventoryItems'
,
function
(
e
)
{
var
getId
=
$
(
this
).
attr
(
'pid'
);
var
getId
=
$
(
this
).
attr
(
'pid'
);
var
isChecked
=
$
(
'#inventoryItem'
+
getId
).
prop
(
'checked'
);
var
isChecked
=
$
(
'#inventoryItem'
+
getId
).
prop
(
'checked'
);
if
(
isChecked
==
true
)
{
if
(
isChecked
==
true
)
{
M
.
toast
({
M
.
toast
({
html
:
'Adding item to inventory'
,
html
:
'Adding item to inventory'
,
classes
:
'spnsrdTst'
,
classes
:
'spnsrdTst'
,
...
@@ -95,9 +102,9 @@ $(document).on('click touchstart', '.inventoryItems', function(e) {
...
@@ -95,9 +102,9 @@ $(document).on('click touchstart', '.inventoryItems', function(e) {
})
})
}
else
{}
}
else
{}
});
});
}
else
{
}
else
{
$
(
"#rmvSpnsrdProd"
).
attr
(
"sid"
,
getId
)
$
(
"#rmvSpnsrdProd"
).
attr
(
"sid"
,
getId
)
$
(
"#rmvSpnsrdProd"
).
css
(
'display'
,
'block'
);
$
(
"#rmvSpnsrdProd"
).
css
(
'display'
,
'block'
);
$
(
document
).
on
(
'touchstart click'
,
'#yesSponsoredBtn'
,
function
(
event
)
{
$
(
document
).
on
(
'touchstart click'
,
'#yesSponsoredBtn'
,
function
(
event
)
{
var
sponsoredID
=
$
(
"#rmvSpnsrdProd"
).
attr
(
"sid"
);
var
sponsoredID
=
$
(
"#rmvSpnsrdProd"
).
attr
(
"sid"
);
$
(
this
).
unbind
(
event
);
$
(
this
).
unbind
(
event
);
...
...
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