cloud-ide-fees 0.0.15 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -7137,6 +7137,8 @@ class FeeDetailsViewerComponent {
|
|
|
7137
7137
|
// Check if feeData signal input is available and has a value
|
|
7138
7138
|
try {
|
|
7139
7139
|
const feeDataValue = this.feeData?.();
|
|
7140
|
+
console.log('🔍 FeeDetailsViewer - loadFeeDetails - feeDataValue:', feeDataValue);
|
|
7141
|
+
console.log('🔍 FeeDetailsViewer - loadFeeDetails - _feeItemData:', feeDataValue?._feeItemData);
|
|
7140
7142
|
if (feeDataValue) {
|
|
7141
7143
|
// Use provided fee data (for new applicable fees)
|
|
7142
7144
|
this.processFeeData(feeDataValue);
|
|
@@ -7239,36 +7241,64 @@ class FeeDetailsViewerComponent {
|
|
|
7239
7241
|
});
|
|
7240
7242
|
}
|
|
7241
7243
|
processFeeData(fee) {
|
|
7244
|
+
console.log('🔍 FeeDetailsViewer - processFeeData - fee:', fee);
|
|
7245
|
+
console.log('🔍 FeeDetailsViewer - processFeeData - _feeItemData:', fee._feeItemData);
|
|
7242
7246
|
// Ensure we have proper item data structure
|
|
7243
7247
|
let itemData = fee._feeItemData;
|
|
7248
|
+
console.log('🔍 FeeDetailsViewer - processFeeData - itemData before check:', itemData);
|
|
7249
|
+
console.log('🔍 FeeDetailsViewer - processFeeData - itemData type:', typeof itemData);
|
|
7250
|
+
console.log('🔍 FeeDetailsViewer - processFeeData - itemData keys:', itemData ? Object.keys(itemData) : 'null/undefined');
|
|
7244
7251
|
// If _feeItemData doesn't exist or is incomplete, construct it from fee data
|
|
7245
|
-
if (!itemData || typeof itemData !== 'object') {
|
|
7246
|
-
|
|
7247
|
-
|
|
7248
|
-
|
|
7249
|
-
|
|
7250
|
-
|
|
7251
|
-
|
|
7252
|
-
|
|
7253
|
-
|
|
7254
|
-
|
|
7255
|
-
|
|
7256
|
-
|
|
7257
|
-
|
|
7258
|
-
|
|
7259
|
-
|
|
7260
|
-
|
|
7261
|
-
|
|
7262
|
-
|
|
7252
|
+
if (!itemData || typeof itemData !== 'object' || Object.keys(itemData).length === 0) {
|
|
7253
|
+
console.warn('⚠️ FeeDetailsViewer - _feeItemData is missing or empty, creating fallback');
|
|
7254
|
+
// Try to extract from fee object itself if it has the structure
|
|
7255
|
+
if (fee && typeof fee === 'object' && 'feesi_item_name' in fee) {
|
|
7256
|
+
itemData = fee; // Use fee as itemData if it has feesi_ fields
|
|
7257
|
+
}
|
|
7258
|
+
else {
|
|
7259
|
+
// Last resort: create minimal structure from available fee data
|
|
7260
|
+
itemData = {
|
|
7261
|
+
feesi_item_name: fee.fees_structure_name || 'N/A',
|
|
7262
|
+
feesi_item_code: fee.fees_structure_code || 'N/A',
|
|
7263
|
+
feesi_amount: fee.fees_amount || fee.fees_total_amount || 0,
|
|
7264
|
+
feesi_description: 'No description available',
|
|
7265
|
+
feesi_category_id_sygms: fee.fees_category_name || null,
|
|
7266
|
+
feesi_is_mandatory: false,
|
|
7267
|
+
feesi_is_refundable: false,
|
|
7268
|
+
feesi_is_amount_editable: false,
|
|
7269
|
+
feesi_is_installment_allowed: false,
|
|
7270
|
+
feesi_installment_count: 1,
|
|
7271
|
+
feesi_due_date_offset_days: 0,
|
|
7272
|
+
feesi_collection_start_offset_days: 0,
|
|
7273
|
+
feesi_collection_end_offset_days: 30,
|
|
7274
|
+
feesi_tax_applicable: false,
|
|
7275
|
+
feesi_tax_percentage: 0
|
|
7276
|
+
};
|
|
7277
|
+
}
|
|
7263
7278
|
}
|
|
7264
7279
|
else {
|
|
7265
7280
|
// Ensure all required fields exist, using fee data as fallback
|
|
7266
|
-
|
|
7267
|
-
|
|
7268
|
-
|
|
7269
|
-
|
|
7270
|
-
|
|
7271
|
-
|
|
7281
|
+
// Only use fallback if the field is missing or empty
|
|
7282
|
+
if (!itemData.feesi_item_name || itemData.feesi_item_name === 'N/A') {
|
|
7283
|
+
itemData.feesi_item_name = fee.fees_structure_name || itemData.feesi_item_name || 'N/A';
|
|
7284
|
+
}
|
|
7285
|
+
if (!itemData.feesi_item_code || itemData.feesi_item_code === 'N/A') {
|
|
7286
|
+
itemData.feesi_item_code = fee.fees_structure_code || itemData.feesi_item_code || 'N/A';
|
|
7287
|
+
}
|
|
7288
|
+
if (itemData.feesi_amount === undefined || itemData.feesi_amount === null || itemData.feesi_amount === 0) {
|
|
7289
|
+
itemData.feesi_amount = fee.fees_amount || fee.fees_total_amount || itemData.feesi_amount || 0;
|
|
7290
|
+
}
|
|
7291
|
+
if (!itemData.feesi_description || itemData.feesi_description === 'No description available') {
|
|
7292
|
+
itemData.feesi_description = itemData.feesi_description || 'No description available';
|
|
7293
|
+
}
|
|
7294
|
+
// Ensure category is properly set
|
|
7295
|
+
if (!itemData.feesi_category_id_sygms || (typeof itemData.feesi_category_id_sygms === 'string' && itemData.feesi_category_id_sygms === 'N/A')) {
|
|
7296
|
+
// Try to preserve if it's an object, otherwise use category name from fee
|
|
7297
|
+
if (fee.fees_category_name && fee.fees_category_name !== 'N/A') {
|
|
7298
|
+
// If we have category name but not the ID object, we'll use the name
|
|
7299
|
+
// The category extraction in calculateAndSetFeeDetails will handle this
|
|
7300
|
+
}
|
|
7301
|
+
}
|
|
7272
7302
|
}
|
|
7273
7303
|
const finalAmount = (fee.fees_total_amount || fee.fees_amount || 0) - (this.discount() || fee.discount || 0);
|
|
7274
7304
|
// Ensure assignmentDate is a Date object
|