Browse Source

Dec 8 : [FIX] Bug Fixed 'pos_discount_manager'

pull/295/head
AjmalCybro 2 years ago
parent
commit
5f1b3e591a
  1. 5
      pos_discount_manager/doc/RELEASE_NOTES.md
  2. 2
      pos_discount_manager/static/description/index.html
  3. 11
      pos_discount_manager/static/src/js/ValidateManager.js

5
pos_discount_manager/doc/RELEASE_NOTES.md

@ -16,3 +16,8 @@
#### UPDATE
- Manager Pin Encrypted in NumberPad.
- Changed Pin Condition Check from Top Sequence Manager to Session Manager.
#### 08.12.2023
#### Version 16.0.2.0.3
#### UPDATE
- Changed Pin Condition Check from Session Manager to All Managers that are Selected in Multi Employee Section.

2
pos_discount_manager/static/description/index.html

@ -272,7 +272,7 @@
<div class="col-lg-12 my-2">
<h4 class="mt-2"
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
Set multiple employees per session in POS. Select the employee to whom we are giving the discount limit.</h4>
Set multiple employees per session in POS. Select the employee to whom we are giving the discount limit and add other managers for validate.</h4>
<img src="assets/screenshots/pos2222.png" class="img-responsive img-thumbnail border" width="100%"
height="auto"/>
</div>

11
pos_discount_manager/static/src/js/ValidateManager.js

@ -17,8 +17,10 @@ odoo.define('pos_discount_manager.ValidateManager', function(require) {
var employee_name = this.env.pos.get_cashier()['name']
var flag = 1;
orderlines.forEach((order) => {
if (employee_dis >= 1) {
if(order.discount > employee_dis)
flag = 0;
}
});
if (flag != 1) {
const {confirmed,payload} = await this.showPopup('NumberPopup', {
@ -26,9 +28,12 @@ odoo.define('pos_discount_manager.ValidateManager', function(require) {
isPassword: true
});
if(confirmed){
var output = this.env.pos.employees.filter((obj) => obj.role == 'manager' && obj.user_id == session.uid);
var pin = output[0].pin
if (Sha1.hash(payload) == pin) {
var output = this.env.pos.employees.filter((obj) => obj.role == 'manager');
var pins = [];
for (var i = 0; i < output.length; i++) {
pins.push(output[i].pin);
}
if (pins.includes(Sha1.hash(payload))) {
this.showScreen(this.nextScreen);
}
else {

Loading…
Cancel
Save