Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cash is displayed even if 0 #1852 #1983

Merged
merged 9 commits into from
Mar 15, 2017
14 changes: 8 additions & 6 deletions src/ChurchCRM/model/ChurchCRM/Deposit.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ private function generateTotalsByFund($thisReport)
$thisReport->pdf->PrintRightJustified($thisReport->curX + 55, $thisReport->curY, $amountStr);
$thisReport->curY += 4;
}

}

private function generateQBDepositSlip($thisReport)
Expand Down Expand Up @@ -210,7 +211,7 @@ private function generateQBDepositSlip($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 Down Expand Up @@ -332,18 +333,19 @@ private function generateDepositSummary($thisReport)

$grandTotalStr = sprintf('%.2f', $this->getTotalAmount());
$thisReport->pdf->PrintRightJustified($thisReport->curX + $thisReport->depositSummaryParameters->summary->AmountX, $thisReport->curY, $grandTotalStr);
$thisReport->curY += $thisReport->depositSummaryParameters->summary->intervalY * 2;

// Now print deposit totals by fund
$thisReport->curY += 2 * $thisReport->depositSummaryParameters->summary->intervalY;
if ($thisReport->depositSummaryParameters->displayBillCounts) {
$this->generateCashDenominations($thisReport);
}

// Now print deposit totals by fund
$thisReport->curX = $thisReport->depositSummaryParameters->aggregateX;
$this->generateTotalsByFund($thisReport);
$thisReport->curY += $thisReport->depositSummaryParameters->summary->intervalY;

$thisReport->curY += $thisReport->summaryIntervalY;
$this->generateTotalsByCurrencyType($thisReport);
$thisReport->curY += $thisReport->summaryIntervalY * 2;
$thisReport->curY += $thisReport->depositSummaryParameters->summary->intervalY * 2;

$thisReport->curY += 130;
$thisReport->curX = $thisReport->depositSummaryParameters->summary->x;
Expand Down Expand Up @@ -462,7 +464,7 @@ public function getFundTotals()
->orderBy(DonationFundTableMap::COL_FUN_NAME)
->select(['Name', 'Total'])
->find();

return $funds;
}

Expand Down
12 changes: 6 additions & 6 deletions src/DepositSlipEditor.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,12 @@
<?php
// Get deposit totals
echo '<li><b>TOTAL ('.$thisDeposit->getPledges()->count().'):</b> $'.$thisDeposit->getVirtualColumn('totalAmount').'</li>';
if ($thisDeposit->getCountChecks()) {
echo '<li><b>CASH ('.$thisDeposit->getCountCash().'):</b> $'.$thisDeposit->getTotalCash().'</li>';
}
if ($thisDeposit->getCountCash()) {
echo '<li><b>CHECKS ('.$thisDeposit->getCountChecks().'):</b> $'.$thisDeposit->getTotalChecks().' </li>';
}
if ($thisDeposit->getCountCash()) {
echo '<li><b>CASH ('.$thisDeposit->getCountCash().'):</b> $'.$thisDeposit->getTotalCash().'</li>';
}
if ($thisDeposit->getCountChecks()) {
echo '<li><b>CHECKS ('.$thisDeposit->getCountChecks().'):</b> $'.$thisDeposit->getTotalChecks().' </li>';
}
?>
</ul>
</div>
Expand Down