Skip to content

Commit

Permalink
Option to hide bill counts in deposit reports ChurchCRM#1941 (ChurchC…
Browse files Browse the repository at this point in the history
…RM#1982)

* resolves ChurchCRM#1941

* reverted changes to deposit slip editor
added bDisplayBillCounts to system config
using bDisplayBillCounts in deposit slip report

* using SystemConfig static function instead of storing parameter
removed extra space in config options
  • Loading branch information
bradgearon authored and DawoudIO committed Mar 15, 2017
1 parent 7e150aa commit 072f9d7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
7 changes: 4 additions & 3 deletions src/ChurchCRM/dto/SystemConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,9 @@ private static function buildConfigs()
"googleTrackingID" => new ConfigItem(1050, "googleTrackingID", "text", "", gettext("Google Analytics Tracking Code")),
"mailChimpApiKey" => new ConfigItem(2000, "mailChimpApiKey", "text", "", gettext("see http://kb.mailchimp.com/accounts/management/about-api-keys")),
"sDepositSlipType" => new ConfigItem(2001, "sDepositSlipType", "choice", "QBDT", gettext("Deposit ticket type. QBDT - Quickbooks"), '{"Choices":["QBDT"]}'),
"bAllowEmptyLastName" => new ConfigItem(2010, "bAllowEmptyLastName", "boolean", "0", gettext("Set true to allow empty lastname in Person Editor. Set false to validate last name and inherit from family when left empty."))
);
"bAllowEmptyLastName" => new ConfigItem(2010, "bAllowEmptyLastName", "boolean", "0", gettext("Set true to allow empty lastname in Person Editor. Set false to validate last name and inherit from family when left empty.")),
"bDisplayBillCounts" => new ConfigItem(2002, "bDisplayBillCounts", "boolean", "1", gettext("Display bill counts on deposit slip"))
);
}

private static function buildCategories()
Expand All @@ -176,7 +177,7 @@ private static function buildCategories()
gettext('Map Settings') => ["sGoogleMapKey","bUseGoogleGeocode","sGMapIcons","sISTusername","sISTpassword","sGeocoderID","sGeocoderPW"],
gettext('Report Settings') => ["sQBDTSettings","leftX","incrementY","sTaxReport1","sTaxReport2","sTaxReport3","sTaxSigner","sReminder1","sReminderSigner","sReminderNoPledge","sReminderNoPayments","sConfirm1","sConfirm2","sConfirm3","sConfirm4","sConfirm5","sConfirm6","sConfirmSincerely","sConfirmSigner","sPledgeSummary1","sPledgeSummary2","sDirectoryDisclaimer1","sDirectoryDisclaimer2","bDirLetterHead","sZeroGivers","sZeroGivers2","sZeroGivers3"],
gettext('Localization') => ["sLanguage","sDistanceUnit","sPhoneFormat","sPhoneFormatWithExt","sDateFormatLong","sDateFormatNoYear","sDateFormatShort","sDateTimeFormat","sDateFilenameFormat"],
gettext('Financial Settings') => ["sDepositSlipType","iChecksPerDepositForm","bUseScannedChecks","sElectronicTransactionProcessor","bEnableNonDeductible","iFYMonth","bUseDonationEnvelopes","aFinanceQueries"],
gettext('Financial Settings') => ["sDepositSlipType","iChecksPerDepositForm","bDisplayBillCounts","bUseScannedChecks","sElectronicTransactionProcessor","bEnableNonDeductible","iFYMonth","bUseDonationEnvelopes","aFinanceQueries"],
gettext('Other Settings') => ["iPDFOutputType","googleTrackingID"]
);
}
Expand Down
17 changes: 10 additions & 7 deletions src/ChurchCRM/model/ChurchCRM/Deposit.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,14 +203,18 @@ private function generateQBDepositSlip($thisReport)

$thisReport->curX = $thisReport->QBDepositTicketParameters->date1->x;
$thisReport->curY += 2 * $thisReport->QBDepositTicketParameters->lineItemInterval->y;
$this->generateCashDenominations($thisReport);

if (SystemConfig::getBooleanValue('bDisplayBillCounts')) {
$this->generateCashDenominations($thisReport);
}

$thisReport->curX = $thisReport->QBDepositTicketParameters->date1->x + 125;

$this->generateTotalsByCurrencyType($thisReport);
$thisReport->curX = $thisReport->QBDepositTicketParameters->date1->x + 125;
$thisReport->curY = $thisReport->QBDepositTicketParameters->perforationY + 30;
$this->generateTotalsByFund($thisReport);

$thisReport->curY += $thisReport->QBDepositTicketParameters->lineItemInterval->y;
$thisReport->pdf->SetXY($thisReport->curX, $thisReport->curY);
$thisReport->pdf->SetFont('Times', 'B', 10);
Expand All @@ -235,7 +239,6 @@ private function generateDepositSummary($thisReport)
$thisReport->depositSummaryParameters->summary->MemoX = 120;
$thisReport->depositSummaryParameters->summary->AmountX = 185;
$thisReport->depositSummaryParameters->aggregateX = 135;
$thisReport->depositSummaryParameters->displayBillCounts = false;

$thisReport->pdf->AddPage();
$thisReport->pdf->SetXY($thisReport->depositSummaryParameters->date->x, $thisReport->depositSummaryParameters->date->y);
Expand Down Expand Up @@ -333,9 +336,9 @@ private function generateDepositSummary($thisReport)
$grandTotalStr = sprintf('%.2f', $this->getTotalAmount());
$thisReport->pdf->PrintRightJustified($thisReport->curX + $thisReport->depositSummaryParameters->summary->AmountX, $thisReport->curY, $grandTotalStr);

// Now print deposit totals by fund
$thisReport->curY += 2 * $thisReport->depositSummaryParameters->summary->intervalY;
if ($thisReport->depositSummaryParameters->displayBillCounts) {
// Now print deposit totals by fund
$thisReport->curY += 2 * $thisReport->depositSummaryParameters->summary->intervalY;
if (SystemConfig::getBooleanValue('bDisplayBillCounts')) {
$this->generateCashDenominations($thisReport);
}
$thisReport->curX = $thisReport->depositSummaryParameters->aggregateX;
Expand Down Expand Up @@ -462,7 +465,7 @@ public function getFundTotals()
->orderBy(DonationFundTableMap::COL_FUN_NAME)
->select(['Name', 'Total'])
->find();

return $funds;
}

Expand Down

0 comments on commit 072f9d7

Please sign in to comment.