Skip to content

Commit

Permalink
FOSFASPRT-19: Sage export for credit note line items should respect c…
Browse files Browse the repository at this point in the history
…onfigured logic
  • Loading branch information
olayiwola-compucorp authored Oct 28, 2024
1 parent 250c4b9 commit 5fe5d28
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ public static function runExportQuery($batchId) {
fii.amount as tax_amount,
eftc.id as civicrm_entity_financial_trxn_id,
li.label as item_description,
li.financial_type_id as financial_type_id,
CASE
WHEN li.financial_type_id IS NOT NULL
THEN li.financial_type_id
ELSE fcli.financial_type_id
END as financial_type_id,
fty.name as financial_type,
ftyc.name as contribution_financial_type,
ov.label as department_code
Expand All @@ -100,6 +104,7 @@ public static function runExportQuery($batchId) {
AND fi.entity_id = fiii.entity_id)
AND (fii.financial_account_id IN ($taxAccounts)))
LEFT JOIN civicrm_line_item li ON (li.id = fi.entity_id AND fi.entity_table = 'civicrm_line_item')
LEFT JOIN financeextras_credit_note_line fcli ON (fcli.id = fi.entity_id AND fi.entity_table = 'financeextras_credit_note_line')
LEFT JOIN civicrm_financial_account fac ON fac.id = fi.financial_account_id
LEFT JOIN civicrm_financial_type fty ON li.financial_type_id = fty.id
LEFT JOIN civicrm_financial_type ftyc ON c.financial_type_id = ftyc.id
Expand Down

0 comments on commit 5fe5d28

Please sign in to comment.