svg
This commit is contained in:
@ -24,11 +24,11 @@ class Accounting
|
||||
#[ORM\Column(length: 255)]
|
||||
private ?string $title = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $icon = null;
|
||||
|
||||
#[ORM\Column]
|
||||
private ?bool $actif = null;
|
||||
#[ORM\Column(length: 255)]
|
||||
private ?string $category = null;
|
||||
|
||||
#[ORM\ManyToOne(inversedBy: 'accountings')]
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
@ -98,21 +98,21 @@ class Accounting
|
||||
return $this->icon;
|
||||
}
|
||||
|
||||
public function setIcon(string $icon): static
|
||||
public function setIcon(?string $icon): static
|
||||
{
|
||||
$this->icon = $icon;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function isActif(): ?bool
|
||||
public function getCategory(): ?string
|
||||
{
|
||||
return $this->actif;
|
||||
return $this->category;
|
||||
}
|
||||
|
||||
public function setActif(bool $actif): static
|
||||
public function setCategory(string $category): static
|
||||
{
|
||||
$this->actif = $actif;
|
||||
$this->category = $category;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ class Company
|
||||
return $this->adress;
|
||||
}
|
||||
|
||||
public function setAdress(string $adress): static
|
||||
public function setAdress(?string $adress): static
|
||||
{
|
||||
$this->adress = $adress;
|
||||
|
||||
@ -260,4 +260,5 @@ class Company
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -95,4 +95,5 @@ class Operation
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -27,15 +27,15 @@ class CompanySubscriber
|
||||
$entityManager = $args->getObjectManager();
|
||||
|
||||
// Génération des accounting par défaut
|
||||
$this->insertAccounting($company,"512","000","Banque",true);
|
||||
$this->insertAccounting($company,"530","000","Caisse",true);
|
||||
$this->insertAccounting($company,"600","000","Charge",false);
|
||||
$this->insertAccounting($company,"700","000","Produit",false);
|
||||
$this->insertAccounting($company,"512","000","Banque","actif","fa-building-columns");
|
||||
$this->insertAccounting($company,"530","000","Caisse","actif","fa-piggy-bank");
|
||||
$this->insertAccounting($company,"600","000","Charge","charge",null);
|
||||
$this->insertAccounting($company,"700","000","Produit","produit",null);
|
||||
|
||||
// Génération du year par
|
||||
}
|
||||
|
||||
private function insertAccounting(Company $company,string $num01, string $num02, string $title, bool $isactif): void
|
||||
private function insertAccounting(Company $company,string $num01, string $num02, string $title, string $category, ?string $icon): void
|
||||
{
|
||||
$accounting=$this->em->getRepository("App\Entity\Accounting")->findOneBy(["company"=>$company,"num01"=>$num01,"num02"=>$num02]);
|
||||
if(!$accounting) {
|
||||
@ -44,7 +44,7 @@ class CompanySubscriber
|
||||
$accounting->setNum01($num01);
|
||||
$accounting->setNum02($num02);
|
||||
$accounting->setTitle($title);
|
||||
$accounting->SetActif($isactif);
|
||||
$accounting->SetCategory($category);
|
||||
$this->em->persist($accounting);
|
||||
$this->em->flush();
|
||||
}
|
||||
|
Reference in New Issue
Block a user