Merge remote-tracking branch 'composer/master'

This commit is contained in:
Daeng Deni Mardaeni
2025-05-26 20:24:26 +07:00

View File

@@ -198,16 +198,24 @@
private function generateNarrative($item)
{
$narr = '';
if ($item->transaction->narr_type) {
$narr .= $item->transaction->stmt_narr . ' ';
$narr .= $this->getFormatNarrative($item->transaction->narr_type, $item);
// Check if transaction exists before accessing its properties
if ($item->transaction) {
if ($item->transaction->narr_type) {
$narr .= $item->transaction->stmt_narr . ' ';
$narr .= $this->getFormatNarrative($item->transaction->narr_type, $item);
} else {
$narr .= $item->transaction->stmt_narr . ' ';
}
} else {
$narr .= $item->transaction->stmt_narr . ' ';
// Fallback description if transaction is null
$narr .= '';
}
if ($item->ft?->recipt_no) {
$narr .= 'Receipt No: ' . $item->ft->recipt_no;
}
return trim($narr);
}
@@ -231,7 +239,13 @@
$fmt = 'TT.O.TRF';
} else if ($narrParam->_id == 'TTTRFIN') {
$fmt = 'TT.I.TRF';
} else {
} else if ($narrParam->_id == 'APITRX'){
$fmt = 'API.TSEL';
} else if ($narrParam->_id == 'ONUSCR'){
$fmt = 'ONUS.CR';
} else if ($narrParam->_id == 'ONUSDR'){
$fmt = 'ONUS.DR';
}else {
$fmt = $narrParam->_id;
}
@@ -260,7 +274,7 @@
$splitPart = explode('!', $part);
if (count($splitPart) > 0) {
// Remove quotes, backslashes, and other escape characters
$cleanPart = trim($splitPart[0]);
$cleanPart = trim($splitPart[0]).' ';
// Remove quotes at the beginning and end
$cleanPart = preg_replace('/^["\'\\\\]+|["\'\\\\]+$/', '', $cleanPart);
// Remove any remaining backslashes
@@ -306,7 +320,7 @@
}
}
return str_replace('<NL>', '', $result);
return str_replace('<NL>', ' ', $result);
}
/**