예제 #1
0
    public static function ClientQuotations()
    {
        $statement = TransactionVouchers::ClientQuotations($_GET['sid'], $_GET['period'], $_GET['all']);
        $client = Client::GetClient($_GET['sid']);
        echo '
				<div class="logo">
				  <h5 style="margin-bottom:-15px;margin-top:0px;font-size:14px;">Date: ' . date('d/m/Y') . '</h5>
				  <h4>' . $client->name . ' QUOTATIONS</h4>';
        if ($_GET['period'] != '' && $_GET['period']) {
            echo '<h5 style="margin-top:-10px">Period: ' . $_GET['period'] . '</h5>';
        }
        echo '</div>

				<table class="table table-bordered table-striped" style="text-align:center;margin-left:0;margin-right:0;width:760px;font-size:12px;">
			      <thead class="title">
			        <tr>
			          <td>DATE</td>
			          <td>QUOTE ID</td>
			          <td>PURPOSE</td>
			          <td>STATUS</td>
					  <td>TOTAL</td>
			        </tr>
			      </thead>
			      <tbody>';
        $total = 0.0;
        $invoiced = 0.0;
        foreach ($statement as $item) {
            echo '<tr>
			      <td>' . $item['date'] . '</td>
			      <td>' . $item['id'] . '</td>';
            if ($item['project_id'] != null && $item['project_id'] != "") {
                $project = Project::GetProject($item['project_id']);
                echo '<td>' . $project->name . '</td>';
            } else {
                echo '<td></td>';
            }
            if ($item['status'] == 1) {
                echo '<td style="color:#232836">CREATED</td>';
            } else {
                echo '<td style="color:#27c97b">INVOICED</td>';
                $invoiced += $item['total'];
            }
            echo '<td class="text-right" style="padding: 0 5px;"><script>document.writeln((' . $item['total'] . ').formatMoney(2, \'.\', \',\'));</script></td>
			    </tr>';
            $total += $item['total'];
        }
        echo '</tbody>
			    </table>
			    <div class="logo">
				    <p style="margin: 5px 0 0 5px">Total Quoted: <b>Ksh. <script>document.writeln((' . $total . ').formatMoney(2, \'.\', \',\'));</script></b></p>
				    <p style="margin: 5px 0 0 5px">Total Invoiced: <b>Ksh. <script>document.writeln((' . $invoiced . ').formatMoney(2, \'.\', \',\'));</script></b></p>
				</div>';
    }