draft ::with() function for models

This commit is contained in:
Dennis Eichhorn 2021-03-11 21:23:41 +01:00
parent 09e343ec61
commit 39143096fe
2 changed files with 3 additions and 1 deletions

View File

@ -111,7 +111,7 @@ final class BackendController extends Controller
$ytd = PurchaseBillMapper::getPurchaseBySupplierId($supplier->getId(), new SmartDateTime('Y-01-01'), new SmartDateTime('now'));
$mtd = PurchaseBillMapper::getPurchaseBySupplierId($supplier->getId(), new SmartDateTime('Y-m-01'), new SmartDateTime('now'));
$lastOrder = PurchaseBillMapper::getLastOrderDateBySupplierId($supplier->getId());
$newestInvoices = PurchaseBillMapper::withConditional('language', $response->getLanguage(), [BillTypeL11n::class])::getNewestSupplierInvoices($supplier->getId(), 5);
$newestInvoices = PurchaseBillMapper::with('language', $response->getLanguage(), [BillTypeL11n::class])::getNewestSupplierInvoices($supplier->getId(), 5);
$monthlyPurchaseCosts = PurchaseBillMapper::getSupplierMonthlyPurchaseCosts($supplier->getId(), (new SmartDateTime('now'))->createModify(-1), new SmartDateTime('now'));
} else {
$ytd = new Money();

View File

@ -228,6 +228,7 @@ echo $this->getData('nav')->render();
<thead>
<tr>
<td><?= $this->getHtml('Number'); ?>
<td><?= $this->getHtml('Type'); ?>
<td class="wf-100"><?= $this->getHtml('Name'); ?>
<td><?= $this->getHtml('Net'); ?>
<td><?= $this->getHtml('Date'); ?>
@ -237,6 +238,7 @@ echo $this->getData('nav')->render();
?>
<tr data-href="<?= $url; ?>">
<td><a href="<?= $url; ?>"><?= $invoice->getNumber(); ?></a>
<td><a href="<?= $url; ?>"><?= $invoice->type->getL11n(); ?></a>
<td><a href="<?= $url; ?>"><?= $invoice->billTo; ?></a>
<td><a href="<?= $url; ?>"><?= $invoice->net->getCurrency(); ?></a>
<td><a href="<?= $url; ?>"><?= $invoice->createdAt->format('Y-m-d'); ?></a>