Simplify addcost management
This commit is contained in:
parent
5101400f64
commit
08c752f1b3
1 changed files with 18 additions and 19 deletions
|
@ -795,15 +795,15 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function askAddcost(errors = '') {
|
||||||
var addcostDialog = new UserDialog({
|
var addcostDialog = new UserDialog({
|
||||||
'title': 'Majoration',
|
'title': 'Majoration',
|
||||||
'content': '<input type="text" placeholder="Trigramme" autocomplete="off" name="trigramme" spellcheck="false" style="text-transform:uppercase" autofocus><input type="number" lang="en" step="0.01" min="0.01" placeholder="€" name="amount">',
|
'content': '<input type="text" placeholder="Trigramme" autocomplete="off" name="trigramme" spellcheck="false" style="text-transform:uppercase" autofocus><input type="number" lang="en" step="0.01" min="0.01" placeholder="€" name="amount">',
|
||||||
'callback_as_dict': true,
|
'callback_as_dict': true,
|
||||||
});
|
});
|
||||||
|
|
||||||
function askAddcost(errors = '') {
|
function callback(data) {
|
||||||
addcostDialog.open(
|
|
||||||
function(data) {
|
|
||||||
api_with_auth({
|
api_with_auth({
|
||||||
url: Urls['kfet.kpsul.update_addcost'](),
|
url: Urls['kfet.kpsul.update_addcost'](),
|
||||||
data: data,
|
data: data,
|
||||||
|
@ -812,10 +812,9 @@ $(document).ready(function() {
|
||||||
},
|
},
|
||||||
next_focus: kpsul.account_manager,
|
next_focus: kpsul.account_manager,
|
||||||
});
|
});
|
||||||
},
|
}
|
||||||
errors,
|
|
||||||
kpsul.account_manager
|
addcostDialog.open(callback, errors, kpsul.account_manager);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue