function fetchEntity($moduleName, $recordId) { $adb = PearDatabase::getInstance(); $entityData = VTEntityData::fromEntityId($adb, $recordId, $moduleName); if ($moduleName == 'HelpDesk') { $entityData->set('comments', getTicketComments($recordId)); } elseif ($moduleName == 'Invoice') { $entityData->set('invoicestatus', getInvoiceStatus($recordId)); } self::$newEntity[$moduleName][$recordId] = $entityData; }
/** * Customizing the Delete procedure. */ function trash($module, $recordId) { $status = getInvoiceStatus($recordId); if ($status != 'Cancel') { addProductsToStock($recordId); } parent::trash($module, $recordId); }
<h5>Overzicht facturen</h5> <table class="table table-cp" id="invoices-table"> <thead> <tr> <th><i class="fa fa-check payed"></i></th> <th>Nummer</th> <th>Klant</th> <th>Betaling</th> <th>Totaal</th> </tr> </thead> <tbody> <?php foreach (getInvoices('', $_GET['id']) as $invoices) { $totalAmount = number_format($invoices['invoice_total'], 2, ',', '.'); $invoiceStatus = getInvoiceStatus($invoices['invoice_status']); echo "<tr>"; echo "<th><a class='invoice status' href='/admin/invoices/{$invoices['invoice_number']}'>{$invoiceStatus}</a></th>"; echo "<th><a class='invoice number' href='/admin/invoices/{$invoices['invoice_number']}'>{$invoices['invoice_number']}</a></th>"; echo "<th><a class='invoice customer' target='_blank' href='/admin/users/{$invoices['invoice_recipient']}'>{$invoices['invoice_recipient']}</a></th>"; echo "<th><a class='invoice number' href='/admin/invoices/{$invoices['invoice_number']}'>{$invoices['invoice_number']}</a></th>"; echo "<th><a class='invoice total' href='/admin/invoices/{$invoices['invoice_number']}'>€ {$totalAmount}</a></th>"; echo '<tr>'; } ?> </tbody> </table> </div> </div> </div> </div>