$contribution = CRM_Contribute_BAO_Contribution::add($contributionParams);
if (Civi::settings()->get('invoicing')) {
- $dataArray = [];
- // @todo - interrogate the line items passed in on the params array.
- // No reason to assume line items will be set on the form.
- foreach ($form->_lineItem as $lineItemKey => $lineItemValue) {
- foreach ($lineItemValue as $key => $value) {
- if (isset($value['tax_amount']) && isset($value['tax_rate'])) {
- if (isset($dataArray[$value['tax_rate']])) {
- $dataArray[$value['tax_rate']] = $dataArray[$value['tax_rate']] + $value['tax_amount'];
- }
- else {
- $dataArray[$value['tax_rate']] = $value['tax_amount'];
- }
- }
- }
- }
$smarty = CRM_Core_Smarty::singleton();
- $smarty->assign('dataArray', $dataArray);
+ // @todo - probably this assign is no longer needed as we use a token.
$smarty->assign('totalTaxAmount', $params['tax_amount'] ?? NULL);
}
}
foreach ($lineItem as $key => $value) {
foreach ($value as $v) {
if (isset($taxRate[(string) CRM_Utils_Array::value('tax_rate', $v)])) {
- $taxRate[(string) $v['tax_rate']] = $taxRate[(string) $v['tax_rate']] + ($v['tax_amount'] ?? 0);
}
else {
if (isset($v['tax_rate'])) {
- $taxRate[(string) $v['tax_rate']] = $v['tax_amount'] ?? NULL;
$getTaxDetails = TRUE;
}
}
if ($action & CRM_Core_Action::UPDATE) {
$totalTaxAmount = $submittedValues['tax_amount'] ?? $this->_values['tax_amount'];
+ // Assign likely replaced by a token
$this->assign('totalTaxAmount', $totalTaxAmount);
- $this->assign('dataArray', $taxRate);
}
else {
if (!empty($submittedValues['price_set_id'])) {
$this->assign('totalTaxAmount', $submittedValues['tax_amount']);
$this->assign('getTaxDetails', $getTaxDetails);
- $this->assign('dataArray', $taxRate);
}
else {
$this->assign('totalTaxAmount', CRM_Utils_Array::value('tax_amount', $submittedValues));
$contribution = CRM_Contribute_BAO_Contribution::add($contributionParams);
- if (Civi::settings()->get('invoicing')) {
- $dataArray = [];
- // @todo - interrogate the line items passed in on the params array.
- // No reason to assume line items will be set on the form.
- foreach ($form->_lineItem as $lineItemKey => $lineItemValue) {
- foreach ($lineItemValue as $key => $value) {
- if (isset($value['tax_amount']) && isset($value['tax_rate'])) {
- if (isset($dataArray[$value['tax_rate']])) {
- $dataArray[$value['tax_rate']] = $dataArray[$value['tax_rate']] + $value['tax_amount'];
- }
- else {
- $dataArray[$value['tax_rate']] = $value['tax_amount'];
- }
- }
- }
- }
- $smarty = CRM_Core_Smarty::singleton();
- $smarty->assign('dataArray', $dataArray);
- }
-
// lets store it in the form variable so postProcess hook can get to this and use it
$form->_contributionID = $contribution->id;
}
$amountDue = ($input['amount'] - $amountPaid);
// retrieving the subtotal and sum of same tax_rate
- $dataArray = [];
$subTotal = 0;
$lineItem = CRM_Price_BAO_LineItem::getLineItemsByContributionID($contributionID);
foreach ($lineItem as $taxRate) {
- if (isset($dataArray[(string) $taxRate['tax_rate']])) {
- $dataArray[(string) $taxRate['tax_rate']] = $dataArray[(string) $taxRate['tax_rate']] + ($taxRate['tax_amount'] ?? 0);
- }
- else {
- $dataArray[(string) $taxRate['tax_rate']] = $taxRate['tax_amount'] ?? NULL;
- }
$subTotal += $taxRate['subTotal'] ?? 0;
}
'notes' => $invoiceNotes,
// @todo not used in shipped template from 5.53
'lineItem' => $lineItem,
- // @todo not used in shipped template from 5.53
- 'dataArray' => $dataArray,
// @todo not used in shipped template from 5.52
'refundedStatusId' => $refundedStatusId,
// @todo not used in shipped template from 5.52
$entityTable = 'civicrm_participant';
$totalTaxAmount = 0;
- $dataArray = [];
foreach ($this->_lineItem as $key => $value) {
if ($value == 'skip') {
continue;
foreach ($value as $line) {
if (isset($line['tax_amount']) && isset($line['tax_rate'])) {
$totalTaxAmount = $line['tax_amount'] + $totalTaxAmount;
- if (isset($dataArray[$line['tax_rate']])) {
- $dataArray[$line['tax_rate']] = $dataArray[$line['tax_rate']] + ($line['tax_amount'] ?? 0);
- }
- else {
- $dataArray[$line['tax_rate']] = $line['tax_amount'] ?? NULL;
- }
}
}
}
}
- $this->assign('dataArray', $dataArray);
$this->assign('totalTaxAmount', $totalTaxAmount);
}
}
if (\Civi::settings()->get('invoicing')) {
$individual = $this->get('individual');
- $dataArray[key($dataArray)] = $individual[$participantNum]['totalTaxAmt'];
- $this->assign('dataArray', $dataArray);
$this->assign('totalAmount', $individual[$participantNum]['totalAmtWithTax']);
$this->assign('totalTaxAmount', $individual[$participantNum]['totalTaxAmt']);
$this->assign('individual', [$individual[$participantNum]]);
$priceFieldOp['start_date'] = $priceFieldOp['end_date'] = 'N/A';
}
}
- if (Civi::settings()->get('invoicing')) {
- $dataArray = [];
- foreach ($lineItem[$this->_priceSetId] as $value) {
- if (isset($value['tax_amount']) && isset($value['tax_rate'])) {
- if (isset($dataArray[$value['tax_rate']])) {
- $dataArray[$value['tax_rate']] = $dataArray[$value['tax_rate']] + CRM_Utils_Array::value('tax_amount', $value);
- }
- else {
- $dataArray[$value['tax_rate']] = $value['tax_amount'] ?? NULL;
- }
- }
- }
-
- $this->assign('dataArray', $dataArray);
- }
}
$this->assign('lineItem', !empty($lineItem) && !$isQuickConfig ? $lineItem : FALSE);
'WorkFlowMessageTemplates' => [
'contribution_invoice_receipt' => [
'$display_name' => 'contact.display_name',
+ '$dataArray' => ts('found within $taxBreakDown'),
],
'contribution_online_receipt' => [
'$contributeMode' => ts('no longer available / relevant'),
'$first_name' => 'contact.first_name',
'$last_name' => 'contact.last_name',
'$displayName' => 'contact.display_name',
+ '$dataArray' => ts('found within $taxBreakDown'),
],
'membership_offline_receipt' => [
// receipt_text_renewal appears to be long gone.
'receipt_text_renewal' => 'receipt_text',
'$isAmountZero' => ts('no longer available / relevant'),
+ '$dataArray' => ts('found within $taxBreakDown'),
+ ],
+ 'membership_online_receipt' => [
+ '$dataArray' => ts('found within $taxBreakDown'),
],
'event_offline_receipt' => [
'$contributeMode' => ts('no longer available / relevant'),
],
'event_online_receipt' => [
'`$participant.id`' => 'participant.id',
+ '$dataArray' => ts('found within $taxBreakDown'),
],
'pledge_acknowledgement' => [
'$domain' => ts('no longer available / relevant'),
{/foreach}
{/foreach}
{/if}
- {if !empty($dataArray)}
- {foreach from=$dataArray item=value key=priceset}
- dataArray: priceset:::$priceset
- dataArray: value:::$value
- {/foreach}
- {/if}
+
{if !empty($honoreeProfile)}
{foreach from=$honoreeProfile item=value key=label}
honoreeProfile: label:::$label
{/foreach}
{/if}
-{if !empty($dataArray)}
-dataArray:::{$dataArray}
-{/if}
-
{if isset($totalTaxAmount)}
totalTaxAmount:::{$totalTaxAmount}
{/if}