added Fatturazione in export and fixed attivo inattivo, added desxription to parts
This commit is contained in:
@@ -595,12 +595,8 @@ $(document).ready(function () {
|
||||
return iddatadb ? "#" + iddatadb : "";
|
||||
}
|
||||
|
||||
// Prefer main field value if available
|
||||
if (record.mainFieldValue) {
|
||||
return record.mainFieldValue;
|
||||
}
|
||||
|
||||
// Fallbacks
|
||||
// "Numero" identifier (no longer falls back to mainFieldValue,
|
||||
// since main fields are now shown separately alongside it)
|
||||
if (record.importreferencecode) {
|
||||
return record.importreferencecode;
|
||||
}
|
||||
@@ -612,12 +608,37 @@ $(document).ready(function () {
|
||||
return "#" + iddatadb;
|
||||
}
|
||||
|
||||
// Builds "Label1: value1 — Label2: value2" from window.gridMeta.mainFieldMappings
|
||||
function getMainFieldsSummary(iddatadb) {
|
||||
const record = getGridRecordById(iddatadb);
|
||||
const mappings =
|
||||
(window.gridMeta && window.gridMeta.mainFieldMappings) || [];
|
||||
|
||||
if (!record || !mappings.length) return "";
|
||||
|
||||
const parts = mappings
|
||||
.map((mapping) => {
|
||||
const value = record.details
|
||||
? record.details[String(mapping.id)]
|
||||
: "";
|
||||
if (!value) return null;
|
||||
return (
|
||||
(mapping.label || mapping.field_label || "") + ": " + value
|
||||
);
|
||||
})
|
||||
.filter(Boolean);
|
||||
|
||||
return parts.join(" — ");
|
||||
}
|
||||
|
||||
function updatePartsRecordHeader(iddatadb) {
|
||||
const list = getVisiblePartsRecordList();
|
||||
const currentId = parseInt(iddatadb, 10);
|
||||
const currentIndex = list.indexOf(currentId);
|
||||
|
||||
$("#trfHeader").text(getRecordHeaderLabel(currentId));
|
||||
const mainSummary = getMainFieldsSummary(currentId);
|
||||
|
||||
$("#trfHeader").text(mainSummary || getRecordHeaderLabel(currentId));
|
||||
|
||||
if (list.length <= 1 || currentIndex === -1) {
|
||||
$("#partsRecordCounter").text("-");
|
||||
|
||||
Reference in New Issue
Block a user