Skip to content

Conversation

@shahrukh-compuco
Copy link
Contributor

Overview

This PR changes the tax amount column in sage50 report to appear as 0.00 instead of blank for transactions where there is no tax amount.

Before

before.csv

After

after.csv

This comment was marked as outdated.

@shahrukh-compuco shahrukh-compuco force-pushed the civimm-351-fix-empty-tax-amount branch from ee96509 to 6754520 Compare July 3, 2025 11:11
@shahrukh-compuco shahrukh-compuco requested a review from Copilot July 3, 2025 11:12
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the Sage50 CSV report to display the tax amount column as 0.00 instead of blank for transactions without a tax amount.

  • Set default TAX_AMOUNT_LABEL value to 0 instead of NULL
  • Apply number_format to always show two decimal places
Comments suppressed due to low confidence (1)

CRM/Financial/BAO/ExportFormat/DataProvider/Sage50CSVProvider.php:199

  • Add a test case to verify that when no tax amount is provided, the CSV output shows "0.00" in the tax amount column.
      $formattedItem[self::TAX_AMOUNT_LABEL] = number_format((float) $formattedItem[self::TAX_AMOUNT_LABEL], 2, '.', '');

}
}

$formattedItem[self::TAX_AMOUNT_LABEL] = number_format((float) $formattedItem[self::TAX_AMOUNT_LABEL], 2, '.', '');
Copy link

Copilot AI Jul 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider extracting this number_format call into a helper for formatting monetary values consistently across all monetary columns.

Copilot uses AI. Check for mistakes.
@shahrukh-compuco shahrukh-compuco merged commit d2a490b into sage50-workstream Jul 3, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants