function showBidAssignment(&$clsRpt, &$package, &$auction, &$pbInfo, $lPackageID)
{
    //---------------------------------------------------------------------
    //
    //---------------------------------------------------------------------
    global $genumDateFormat;
    openBlock('Bid Assignment', '');
    echoT($clsRpt->openReport());
    $lBidWinnerID = $package->lBidWinnerID;
    $lGiftID = $package->lGiftID;
    $bAssigned = !is_null($lBidWinnerID);
    $bFulfilled = !is_null($lGiftID);
    if ($bAssigned) {
        // winning bidder
        echoT($clsRpt->openRow() . $clsRpt->writeLabel('Package Winner:', '', 'vertical-align: bottom;') . $clsRpt->writeCell($pbInfo->strSafeNameFL . ' ' . $pbInfo->strLink) . $clsRpt->closeRow());
        // winning bid amount
        if ($bFulfilled) {
            $strEditWin = '';
        } else {
            $strEditWin = strLinkEdit_AuctionWinnngBid($lPackageID, $lBidWinnerID, 'Edit winning bid', true);
        }
        echoT($clsRpt->openRow() . $clsRpt->writeLabel('Winning Bid:', '', 'vertical-align: bottom;') . $clsRpt->writeCell($auction->strCurrencySymbol . ' ' . number_format($package->curWinBidAmnt, 2) . ' ' . $strEditWin . '      ' . strLinkRem_AuctionWinningBid($lPackageID, 'Remove this winning bid (and fulfillment)', true, true), '', ' vertical-align: bottom; ') . $clsRpt->closeRow());
        // fulfillment
        if ($bFulfilled) {
            echoT($clsRpt->openRow() . $clsRpt->writeLabel('Fulfilled?:', '', 'vertical-align: bottom;') . $clsRpt->writeCell('Yes: giftID ' . str_pad($lGiftID, 5, '0', STR_PAD_LEFT) . ' ' . strLinkView_GiftsRecord($lGiftID, 'View gift record', true) . '      ' . strLinkRem_AuctionFulfillment($lPackageID, 'Remove fulfillment', true, true), '', ' vertical-align: bottom; ') . $clsRpt->closeRow());
        } else {
            echoT($clsRpt->openRow() . $clsRpt->writeLabel('Fulfilled?:', '', 'vertical-align: bottom;') . $clsRpt->writeCell('No ' . strLink_SetPackageFulfill($lPackageID, 'Fulfill/complete this bid', true), '', ' vertical-align: bottom; ') . $clsRpt->closeRow());
        }
    } else {
        echoT($clsRpt->openRow() . $clsRpt->writeLabel('Package Winner:', '', 'vertical-align: bottom;') . $clsRpt->writeCell('<i>Not assigned</i>&nbsp;&nbsp;&nbsp;' . strLink_SetPackageWinner($lPackageID, 'Add a bid winner', true) . '&nbsp;' . strLink_SetPackageWinner($lPackageID, 'Add a bid winner', false) . '&nbsp;') . $clsRpt->closeRow());
    }
    echoT($clsRpt->closeReport());
    closeBlock();
}
function writeAuctionPackageTable($lAuctionID, &$auction, &$packages, $bDescriptions)
{
    //---------------------------------------------------------------------
    //
    //---------------------------------------------------------------------
    echoT('
         <table class="enpRpt">');
    echoT('
         <tr>
            <td class="enpRptLabel">
               package ID
            </td>
            <td class="enpRptLabel">
               &nbsp;
            </td>
            <td class="enpRptLabel">
               &nbsp;
            </td>
            <td class="enpRptLabel">
               Bid<br>Sheet
            </td>
            <td class="enpRptLabel">
               Name
            </td>
            <td class="enpRptLabel" nowrap>
               # Items
            </td>
            <td class="enpRptLabel">
               Est. Value
            </td>
            <td class="enpRptLabel">
               Winner
            </td>
            <td class="enpRptLabel">
               Winning Bid
            </td>
            <td class="enpRptLabel">
               Fulfilled?
            </td>
         </tr>');
    $curEstValueTot = $curWinBidTot = $curFullfillTot = 0.0;
    $lTotItems = 0;
    foreach ($packages as $package) {
        $lPackageID = $package->lKeyID;
        $lWinnerID = $package->lBidWinnerID;
        $lGiftID = $package->lGiftID;
        $curEstValueTot += $package->curEstValue;
        $lTotItems += $package->lNumItems;
        if (is_null($lWinnerID)) {
            $strWinner = 'n/a ' . strLink_SetPackageWinner($lPackageID, 'Set Winner', true);
            $strWinnerStyle = 'text-align: center;';
            $strWinningBid = 'n/a';
            $strWinningBidStyle = 'text-align: center;';
            $strFulfilled = 'No';
            $strFulfilledStyle = 'text-align: center;';
            $strPeopleLink = '';
        } else {
            $curWinBidTot += $package->curWinBidAmnt;
            $strWinner = $package->bidWinner->strLink . '&nbsp;' . $package->bidWinner->strSafeNameLF;
            $strWinnerStyle = '';
            $strWinningBid = number_format($package->curWinBidAmnt, 2);
            $strWinningBidStyle = 'text-align: right;';
            if (is_null($lGiftID)) {
                $strFulfilled = 'No' . strLink_SetPackageFulfill($lPackageID, 'Fulfill/receive payment', true);
                $strFulfilledStyle = 'text-align: center;';
            } else {
                $strFulfilled = number_format($package->curActualGiftAmnt, 2) . '&nbsp;' . strLinkView_GiftsRecord($lGiftID, 'View gift record', true);
                $strFulfilledStyle = '';
                $curFullfillTot += $package->curActualGiftAmnt;
            }
        }
        if (is_null($package->lBidSheetID)) {
            $strLinkPDF = 'n/a';
        } else {
            $strLinkPDF = strLink_PDF_PackageBidSheet($package->lBidSheetID, $lPackageID, 'Create PDF Bid Sheet', true, ' target="_blank" ');
        }
        echoT('
            <tr class="makeStripe">
               <td class="enpRpt" style="text-align: center;">' . str_pad($lPackageID, 5, '0', STR_PAD_LEFT) . '&nbsp;' . strLinkView_AuctionPackageRecord($lPackageID, 'View auction package', true) . '
               </td>
               <td class="enpRpt" style="text-align: center;">' . strLinkEdit_AuctionPackage($lAuctionID, $lPackageID, 'Edit package', true) . '
               </td>
               <td class="enpRpt" style="text-align: center;">' . strLinkRem_AuctionPackage($lAuctionID, $lPackageID, 'Remove Package', true, true) . '
               </td>
               <td class="enpRpt" style="text-align: center;">' . $strLinkPDF . '
               </td>
               <td class="enpRpt">' . $package->strPackageSafeName . '
               </td>
               <td class="enpRpt" style="text-align: center; padding-left: 7pt;" nowrap>' . number_format($package->lNumItems) . '&nbsp;' . strLinkView_AuctionItemsViaPID($lPackageID, 'View package items', true) . '&nbsp;' . strLinkAdd_AuctionItem($lPackageID, 'Add new item', true) . '
               </td>
               <td class="enpRpt" style="text-align: right;">' . $auction->strCurrencySymbol . ' ' . number_format($package->curEstValue, 2) . '
               </td>
               <td class="enpRpt" style="' . $strWinnerStyle . '">' . $strWinner . '
               </td>
               <td class="enpRpt" style="' . $strWinningBidStyle . '">' . $strWinningBid . '
               </td>
               <td class="enpRpt"style="' . $strFulfilledStyle . '">' . $strFulfilled . '
               </td>
            </tr>');
    }
    echoT('
         <tr class="makeStripe">
            <td class="enpRpt" colspan="5">
               <b>Total:</b>
            </td>
            <td class="enpRpt" style="width: 40pt; text-align: center;"><b>' . number_format($lTotItems) . '</b>
            </td>
            <td class="enpRpt" style="width: 40pt; text-align: right;"><b>' . number_format($curEstValueTot, 2) . '</b>
            </td>
            <td class="enpRpt" >
               &nbsp;
            </td>
            <td class="enpRpt" style="width: 40pt; text-align: right;"><b>' . number_format($curWinBidTot, 2) . '</b>
            </td>
            <td class="enpRpt" style="width: 40pt; text-align: right;"><b>' . number_format($curFullfillTot, 2) . '</b>
            </td>
         </tr>');
    echoT('</table><br><br>');
}