Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Ahmad Hasan Ali
Go-Toko
Commits
e5fbb257
Commit
e5fbb257
authored
7 months ago
by
ArifMubarok
Browse files
Options
Download
Email Patches
Plain Diff
fix: kembalian
parent
179e1b5a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
resources/views/page/auth/cashier-signin.blade.php
+6
-0
resources/views/page/auth/cashier-signin.blade.php
resources/views/page/cashier/pos/index.blade.php
+9
-1
resources/views/page/cashier/pos/index.blade.php
with
15 additions
and
1 deletion
+15
-1
resources/views/page/auth/cashier-signin.blade.php
View file @
e5fbb257
...
...
@@ -100,6 +100,7 @@
$
(
'
.invalid-feedback
'
).
text
(
''
);
},
success
:
function
(
data
)
{
console
.
log
(
data
);
if
(
data
.
status
==
0
)
{
// enable button
submit
.
disabled
=
false
;
...
...
@@ -116,8 +117,13 @@
return
;
}
if
(
data
.
route
)
{
console
.
log
(
data
.
route
);
window
.
location
.
href
=
data
.
route
}
},
error
:
function
(
error
)
{
console
.
error
(
error
);
}
});
});
...
...
This diff is collapsed.
Click to expand it.
resources/views/page/cashier/pos/index.blade.php
View file @
e5fbb257
...
...
@@ -123,7 +123,7 @@ class="fa fa-plus me-2"></i>Add Member</a>
<h5>
Total
</h5>
<h6
id=
"total-price"
>
Rp 0
</h6>
</li>
<li>
<li
class=
"total-value"
>
<h5>
Kembalian
</h5>
<h6
id=
"total-change"
>
Rp 0
</h6>
</li>
...
...
@@ -161,6 +161,8 @@ class="fa fa-plus me-2"></i>Add Member</a>
const
totalItemField
=
$
(
'
#total-item
'
)
const
totalPriceField
=
$
(
'
#total-price
'
)
const
totalChangeField
=
$
(
'
#total-change
'
)
const
uangBayarField
=
$
(
'
#uang-bayar
'
)
let
totalItem
=
0
;
const
incrementTotalItem
=
()
=>
{
totalItem
++
;
...
...
@@ -181,6 +183,8 @@ class="fa fa-plus me-2"></i>Add Member</a>
const
price
=
cart
.
jml
*
(
cart
.
priceSell
-
cart
.
discount
)
newTotalPrice
+=
price
;
})
newTotalChange
=
+
uangBayarField
.
val
()
-
+
newTotalPrice
<
0
?
0
:
+
uangBayarField
.
val
()
-
+
newTotalPrice
;
totalChangeField
.
text
(
`Rp
${
newTotalChange
}
`
)
totalPriceField
.
text
(
`Rp
${
newTotalPrice
}
`
)
}
const
addCartTemporary
=
(
object
)
=>
{
...
...
@@ -537,5 +541,9 @@ class="fa fa-plus me-2"></i>Add Member</a>
}
})
})
$
(
document
).
on
(
'
keyup
'
,
'
#uang-bayar
'
,
function
()
{
reRenderTotalPrice
();
})
</script>
@endsection
This diff is collapsed.
Click to expand it.
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