Beispiel #1
0
    public static function SalesByItem()
    {
        $statement = FinancialStatements::ItemRevenueStatement($_GET['sid'], $_GET['period'], $_GET['all']);
        $service = BillableService::Get($_GET['sid']);
        echo '
				<div class="logo">
				  <h5 style="margin-bottom:-15px;margin-top:0px;font-size:14px;">Date: ' . date('d/m/Y') . '</h5>
				  <h4 style="text-transform:uppercase">' . $service->name . ' REVENUE REPORT</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>INV No.</td>
			          <td>DESCRIPTION</td>
			          <td>QTY</td>
			          <td>ITEMS TOTAL</td>
			          <td>SERVED BY</td>
			        </tr>
			      </thead>
			      <tbody>';
        $total = 0.0;
        foreach ($statement as $item) {
            $sqla = 'SELECT * FROM invoices WHERE id = ' . $item['invoice_id'] . ' LIMIT 0,1';
            $resa = DatabaseHandler::GetRow($sqla);
            echo '<tr>
			      <td style="width: 100px">' . $resa['datetime'] . '</td>
			      <td style="width: 60px">' . $resa['id'] . '</td>
			      <td style="width: 250px">' . $item['item_desc'] . '</td>
			      <td style="width: 50px">' . $item['quantity'] . '</td>';
            $sql = 'SELECT * FROM vouchers WHERE tx_type LIKE "%Invoice%" AND voucher_id = ' . $resa['id'] . ' LIMIT 0,1';
            $result = DatabaseHandler::GetRow($sql);
            echo '<td style="width: 150px"><script>document.writeln((' . $item['quantity'] * $item['unit_price'] . ').formatMoney(2, \'.\', \',\'));</script></td>
			      <td style="padding: 0 5px;">' . $result['cashier'] . '</td>
			    </tr>';
            $total += $item['quantity'] * $item['unit_price'];
        }
        echo '</tbody>
			    </table>
			    <div class="logo">
				    <p style="margin: 5px 0 0 5px">Total Revenue: <b>Ksh. <script>document.writeln((' . $total . ').formatMoney(2, \'.\', \',\'));</script></b></p>
				</div>';
    }
Beispiel #2
0
 public function deleteService($name)
 {
     if (BillableService::Delete($name)) {
         echo 1;
     } else {
         echo 0;
     }
 }