fix(Purchase): set price based on product in all lines.
This commit is contained in:
@@ -25,5 +25,6 @@ document.addEventListener('DOMContentLoaded', function(){
|
||||
|
||||
formContainer.appendChild(newForm);
|
||||
totalForms.value = formCount + 1;
|
||||
setPriceListeners();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -2,14 +2,11 @@ setPriceListeners();
|
||||
|
||||
function setPriceListeners() {
|
||||
document.querySelectorAll('select[id^="id_saleline_set-"][id$="-product"]').forEach((input) => {
|
||||
console.log('setPriceListenersForeach');
|
||||
console.log(input.id);
|
||||
input.addEventListener('change', (e) => setLinePrice(e));
|
||||
});
|
||||
}
|
||||
|
||||
function setLinePrice(e) {
|
||||
console.log('setLinePrice');
|
||||
let input = e.target;
|
||||
const idLine = input.id.split('-')[1];
|
||||
const productId = input.value;
|
||||
|
||||
Reference in New Issue
Block a user