bug fix in buy pdf export and start working on dashboard customizition
This commit is contained in:
parent
ca64caeace
commit
6f30c0b11a
|
@ -270,6 +270,12 @@ class Business
|
|||
#[ORM\OneToMany(mappedBy: 'bid', targetEntity: PreInvoiceItem::class, orphanRemoval: true)]
|
||||
private Collection $preInvoiceItems;
|
||||
|
||||
/**
|
||||
* @var Collection<int, DashboardSettings>
|
||||
*/
|
||||
#[ORM\OneToMany(mappedBy: 'bid', targetEntity: DashboardSettings::class, orphanRemoval: true)]
|
||||
private Collection $dashboardSettings;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->logs = new ArrayCollection();
|
||||
|
@ -308,6 +314,7 @@ class Business
|
|||
$this->extraMoney = new ArrayCollection();
|
||||
$this->preInvoiceDocs = new ArrayCollection();
|
||||
$this->preInvoiceItems = new ArrayCollection();
|
||||
$this->dashboardSettings = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
|
@ -1892,4 +1899,34 @@ class Business
|
|||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, DashboardSettings>
|
||||
*/
|
||||
public function getDashboardSettings(): Collection
|
||||
{
|
||||
return $this->dashboardSettings;
|
||||
}
|
||||
|
||||
public function addDashboardSetting(DashboardSettings $dashboardSetting): static
|
||||
{
|
||||
if (!$this->dashboardSettings->contains($dashboardSetting)) {
|
||||
$this->dashboardSettings->add($dashboardSetting);
|
||||
$dashboardSetting->setBid($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeDashboardSetting(DashboardSettings $dashboardSetting): static
|
||||
{
|
||||
if ($this->dashboardSettings->removeElement($dashboardSetting)) {
|
||||
// set the owning side to null (unless already changed)
|
||||
if ($dashboardSetting->getBid() === $this) {
|
||||
$dashboardSetting->setBid(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
|
172
hesabixCore/src/Entity/DashboardSettings.php
Normal file
172
hesabixCore/src/Entity/DashboardSettings.php
Normal file
|
@ -0,0 +1,172 @@
|
|||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\DashboardSettingsRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: DashboardSettingsRepository::class)]
|
||||
class DashboardSettings
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column]
|
||||
private ?int $id = null;
|
||||
|
||||
#[ORM\ManyToOne(inversedBy: 'dashboardSettings')]
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
private ?User $submitter = null;
|
||||
|
||||
#[ORM\ManyToOne(inversedBy: 'dashboardSettings')]
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
private ?Business $bid = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?bool $wallet = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?bool $banks = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?bool $accDocs = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?bool $commodities = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?bool $persons = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?bool $buys = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?bool $sells = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?bool $accountingTotal = null;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getSubmitter(): ?User
|
||||
{
|
||||
return $this->submitter;
|
||||
}
|
||||
|
||||
public function setSubmitter(?User $submitter): static
|
||||
{
|
||||
$this->submitter = $submitter;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getBid(): ?Business
|
||||
{
|
||||
return $this->bid;
|
||||
}
|
||||
|
||||
public function setBid(?Business $bid): static
|
||||
{
|
||||
$this->bid = $bid;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function isWallet(): ?bool
|
||||
{
|
||||
return $this->wallet;
|
||||
}
|
||||
|
||||
public function setWallet(?bool $wallet): static
|
||||
{
|
||||
$this->wallet = $wallet;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function isBanks(): ?bool
|
||||
{
|
||||
return $this->banks;
|
||||
}
|
||||
|
||||
public function setBanks(?bool $banks): static
|
||||
{
|
||||
$this->banks = $banks;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function isAccDocs(): ?bool
|
||||
{
|
||||
return $this->accDocs;
|
||||
}
|
||||
|
||||
public function setAccDocs(?bool $accDocs): static
|
||||
{
|
||||
$this->accDocs = $accDocs;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function isCommodities(): ?bool
|
||||
{
|
||||
return $this->commodities;
|
||||
}
|
||||
|
||||
public function setCommodities(?bool $commodities): static
|
||||
{
|
||||
$this->commodities = $commodities;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function isPersons(): ?bool
|
||||
{
|
||||
return $this->persons;
|
||||
}
|
||||
|
||||
public function setPersons(?bool $persons): static
|
||||
{
|
||||
$this->persons = $persons;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function isBuys(): ?bool
|
||||
{
|
||||
return $this->buys;
|
||||
}
|
||||
|
||||
public function setBuys(?bool $buys): static
|
||||
{
|
||||
$this->buys = $buys;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function isSells(): ?bool
|
||||
{
|
||||
return $this->sells;
|
||||
}
|
||||
|
||||
public function setSells(?bool $sells): static
|
||||
{
|
||||
$this->sells = $sells;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function isAccountingTotal(): ?bool
|
||||
{
|
||||
return $this->accountingTotal;
|
||||
}
|
||||
|
||||
public function setAccountingTotal(?bool $accountingTotal): static
|
||||
{
|
||||
$this->accountingTotal = $accountingTotal;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
|
@ -107,6 +107,12 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
|
|||
#[ORM\OneToMany(mappedBy: 'submitter', targetEntity: PreInvoiceDoc::class, orphanRemoval: true)]
|
||||
private Collection $preInvoiceDocs;
|
||||
|
||||
/**
|
||||
* @var Collection<int, DashboardSettings>
|
||||
*/
|
||||
#[ORM\OneToMany(mappedBy: 'submitter', targetEntity: DashboardSettings::class, orphanRemoval: true)]
|
||||
private Collection $dashboardSettings;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->userTokens = new ArrayCollection();
|
||||
|
@ -128,6 +134,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
|
|||
$this->plugRepserviceOrders = new ArrayCollection();
|
||||
$this->notes = new ArrayCollection();
|
||||
$this->preInvoiceDocs = new ArrayCollection();
|
||||
$this->dashboardSettings = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
|
@ -819,4 +826,34 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
|
|||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, DashboardSettings>
|
||||
*/
|
||||
public function getDashboardSettings(): Collection
|
||||
{
|
||||
return $this->dashboardSettings;
|
||||
}
|
||||
|
||||
public function addDashboardSetting(DashboardSettings $dashboardSetting): static
|
||||
{
|
||||
if (!$this->dashboardSettings->contains($dashboardSetting)) {
|
||||
$this->dashboardSettings->add($dashboardSetting);
|
||||
$dashboardSetting->setSubmitter($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeDashboardSetting(DashboardSettings $dashboardSetting): static
|
||||
{
|
||||
if ($this->dashboardSettings->removeElement($dashboardSetting)) {
|
||||
// set the owning side to null (unless already changed)
|
||||
if ($dashboardSetting->getSubmitter() === $this) {
|
||||
$dashboardSetting->setSubmitter(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
|
43
hesabixCore/src/Repository/DashboardSettingsRepository.php
Normal file
43
hesabixCore/src/Repository/DashboardSettingsRepository.php
Normal file
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\DashboardSettings;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @extends ServiceEntityRepository<DashboardSettings>
|
||||
*/
|
||||
class DashboardSettingsRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, DashboardSettings::class);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return DashboardSettings[] Returns an array of DashboardSettings objects
|
||||
// */
|
||||
// public function findByExampleField($value): array
|
||||
// {
|
||||
// return $this->createQueryBuilder('d')
|
||||
// ->andWhere('d.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->orderBy('d.id', 'ASC')
|
||||
// ->setMaxResults(10)
|
||||
// ->getQuery()
|
||||
// ->getResult()
|
||||
// ;
|
||||
// }
|
||||
|
||||
// public function findOneBySomeField($value): ?DashboardSettings
|
||||
// {
|
||||
// return $this->createQueryBuilder('d')
|
||||
// ->andWhere('d.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->getQuery()
|
||||
// ->getOneOrNullResult()
|
||||
// ;
|
||||
// }
|
||||
}
|
|
@ -213,14 +213,14 @@
|
|||
{{ item.commdityCount }}
|
||||
{{ item.commodity.unit.name }}
|
||||
</td>
|
||||
<td class="center item">{{ ((item.bs - item.tax + item.discount) / item.commdityCount) | number_format }}</td>
|
||||
<td class="center item">{{ ((item.bd - item.tax + item.discount) / item.commdityCount) | number_format }}</td>
|
||||
{% if printOptions.discountInfo %}
|
||||
<td class="center item">{{ item.discount | number_format }}</td>
|
||||
{% endif %}
|
||||
{% if printOptions.taxInfo %}
|
||||
<td class="center item">{{ item.tax | number_format}}</td>
|
||||
{% endif %}
|
||||
<td class="center item">{{ item.bs| number_format }}</td>
|
||||
<td class="center item">{{ item.bd| number_format }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
|
Loading…
Reference in a new issue