From: Guanhuan Chen Date: Wed, 3 Jun 2015 14:20:50 +0000 (+0100) Subject: Add invoice number prefix and rename columns X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=35129997f20fe094ff1b057c241a160e4eb69742;p=civicrm-core.git Add invoice number prefix and rename columns --- diff --git a/CRM/Financial/BAO/ExportFormat/CSV.php b/CRM/Financial/BAO/ExportFormat/CSV.php index f8bac88241..7bb44d39b3 100644 --- a/CRM/Financial/BAO/ExportFormat/CSV.php +++ b/CRM/Financial/BAO/ExportFormat/CSV.php @@ -174,6 +174,9 @@ class CRM_Financial_BAO_ExportFormat_CSV extends CRM_Financial_BAO_ExportFormat * @param array $export */ public function makeCSV($export) { + // getting data from admin page + $prefixValue = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings'); + foreach ($export as $batchId => $dao) { $financialItems = array(); $this->_batchIds = $batchId; @@ -194,11 +197,13 @@ class CRM_Financial_BAO_ExportFormat_CSV extends CRM_Financial_BAO_ExportFormat $creditAccount = $dao->from_credit_account; } + $invoiceNo = CRM_Utils_Array::value('invoice_prefix', $prefixValue) . "" . $dao->contribution_id; + $financialItems[] = array( 'Batch ID' => $dao->batch_id, - 'Invoice ID' => $dao->contribution_id, + 'Invoice No' => $invoiceNo, 'Contact ID' => $dao->contact_id, - 'Internal ID' => $dao->financial_trxn_id, + 'Financial Trxn ID/Internal ID' => $dao->financial_trxn_id, 'Transaction Date' => $dao->trxn_date, 'Debit Account' => $dao->to_account_code, 'Debit Account Name' => $dao->to_account_name,