}
            $i++;
            $TaxGLCodes[$FreightTaxLine->TaxAuthID] = $FreightTaxLine->TaxGLCode;
        }
        echo '</td>';
        echo '<td class="number">' . locale_number_format($FreightTaxTotal, $_SESSION['CreditItems' . $identifier]->CurrDecimalPlaces) . '</td>
			<td class="number">' . locale_number_format($FreightTaxTotal + $_SESSION['CreditItems' . $identifier]->FreightCost, $_SESSION['CreditItems' . $identifier]->CurrDecimalPlaces) . '</td>
			</tr>';
        $TaxTotal += $FreightTaxTotal;
        $DisplayTotal = locale_number_format($_SESSION['CreditItems' . $identifier]->total + $_SESSION['CreditItems' . $identifier]->FreightCost, $_SESSION['CreditItems' . $identifier]->CurrDecimalPlaces);
        echo '<tr>
				<td colspan="7" class="number">' . _('Credit Totals') . '</td>
				<td class="number"><b>' . $DisplayTotal . '</b></td>
				<td colspan="2"></td>
				<td class="number"><b>' . locale_number_format($TaxTotal, $_SESSION['CreditItems' . $identifier]->CurrDecimalPlaces) . '</td>
				<td class="number"><b>' . locale_number_format($TaxTotal + ($_SESSION['CreditItems' . $identifier]->total + $_SESSION['CreditItems' . $identifier]->FreightCost), $_SESSION['CreditItems' . $identifier]->CurrDecimalPlaces) . '</b></td>
			</tr>
			</table>';
        /*Now show options for the credit note */
        echo '<br />
				<table class="selection">
				<tr>
					<td>' . _('Credit Note Type') . ' :</td>
					<td><select name="CreditType" onchange="ReloadForm(MainForm.Update)" >';
        if (!isset($_POST['CreditType']) or $_POST['CreditType'] == 'Return') {
            echo '<option selected="selected" value="Return">' . _('Goods returned to store') . '</option>
					<option value="WriteOff">' . _('Goods written off') . '</option>
					<option value="ReverseOverCharge">' . _('Reverse an Overcharge') . '</option>';
        } elseif ($_POST['CreditType'] == 'WriteOff') {
            echo '<option selected="selected" value="WriteOff">' . _('Goods written off') . '</option>
					<option value="Return">' . _('Goods returned to store') . '</option>
Exemplo n.º 2
0
     if ($debug == 1 and abs($_SESSION['SuppTrans']->OvAmount / $_SESSION['SuppTrans']->ExRate - $LocalTotal) > 0.004) {
         prnMsg(_('The total posted to the credit accounts is') . ' ' . $LocalTotal . ' ' . _('but the sum of OvAmount converted at ExRate') . ' = ' . $_SESSION['SuppTrans']->OvAmount / $_SESSION['SuppTrans']->ExRate, 'error');
     }
     foreach ($_SESSION['SuppTrans']->Taxes as $Tax) {
         /* Now the TAX account */
         if ($Tax->TaxOvAmount / $_SESSION['SuppTrans']->ExRate != 0) {
             $SQL = "INSERT INTO gltrans (type,\n\t\t\t\t\t\t\t\t\ttypeno,\n\t\t\t\t\t\t\t\t\ttrandate,\n\t\t\t\t\t\t\t\t\tperiodno,\n\t\t\t\t\t\t\t\t\taccount,\n\t\t\t\t\t\t\t\t\tnarrative,\n\t\t\t\t\t\t\t\t\tamount)\n\t\t\t\t\t\t\tVALUES (21,\n\t\t\t\t\t\t\t\t'" . $CreditNoteNo . "',\n\t\t\t\t\t\t\t\t'" . $SQLCreditNoteDate . "',\n\t\t\t\t\t\t\t\t'" . $PeriodNo . "',\n\t\t\t\t\t\t\t\t'" . $Tax->TaxGLCode . "',\n\t\t\t\t\t\t\t\t'" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('Credit note') . ' ' . $_SESSION['SuppTrans']->SuppReference . ' ' . $_SESSION['SuppTrans']->CurrCode . $Tax->TaxOvAmount . ' @ ' . _('a rate of') . ' ' . $_SESSION['SuppTrans']->ExRate . "',\n\t\t\t\t\t\t\t\t'" . -$Tax->TaxOvAmount / $_SESSION['SuppTrans']->ExRate . "')";
             $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The general ledger transaction for the tax could not be added because');
             $DbgMsg = _('The following SQL to insert the GL transaction was used');
             $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, True);
         }
         /* if the tax is not 0 */
     }
     /*end of loop to post the tax */
     /* Now the control account */
     $SQL = "INSERT INTO gltrans (type,\n\t\t\t\t\t\t\ttypeno,\n\t\t\t\t\t\t\ttrandate,\n\t\t\t\t\t\t\tperiodno,\n\t\t\t\t\t\t\taccount,\n\t\t\t\t\t\t\tnarrative,\n\t\t\t\t\t\t\tamount)\n\t\t\t\t\t VALUES (21,\n\t\t\t\t\t \t'" . $CreditNoteNo . "',\n\t\t\t\t\t\t'" . $SQLCreditNoteDate . "',\n\t\t\t\t\t\t'" . $PeriodNo . "',\n\t\t\t\t\t\t'" . $_SESSION['SuppTrans']->CreditorsAct . "',\n\t\t\t\t\t\t'" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('Credit Note') . ' ' . $_SESSION['SuppTrans']->SuppReference . ' ' . $_SESSION['SuppTrans']->CurrCode . locale_number_format($_SESSION['SuppTrans']->OvAmount + $_SESSION['SuppTrans']->OvGST, $_SESSION['SuppTrans']->CurrDecimalPlaces) . ' @ ' . _('a rate of') . ' ' . $_SESSION['SuppTrans']->ExRate . "',\n\t\t\t\t\t\t'" . ($LocalTotal + $TaxTotal / $_SESSION['SuppTrans']->ExRate) . "')";
     $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The general ledger transaction for the control total could not be added because');
     $DbgMsg = _('The following SQL to insert the GL transaction was used');
     $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, True);
 }
 /*Thats the end of the GL postings */
 /*Now insert the credit note into the SuppTrans table*/
 $SQL = "INSERT INTO supptrans (transno,\n\t\t\t\t\t\ttype,\n\t\t\t\t\t\tsupplierno,\n\t\t\t\t\t\tsuppreference,\n\t\t\t\t\t\ttrandate,\n\t\t\t\t\t\tduedate,\n\t\t\t\t\t\tinputdate,\n\t\t\t\t\t\tovamount,\n\t\t\t\t\t\tovgst,\n\t\t\t\t\t\trate,\n\t\t\t\t\t\ttranstext)\n\t\t\t\tVALUES (\n\t\t\t\t\t'" . $CreditNoteNo . "',\n\t\t\t\t\t21,\n\t\t\t\t\t'" . $_SESSION['SuppTrans']->SupplierID . "',\n\t\t\t\t\t'" . $_SESSION['SuppTrans']->SuppReference . "',\n\t\t\t\t\t'" . $SQLCreditNoteDate . "',\n\t\t\t\t\t'" . FormatDateForSQL($_SESSION['SuppTrans']->DueDate) . "',\n\t\t\t\t\t'" . Date('Y-m-d H-i-s') . "',\n\t\t\t\t\t'" . -$_SESSION['SuppTrans']->OvAmount . "',\n\t\t\t\t\t'" . -$TaxTotal . "',\n\t\t\t\t\t'" . $_SESSION['SuppTrans']->ExRate . "',\n\t\t\t\t\t'" . $_SESSION['SuppTrans']->Comments . "')";
 $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The supplier credit note transaction could not be added to the database because');
 $DbgMsg = _('The following SQL to insert the supplier credit note was used');
 $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, True);
 $SuppTransID = DB_Last_Insert_ID($db, 'supptrans', 'id');
 /* Insert the tax totals for each tax authority where tax was charged on the invoice */
 foreach ($_SESSION['SuppTrans']->Taxes as $TaxTotals) {
     $SQL = "INSERT INTO supptranstaxes (supptransid,\n\t\t\t\t\t\t\t\t\t\t\t\ttaxauthid,\n\t\t\t\t\t\t\t\t\t\t\t\ttaxamount)\n\t\t\t\t\t\t\t\t\tVALUES ('" . $SuppTransID . "',\n\t\t\t\t\t\t\t\t\t\t\t'" . $TaxTotals->TaxAuthID . "',\n\t\t\t\t\t\t\t\t\t\t\t'" . -$TaxTotals->TaxOvAmount . "')";
     $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The supplier transaction taxes records could not be inserted because');
Exemplo n.º 3
0
        }
        echo '<tr>
                    <td>';
        echo '<input type="hidden" name="PropID' . $PropertyCounter . '" value="' . $PropertyRow['stkcatpropid'] . '" />';
        echo '<input type="hidden" name="PropNumeric' . $PropertyCounter . '" value="' . $PropertyRow['numericvalue'] . '" />';
        echo $PropertyRow['label'] . '</td>

                    <td>';
        switch ($PropertyRow['controltype']) {
            case 0:
                //textbox
                if ($PropertyRow['numericvalue'] == 1) {
                    echo '<input type="hidden" name="PropMin' . $PropertyCounter . '" value="' . $PropertyRow['minimumvalue'] . '" />';
                    echo '<input type="hidden" name="PropMax' . $PropertyCounter . '" value="' . $PropertyRow['maximumvalue'] . '" />';
                    echo '<input type="text" class="number" name="PropValue' . $PropertyCounter . '" size="20" maxlength="100" value="' . locale_number_format($PropertyValue, 'Variable') . '" />';
                    echo _('A number between') . ' ' . locale_number_format($PropertyRow['minimumvalue'], 'Variable') . ' ' . _('and') . ' ' . locale_number_format($PropertyRow['maximumvalue'], 'Variable') . ' ' . _('is expected');
                } else {
                    echo '<input type="text" name="PropValue' . $PropertyCounter . '" size="20" maxlength="100" value="' . $PropertyValue . '" />';
                }
                break;
            case 1:
                //select box
                $OptionValues = explode(',', $PropertyRow['defaultvalue']);
                echo '<select name="PropValue' . $PropertyCounter . '">';
                foreach ($OptionValues as $PropertyOptionValue) {
                    if ($PropertyOptionValue == $PropertyValue) {
                        echo '<option selected="selected" value="' . $PropertyOptionValue . '">' . $PropertyOptionValue . '</option>';
                    } else {
                        echo '<option value="' . $PropertyOptionValue . '">' . $PropertyOptionValue . '</option>';
                    }
                }
        if ($k == 1) {
            echo '<tr class="EvenTableRows">';
            $k = 0;
        } else {
            echo '<tr class="OddTableRows">';
            $k = 1;
        }
        $OnOrder = $PurchQty + $WoQty;
        $Available = $QOH - $DemandQty + $OnOrder;
        echo '<td>' . $myrow['stockid'] . '</td>
				<td>' . $myrow['description'] . '</td>
				<td>' . $myrow['stockunits'] . '</td>
				<td class="number">' . locale_number_format($QOH, $DecimalPlaces) . '</td>
				<td class="number">' . locale_number_format($DemandQty, $DecimalPlaces) . '</td>
				<td class="number">' . locale_number_format($OnOrder, $DecimalPlaces) . '</td>
				<td class="number">' . locale_number_format($Available, $DecimalPlaces) . '</td>
				<td><input class="number"  tabindex="' . ($j + 7) . '" type="text" size="6" name="Quantity' . $i . '" value="0" />
				<input type="hidden" name="StockID' . $i . '" value="' . $myrow['stockid'] . '" />
				</td>
			</tr>';
        echo '<input type="hidden" name="DecimalPlaces' . $i . '" value="' . $myrow['decimalplaces'] . '" />';
        echo '<input type="hidden" name="ItemDescription' . $i . '" value="' . $myrow['description'] . '" />';
        echo '<input type="hidden" name="Units' . $i . '" value="' . $myrow['stockunits'] . '" />';
        if ($j == 1) {
            $jsCall = '<script  type="text/javascript">if (document.SelectParts) {defaultControl(document.SelectParts.itm' . $myrow['stockid'] . ');}</script>';
        }
        $i++;
        #end of page full new headings if
    }
    #end of while loop
    echo '<tr><td><input type="hidden" name="Previous" value="' . ($Offset - 1) . '" />
                $pdf->line($Left_Margin, $YPos + $line_height - 2, $Page_Width - $Right_Margin, $YPos + $line_height - 2);
                $YPos -= 2 * $line_height;
            }
            $CatTot_Val = 0;
        }
        $LeftOvers = $pdf->addTextWrap($Left_Margin, $YPos, 260 - $Left_Margin, $FontSize, $InventoryValn['categoryid'] . " - " . $InventoryValn['categorydescription']);
        $Category = $InventoryValn['categoryid'];
        $CategoryName = $InventoryValn['categorydescription'];
    }
    if ($_POST['DetailedReport'] == 'Yes') {
        $YPos -= $line_height;
        $FontSize = 8;
        $LeftOvers = $pdf->addTextWrap($Left_Margin, $YPos, 60, $FontSize, $InventoryValn['stockid']);
        $LeftOvers = $pdf->addTextWrap(120, $YPos, 260, $FontSize, $InventoryValn['description']);
        $DisplayUnitCost = locale_money_format($InventoryValn['unitcost'], $_SESSION['CompanyRecord']['currencydefault']);
        $DisplayQtyOnHand = locale_number_format($InventoryValn['qtyonhand'], $InventoryValn['decimalplaces']);
        $DisplayItemTotal = locale_money_format($InventoryValn['itemtotal'], $_SESSION['CompanyRecord']['currencydefault']);
        $LeftOvers = $pdf->addTextWrap(380, $YPos, 60, $FontSize, $DisplayQtyOnHand, 'right');
        $LeftOvers = $pdf->addTextWrap(440, $YPos, 60, $FontSize, $DisplayUnitCost, 'right');
        $LeftOvers = $pdf->addTextWrap(500, $YPos, 60, $FontSize, $DisplayItemTotal, 'right');
    }
    $Tot_Val += $InventoryValn['itemtotal'];
    $CatTot_Val += $InventoryValn['itemtotal'];
    if ($YPos < $Bottom_Margin + $line_height) {
        include 'includes/PDFInventoryValnPageHeader.inc';
    }
}
/*end inventory valn while loop */
$FontSize = 10;
/*Print out the category totals */
if ($_POST['DetailedReport'] == 'Yes') {
Exemplo n.º 6
0
						<td class="number"><i>%s</i></td>
						<td class="number"><i>%s</i></td>
						<td class="number"><i>%s</i></td>
						<td class="number"><i>%s</i></td>
						</tr>', $ParentGroups[$Level], locale_number_format($GrpActual[$Level], $_SESSION['CompanyRecord']['decimalplaces']), locale_number_format($GrpBudget[$Level], $_SESSION['CompanyRecord']['decimalplaces']), locale_number_format($GrpPrdActual[$Level], $_SESSION['CompanyRecord']['decimalplaces']), locale_number_format($GrpPrdBudget[$Level], $_SESSION['CompanyRecord']['decimalplaces']));
                    $GrpActual[$Level] = 0;
                    $GrpBudget[$Level] = 0;
                    $GrpPrdActual[$Level] = 0;
                    $GrpPrdBudget[$Level] = 0;
                    $ParentGroups[$Level] = '';
                } else {
                    $Level = 1;
                }
            }
        }
        printf('<tr style="background-color:#ffffff">
				<td colspan="2"><b>' . _('Check Totals') . '</b></td>
				<td class="number">%s</td>
				<td class="number">%s</td>
				<td class="number">%s</td>
				<td class="number">%s</td>
			</tr>', locale_number_format($CheckMonth, $_SESSION['CompanyRecord']['decimalplaces']), locale_number_format($CheckBudgetMonth, $_SESSION['CompanyRecord']['decimalplaces']), locale_number_format($CheckPeriodActual, $_SESSION['CompanyRecord']['decimalplaces']), locale_number_format($CheckPeriodBudget, $_SESSION['CompanyRecord']['decimalplaces']));
        echo '</table><br />';
        echo '<div class="centre">
			<input type="submit" name="SelectADifferentPeriod" value="' . _('Select A Different Period') . '" />
		</div>';
    }
}
echo '</div>
	</form>';
include 'includes/footer.inc';
Exemplo n.º 7
0
         $NumberMonths = $_POST['NumberMonthsHolding'] - 10;
         $MaxMthSales = ($SalesRow['prd1'] + $SalesRow['prd2'] + $SalesRow['prd3'] + $SalesRow['prd4'] + $SalesRow['prd5']) / 5;
     } else {
         $NumberMonths = $_POST['NumberMonthsHolding'];
         $MaxMthSales = max($SalesRow['prd1'], $SalesRow['prd2'], $SalesRow['prd3'], $SalesRow['prd4'], $SalesRow['prd5']);
     }
     $IdealStockHolding = ceil($MaxMthSales * $NumberMonths);
     $LeftOvers = $pdf->addTextWrap(497, $YPos, 40, $FontSize, locale_number_format($IdealStockHolding, 0), 'right');
     $LeftOvers = $pdf->addTextWrap(597, $YPos, 40, $FontSize, locale_number_format($InventoryPlan['qoh'], 0), 'right');
     $LeftOvers = $pdf->addTextWrap(638, $YPos, 40, $FontSize, locale_number_format($TotalDemand, 0), 'right');
     $LeftOvers = $pdf->addTextWrap(679, $YPos, 40, $FontSize, locale_number_format($QOO, 0), 'right');
     $SuggestedTopUpOrder = $IdealStockHolding - $InventoryPlan['qoh'] + $TotalDemand - $QOO;
     if ($SuggestedTopUpOrder <= 0) {
         $LeftOvers = $pdf->addTextWrap(720, $YPos, 40, $FontSize, '   ', 'right');
     } else {
         $LeftOvers = $pdf->addTextWrap(720, $YPos, 40, $FontSize, locale_number_format($SuggestedTopUpOrder, 0), 'right');
     }
     if ($YPos < $Bottom_Margin + $line_height) {
         $PageNumber++;
         include 'includes/PDFInventoryPlanPageHeader.inc';
     }
 }
 /*end inventory valn while loop */
 $YPos -= 2 * $line_height;
 $pdf->line($Left_Margin, $YPos + $line_height, $Page_Width - $Right_Margin, $YPos + $line_height);
 if ($ListCount == 0) {
     $Title = _('Print Inventory Planning Report Empty');
     include 'includes/header.inc';
     prnMsg(_('There were no items in the range and location specified'), 'error');
     echo '<br /><a href="' . $RootPath . '/index.php">' . _('Back to the menu') . '</a>';
     include 'includes/footer.inc';
Exemplo n.º 8
0
     $YPos -= $line_height;
 }
 $YPos -= $line_height;
 $LeftOvers = $pdf->addTextWrap(20, $YPos, 60, $FontSize, $Customers['debtorno']);
 $LeftOvers = $pdf->addTextWrap(80, $YPos, 150, $FontSize, $Customers['name']);
 $LeftOvers = $pdf->addTextWrap(80, $YPos - 10, 150, $FontSize, $Customers['address1']);
 $LeftOvers = $pdf->addTextWrap(80, $YPos - 20, 150, $FontSize, $Customers['address2']);
 $LeftOvers = $pdf->addTextWrap(80, $YPos - 30, 150, $FontSize, $Customers['address3']);
 $LeftOvers = $pdf->addTextWrap(140, $YPos - 30, 150, $FontSize, $Customers['address4']);
 $LeftOvers = $pdf->addTextWrap(180, $YPos - 30, 150, $FontSize, $Customers['address5']);
 $LeftOvers = $pdf->addTextWrap(210, $YPos - 30, 150, $FontSize, $Customers['address6']);
 $LeftOvers = $pdf->addTextWrap(230, $YPos, 60, $FontSize, $Customers['branchcode']);
 $LeftOvers = $pdf->addTextWrap(230, $YPos - 10, 60, $FontSize, _('Price List') . ': ' . $Customers['salestype']);
 if ($_POST['Activity'] != 'All') {
     $LeftOvers = $pdf->addTextWrap(230, $YPos - 20, 60, $FontSize, _('Turnover'), 'right');
     $LeftOvers = $pdf->addTextWrap(230, $YPos - 30, 60, $FontSize, locale_number_format($LocalCurrencyTurnover, 0), 'right');
 }
 $LeftOvers = $pdf->addTextWrap(290, $YPos, 150, $FontSize, $Customers['brname']);
 $LeftOvers = $pdf->addTextWrap(290, $YPos - 10, 150, $FontSize, $Customers['contactname']);
 $LeftOvers = $pdf->addTextWrap(290, $YPos - 20, 150, $FontSize, _('Ph') . ': ' . $Customers['phoneno']);
 $LeftOvers = $pdf->addTextWrap(290, $YPos - 30, 150, $FontSize, _('Fax') . ': ' . $Customers['faxno']);
 $LeftOvers = $pdf->addTextWrap(440, $YPos, 150, $FontSize, $Customers['braddress1']);
 $LeftOvers = $pdf->addTextWrap(440, $YPos - 10, 150, $FontSize, $Customers['braddress2']);
 $LeftOvers = $pdf->addTextWrap(440, $YPos - 20, 150, $FontSize, $Customers['braddress3']);
 $LeftOvers = $pdf->addTextWrap(500, $YPos - 20, 150, $FontSize, $Customers['braddress4']);
 $LeftOvers = $pdf->addTextWrap(540, $YPos - 20, 150, $FontSize, $Customers['braddress5']);
 $LeftOvers = $pdf->addTextWrap(570, $YPos - 20, 150, $FontSize, $Customers['braddress6']);
 $LeftOvers = $pdf->addTextWrap(440, $YPos - 30, 150, $FontSize, $Customers['email']);
 $pdf->line($Page_Width - $Right_Margin, $YPos - 32, $Left_Margin, $YPos - 32);
 $YPos -= 40;
 if ($YPos < $Bottom_Margin + 30) {
Exemplo n.º 9
0
     $CatTot_Val += $InventoryValn['itemtotal'];
     $CatTot_Qty += $InventoryValn['qtyonhand'];
     if ($YPos < $Bottom_Margin + $line_height) {
         include 'includes/PDFInventoryValnPageHeader.inc';
     }
 }
 /*end inventory valn while loop */
 $FontSize = 10;
 /*Print out the category totals */
 if ($_POST['DetailedReport'] == 'Yes') {
     $YPos -= 2 * $line_height;
     $LeftOvers = $pdf->addTextWrap($Left_Margin, $YPos, 260 - $Left_Margin, $FontSize, _('Total for') . ' ' . $Category . ' - ' . $CategoryName, 'left');
 }
 $DisplayCatTotVal = locale_money_format($CatTot_Val, $_SESSION['CompanyRecord']['currencydefault']);
 $LeftOvers = $pdf->addTextWrap(500, $YPos, 60, $FontSize, $DisplayCatTotVal, 'right');
 $DisplayCatTotQty = locale_number_format($CatTot_Qty, 2);
 $LeftOvers = $pdf->addTextWrap(360, $YPos, 60, $FontSize, $DisplayCatTotQty, 'right');
 if ($_POST['DetailedReport'] == 'Yes') {
     /*draw a line under the CATEGORY TOTAL*/
     $YPos -= $line_height;
     $pdf->line($Left_Margin, $YPos + $line_height - 2, $Page_Width - $Right_Margin, $YPos + $line_height - 2);
 }
 $YPos -= 2 * $line_height;
 if ($YPos < $Bottom_Margin + $line_height) {
     include 'includes/PDFInventoryValnPageHeader.inc';
 }
 /*Print out the grand totals */
 $LeftOvers = $pdf->addTextWrap(80, $YPos, 260 - $Left_Margin, $FontSize, _('Grand Total Value'), 'right');
 $DisplayTotalVal = locale_money_format($Tot_Val, $_SESSION['CompanyRecord']['currencydefault']);
 $LeftOvers = $pdf->addTextWrap(500, $YPos, 60, $FontSize, $DisplayTotalVal, 'right');
 $pdf->OutputD($_SESSION['DatabaseName'] . '_Inventory_Valuation_' . Date('Y-m-d') . '.pdf');
Exemplo n.º 10
0
if (!isset($_POST['ReceivedDate'])) {
    $_POST['ReceivedDate'] = Date($_SESSION['DefaultDateFormat']);
}
echo '<table cellpadding="2" class="selection">
		<tr><td>' . _('Receive work order') . ':</td>
			<td>' . $_POST['WO'] . '</td><td>' . _('Item') . ':</td>
			<td>' . $_POST['StockID'] . ' - ' . $WORow['description'] . '</td></tr>
		 <tr><td>' . _('Manufactured at') . ':</td>
		 	<td>' . $WORow['locationname'] . '</td>
			<td>' . _('Required By') . ':</td>
			<td>' . ConvertSQLDate($WORow['requiredby']) . '</td></tr>
		 <tr><td>' . _('Quantity Ordered') . ':</td>
		 	<td class="number">' . locale_number_format($WORow['qtyreqd'], $WORow['decimalplaces']) . '</td>
			<td colspan="2">' . $WORow['units'] . '</td></tr>
		 <tr><td>' . _('Already Received') . ':</td>
		 	<td class="number">' . locale_number_format($WORow['qtyrecd'], $WORow['decimalplaces']) . '</td>
			<td colspan="2">' . $WORow['units'] . '</td></tr>
		 <tr><td>' . _('Date Received') . ':</td>
		 	<td>' . Date($_SESSION['DefaultDateFormat']) . '</td>
			<td>' . _('Received Into') . ':</td><td>
		 <select name="IntoLocation">';
if (!isset($_POST['IntoLocation'])) {
    $_POST['IntoLocation'] = $WORow['loccode'];
}
$LocResult = DB_query("SELECT loccode, locationname FROM locations", $db);
while ($LocRow = DB_fetch_array($LocResult)) {
    if ($_POST['IntoLocation'] == $LocRow['loccode']) {
        echo '<option selected="True" value="' . $LocRow['loccode'] . '">' . $LocRow['locationname'] . '</option>';
    } else {
        echo '<option value="' . $LocRow['loccode'] . '">' . $LocRow['locationname'] . '</option>';
    }
Exemplo n.º 11
0
                echo '<tr>
					<td colspan="2"></td>
					<td colspan="6"><hr /></td>
				</tr>';
                printf('<tr>
						<td colspan="2"><font size="2"><i>' . _('Gross Profit Percent') . '</i></font></td>
						<td></td>
						<td class="number"><i>%s</i></td>
						<td></td>
						<td class="number"><i>%s</i></td>
						<td></td>
						<td class="number"><i>%s</i></td>
					</tr>
					<tr>
						<td colspan="6"> </td>
					</tr>', locale_number_format($PrdGPPercent, 1) . '%');
                $j++;
            }
            $SectionPrdActual = 0;
            $Section = $myrow['sectioninaccounts'];
            if ($_POST['Detail'] == 'Detailed' and isset($Sections[$myrow['sectioninaccounts']])) {
                printf('<tr>
						<th colspan="6" class="header" style="text-align: left;">%s</th>
					</tr>', $Sections[$myrow['sectioninaccounts']]);
            }
            $j++;
        }
        echo '<tr>
			<td colspan="2"></td>
			<td colspan="6"><hr /></td>
		</tr>';
Exemplo n.º 12
0
				</tr>';
            echo '<tr>
					<td class="select">' . _('Customer since:') . '</td>
					<td class="select"> <b>' . ConvertSQLDate($myrow['clientsince']) . '</b> </td>
					<td class="select">' . $myrow['customersincedays'] . ' ' . _('days') . '</td>
				</tr>';
            if ($row['total'] == 0) {
                echo '<tr>
						<td class="select">' . _('No Spend from this Customer.') . '</b></td>
						<td class="select"></td>
						<td class="select"></td>
					</tr>';
            } else {
                echo '<tr>
						<td class="select">' . _('Total Spend from this Customer (inc tax):') . ' </td>
						<td class="select"><b>' . locale_number_format($row['total'], $myrow['currdecimalplaces']) . '</b></td>
						<td class="select"></td>
					</tr>';
            }
            echo '<tr>
					<td class="select">' . _('Customer Type:') . ' </td>
					<td class="select"><b>' . $CustomerTypeName . '</b></td>
					<td class="select"></td>
				</tr>';
            echo '</table>';
        }
        //$_SESSION['CustomerID'] != ''
        // Customer Contacts
        $sql = "SELECT * FROM custcontacts\n\t\t\t\tWHERE debtorno='" . $_SESSION['CustomerID'] . "'\n\t\t\t\tORDER BY contid";
        $result = DB_query($sql, $db);
        if (DB_num_rows($result) != 0) {
Exemplo n.º 13
0
     $FontSize = 8;
 }
 $YPos -= $line_height;
 $LeftOvers = $pdf->addTextWrap($Left_Margin, $YPos, 80, $FontSize, $PriceList['stockid']);
 $LeftOvers = $pdf->addTextWrap($Left_Margin + 100, $YPos, 47, $FontSize, ConvertSQLDate($PriceList['startdate']));
 if ($PriceList['enddate'] != '0000-00-00') {
     $DisplayEndDate = ConvertSQLDate($PriceList['enddate']);
 } else {
     $DisplayEndDate = _('No End Date');
 }
 $LeftOvers = $pdf->addTextWrap($Left_Margin + 100 + 47, $YPos, 47, $FontSize, $DisplayEndDate);
 $LeftOvers = $pdf->addTextWrap($Left_Margin + 130 + 47 + 47, $YPos, 130, $FontSize, $PriceList['description']);
 $DisplayUnitPrice = locale_number_format($PriceList['price'], $PriceList['decimalplaces']);
 $LeftOvers = $pdf->addTextWrap($Left_Margin + 110 + 47 + 47 + 130, $YPos, 180, $FontSize, $DisplayUnitPrice, 'right');
 if ($PriceList['price'] != 0) {
     $DisplayGPPercent = locale_number_format(($PriceList['price'] - $PriceList['standardcost']) * 100 / $PriceList['price'], 1) . '%';
 } else {
     $DisplayGPPercent = 0;
 }
 if ($_POST['ShowGPPercentages'] == 'Yes') {
     $LeftOvers = $pdf->addTextWrap($Left_Margin + 135 + 47 + 47 + 130 + 65, $YPos, 20, $FontSize, $DisplayGPPercent, 'right');
 }
 if ($_POST['CustomerSpecials'] == 'Customer Special Prices Only') {
     /*Need to show to which branch the price relates */
     if ($PriceList['branchcode'] != '') {
         $LeftOvers = $pdf->addTextWrap($Left_Margin + 80 + 47 + 47 + 130 + 65 + 25, $YPos, 60, $FontSize, $PriceList['brname'], 'left');
     } else {
         $LeftOvers = $pdf->addTextWrap($Left_Margin + 80 + 47 + 47 + 130 + 65 + 25, $YPos, 60, $FontSize, _('All'), 'left');
     }
 } else {
     if ($_POST['CustomerSpecials'] == 'Full Description') {
Exemplo n.º 14
0
					</tr>';
            echo $TableHeader;
            /* show the GRNs outstanding to be invoiced that could be reversed */
            $RowCounter = 0;
            $k = 0;
            while ($myrow = DB_fetch_array($result)) {
                if ($k == 1) {
                    echo '<tr class="EvenTableRows">';
                    $k = 0;
                } else {
                    echo '<tr class="OddTableRows">';
                    $k = 1;
                }
                $DisplayQtyRecd = locale_number_format($myrow['qtyrecd'], $myrow['decimalplaces']);
                $DisplayQtyInv = locale_number_format($myrow['quantityinv'], $myrow['decimalplaces']);
                $DisplayQtyRev = locale_number_format($myrow['qtytoreverse'], $myrow['decimalplaces']);
                $DisplayDateDel = ConvertSQLDate($myrow['deliverydate']);
                $LinkToRevGRN = '<a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?GRNNo=' . $myrow['grnno'] . '">' . _('Reverse') . '</a>';
                printf('<td>%s</td>
					<td>%s</td>
					<td>%s</td>
					<td>%s</td>
					<td class="number">%s</td>
					<td class="number">%s</td>
					<td class="number">%s</td>
					<td>%s</td>
					</tr>', $myrow['grnno'], $myrow['itemcode'], $myrow['itemdescription'], $DisplayDateDel, $DisplayQtyRecd, $DisplayQtyInv, $DisplayQtyRev, $LinkToRevGRN);
                $RowCounter++;
                if ($RowCounter > 20) {
                    $RowCounter = 0;
                    echo $TableHeader;
Exemplo n.º 15
0
        }
    }
}
echo '</select></td></tr>';
echo '<input type="hidden" name="Item" value="' . $Item . '" />';
echo '<tr><td>' . _('Decimal Places') . '<br />' . _('to display') . '</td>';
if (isset($_POST['DecimalPlaces'])) {
    echo '<td><input type="text" class="number" name="DecimalPlaces" size="8" maxlength="8" value="' . $_POST['DecimalPlaces'] . '" /></td></tr>';
} else {
    echo '<td><input type="text" class="number" name="DecimalPlaces" size="8" maxlength="8" value="0" /></td></tr>';
}
echo '<tr><td>' . _('Conversion Factor') . '<br />' . _('to stock units') . '</td>';
if (isset($_POST['ConversionFactor'])) {
    echo '<td><input type="text" class="number" name="ConversionFactor" size="8" maxlength="8" value="' . locale_number_format($_POST['ConversionFactor'], 4) . '" /></td></tr>';
} else {
    echo '<td><input type="text" class="number" name="ConversionFactor" size="8" maxlength="8" value="' . locale_number_format(1, 4) . '" /></td></tr>';
}
echo '<tr><td>' . _('Price') . ':</td>
	          <td><input type="text" class="number" name="Price" size="11" maxlength="10" value="' . locale_money_format($_POST['Price'], $CustomerCurrencyCode) . '" /></td>
				</tr></table>';
echo '<br /><div class="centre"><button type="submit" name="submit">' . _('Enter Information') . '</button></div>';
echo '</form>';
include 'includes/footer.inc';
function ReSequenceEffectiveDates($Item, $PriceList, $CurrAbbrev, $CustomerID, $db)
{
    /*This is quite complicated - the idea is that prices set up should be unique and there is no way two prices could be returned as valid - when getting a price in includes/GetPrice.inc the logic is to first look for a price of the salestype/currency within the effective start and end dates - then if not get the price with a start date prior but a blank end date (the default price). We would not want two prices where the effective dates fall between an existing price so it is necessary to update enddates of prices  - with me - I am just hanging on here myself
    	 Prices with no end date are default prices and need to be ignored in this resquence*/
    $SQL = "SELECT branchcode,\n\t\t\t\t\t\tstartdate,\n\t\t\t\t\t\tenddate\n\t\t\t\t\t\tFROM prices\n\t\t\t\t\t\tWHERE debtorno='" . $CustomerID . "'\n\t\t\t\t\t\tAND stockid='" . $Item . "'\n\t\t\t\t\t\tAND currabrev='" . $CurrAbbrev . "'\n\t\t\t\t\t\tAND typeabbrev='" . $PriceList . "'\n\t\t\t\t\t\tAND enddate<>''\n\t\t\t\t\t\tORDER BY\n\t\t\t\t\t\tbranchcode,\n\t\t\t\t\t\tstartdate,\n\t\t\t\t\t\tenddate";
    $result = DB_query($SQL, $db);
    unset($BranchCode);
    while ($myrow = DB_fetch_array($result)) {
Exemplo n.º 16
0
				<td><input type="text" class="number" name="ConversionFactor' . $POLine->LineNo . '" size="8" value="' . $POLine->ConversionFactor . '" /></td>
				<td><input type="text" class="number" name="SuppQty' . $POLine->LineNo . '" size="10" value="' . locale_number_format(round($POLine->Quantity / $POLine->ConversionFactor, $POLine->DecimalPlaces), $POLine->DecimalPlaces) . '" /></td>
				<td>' . $POLine->SuppliersUnit . '</td>
				<td><input type="text" class="number" name="SuppPrice' . $POLine->LineNo . '" size="10" value="' . locale_number_format(round($POLine->Price * $POLine->ConversionFactor, $_SESSION['PO' . $identifier]->CurrDecimalPlaces), $_SESSION['PO' . $identifier]->CurrDecimalPlaces) . '" /></td>
				<td class="number">' . $DisplayLineTotal . '</td>
				<td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="ReqDelDate' . $POLine->LineNo . '" size="10" value="' . $POLine->ReqDelDate . '" /></td>';
            if ($POLine->QtyReceived != 0 and $POLine->Completed != 1) {
                echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?identifier=' . $identifier . '&amp;Complete=' . $POLine->LineNo . '">' . _('Complete') . '</a></td>';
            } elseif ($POLine->QtyReceived == 0) {
                echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?identifier=' . $identifier . '&amp;Delete=' . $POLine->LineNo . '">' . _('Delete') . '</a></td>';
            }
            echo '</tr>';
            $_SESSION['PO' . $identifier]->Total += $LineTotal;
        }
    }
    $DisplayTotal = locale_number_format($_SESSION['PO' . $identifier]->Total, $_SESSION['PO' . $identifier]->CurrDecimalPlaces);
    echo '<tr><td colspan="9" class="number">' . _('TOTAL') . _(' excluding Tax') . '</td>
						<td class="number"><b>' . $DisplayTotal . '</b></td>
			</tr></table>';
    echo '<br />
			<div class="centre">
			<input type="submit" name="UpdateLines" value="' . _('Update Order Lines') . '" />';
    echo '&nbsp;<input type="submit" name="Commit" value="' . _('Process Order') . '" />
			</div>';
}
/*Only display the order line items if there are any !! */
if (isset($_POST['NonStockOrder'])) {
    echo '<br /><table class="selection"><tr>
				<td>' . _('Item Description') . '</td>';
    echo '<td><input type="text" name="ItemDescription" size="40" /></td></tr>';
    echo '<tr>
						<th>' . _('Currency') . '</th>
						<th>' . _('Price') . '</th>
						<th>' . _('Line Total') . '</th>
					</tr>';
        while ($LineRow = DB_fetch_array($LineResult)) {
            if ($LineRow['decimalplaces'] != NULL) {
                $DecimalPlaces = $LineRow['decimalplaces'];
            } else {
                $DecimalPlaces = 2;
            }
            echo '<tr>
					<td>' . $LineRow['description'] . '</td>
					<td class="number">' . locale_number_format($LineRow['quantityord'], $DecimalPlaces) . '</td>
					<td>' . $myrow['currcode'] . '</td>
					<td class="number">' . locale_number_format($LineRow['unitprice'], $myrow['currdecimalplaces']) . '</td>
					<td class="number">' . locale_number_format($LineRow['unitprice'] * $LineRow['quantityord'], $myrow['currdecimalplaces']) . '</td>
				</tr>';
        }
        // end while order line detail
        echo '</table>
			</td>
			</tr>';
    }
}
//end while header loop
echo '</table>';
echo '<br />
		<div class="centre">
			<input type="submit" name="UpdateAll" value="' . _('Update') . '" />
		</div>
        </div>
Exemplo n.º 18
0
        echo '<tr>
				<td>' . _('Standard Material Cost Per Unit') . ':</td>
				<td class="number"><input type="text" class="number" name="MaterialCost" value="' . locale_number_format($myrow['materialcost'], $_SESSION['StandardCostDecimalPlaces']) . '" /></td>
			</tr>
			<tr>
				<td>' . _('Standard Labour Cost Per Unit') . ':</td>
				<td class="number"><input type="text" class="number" name="LabourCost" value="' . locale_number_format($myrow['labourcost'], $_SESSION['StandardCostDecimalPlaces']) . '" /></td>
			</tr>
			<tr>
				<td>' . _('Standard Overhead Cost Per Unit') . ':</td>
				<td class="number"><input type="text" class="number" name="OverheadCost" value="' . locale_number_format($myrow['overheadcost'], $_SESSION['StandardCostDecimalPlaces']) . '" /></td>
			</tr>';
    } elseif ($myrow['mbflag'] == 'B' or $myrow['mbflag'] == 'D') {
        echo '<tr>
				<td>' . _('Standard Cost') . ':</td>
				<td class="number"><input type="text" class="number" name="MaterialCost" value="' . locale_number_format($myrow['materialcost'], $_SESSION['StandardCostDecimalPlaces']) . '" /></td>
			</tr>';
    } else {
        echo '<tr><td><input type="hidden" name="LabourCost" value="0" />';
        echo '<input type="hidden" name="OverheadCost" value="0" /></td></tr>';
    }
    echo '</table>
         <br />
             <div class="centre">
                  <input type="submit" name="UpdateData" value="' . _('Update') . '" />
             </div>
         <br />
         <br />';
}
if ($myrow['mbflag'] != 'D') {
    echo '<div class="centre"><a href="' . $RootPath . '/StockStatus.php?StockID=' . $StockID . '">' . _('Show Stock Status') . '</a>';
Exemplo n.º 19
0
     } else {
         if ($TrfLine->Controlled == 1) {
             if (sizeOf($TrfLine->SerialItems) == 0) {
                 $Qty = 0;
             } else {
                 $Qty = $TrfLine->Quantity;
             }
         } else {
             $Qty = $TrfLine->Quantity;
         }
     }
     echo '<td class="number">' . locale_number_format($TrfLine->PrevRecvQty, $TrfLine->DecimalPlaces) . '</td>';
     if ($TrfLine->Controlled == 1) {
         echo '<td class="number"><input type="hidden" name="Qty' . $i . '" value="' . locale_number_format($Qty, $TrfLine->DecimalPlaces) . '"><a href="' . $rootpath . '/StockTransferControlled.php?TransferItem=' . $i . '" />' . locale_number_format($Qty, $TrfLine->DecimalPlaces) . '</a></td>';
     } else {
         echo '<td><input type="text" class="number" name="Qty' . $i . '" maxlength="10" class="number" size="auto" value="' . locale_number_format($Qty, $TrfLine->DecimalPlaces) . '" /></td>';
     }
     echo '<td>' . $TrfLine->PartUnit . '</td>';
     echo '<td><input type="checkbox" name="CancelBalance' . $i . '" value="1" /></td>';
     if ($TrfLine->Controlled == 1) {
         if ($TrfLine->Serialised == 1) {
             echo '<td><a href="' . $rootpath . '/StockTransferControlled.php?TransferItem=' . $i . '">' . _('Enter Serial Numbers') . '</a></td>';
         } else {
             echo '<td><a href="' . $rootpath . '/StockTransferControlled.php?TransferItem=' . $i . '">' . _('Enter Batch Refs') . '</a></td>';
         }
     }
     echo '</tr>';
     $i++;
     /* the array of TransferItem s is indexed numerically and i matches the index no */
 }
 /*end of foreach TransferItem */
Exemplo n.º 20
0
                if ($_POST['BelowReorderQuantity'] != 'NotZero') {
                    if ($k == 1) {
                        echo '<tr class="OddTableRows">';
                        $k = 0;
                    } else {
                        echo '<tr class="EvenTableRows">';
                        $k = 1;
                    }
                    printf('<td><a target="_blank" href="' . $RootPath . '/StockStatus.php?StockID=%s">%s</a></td>
    					<td>%s</td>
    					<td class="number">%s</td>
    					<td>%s</td>
    					<td class="number">%s</td>
    					<td class="number">%s</td>
    					<td class="number"><a target="_blank" href="' . $RootPath . '/SelectProduct.php?StockID=%s">%s</a></td>
    					<td class="number">%s</td>', mb_strtoupper($myrow['stockid']), mb_strtoupper($myrow['stockid']), $myrow['description'], locale_number_format($myrow['quantity'], $myrow['decimalplaces']), $myrow['bin'], locale_number_format($myrow['reorderlevel'], $myrow['decimalplaces']), locale_number_format($DemandQty, $myrow['decimalplaces']), mb_strtoupper($myrow['stockid']), locale_number_format($myrow['quantity'] - $DemandQty, $myrow['decimalplaces']), locale_number_format($QOO, $myrow['decimalplaces']));
                    if ($myrow['serialised'] == 1) {
                        /*The line is a serialised item*/
                        echo '<td><a target="_blank" href="' . $RootPath . '/StockSerialItems.php?Serialised=Yes&Location=' . $myrow['loccode'] . '&StockID=' . $StockID . '">' . _('Serial Numbers') . '</a></td></tr>';
                    } elseif ($myrow['controlled'] == 1) {
                        echo '<td><a target="_blank" href="' . $RootPath . '/StockSerialItems.php?Location=' . $myrow['loccode'] . '&StockID=' . $StockID . '">' . _('Batches') . '</a></td></tr>';
                    }
                }
            }
            //end of page full new headings if
        }
        //end of if BelowOrderQuantity or all items
    }
    //end of while loop
    echo '</table>';
}
Exemplo n.º 21
0
            $LeftOvers = $pdf->addTextWrap(220, $YPos, 60, $FontSize, $DisplayBalance, 'right');
            $LeftOvers = $pdf->addTextWrap(280, $YPos, 60, $FontSize, $DisplayFXBalance, 'right');
            $LeftOvers = $pdf->addTextWrap(350, $YPos, 100, $FontSize, $DebtorBalances['currency'], 'left');
            $YPos -= $line_height;
            if ($YPos < $Bottom_Margin + $line_height) {
                include 'includes/PDFDebtorBalsPageHeader.inc';
            }
        }
    }
    /*end customer aged analysis while loop */
    $YPos -= $line_height;
    if ($YPos < $Bottom_Margin + 2 * $line_height) {
        $PageNumber++;
        include 'includes/PDFDebtorBalsPageHeader.inc';
    }
    $DisplayTotBalance = locale_number_format($TotBal, $_SESSION['CompanyRecord']['decimalplaces']);
    $LeftOvers = $pdf->addTextWrap(50, $YPos, 160, $FontSize, _('Total balances'), 'left');
    $LeftOvers = $pdf->addTextWrap(220, $YPos, 60, $FontSize, $DisplayTotBalance, 'right');
    $pdf->OutputD($_SESSION['DatabaseName'] . '_DebtorBals_' . date('Y-m-d') . '.pdf');
    $pdf->__destruct();
} else {
    /*The option to print PDF was not hit */
    $Title = _('Debtor Balances');
    $ViewTopic = 'ARReports';
    $BookMark = 'PriorMonthDebtors';
    include 'includes/header.inc';
    echo '<p class="page_title_text"><img src="' . $RootPath . '/css/' . $Theme . '/images/customer.png" title="' . _('Search') . '" alt="" />' . ' ' . $Title . '</p><br />';
    if (!isset($_POST['FromCriteria']) or !isset($_POST['ToCriteria'])) {
        /*if $FromCriteria is not set then show a form to allow input	*/
        echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '" method="post">
              <div>';
Exemplo n.º 22
0
    while ($InvRow = DB_fetch_array($InvoicesResult)) {
        $ValueInvoiced = $InvRow['netprice'] * $InvRow['quantity'];
        $LeftOvers = $pdf->addTextWrap($Left_Margin + 150, $YPos, 90, $FontSize, $InvRow['typename'] . ' ' . $InvRow['transno'], 'left');
        $LeftOvers = $pdf->addTextWrap($Left_Margin + 240, $YPos, 60, $FontSize, locale_number_format($InvRow['quantity'], $myrow['decimalplaces']), 'right');
        $LeftOvers = $pdf->addTextWrap($Left_Margin + 300, $YPos, 60, $FontSize, locale_number_format($InvRow['netprice'], $_SESSION['CompanyRecord']['decimalplaces']), 'right');
        $LeftOvers = $pdf->addTextWrap($Left_Margin + 360, $YPos, 80, $FontSize, locale_number_format($ValueInvoiced, $_SESSION['CompanyRecord']['decimalplaces']), 'right');
        $YPos -= $line_height;
        if ($YPos - 2 * $line_height < $Bottom_Margin) {
            /*Then set up a new page */
            $PageNumber++;
            include 'includes/PDFOrdersInvoicedPageHeader.inc';
        }
        /*end of new page header  */
        $AccumOrderTotal += $ValueInvoiced;
        $AccumTotalInv += $ValueInvoiced;
    }
    $YPos -= $line_height;
    if ($YPos - 2 * $line_height < $Bottom_Margin) {
        /*Then set up a new page */
        $PageNumber++;
        include 'includes/PDFOrdersInvoicedPageHeader.inc';
    }
    /*end of new page header  */
}
/* end of while there are invoiced orders to print */
$YPos -= $line_height;
$LeftOvers = $pdf->addTextWrap($Left_Margin + 260, $YPos, 100, $FontSize, _('GRAND TOTAL INVOICED'), 'right');
$LeftOvers = $pdf->addTextWrap($Left_Margin + 360, $YPos, 80, $FontSize, locale_number_format($AccumTotalInv, $_SESSION['CompanyRecord']['decimalplaces']), 'right');
$YPos -= $line_height;
$pdf->OutputD($_SESSION['DatabaseName'] . '_OrdersInvoiced_' . date('Y-m-d') . '.pdf');
$pdf->__destruct();
Exemplo n.º 23
0
		</tr>', $Sections[$Section], locale_number_format($SectionBalance, $_SESSION['CompanyRecord']['decimalplaces']), locale_number_format($SectionBalanceLY, $_SESSION['CompanyRecord']['decimalplaces']));
    $Section = $myrow['sectioninaccounts'];
    if (isset($myrow['sectioninaccounts']) and $_POST['Detail'] == 'Detailed') {
        printf('<tr>
				<td colspan="6"><h1>%s</h1></td>
				</tr>', $Sections[$myrow['sectioninaccounts']]);
    }
    echo '<tr>
			<td colspan="3"></td>
	  		<td><hr /></td>
			<td></td>
			<td><hr /></td>
		</tr>';
    printf('<tr>
		<td colspan="3"><h2>' . _('Check Total') . '</h2></td>
		<td class="number">%s</td>
		<td></td>
		<td class="number">%s</td>
		</tr>', locale_number_format($CheckTotal, $_SESSION['CompanyRecord']['decimalplaces']), locale_number_format($LYCheckTotal, $_SESSION['CompanyRecord']['decimalplaces']));
    echo '<tr>
		<td colspan="3"></td>
	  	<td><hr /></td>
		<td></td>
		<td><hr /></td>
		</tr>';
    echo '</table>';
    echo '</div>';
    echo '<br /><div class="centre noPrint"><input type="submit" name="SelectADifferentPeriod" value="' . _('Select A Different Balance Date') . '" /></div>';
    echo '</form>';
}
include 'includes/footer.inc';
Exemplo n.º 24
0
     /*Its a detailed report */
 }
 /*end Supplier aged analysis while loop */
 $YPos -= $line_height;
 if ($YPos < $Bottom_Margin + 2 * $line_height) {
     $PageNumber++;
     include 'includes/PDFAgedSuppliersPageHeader.inc';
 } elseif ($_POST['DetailedReport'] == 'Yes') {
     //dont do a line if the totals have to go on a new page
     $pdf->line($Page_Width - $Right_Margin, $YPos + 10, 220, $YPos + 10);
 }
 $DisplayTotBalance = locale_number_format($TotBal, $CurrDecimalPlaces);
 $DisplayTotDue = locale_number_format($TotDue, $CurrDecimalPlaces);
 $DisplayTotCurrent = locale_number_format($TotCurr, $CurrDecimalPlaces);
 $DisplayTotOverdue1 = locale_number_format($TotOD1, $CurrDecimalPlaces);
 $DisplayTotOverdue2 = locale_number_format($TotOD2, $CurrDecimalPlaces);
 $LeftOvers = $pdf->addTextWrap(220, $YPos, 60, $FontSize, $DisplayTotBalance, 'right');
 $LeftOvers = $pdf->addTextWrap(280, $YPos, 60, $FontSize, $DisplayTotCurrent, 'right');
 $LeftOvers = $pdf->addTextWrap(340, $YPos, 60, $FontSize, $DisplayTotDue, 'right');
 $LeftOvers = $pdf->addTextWrap(400, $YPos, 60, $FontSize, $DisplayTotOverdue1, 'right');
 $LeftOvers = $pdf->addTextWrap(460, $YPos, 60, $FontSize, $DisplayTotOverdue2, 'right');
 $YPos -= $line_height;
 $pdf->line($Page_Width - $Right_Margin, $YPos, 220, $YPos);
 if ($ListCount == 0) {
     $Title = _('Aged Supplier Analysis');
     include 'includes/header.inc';
     prnMsg(_('There are no results so the PDF is empty'));
     include 'includes/footer.inc';
 } else {
     $pdf->OutputD($_SESSION['DatabaseName'] . '_AggedSupliers_' . date('Y-m-d') . '.pdf');
 }
Exemplo n.º 25
0
		<th>' . _('Order Date') . '</th>
		<th>' . _('Delivery Date') . '</th>
		<th>' . _('Order Amount') . '</th>
		<th>' . _('Currency') . '</th>
	</tr> ';
$k = 0;
while ($row = DB_fetch_array($SalesOrdersResult)) {
    if ($k == 1) {
        echo '<tr class="EvenTableRows">';
        $k = 0;
    } else {
        echo '<tr class="OddTableRows">';
        $k++;
    }
    $FormatedOrderValue = locale_number_format($row['ordervalue'], $row['currdecimalplaces']);
    $OrderDate = ConvertSQLDate($row['orddate']);
    $DelDate = ConvertSQLDate($row['deliverydate']);
    $TotalSalesOrders += $row['ordervalue'];
    echo ' <td> ' . $row['orderno'] . ' </td>
			<td> ' . $row['name'] . ' </td>
			<td>' . $OrderDate . '</td>
			<td>' . $DelDate . '</td>
			<td class="number">' . $FormatedOrderValue . '</td>
			<td>' . $row['currcode'] . '</td>
		</tr>';
}
echo '<tr>
		<td colspan=3>' . _('Total') . '</td>
		<td colspan=3 class="number">' . locale_number_format($TotalSalesOrders, $row['currdecimalplaces']) . '</td>
	</tr>';
echo '</table>';
Exemplo n.º 26
0
            if ($j < 0) {
                $j = 11;
                echo $tableheader;
            }
            if ($k == 1) {
                echo '<tr class="EvenTableRows">';
                $k = 0;
            } else {
                echo '<tr class="OddTableRows">';
                $k = 1;
            }
            printf('<td>%s</td>
			<td class="number">%s</td>
			<td class="number">%s</td>
			<td class="number">%s%%</td>
			</tr>', $ph[0], locale_number_format($ph[1], $DecimalPlaces), locale_money_format($ph[2], $_SESSION['CompanyRecord']['currencydefault']), locale_number_format($ph[3] * 100, 2));
        }
        echo '</table>';
    } else {
        echo '<p>' . _('No history of sales of') . ' ' . $StockID . ' ' . _('to') . ' ' . $DebtorNo . '</p>';
    }
}
//end of displaying price history for a debtor
echo '<div class="centre">';
echo '<br /><a href="' . $rootpath . '/StockMovements.php?StockID=' . $StockID . '">' . _('Show Movements') . '</a>';
echo '<br /><a href="' . $rootpath . '/StockUsage.php?StockID=' . $StockID . '">' . _('Show Usage') . '</a>';
echo '<br /><a href="' . $rootpath . '/SelectSalesOrder.php?SelectedStockItem=' . $StockID . '">' . _('Search Outstanding Sales Orders') . '</a>';
echo '<br /><a href="' . $rootpath . '/SelectCompletedOrder.php?SelectedStockItem=' . $StockID . '">' . _('Search Completed Sales Orders') . '</a>';
if ($Its_A_KitSet_Assembly_Or_Dummy == False) {
    echo '<br /><a href="' . $rootpath . '/PO_SelectOSPurchOrder.php?SelectedStockItem=' . $StockID . '">' . _('Search Outstanding Purchase Orders') . '</a>';
}
Exemplo n.º 27
0
					<td>' . $LineRow['uom'] . '</td>
					<td><input type="checkbox" name="' . $LineRow['dispatchid'] . 'Completed' . $LineRow['dispatchitemsid'] . '" /></td>
					<td><select minlength="0" name="' . $LineRow['dispatchid'] . 'Tag' . $LineRow['dispatchitemsid'] . '">';
            $SQL = "SELECT tagref,\n\t\t\t\t\t\t\ttagdescription\n\t\t\t\t\t\tFROM tags\n\t\t\t\t\t\tORDER BY tagref";
            $TagResult = DB_query($SQL, $db);
            echo '<option value=0>0 - None</option>';
            while ($mytagrow = DB_fetch_array($TagResult)) {
                if (isset($_SESSION['Adjustment']->tag) and $_SESSION['Adjustment']->tag == $mytagrow['tagref']) {
                    echo '<option selected="selected" value="' . $mytagrow['tagref'] . '">' . $mytagrow['tagref'] . ' - ' . $myrow['tagdescription'] . '</option>';
                } else {
                    echo '<option value="' . $mytagrow['tagref'] . '">' . $mytagrow['tagref'] . ' - ' . $mytagrow['tagdescription'] . '</option>';
                }
            }
            echo '</select></td>';
            // End select tag
            echo '</tr>';
            echo '<input type="hidden" class="number" name="' . $LineRow['dispatchid'] . 'StockID' . $LineRow['dispatchitemsid'] . '" value="' . $LineRow['stockid'] . '" />';
            echo '<input type="hidden" class="number" name="' . $LineRow['dispatchid'] . 'Location' . $LineRow['dispatchitemsid'] . '" value="' . $_POST['Location'] . '" />';
            echo '<input type="hidden" class="number" name="' . $LineRow['dispatchid'] . 'RequestedQuantity' . $LineRow['dispatchitemsid'] . '" value="' . locale_number_format($LineRow['quantity'] - $LineRow['qtydelivered'], $LineRow['decimalplaces']) . '" />';
            echo '<input type="hidden" class="number" name="' . $LineRow['dispatchid'] . 'Department' . $LineRow['dispatchitemsid'] . '" value="' . $myrow['description'] . '" />';
        }
        // end while order line detail
        echo '</table></td></tr>';
    }
    //end while header loop
    echo '</table>';
    echo '<br /><div class="centre"><input type="submit" name="UpdateAll" value="' . _('Update') . '" /></div>
		  </div>
		  </form>';
}
include 'includes/footer.inc';
Exemplo n.º 28
0
    $OldProvince = '';
    while ($myrow = DB_fetch_array($TaxRatesResult)) {
        if ($OldProvince != $myrow['dispatchtaxprovince'] and $OldProvince != '') {
            echo '<tr style="background-color:#555555"><td colspan="3"></td></tr>';
        }
        if ($k == 1) {
            echo '<tr class="EvenTableRows">';
            $k = 0;
        } else {
            echo '<tr class="OddTableRows">';
            $k = 1;
        }
        printf('<td>%s</td>
				<td>%s</td>
				<td><input type="text" class="number" name="%s" required="required" minlength="1" maxlength="5" size="5" value="%s" /></td>
				</tr>', $myrow['taxprovincename'], $myrow['taxcatname'], $myrow['dispatchtaxprovince'] . '_' . $myrow['taxcatid'], locale_number_format($myrow['taxrate'] * 100, 2));
        $OldProvince = $myrow['dispatchtaxprovince'];
    }
    //end of while loop
    echo '</table>';
    echo '<div class="centre">
			<input type="submit" name="UpdateRates" value="' . _('Update Rates') . '" />
		</div>';
} else {
    prnMsg(_('There are no tax rates to show - perhaps the dispatch tax province records have not yet been created?'), 'warn');
}
echo '<div class="centre">
		<a href="' . $RootPath . '/TaxAuthorities.php">' . _('Tax Authorities') . '</a>
		<br />
		<a href="' . $RootPath . '/TaxGroups.php">' . _('Tax Groupings') . '</a>
		<br />
Exemplo n.º 29
0
		<th>' . _('Price Effective To Date') . '</th>
		<th>' . _('Quantity Break') . '</th>
		<th>' . _('Sell Price') . '</th>
	</tr>';
$k = 0;
//row colour counter
while ($myrow = DB_fetch_array($result)) {
    if ($k == 1) {
        echo '<tr class="EvenTableRows">';
        $k = 0;
    } else {
        echo '<tr class="OddTableRows">';
        $k = 1;
    }
    $DeleteURL = htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?Delete=yes&amp;SalesType=' . $myrow['salestype'] . '&amp;StockID=' . $myrow['stockid'] . '&amp;QuantityBreak=' . $myrow['quantitybreak'] . '&amp;Price=' . $myrow['price'] . '&amp;currabrev=' . $myrow['currabrev'] . '&amp;StartDate=' . $myrow['startdate'] . '&amp;EndDate=' . $myrow['enddate'];
    $EditURL = htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?Edit=yes&amp;StockID=' . $myrow['stockid'] . '&amp;TypeAbbrev=' . $myrow['salestype'] . '&amp;CurrAbrev=' . $myrow['currabrev'] . '&amp;Price=' . locale_number_format($myrow['price'], $myrow['currdecimalplaces']) . '&amp;StartDate=' . $myrow['startdate'] . '&amp;EndDate=' . $myrow['enddate'] . '&amp;QuantityBreak=' . $myrow['quantitybreak'];
    if (in_array(5, $_SESSION['AllowedPageSecurityTokens'])) {
        printf('<td>%s</td>
		    	<td>%s</td>
			<td>%s</td>
			<td>%s</td>
			<td class="number">%s</td>
			<td class="number">%s</td>
			<td><a href="%s" onclick="return confirm(\'' . _('Are you sure you wish to delete this discount matrix record?') . '\');">' . _('Delete') . '</a></td>
			<td><a href="%s">' . _('Edit') . '</a></td>
			</tr>', $myrow['currency'], $myrow['sales_type'], ConvertSQLDate($myrow['startdate']), ConvertSQLDate($myrow['enddate']), $myrow['quantitybreak'], $myrow['price'], $DeleteURL, $EditURL);
    } else {
        printf('<td>%s</td>
		    	<td>%s</td>
			<td>%s</td>
			<td>%s</td>
Exemplo n.º 30
0
        echo '<th>' . $Supplier . '<br />' . _('Price') . '</th>';
        echo '<th>' . _('Delivery By') . '</th>';
        $i = 0;
        while ($MyItemRow = DB_fetch_array($ItemResult)) {
            echo '<tr><td>' . $MyItemRow['stockid'] . '</td>';
            echo '<td>' . $MyItemRow['description'] . '</td>';
            echo '<input type="hidden" name="StockID' . $i . '" value="' . $MyItemRow['stockid'] . '" />';
            echo '<input type="hidden" name="ItemDescription' . $i . '" value="' . $MyItemRow['description'] . '" />';
            echo '<td>' . $MyItemRow['suppliers_partno'] . '</td>';
            echo '<td class="number">' . locale_number_format($MyItemRow['quantity'], $MyItemRow['decimalplaces']) . '</td>';
            echo '<td>' . $MyItemRow['units'] . '</td>';
            echo '<td>' . ConvertSQLDate($MyItemRow['requiredbydate']) . '</td>';
            if ($MyItemRow['suppliersuom'] == '') {
                $MyItemRow['suppliersuom'] = $MyItemRow['units'];
            }
            echo '<td><input type="text" class="number" size="10" name="Qty' . $i . '" value="' . locale_number_format($MyItemRow['quantity'], $MyItemRow['decimalplaces']) . '" /></td>';
            echo '<input type="hidden" name="UOM' . $i . '" value="' . $MyItemRow['units'] . '" />';
            echo '<input type="hidden" name="DecimalPlaces' . $i . '" value="' . $MyItemRow['decimalplaces'] . '" />';
            echo '<td>' . $MyItemRow['suppliersuom'] . '</td>';
            echo '<td>' . $myrow['currcode'] . '</td>';
            echo '<td><input type="text" class="number" size="10" name="Price' . $i . '" value="0.00" /></td>';
            echo '<td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="RequiredByDate' . $i . '" size="11" value="' . ConvertSQLDate($MyItemRow['requiredbydate']) . '" /></td>';
            $i++;
        }
        echo '</form>';
    }
    echo '</table>';
}
if (isset($_POST['Search'])) {
    /*ie seach for stock items */
    echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'] . '?identifier=' . $identifier) . '">';