Fix item counts, PR/QT conversions, validation and department loss
This commit is contained in:
+11
-1
@@ -581,9 +581,19 @@ function load_formula_options(select_id, document_type, selected_id, onLoaded) {
|
||||
});
|
||||
}
|
||||
|
||||
// Line tax rate; derived from tax_amount / total_price when only the amount was stored
|
||||
function line_tax_rate(item) {
|
||||
var rate = parseFloat(item.tax_rate) || 0;
|
||||
var amount = parseFloat(item.tax_amount) || 0;
|
||||
var total = parseFloat(item.total_price) || 0;
|
||||
if (rate === 0 && amount > 0 && total > 0) rate = round_dp(amount / total * 100, 2);
|
||||
return rate;
|
||||
}
|
||||
|
||||
// Returns the request promise so callers can await the options before selecting a value
|
||||
function load_departments(select_id, selected_id) {
|
||||
var ctx = document.getElementById('session-context');
|
||||
ajax_request({
|
||||
return ajax_request({
|
||||
url: server_url + 'accounting/api/engine/department.php',
|
||||
action: 'get',
|
||||
queueLock: false,
|
||||
|
||||
Reference in New Issue
Block a user