cloud-ide-fees 0.0.37 → 0.0.41

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.
@@ -117,7 +117,7 @@ const feesRoutes = [
117
117
  // Discount & Scholarship Management
118
118
  {
119
119
  path: 'discounts',
120
- loadComponent: () => import('./cloud-ide-fees-discount-rule-manager.component-CGWOUR49.mjs').then(c => c.DiscountRuleManagerComponent),
120
+ loadComponent: () => import('./cloud-ide-fees-discount-rule-manager.component-CTgMTze9.mjs').then(c => c.DiscountRuleManagerComponent),
121
121
  title: 'Discount Rules Management',
122
122
  canActivate: [authGuard],
123
123
  data: { sypg_page_code: "fee_discount_rule" }
@@ -4230,7 +4230,22 @@ class FeeDetailsViewerComponent {
4230
4230
  // We have a name but no ID object, that's fine, logic later handles name only
4231
4231
  }
4232
4232
  }
4233
- const finalAmount = (fee.fees_total_amount || fee.fees_amount || 0) - (this.discount || fee.discount || 0) - (this.scholarship || fee.scholarship || 0);
4233
+ // Final amount logic: prioritize total_amount, then base amount minus discounts
4234
+ const totalBase = Number(fee.fees_total_amount) || Number(fee.fees_amount) || 0;
4235
+ const discountVal = Number(this.discount) || Number(fee.discount) || 0;
4236
+ const scholarshipVal = Number(this.scholarship) || Number(fee.scholarship) || 0;
4237
+ // If we have fees_total_amount, assume it's already net of discounts (common in assignments)
4238
+ // Otherwise, calculate net amount
4239
+ let finalAmount = 0;
4240
+ if (Number(fee.fees_total_amount) > 0) {
4241
+ finalAmount = Number(fee.fees_total_amount);
4242
+ }
4243
+ else {
4244
+ finalAmount = Math.max(0, totalBase - discountVal - scholarshipVal);
4245
+ }
4246
+ // Double check that finalAmount is not NaN
4247
+ if (isNaN(finalAmount))
4248
+ finalAmount = 0;
4234
4249
  // Ensure assignmentDate is a Date object
4235
4250
  let assignmentDate;
4236
4251
  try {
@@ -4265,7 +4280,8 @@ class FeeDetailsViewerComponent {
4265
4280
  }
4266
4281
  processFeeAssignmentData(assignment) {
4267
4282
  // Transform assignment data to fee details format
4268
- const finalAmount = assignment.feeas_final_amount || assignment.feeas_total_amount || 0;
4283
+ const totalAmount = Number(assignment.feeas_total_amount) || Number(assignment.feeas_final_amount) || Number(assignment.feeas_original_amount) || 0;
4284
+ const finalAmount = totalAmount;
4269
4285
  // Ensure assignmentDate is a Date object
4270
4286
  let assignmentDate;
4271
4287
  try {
@@ -4316,10 +4332,10 @@ class FeeDetailsViewerComponent {
4316
4332
  ? assignment.feeas_fee_structure_id_feest?.fees_structure_name
4317
4333
  : assignment.fee_structure_name || 'Custom Fee',
4318
4334
  fees_category_name: assignment.feeas_fee_category_sygms || 'N/A',
4319
- fees_amount: assignment.feeas_original_amount || 0,
4320
- fees_total_amount: assignment.feeas_original_amount || 0,
4321
- discount: assignment.feeas_discount_amount || 0,
4322
- scholarship: assignment.feeas_scholarship_amount || 0,
4335
+ fees_amount: Number(assignment.feeas_original_amount) || 0,
4336
+ fees_total_amount: totalAmount,
4337
+ discount: Number(assignment.feeas_discount_amount) || 0,
4338
+ scholarship: Number(assignment.feeas_scholarship_amount) || 0,
4323
4339
  finalAmount: finalAmount,
4324
4340
  _feeItemData: itemData,
4325
4341
  _feeAssignmentData: assignment
@@ -4327,7 +4343,8 @@ class FeeDetailsViewerComponent {
4327
4343
  this.calculateAndSetFeeDetails(itemData, feeData, finalAmount, assignmentDate);
4328
4344
  }
4329
4345
  processFeeItemData(item, structure) {
4330
- const finalAmount = (item.feesi_amount || 0) - (this.discount || 0) - (this.scholarship || 0);
4346
+ const totalAmount = Number(item.feesi_amount) || 0;
4347
+ const finalAmount = totalAmount - (Number(this.discount) || 0) - (Number(this.scholarship) || 0);
4331
4348
  // Ensure assignmentDate is a Date object
4332
4349
  let assignmentDate;
4333
4350
  try {
@@ -4352,10 +4369,10 @@ class FeeDetailsViewerComponent {
4352
4369
  fees_category_name: typeof item.feesi_category_id_sygms === 'object'
4353
4370
  ? item.feesi_category_id_sygms?.sygms_title || 'N/A'
4354
4371
  : 'N/A',
4355
- fees_amount: item.feesi_amount || 0,
4356
- fees_total_amount: item.feesi_amount || 0,
4357
- discount: this.discount,
4358
- scholarship: this.scholarship,
4372
+ fees_amount: Number(item.feesi_amount) || 0,
4373
+ fees_total_amount: totalAmount,
4374
+ discount: Number(this.discount) || 0,
4375
+ scholarship: Number(this.scholarship) || 0,
4359
4376
  finalAmount: finalAmount,
4360
4377
  _feeItemData: item
4361
4378
  };
@@ -5428,7 +5445,6 @@ class FeeApplicableFeesComponent {
5428
5445
  // Cap at fee amount
5429
5446
  discountAmount = Math.min(discountAmount, feeAmount);
5430
5447
  const discountData = {
5431
- fee_id: feeId,
5432
5448
  discount_type: data.discount_type,
5433
5449
  discount_value: data.discount_value,
5434
5450
  discount_amount: discountAmount,
@@ -5451,7 +5467,6 @@ class FeeApplicableFeesComponent {
5451
5467
  // Cap at fee amount (considering discount?)
5452
5468
  scholarshipAmount = Math.min(scholarshipAmount, feeAmount);
5453
5469
  const scholarshipData = {
5454
- fee_id: feeId,
5455
5470
  scholarship_type_id: data.scholarship_type_id,
5456
5471
  scholarship_category: data.scholarship_category,
5457
5472
  scholarship_percentage: data.scholarship_percentage,
@@ -11268,4 +11283,4 @@ var myOnlinePayment_component = /*#__PURE__*/Object.freeze({
11268
11283
  */
11269
11284
 
11270
11285
  export { CideFeeDiscountRuleService as C, DiscountRulesComponent as D, FeeStructureListComponent as F, MyFeeStatementComponent as M, ReceiptTemplateService as R, StudentSelectionWrapperComponent as S, TemplateDesignerComponent as T, CloudIdeFees as a, CideFeeFeeStructureService as b, FeeStructureCreateComponent as c, CideFeeFeeAssignmentService as d, FeeAssignmentListComponent as e, feesRoutes as f, FeeAssignmentCreateComponent as g, CideFeeFeePaymentService as h, FeePaymentListComponent as i, FeePaymentProcessComponent as j, FeePaymentViewComponent as k, CollectionReportComponent as l, MyOnlinePaymentComponent as m, FeeDetailsViewerComponent as n, FeeApplicableFeesComponent as o };
11271
- //# sourceMappingURL=cloud-ide-fees-cloud-ide-fees-DiELXkPH.mjs.map
11286
+ //# sourceMappingURL=cloud-ide-fees-cloud-ide-fees-Cyb9Q9l7.mjs.map