diff --git a/CRM/Contact/Page/View/UserDashBoard.php b/CRM/Contact/Page/View/UserDashBoard.php
index 135e70ddb167..d749af8e6161 100644
--- a/CRM/Contact/Page/View/UserDashBoard.php
+++ b/CRM/Contact/Page/View/UserDashBoard.php
@@ -185,6 +185,9 @@ function buildUserDashBoard() {
usort($dashboardElements, array('CRM_Utils_Sort', 'cmpFunc'));
$this->assign('dashboardElements', $dashboardElements);
+ // return true when 'Invoices / Credit Notes' checkbox is checked
+ $this->assign('invoices', $this->_userOptions['Invoices / Credit Notes']);
+
if (!empty($this->_userOptions['Groups'])) {
$this->assign('showGroup', TRUE);
//build group selector
diff --git a/CRM/Contribute/xml/Menu/Contribute.xml b/CRM/Contribute/xml/Menu/Contribute.xml
index eb4550badc2f..9dc6a30d15b6 100644
--- a/CRM/Contribute/xml/Menu/Contribute.xml
+++ b/CRM/Contribute/xml/Menu/Contribute.xml
@@ -300,4 +300,22 @@
access CiviContribute,administer CiviCRM
CiviContribute
+ -
+ civicrm/contribute/invoice
+ CiviContributePdf
+ CRM_Financial_Page_AJAX::getPrintPDF
+ access CiviContribute
+ 1
+ 620
+ CiviContribute
+
+ -
+ civicrm/contribute/invoice/email
+ CiviContributePdf
+ CRM_Contribute_Form_Task_Invoice
+ access CiviContribute
+ 1
+ 630
+ CiviContribute
+
diff --git a/CRM/Financial/Page/AJAX.php b/CRM/Financial/Page/AJAX.php
index c1777b80de24..ee1c0241c3bf 100644
--- a/CRM/Financial/Page/AJAX.php
+++ b/CRM/Financial/Page/AJAX.php
@@ -507,4 +507,16 @@ static function getBatchSummary() {
echo json_encode($batchSummary);
CRM_Utils_System::civiExit();
}
+
+ /**
+ * Callback to perform action on Print Invoice button.
+ */
+ static function getPrintPDF() {
+
+ $contribIDs = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE);
+ $contributionIDs = array($contribIDs);
+ $contactIds = CRM_Utils_Request::retrieve('cid', 'Positive', $this, FALSE);
+ $params = array('output' => 'pdf_invoice');
+ CRM_Contribute_Form_Task_Invoice::printPDF($contributionIDs , $params, $contactIds);
+ }
}
diff --git a/css/civicrm.css b/css/civicrm.css
index fa558723e69e..25dbe5f28463 100644
--- a/css/civicrm.css
+++ b/css/civicrm.css
@@ -4672,3 +4672,21 @@ span.crm-status-icon {
.crm-container .survey-completed {
text-decoration: line-through;
}
+
+.crm-printButton {
+ padding-left: 469px;
+}
+
+.crm-invoiceButton {
+ text-shadow: 0 1px 0 black;
+ background: #70716B url(../i/crm-button-bg.gif) repeat-x top left;
+ color: #FFFFFF !important;
+ font-size: 13px;
+ font-weight: normal;
+ margin-right: 16px;
+ padding: 2px 6px;
+ text-decoration: none;
+ cursor: pointer;
+ border: 1px solid #3e3e3e;
+ border-radius: 3px 3px 3px 3px;
+}
\ No newline at end of file
diff --git a/templates/CRM/Contribute/Form/ContributionView.tpl b/templates/CRM/Contribute/Form/ContributionView.tpl
index d13cf73fb3e0..d6f32ccf6b6d 100644
--- a/templates/CRM/Contribute/Form/ContributionView.tpl
+++ b/templates/CRM/Contribute/Form/ContributionView.tpl
@@ -47,6 +47,17 @@
{/if}
{include file="CRM/common/formButtons.tpl" location="top"}
+ {assign var='emailUrlParams' value="reset=1&id=$id&cid=$contact_id&select=email"}
+ {assign var='invoiceUrlParams' value="reset=1&id=$id&cid=$contact_id"}
+ {if $contribution_status != 'Refunded'}
+
+ {else}
+
+ {/if}
@@ -81,6 +92,12 @@
{/if}
+ {if $tax_amount}
+
+ {ts}Total Tax Amount{/ts} |
+ {$tax_amount|crmMoney:$currency} |
+
+ {/if}
{if $non_deductible_amount}
{ts}Non-deductible Amount{/ts} |
@@ -306,5 +323,14 @@
class="icon delete-icon">{ts}Delete{/ts}
{/if}
{include file="CRM/common/formButtons.tpl" location="bottom"}
+ {if $contribution_status != 'Refunded'}
+
+ {else}
+
+ {/if}
diff --git a/templates/CRM/Contribute/Page/UserDashboard.tpl b/templates/CRM/Contribute/Page/UserDashboard.tpl
index c1841e8ab25a..04ee6b6e4f1b 100644
--- a/templates/CRM/Contribute/Page/UserDashboard.tpl
+++ b/templates/CRM/Contribute/Page/UserDashboard.tpl
@@ -34,6 +34,9 @@
{ts}Received date{/ts} |
{ts}Receipt Sent{/ts} |
{ts}Status{/ts} |
+ {if $invoices}
+ |
+ {/if}
{foreach from=$contribute_rows item=row}
@@ -47,6 +50,18 @@
{$row.receive_date|truncate:10:''|crmDate} |
{$row.receipt_date|truncate:10:''|crmDate} |
{$row.contribution_status} |
+ {if $invoices}
+
+ {assign var='urlParams' value="reset=1&id=$row.contribution_id&cid=$row.contact_id"}
+
+ {if $row.contribution_status != 'Refunded'}
+ {ts}Print Invoice{/ts}
+ {else}
+ {ts}Print Credit Note{/ts}
+ {/if}
+
+ |
+ {/if}
{/foreach}
diff --git a/xml/templates/civicrm_data.tpl b/xml/templates/civicrm_data.tpl
index 0d2c57dec0d9..100e157fe380 100644
--- a/xml/templates/civicrm_data.tpl
+++ b/xml/templates/civicrm_data.tpl
@@ -369,6 +369,9 @@ VALUES
-- for selection changes
(@option_group_id_act, '{ts escape="sql"}Change Registration{/ts}', 48, 'Change Registration', NULL, 1, NULL, 48, '{ts escape="sql"}Changes to an existing event registration.{/ts}', 0, 1, 1, @eventCompId, NULL),
+ -- for Print or Email Contribution Invoices
+ (@option_group_id_act, '{ts escape="sql"}Downloaded Invoice{/ts}', 49, 'Downloaded Invoice', NULL, 1, NULL, 49, '{ts escape="sql"}Downloaded Invoice.{/ts}',0, 1, 1, NULL, NULL),
+ (@option_group_id_act, '{ts escape="sql"}Emailed Invoice{/ts}', 50, 'Emailed Invoice', NULL, 1, NULL, 50, '{ts escape="sql"}Emailed Invoice.{/ts}',0, 1, 1, NULL, NULL),
(@option_group_id_gender, '{ts escape="sql"}Female{/ts}', 1, 'Female', NULL, 0, NULL, 1, NULL, 0, 0, 1, NULL, NULL),
(@option_group_id_gender, '{ts escape="sql"}Male{/ts}', 2, 'Male', NULL, 0, NULL, 2, NULL, 0, 0, 1, NULL, NULL),
@@ -507,6 +510,7 @@ VALUES
(@option_group_id_udOpt, '{ts escape="sql"}Pledges{/ts}' , 7, 'CiviPledge', NULL, 0, NULL, 7, NULL, 0, 0, 1, NULL, NULL),
(@option_group_id_udOpt, '{ts escape="sql"}Personal Campaign Pages{/ts}' , 8, 'PCP', NULL, 0, NULL, 8, NULL, 0, 0, 1, NULL, NULL),
(@option_group_id_udOpt, '{ts escape="sql"}Assigned Activities{/ts}' , 9, 'Assigned Activities', NULL, 0, NULL, 9, NULL, 0, 0, 1, NULL, NULL),
+ (@option_group_id_udOpt, '{ts escape="sql"}Invoices / Credit Notes{/ts}' , 10, 'Invoices / Credit Notes', NULL, 0, NULL, 10, NULL, 0, 0, 1, NULL, NULL),
(@option_group_id_acsOpt, '{ts escape="sql"}Email Address{/ts}' , 2, 'email' , NULL, 0, NULL, 2, NULL, 0, 0, 1, NULL, NULL),
(@option_group_id_acsOpt, '{ts escape="sql"}Phone{/ts}' , 3, 'phone' , NULL, 0, NULL, 3, NULL, 0, 0, 1, NULL, NULL),