This commit is contained in:
babak alizadeh 2024-10-22 17:32:13 +03:30
commit 2b2abff420
8 changed files with 301 additions and 1 deletions

View file

@ -165,7 +165,7 @@ class ArchiveController extends AbstractController
} else { } else {
if(array_key_exists('code',$result['data'])){ if(array_key_exists('code',$result['data'])){
if ($result['data']['code'] == 100) { if ($result['data']['code'] == 100) {
$req->setStatus($request->get('Status')); $req->setStatus(100);
$req->setRefID($result['data']['ref_id']); $req->setRefID($result['data']['ref_id']);
$req->setCardPan($result['data']['card_pan']); $req->setCardPan($result['data']['card_pan']);
$req->setExpireDate(time() + ($req->getMonth() * 30 * 24 * 60 * 60)); $req->setExpireDate(time() + ($req->getMonth() * 30 * 24 * 60 * 60));

View file

@ -86,6 +86,12 @@ class Commodity
#[ORM\OneToMany(mappedBy: 'commodity', targetEntity: PriceListDetail::class, orphanRemoval: true)] #[ORM\OneToMany(mappedBy: 'commodity', targetEntity: PriceListDetail::class, orphanRemoval: true)]
private Collection $priceListDetails; private Collection $priceListDetails;
/**
* @var Collection<int, PreInvoiceItem>
*/
#[ORM\OneToMany(mappedBy: 'commodity', targetEntity: PreInvoiceItem::class, orphanRemoval: true)]
private Collection $preInvoiceItems;
public function __construct() public function __construct()
{ {
$this->setPriceBuy(0); $this->setPriceBuy(0);
@ -95,6 +101,7 @@ class Commodity
$this->storeroomItems = new ArrayCollection(); $this->storeroomItems = new ArrayCollection();
$this->plugRepserviceOrders = new ArrayCollection(); $this->plugRepserviceOrders = new ArrayCollection();
$this->priceListDetails = new ArrayCollection(); $this->priceListDetails = new ArrayCollection();
$this->preInvoiceItems = new ArrayCollection();
} }
public function getId(): ?int public function getId(): ?int
@ -443,4 +450,34 @@ class Commodity
return $this; return $this;
} }
/**
* @return Collection<int, PreInvoiceItem>
*/
public function getPreInvoiceItems(): Collection
{
return $this->preInvoiceItems;
}
public function addPreInvoiceItem(PreInvoiceItem $preInvoiceItem): static
{
if (!$this->preInvoiceItems->contains($preInvoiceItem)) {
$this->preInvoiceItems->add($preInvoiceItem);
$preInvoiceItem->setCommodity($this);
}
return $this;
}
public function removePreInvoiceItem(PreInvoiceItem $preInvoiceItem): static
{
if ($this->preInvoiceItems->removeElement($preInvoiceItem)) {
// set the owning side to null (unless already changed)
if ($preInvoiceItem->getCommodity() === $this) {
$preInvoiceItem->setCommodity(null);
}
}
return $this;
}
} }

View file

@ -131,6 +131,12 @@ class Person
#[ORM\OneToMany(mappedBy: 'person', targetEntity: PlugRepserviceOrder::class, orphanRemoval: true)] #[ORM\OneToMany(mappedBy: 'person', targetEntity: PlugRepserviceOrder::class, orphanRemoval: true)]
private Collection $plugRepserviceOrders; private Collection $plugRepserviceOrders;
/**
* @var Collection<int, PreInvoiceDoc>
*/
#[ORM\OneToMany(mappedBy: 'person', targetEntity: PreInvoiceDoc::class, orphanRemoval: true)]
private Collection $preInvoiceDocs;
public function __construct() public function __construct()
{ {
$this->hesabdariRows = new ArrayCollection(); $this->hesabdariRows = new ArrayCollection();
@ -142,6 +148,7 @@ class Person
$this->type = new ArrayCollection(); $this->type = new ArrayCollection();
$this->personCards = new ArrayCollection(); $this->personCards = new ArrayCollection();
$this->plugRepserviceOrders = new ArrayCollection(); $this->plugRepserviceOrders = new ArrayCollection();
$this->preInvoiceDocs = new ArrayCollection();
} }
public function getId(): ?int public function getId(): ?int
@ -736,4 +743,34 @@ class Person
return $this; return $this;
} }
/**
* @return Collection<int, PreInvoiceDoc>
*/
public function getPreInvoiceDocs(): Collection
{
return $this->preInvoiceDocs;
}
public function addPreInvoiceDoc(PreInvoiceDoc $preInvoiceDoc): static
{
if (!$this->preInvoiceDocs->contains($preInvoiceDoc)) {
$this->preInvoiceDocs->add($preInvoiceDoc);
$preInvoiceDoc->setPerson($this);
}
return $this;
}
public function removePreInvoiceDoc(PreInvoiceDoc $preInvoiceDoc): static
{
if ($this->preInvoiceDocs->removeElement($preInvoiceDoc)) {
// set the owning side to null (unless already changed)
if ($preInvoiceDoc->getPerson() === $this) {
$preInvoiceDoc->setPerson(null);
}
}
return $this;
}
} }

View file

@ -0,0 +1,67 @@
<?php
namespace App\Entity;
use App\Repository\PreInvoiceDocRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: PreInvoiceDocRepository::class)]
class PreInvoiceDoc
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\ManyToOne(inversedBy: 'preInvoiceDocs')]
#[ORM\JoinColumn(nullable: false)]
private ?User $submitter = null;
#[ORM\Column(length: 100)]
private ?string $code = null;
#[ORM\ManyToOne(inversedBy: 'preInvoiceDocs')]
#[ORM\JoinColumn(nullable: false)]
private ?Person $person = 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 getCode(): ?string
{
return $this->code;
}
public function setCode(string $code): static
{
$this->code = $code;
return $this;
}
public function getPerson(): ?Person
{
return $this->person;
}
public function setPerson(?Person $person): static
{
$this->person = $person;
return $this;
}
}

View file

@ -0,0 +1,36 @@
<?php
namespace App\Entity;
use App\Repository\PreInvoiceItemRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: PreInvoiceItemRepository::class)]
class PreInvoiceItem
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\ManyToOne(inversedBy: 'preInvoiceItems')]
#[ORM\JoinColumn(nullable: false)]
private ?Commodity $commodity = null;
public function getId(): ?int
{
return $this->id;
}
public function getCommodity(): ?Commodity
{
return $this->commodity;
}
public function setCommodity(?Commodity $commodity): static
{
$this->commodity = $commodity;
return $this;
}
}

View file

@ -113,6 +113,12 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
#[ORM\OneToMany(mappedBy: 'submitter', targetEntity: Note::class, orphanRemoval: true)] #[ORM\OneToMany(mappedBy: 'submitter', targetEntity: Note::class, orphanRemoval: true)]
private Collection $notes; private Collection $notes;
/**
* @var Collection<int, PreInvoiceDoc>
*/
#[ORM\OneToMany(mappedBy: 'submitter', targetEntity: PreInvoiceDoc::class, orphanRemoval: true)]
private Collection $preInvoiceDocs;
public function __construct() public function __construct()
{ {
$this->userTokens = new ArrayCollection(); $this->userTokens = new ArrayCollection();
@ -137,6 +143,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
$this->mostDes = new ArrayCollection(); $this->mostDes = new ArrayCollection();
$this->plugRepserviceOrders = new ArrayCollection(); $this->plugRepserviceOrders = new ArrayCollection();
$this->notes = new ArrayCollection(); $this->notes = new ArrayCollection();
$this->preInvoiceDocs = new ArrayCollection();
} }
public function getId(): ?int public function getId(): ?int
@ -940,4 +947,34 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
return $this; return $this;
} }
/**
* @return Collection<int, PreInvoiceDoc>
*/
public function getPreInvoiceDocs(): Collection
{
return $this->preInvoiceDocs;
}
public function addPreInvoiceDoc(PreInvoiceDoc $preInvoiceDoc): static
{
if (!$this->preInvoiceDocs->contains($preInvoiceDoc)) {
$this->preInvoiceDocs->add($preInvoiceDoc);
$preInvoiceDoc->setSubmitter($this);
}
return $this;
}
public function removePreInvoiceDoc(PreInvoiceDoc $preInvoiceDoc): static
{
if ($this->preInvoiceDocs->removeElement($preInvoiceDoc)) {
// set the owning side to null (unless already changed)
if ($preInvoiceDoc->getSubmitter() === $this) {
$preInvoiceDoc->setSubmitter(null);
}
}
return $this;
}
} }

View file

@ -0,0 +1,43 @@
<?php
namespace App\Repository;
use App\Entity\PreInvoiceDoc;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<PreInvoiceDoc>
*/
class PreInvoiceDocRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, PreInvoiceDoc::class);
}
// /**
// * @return PreInvoiceDoc[] Returns an array of PreInvoiceDoc objects
// */
// public function findByExampleField($value): array
// {
// return $this->createQueryBuilder('p')
// ->andWhere('p.exampleField = :val')
// ->setParameter('val', $value)
// ->orderBy('p.id', 'ASC')
// ->setMaxResults(10)
// ->getQuery()
// ->getResult()
// ;
// }
// public function findOneBySomeField($value): ?PreInvoiceDoc
// {
// return $this->createQueryBuilder('p')
// ->andWhere('p.exampleField = :val')
// ->setParameter('val', $value)
// ->getQuery()
// ->getOneOrNullResult()
// ;
// }
}

View file

@ -0,0 +1,43 @@
<?php
namespace App\Repository;
use App\Entity\PreInvoiceItem;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<PreInvoiceItem>
*/
class PreInvoiceItemRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, PreInvoiceItem::class);
}
// /**
// * @return PreInvoiceItem[] Returns an array of PreInvoiceItem objects
// */
// public function findByExampleField($value): array
// {
// return $this->createQueryBuilder('p')
// ->andWhere('p.exampleField = :val')
// ->setParameter('val', $value)
// ->orderBy('p.id', 'ASC')
// ->setMaxResults(10)
// ->getQuery()
// ->getResult()
// ;
// }
// public function findOneBySomeField($value): ?PreInvoiceItem
// {
// return $this->createQueryBuilder('p')
// ->andWhere('p.exampleField = :val')
// ->setParameter('val', $value)
// ->getQuery()
// ->getOneOrNullResult()
// ;
// }
}