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
+30 -8
View File
@@ -127,7 +127,35 @@
function source_label(source) {
source = source || '';
if (!source) return 'Manual';
return source.charAt(0).toUpperCase() + source.slice(1).replace(/_/g, ' ');
return source.split('_').map(function(w) {
return w.charAt(0).toUpperCase() + w.slice(1);
}).join(' ');
}
var source_view_urls = {
'supplier_return': '<?php echo $server_url?>po/manage_supplier_return.php',
'order': '<?php echo $server_url?>order/manage_order.php',
'return': '<?php echo $server_url?>order/manage_return.php',
};
function action_cell(item, warehouse) {
var source = item.source || '';
var source_id = parseInt(item.source_id) || 0;
var view_url;
if (source && source_view_urls[source] && source_id > 0) {
view_url = source_view_urls[source] + '?id=' + source_id;
} else {
view_url = '<?php echo $server_url?>ics/manage_stock_out.php?id=' + item['id'] + '&wh=' + warehouse;
}
var delete_btn = (!source)
? `<a href="javascript:void(0);" class="link-danger" onclick="delete_stock_out($(this),${item['id']})">
<i class="ti ti-trash ms-2 fs-5"></i>
</a>`
: '';
return `<a href="${view_url}"><i class="ti ti-eye fs-5"></i></a>${delete_btn}`;
}
function source_cell(source) {
@@ -227,13 +255,7 @@
<td class="py-3">
${item['status'] == 1 ? '<span class="badge bg-success">Approved</span>' : '<span class="badge bg-warning text-dark">Draft</span>'}
</td>
<td class="py-3">
<a href="<?php echo $server_url?>ics/manage_stock_out.php?id=${item['id']}&wh=${warehouse}" class=""><i class="ti ti-eye fs-5"></i></a>
<a href="javascript:void(0);" class="link-danger"
onclick="delete_stock_out($(this),${item['id']})">
<i class="ti ti-trash ms-2 fs-5"></i>
</a>
</td>
<td class="py-3">${action_cell(item, warehouse)}</td>
</tr>`;
})