示例#1
0
 public static function Delete($id)
 {
     try {
         $statement = TransactionVouchers::SupplierStatement($id, '', 'true');
         if (!empty($statement) && count($statement) > 0) {
             return false;
         } else {
             $sql = 'DELETE FROM suppliers WHERE id = ' . intval($id);
             $res = DatabaseHandler::Execute($sql);
             return true;
         }
     } catch (Exception $e) {
         return false;
     }
 }
示例#2
0
    public static function EmployeeOvertime()
    {
        $statement = TransactionVouchers::PayrollCategoryReport($_GET['sid'], $_GET['month'], 'Overtime');
        $employee = Employee::GetEmployee($_GET['sid']);
        echo '
				<div class="logo">
				  <h5 style="margin-bottom:-15px;margin-top:0px;font-size:14px;">Date: ' . date('d/m/Y') . '</h5>
				  <h4>OVERTIME: ' . $employee->name . '</h4>
				  <h5 style="margin-top:-10px">Month: ' . $_GET['month'] . '</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>HOURS</td>
			          <td>RATE</td>
			          <td>AMOUNT</td>
			          <td>DESCRIPTION</td>
			        </tr>
			      </thead>
			      <tbody>';
        $tot = 0.0;
        foreach ($statement as $item) {
            $tot += $item['amount'];
            echo '<tr>
			      <td style="width:90px">' . $item['datetime'] . '</td>
			      <td style="width: 100px">' . $item['qty'] . '</td>
			      <td style="width: 100px"><script>document.writeln((' . $item['rate'] . ').formatMoney(2, \'.\', \',\'));</script></td>
			      <td style="width: 100px"><script>document.writeln((' . $item['amount'] . ').formatMoney(2, \'.\', \',\'));</script></td>
			      <td style="max-width: 220px;">' . $item['description'] . '</td>
			    </tr>';
        }
        echo '</tbody>
			    </table>
			    <div class="logo">
			    <p style="margin: 5px 0 0 5px">Total Advances: <b>Ksh. <script>document.writeln((' . $tot . ').formatMoney(2, \'.\', \',\'));</script></b></p>				    
			    </div>';
    }
示例#3
0
 public function findEmployeeEntries($employeeid, $dates, $all)
 {
     if ($this->validateAdmin()) {
         echo json_encode(TransactionVouchers::GetEmployeeTransactions($employeeid, $dates, $all));
     } else {
         echo 0;
     }
 }
示例#4
0
 public function findClientEntries($client, $category, $dates, $all)
 {
     if ($this->validateAdmin()) {
         echo json_encode(TransactionVouchers::GetClientTransactions($client, $category, $dates, $all));
     } else {
         echo 0;
     }
 }
示例#5
0
 public function findSupplierEntries($supplierid, $category, $dates, $all)
 {
     if ($this->validateAdmin()) {
         echo json_encode(TransactionVouchers::GetSupplierTransactions($supplierid, $category, $dates, $all));
     } else {
         echo 0;
     }
 }