accounting workflows

This commit is contained in:
Thanakorn S
2026-05-20 10:17:02 +07:00
parent 04a683bd02
commit 7396db6ffc
199 changed files with 23539 additions and 5345 deletions
+1 -16
View File
@@ -263,6 +263,7 @@
<?php require "../include_ending.php";?>
<script>
// custom.js globals: load_location_config(), format_number()
// ── Location config ───────────────────────────────────────────────────────
var advanced = false;
@@ -270,22 +271,6 @@
var label_zone = 'Zone';
var label_aisle = 'Aisle';
function load_location_config(callback) {
return ajax_request({
url: '<?php echo $server_url?>setting/api/engine/company_setting.php',
autoPrepare: true,
checkRequired: 0,
action: 'read',
onSuccess: function(res) {
var s = res.output;
advanced = s.advanced_location == 1;
label_rack = s.location_label_rack || (advanced ? 'Rack' : 'Location');
label_zone = s.location_label_zone || 'Zone';
label_aisle = s.location_label_aisle || 'Aisle';
if (callback) callback();
}
});
}
function apply_location_labels() {
if (advanced) {
+3 -3
View File
@@ -294,7 +294,7 @@
<td class="py-3">${item.lot_number}</td>
<td class="py-3">${item.expiry_date || '<span class="text-muted">—</span>'}</td>
<td class="py-3">${days_lbl}</td>
<td class="py-3">${Number(item.balance).toLocaleString()}</td>
<td class="py-3">${format_number(item.balance)}</td>
<td class="py-3">${item.is_active == 1
? '<span class="badge bg-success">Active</span>'
: '<span class="badge bg-secondary">Inactive</span>'}</td>
@@ -332,8 +332,8 @@
<td class="py-3">${type_badge[row.type] || row.type}</td>
<td class="py-3">${row.warehouse_name}</td>
<td class="py-3">${format_location(row)}</td>
<td class="py-3 text-success">${parseFloat(row.stock_in) > 0 ? '+' + Number(row.stock_in).toLocaleString() : '<span class="text-muted">—</span>'}</td>
<td class="py-3 text-danger">${parseFloat(row.stock_out) > 0 ? '-' + Number(row.stock_out).toLocaleString() : '<span class="text-muted">—</span>'}</td>
<td class="py-3 text-success">${parseFloat(row.stock_in) > 0 ? '+' + format_number(row.stock_in) : '<span class="text-muted">—</span>'}</td>
<td class="py-3 text-danger">${parseFloat(row.stock_out) > 0 ? '-' + format_number(row.stock_out) : '<span class="text-muted">—</span>'}</td>
<td class="py-3">${row.serial_number || '<span class="text-muted">—</span>'}</td>
</tr>`;
});
+5 -7
View File
@@ -614,12 +614,10 @@
observer.observe(document.getElementById('lazy_sentinel'));
// ── Helpers ───────────────────────────────────────────────────────────
function fmt(n) {
return parseFloat(n || 0).toLocaleString(undefined, {
minimumFractionDigits: 2, maximumFractionDigits: 2
});
}
// ── Helpers ───────────────────────────────────────────────────────────
function fmt(n) {
return format_number(n, 2);
}
// ── Export ───────────────────────────────────────────────────────────
@@ -699,4 +697,4 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf-autotable/3.8.2/jspdf.plugin.autotable.min.js"></script>
</body>
</html>
</html>