mirror of
https://github.com/Karaka-Management/oms-ClientManagement.git
synced 2026-02-11 22:38:42 +00:00
improve billing
This commit is contained in:
parent
3bf4821761
commit
5121bd3276
|
|
@ -14,7 +14,7 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace Modules\ClientManagement\Controller;
|
namespace Modules\ClientManagement\Controller;
|
||||||
|
|
||||||
use Modules\Billing\Models\BillMapper;
|
use Modules\Billing\Models\SalesBillMapper;
|
||||||
use Modules\Billing\Models\BillTypeL11n;
|
use Modules\Billing\Models\BillTypeL11n;
|
||||||
use Modules\ClientManagement\Models\ClientMapper;
|
use Modules\ClientManagement\Models\ClientMapper;
|
||||||
use phpOMS\Asset\AssetType;
|
use phpOMS\Asset\AssetType;
|
||||||
|
|
@ -108,11 +108,11 @@ final class BackendController extends Controller
|
||||||
|
|
||||||
// stats
|
// stats
|
||||||
if ($this->app->moduleManager->isActive('Billing')) {
|
if ($this->app->moduleManager->isActive('Billing')) {
|
||||||
$ytd = BillMapper::getSalesByClientId($client->getId(), new SmartDateTime('Y-01-01'), new SmartDateTime('now'));
|
$ytd = SalesBillMapper::getSalesByClientId($client->getId(), new SmartDateTime('Y-01-01'), new SmartDateTime('now'));
|
||||||
$mtd = BillMapper::getSalesByClientId($client->getId(), new SmartDateTime('Y-m-01'), new SmartDateTime('now'));
|
$mtd = SalesBillMapper::getSalesByClientId($client->getId(), new SmartDateTime('Y-m-01'), new SmartDateTime('now'));
|
||||||
$lastOrder = BillMapper::getLastOrderDateByClientId($client->getId());
|
$lastOrder = SalesBillMapper::getLastOrderDateByClientId($client->getId());
|
||||||
$newestInvoices = BillMapper::withConditional('language', $response->getLanguage(), [BillTypeL11n::class])::getNewestClientInvoices($client->getId(), 5);
|
$newestInvoices = SalesBillMapper::withConditional('language', $response->getLanguage(), [BillTypeL11n::class])::getNewestClientInvoices($client->getId(), 5);
|
||||||
$monthlySalesCosts = BillMapper::getClientMonthlySalesCosts($client->getId(), (new SmartDateTime('now'))->createModify(-1), new SmartDateTime('now'));
|
$monthlySalesCosts = SalesBillMapper::getClientMonthlySalesCosts($client->getId(), (new SmartDateTime('now'))->createModify(-1), new SmartDateTime('now'));
|
||||||
} else {
|
} else {
|
||||||
$ytd = new Money();
|
$ytd = new Money();
|
||||||
$mtd = new Money();
|
$mtd = new Money();
|
||||||
|
|
|
||||||
|
|
@ -208,7 +208,7 @@ echo $this->getData('nav')->render();
|
||||||
<td><?= $this->getHtml('Date'); ?>
|
<td><?= $this->getHtml('Date'); ?>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php foreach ($newestInvoices as $invoice) :
|
<?php foreach ($newestInvoices as $invoice) :
|
||||||
$url = UriFactory::build('{/prefix}sales/invoice?{?}&id=' . $invoice->getId());
|
$url = UriFactory::build('{/prefix}sales/bill?{?}&id=' . $invoice->getId());
|
||||||
?>
|
?>
|
||||||
<tr data-href="<?= $url; ?>">
|
<tr data-href="<?= $url; ?>">
|
||||||
<td><a href="<?= $url; ?>"><?= $invoice->getNumber(); ?></a>
|
<td><a href="<?= $url; ?>"><?= $invoice->getNumber(); ?></a>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user