mirror of
https://github.com/Karaka-Management/oms-ClientManagement.git
synced 2026-01-11 23: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;
|
||||
|
||||
use Modules\Billing\Models\BillMapper;
|
||||
use Modules\Billing\Models\SalesBillMapper;
|
||||
use Modules\Billing\Models\BillTypeL11n;
|
||||
use Modules\ClientManagement\Models\ClientMapper;
|
||||
use phpOMS\Asset\AssetType;
|
||||
|
|
@ -108,11 +108,11 @@ final class BackendController extends Controller
|
|||
|
||||
// stats
|
||||
if ($this->app->moduleManager->isActive('Billing')) {
|
||||
$ytd = BillMapper::getSalesByClientId($client->getId(), new SmartDateTime('Y-01-01'), new SmartDateTime('now'));
|
||||
$mtd = BillMapper::getSalesByClientId($client->getId(), new SmartDateTime('Y-m-01'), new SmartDateTime('now'));
|
||||
$lastOrder = BillMapper::getLastOrderDateByClientId($client->getId());
|
||||
$newestInvoices = BillMapper::withConditional('language', $response->getLanguage(), [BillTypeL11n::class])::getNewestClientInvoices($client->getId(), 5);
|
||||
$monthlySalesCosts = BillMapper::getClientMonthlySalesCosts($client->getId(), (new SmartDateTime('now'))->createModify(-1), new SmartDateTime('now'));
|
||||
$ytd = SalesBillMapper::getSalesByClientId($client->getId(), new SmartDateTime('Y-01-01'), new SmartDateTime('now'));
|
||||
$mtd = SalesBillMapper::getSalesByClientId($client->getId(), new SmartDateTime('Y-m-01'), new SmartDateTime('now'));
|
||||
$lastOrder = SalesBillMapper::getLastOrderDateByClientId($client->getId());
|
||||
$newestInvoices = SalesBillMapper::withConditional('language', $response->getLanguage(), [BillTypeL11n::class])::getNewestClientInvoices($client->getId(), 5);
|
||||
$monthlySalesCosts = SalesBillMapper::getClientMonthlySalesCosts($client->getId(), (new SmartDateTime('now'))->createModify(-1), new SmartDateTime('now'));
|
||||
} else {
|
||||
$ytd = new Money();
|
||||
$mtd = new Money();
|
||||
|
|
|
|||
|
|
@ -208,7 +208,7 @@ echo $this->getData('nav')->render();
|
|||
<td><?= $this->getHtml('Date'); ?>
|
||||
<tbody>
|
||||
<?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; ?>">
|
||||
<td><a href="<?= $url; ?>"><?= $invoice->getNumber(); ?></a>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user