fix: improve reliability of combo sub-line identification by explicitly validating parent reference properties
This commit is contained in:
parent
17d51ac34f
commit
71b7461f41
@ -760,7 +760,15 @@ patch(PosPrinterService.prototype, {
|
||||
|
||||
// Find combo sub-lines linked to this line
|
||||
const comboSubLines = orderlines
|
||||
.filter(subLine => subLine.combo_parent_id === line || subLine.combo_parent_id?.cid === line.cid || (line.id && subLine.combo_parent_id?.id === line.id))
|
||||
.filter(subLine => {
|
||||
const parent = subLine.combo_parent_id;
|
||||
if (!parent) {
|
||||
return false;
|
||||
}
|
||||
return parent === line ||
|
||||
(parent.cid && line.cid && parent.cid === line.cid) ||
|
||||
(line.id && parent.id && parent.id === line.id);
|
||||
})
|
||||
.map(subLine => {
|
||||
return {
|
||||
productName: subLine.full_product_name || subLine.product_id?.display_name || '',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user