first commit
This commit is contained in:
parent
416ce7479f
commit
d8882c93b9
41
.env
41
.env
@ -1,41 +1,6 @@
|
||||
# In all environments, the following files are loaded if they exist,
|
||||
# the latter taking precedence over the former:
|
||||
#
|
||||
# * .env contains default values for the environment variables needed by the app
|
||||
# * .env.local uncommitted file with local overrides
|
||||
# * .env.$APP_ENV committed environment-specific defaults
|
||||
# * .env.$APP_ENV.local uncommitted environment-specific overrides
|
||||
#
|
||||
# Real environment variables win over .env files.
|
||||
#
|
||||
# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES.
|
||||
# https://symfony.com/doc/current/configuration/secrets.html
|
||||
#
|
||||
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).
|
||||
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration
|
||||
|
||||
###> symfony/framework-bundle ###
|
||||
APP_ENV=dev
|
||||
APP_SECRET=54728c0e8abdcd79758807c0abea30ea
|
||||
###< symfony/framework-bundle ###
|
||||
|
||||
###> doctrine/doctrine-bundle ###
|
||||
# Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
|
||||
# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml
|
||||
#
|
||||
# DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db"
|
||||
# DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=8.0.32&charset=utf8mb4"
|
||||
# DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=10.11.2-MariaDB&charset=utf8mb4"
|
||||
DATABASE_URL="postgresql://app:!ChangeMe!@127.0.0.1:5432/app?serverVersion=16&charset=utf8"
|
||||
###< doctrine/doctrine-bundle ###
|
||||
|
||||
###> symfony/messenger ###
|
||||
# Choose one of the transports below
|
||||
# MESSENGER_TRANSPORT_DSN=amqp://guest:guest@localhost:5672/%2f/messages
|
||||
# MESSENGER_TRANSPORT_DSN=redis://localhost:6379/messages
|
||||
APP_SECRET=changeme
|
||||
DATABASE_URL="mysql://user:changeme@mariadb:3306/ninecompta"
|
||||
MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0
|
||||
###< symfony/messenger ###
|
||||
|
||||
###> symfony/mailer ###
|
||||
# MAILER_DSN=null://null
|
||||
###< symfony/mailer ###
|
||||
APP_NAME=Ninecompta
|
||||
|
@ -1,10 +1,14 @@
|
||||
import './bootstrap.js';
|
||||
/*
|
||||
* Welcome to your app's main JavaScript file!
|
||||
*
|
||||
* This file will be included onto the page via the importmap() Twig function,
|
||||
* which should already be in your base.html.twig.
|
||||
*/
|
||||
|
||||
// jQuery
|
||||
import $ from 'jquery';
|
||||
window.$ = $;
|
||||
|
||||
// Bootstrap
|
||||
import 'bootstrap/dist/css/bootstrap.min.css';
|
||||
|
||||
// Local CSS
|
||||
import './styles/bootswatch.min.css'
|
||||
import './styles/app.css';
|
||||
|
||||
console.log('This log comes from assets/app.js - welcome to AssetMapper! 🎉');
|
||||
|
@ -1,3 +1,5 @@
|
||||
body {
|
||||
background-color: skyblue;
|
||||
}
|
||||
|
||||
.navbar-brand img {
|
||||
width:40px;
|
||||
margin-right:10px;
|
||||
}
|
12
assets/styles/bootswatch.min.css
vendored
Normal file
12
assets/styles/bootswatch.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -1,18 +0,0 @@
|
||||
|
||||
services:
|
||||
###> doctrine/doctrine-bundle ###
|
||||
database:
|
||||
ports:
|
||||
- "5432"
|
||||
###< doctrine/doctrine-bundle ###
|
||||
|
||||
###> symfony/mailer ###
|
||||
mailer:
|
||||
image: axllent/mailpit
|
||||
ports:
|
||||
- "1025"
|
||||
- "8025"
|
||||
environment:
|
||||
MP_SMTP_AUTH_ACCEPT_ANY: 1
|
||||
MP_SMTP_AUTH_ALLOW_INSECURE: 1
|
||||
###< symfony/mailer ###
|
54
compose.yaml
54
compose.yaml
@ -1,25 +1,41 @@
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
###> doctrine/doctrine-bundle ###
|
||||
database:
|
||||
image: postgres:${POSTGRES_VERSION:-16}-alpine
|
||||
mariadb:
|
||||
image: mariadb
|
||||
container_name: ninecompta-mariadb
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_DB: ${POSTGRES_DB:-app}
|
||||
# You should definitely change the password in production
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-!ChangeMe!}
|
||||
POSTGRES_USER: ${POSTGRES_USER:-app}
|
||||
healthcheck:
|
||||
test: ["CMD", "pg_isready", "-d", "${POSTGRES_DB:-app}", "-U", "${POSTGRES_USER:-app}"]
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
start_period: 60s
|
||||
MYSQL_ROOT_PASSWORD: changeme
|
||||
MYSQL_DATABASE: ninecompta
|
||||
MYSQL_USER: user
|
||||
MYSQL_PASSWORD: changeme
|
||||
volumes:
|
||||
- database_data:/var/lib/postgresql/data:rw
|
||||
# You may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!
|
||||
# - ./docker/db/data:/var/lib/postgresql/data:rw
|
||||
###< doctrine/doctrine-bundle ###
|
||||
- mariadb-data:/var/lib/mysql
|
||||
|
||||
ninecompta:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: ./misc/docker/Dockerfile
|
||||
container_name: ninecompta-app
|
||||
restart: unless-stopped
|
||||
image: reg.cadoles.com/envole/ninecompta
|
||||
depends_on:
|
||||
- mariadb
|
||||
env_file: .env
|
||||
ports:
|
||||
- "8008:80"
|
||||
volumes:
|
||||
- .:/app:delegated
|
||||
|
||||
adminer:
|
||||
image: adminer
|
||||
container_name: ninecompta-adminer
|
||||
restart: always
|
||||
ports:
|
||||
- 6088:8080
|
||||
|
||||
volumes:
|
||||
###> doctrine/doctrine-bundle ###
|
||||
database_data:
|
||||
###< doctrine/doctrine-bundle ###
|
||||
mariadb-data:
|
||||
|
||||
|
||||
|
@ -4,14 +4,18 @@ security:
|
||||
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: 'auto'
|
||||
# https://symfony.com/doc/current/security.html#loading-the-user-the-user-provider
|
||||
providers:
|
||||
users_in_memory: { memory: null }
|
||||
# used to reload user from session & other features (e.g. switch_user)
|
||||
app_user_provider:
|
||||
entity:
|
||||
class: App\Entity\User
|
||||
property: username
|
||||
firewalls:
|
||||
dev:
|
||||
pattern: ^/(_(profiler|wdt)|css|images|js)/
|
||||
security: false
|
||||
main:
|
||||
lazy: true
|
||||
provider: users_in_memory
|
||||
provider: app_user_provider
|
||||
|
||||
# activate different ways to authenticate
|
||||
# https://symfony.com/doc/current/security.html#the-firewall
|
||||
|
@ -1,6 +1,9 @@
|
||||
twig:
|
||||
file_name_pattern: '*.twig'
|
||||
file_name_pattern: "*.twig"
|
||||
|
||||
globals:
|
||||
appName: "%appName%"
|
||||
|
||||
when@test:
|
||||
twig:
|
||||
strict_variables: true
|
||||
twig:
|
||||
strict_variables: true
|
||||
|
@ -4,21 +4,24 @@
|
||||
# Put parameters here that don't need to change on each machine where the app is deployed
|
||||
# https://symfony.com/doc/current/best_practices.html#use-parameters-for-application-configuration
|
||||
parameters:
|
||||
appEnv: "%env(resolve:APP_ENV)%"
|
||||
appSecret: "%env(resolve:APP_SECRET)%"
|
||||
appName: "%env(resolve:APP_NAME)%"
|
||||
|
||||
services:
|
||||
# default configuration for services in *this* file
|
||||
_defaults:
|
||||
autowire: true # Automatically injects dependencies in your services.
|
||||
autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.
|
||||
# default configuration for services in *this* file
|
||||
_defaults:
|
||||
autowire: true # Automatically injects dependencies in your services.
|
||||
autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.
|
||||
|
||||
# makes classes in src/ available to be used as services
|
||||
# this creates a service per class whose id is the fully-qualified class name
|
||||
App\:
|
||||
resource: '../src/'
|
||||
exclude:
|
||||
- '../src/DependencyInjection/'
|
||||
- '../src/Entity/'
|
||||
- '../src/Kernel.php'
|
||||
# makes classes in src/ available to be used as services
|
||||
# this creates a service per class whose id is the fully-qualified class name
|
||||
App\:
|
||||
resource: "../src/"
|
||||
exclude:
|
||||
- "../src/DependencyInjection/"
|
||||
- "../src/Entity/"
|
||||
- "../src/Kernel.php"
|
||||
|
||||
# add more service definitions when explicit configuration is needed
|
||||
# please note that last definitions always *replace* previous ones
|
||||
# add more service definitions when explicit configuration is needed
|
||||
# please note that last definitions always *replace* previous ones
|
||||
|
@ -25,4 +25,11 @@ return [
|
||||
'@hotwired/turbo' => [
|
||||
'version' => '7.3.0',
|
||||
],
|
||||
'jquery' => [
|
||||
'version' => '3.7.1',
|
||||
],
|
||||
'bootstrap/dist/css/bootstrap.min.css' => [
|
||||
'version' => '5.3.3',
|
||||
'type' => 'css',
|
||||
],
|
||||
];
|
||||
|
21
misc/docker/Dockerfile
Normal file
21
misc/docker/Dockerfile
Normal file
@ -0,0 +1,21 @@
|
||||
FROM reg.cadoles.com/envole/nineapache:8.2
|
||||
|
||||
COPY ./misc/docker/apache.conf /etc/apache2/conf.d/nine/site.conf
|
||||
|
||||
RUN echo "* * * * * /app/bin/console app:Cron --env=prod" >> /var/spool/cron/crontabs/root
|
||||
|
||||
WORKDIR /app
|
||||
COPY . .
|
||||
|
||||
# Installation des dépendances composer
|
||||
RUN composer install --no-interaction
|
||||
|
||||
RUN mkdir -p /app/public/uploads
|
||||
RUN chown apache /app/public/uploads -R
|
||||
RUN chmod u+w /app/public/uploads -R
|
||||
|
||||
RUN mkdir -p /app/var
|
||||
RUN chown apache /app/var -R
|
||||
RUN chmod u+w /app/var -R
|
||||
|
||||
CMD /app/misc/script/reconfigure.sh && /etc/apache2/apache2.sh
|
19
misc/docker/apache.conf
Executable file
19
misc/docker/apache.conf
Executable file
@ -0,0 +1,19 @@
|
||||
LoadModule rewrite_module modules/mod_rewrite.so
|
||||
ServerName nineapache.local
|
||||
DocumentRoot "/app/public"
|
||||
Alias /ninefolio /app/public
|
||||
<Directory "/app/public">
|
||||
Options Indexes FollowSymLinks
|
||||
AllowOverride All
|
||||
Require all granted
|
||||
|
||||
RewriteEngine On
|
||||
RewriteCond %{REQUEST_URI}::$0 ^(/.+)/(.*)::\2$
|
||||
RewriteRule .* - [E=BASE:%1]
|
||||
RewriteCond %{HTTP:Authorization} .+
|
||||
RewriteRule ^ - [E=HTTP_AUTHORIZATION:%0]
|
||||
RewriteCond %{ENV:REDIRECT_STATUS} =""
|
||||
RewriteRule ^index\.php(?:/(.*)|$) %{ENV:BASE}/$1 [R=301,L]
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteRule ^ %{ENV:BASE}/index.php [L]
|
||||
</Directory>
|
12
misc/script/reconfigure.sh
Executable file
12
misc/script/reconfigure.sh
Executable file
@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
set -eo pipefail
|
||||
|
||||
# Se positionner sur la racine du projet
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||
cd ${DIR}
|
||||
cd ../..
|
||||
DIR=$(pwd)
|
||||
|
||||
bin/console d:s:u --force --complete
|
||||
|
||||
exec $@
|
BIN
public/medias/logo/logo.png
Normal file
BIN
public/medias/logo/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 30 KiB |
49
src/Command/InitCommand.php
Normal file
49
src/Command/InitCommand.php
Normal file
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace App\Command;
|
||||
|
||||
use Symfony\Component\Console\Attribute\AsCommand;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
|
||||
#[AsCommand(
|
||||
name: 'app:init',
|
||||
description: 'Add a short description for your command',
|
||||
)]
|
||||
class InitCommand extends Command
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
protected function configure(): void
|
||||
{
|
||||
$this
|
||||
->addArgument('arg1', InputArgument::OPTIONAL, 'Argument description')
|
||||
->addOption('option1', null, InputOption::VALUE_NONE, 'Option description')
|
||||
;
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
$io = new SymfonyStyle($input, $output);
|
||||
$arg1 = $input->getArgument('arg1');
|
||||
|
||||
if ($arg1) {
|
||||
$io->note(sprintf('You passed an argument: %s', $arg1));
|
||||
}
|
||||
|
||||
if ($input->getOption('option1')) {
|
||||
// ...
|
||||
}
|
||||
|
||||
$io->success('You have a new command! Now make it your own! Pass --help to see your options.');
|
||||
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
}
|
18
src/Controller/HomeController.php
Normal file
18
src/Controller/HomeController.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
|
||||
class HomeController extends AbstractController
|
||||
{
|
||||
#[Route('/', name: 'app_home')]
|
||||
public function index(): Response
|
||||
{
|
||||
return $this->render('home/index.html.twig', [
|
||||
'controller_name' => 'HomeController',
|
||||
]);
|
||||
}
|
||||
}
|
176
src/Entity/Accounting.php
Normal file
176
src/Entity/Accounting.php
Normal file
@ -0,0 +1,176 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\AccountingRepository;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: AccountingRepository::class)]
|
||||
class Accounting
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column]
|
||||
private ?int $id = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
private ?string $num01 = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
private ?string $num02 = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
private ?string $title = null;
|
||||
|
||||
#[ORM\Column]
|
||||
private ?bool $actif = null;
|
||||
|
||||
#[ORM\ManyToOne(inversedBy: 'accountings')]
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
private ?Company $company = null;
|
||||
|
||||
/**
|
||||
* @var Collection<int, Operation>
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: Operation::class, mappedBy: 'credit', orphanRemoval: true)]
|
||||
private Collection $credits;
|
||||
|
||||
/**
|
||||
* @var Collection<int, Operation>
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: Operation::class, mappedBy: 'debit', orphanRemoval: true)]
|
||||
private Collection $debits;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->credits = new ArrayCollection();
|
||||
$this->debits = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getNum01(): ?string
|
||||
{
|
||||
return $this->num01;
|
||||
}
|
||||
|
||||
public function setNum01(string $num01): static
|
||||
{
|
||||
$this->num01 = $num01;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getNum02(): ?string
|
||||
{
|
||||
return $this->num02;
|
||||
}
|
||||
|
||||
public function setNum02(string $num02): static
|
||||
{
|
||||
$this->num02 = $num02;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getTitle(): ?string
|
||||
{
|
||||
return $this->title;
|
||||
}
|
||||
|
||||
public function setTitle(string $title): static
|
||||
{
|
||||
$this->title = $title;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function isActif(): ?bool
|
||||
{
|
||||
return $this->actif;
|
||||
}
|
||||
|
||||
public function setActif(bool $actif): static
|
||||
{
|
||||
$this->actif = $actif;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getCompany(): ?Company
|
||||
{
|
||||
return $this->company;
|
||||
}
|
||||
|
||||
public function setCompany(?Company $company): static
|
||||
{
|
||||
$this->company = $company;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, Operation>
|
||||
*/
|
||||
public function getCredits(): Collection
|
||||
{
|
||||
return $this->credits;
|
||||
}
|
||||
|
||||
public function addCredit(Operation $credit): static
|
||||
{
|
||||
if (!$this->credits->contains($credit)) {
|
||||
$this->credits->add($credit);
|
||||
$credit->setCredit($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeCredit(Operation $credit): static
|
||||
{
|
||||
if ($this->credits->removeElement($credit)) {
|
||||
// set the owning side to null (unless already changed)
|
||||
if ($credit->getCredit() === $this) {
|
||||
$credit->setCredit(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, Operation>
|
||||
*/
|
||||
public function getDebits(): Collection
|
||||
{
|
||||
return $this->debits;
|
||||
}
|
||||
|
||||
public function addDebit(Operation $debit): static
|
||||
{
|
||||
if (!$this->debits->contains($debit)) {
|
||||
$this->debits->add($debit);
|
||||
$debit->setDebit($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeDebit(Operation $debit): static
|
||||
{
|
||||
if ($this->debits->removeElement($debit)) {
|
||||
// set the owning side to null (unless already changed)
|
||||
if ($debit->getDebit() === $this) {
|
||||
$debit->setDebit(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
263
src/Entity/Company.php
Normal file
263
src/Entity/Company.php
Normal file
@ -0,0 +1,263 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\CompanyRepository;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\DBAL\Types\Types;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: CompanyRepository::class)]
|
||||
class Company
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column]
|
||||
private ?int $id = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
private ?string $title = null;
|
||||
|
||||
#[ORM\Column(type: Types::TEXT, nullable: true)]
|
||||
private ?string $adress = null;
|
||||
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $logo = null;
|
||||
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $bankname = null;
|
||||
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $bankcode = null;
|
||||
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $bankguichet = null;
|
||||
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $banknum = null;
|
||||
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $bankkey = null;
|
||||
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $banklocality = null;
|
||||
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $bankiban = null;
|
||||
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $bankbic = null;
|
||||
|
||||
/**
|
||||
* @var Collection<int, Accounting>
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: Accounting::class, mappedBy: 'company', orphanRemoval: true)]
|
||||
private Collection $accountings;
|
||||
|
||||
/**
|
||||
* @var Collection<int, User>
|
||||
*/
|
||||
#[ORM\ManyToMany(targetEntity: User::class, mappedBy: 'companys')]
|
||||
private Collection $users;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->accountings = new ArrayCollection();
|
||||
$this->users = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getTitle(): ?string
|
||||
{
|
||||
return $this->title;
|
||||
}
|
||||
|
||||
public function setTitle(string $title): static
|
||||
{
|
||||
$this->title = $title;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getAdress(): ?string
|
||||
{
|
||||
return $this->adress;
|
||||
}
|
||||
|
||||
public function setAdress(string $adress): static
|
||||
{
|
||||
$this->adress = $adress;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getLogo(): ?string
|
||||
{
|
||||
return $this->logo;
|
||||
}
|
||||
|
||||
public function setLogo(?string $logo): static
|
||||
{
|
||||
$this->logo = $logo;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getBankname(): ?string
|
||||
{
|
||||
return $this->bankname;
|
||||
}
|
||||
|
||||
public function setBankname(?string $bankname): static
|
||||
{
|
||||
$this->bankname = $bankname;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getBankcode(): ?string
|
||||
{
|
||||
return $this->bankcode;
|
||||
}
|
||||
|
||||
public function setBankcode(?string $bankcode): static
|
||||
{
|
||||
$this->bankcode = $bankcode;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getBankguichet(): ?string
|
||||
{
|
||||
return $this->bankguichet;
|
||||
}
|
||||
|
||||
public function setBankguichet(?string $bankguichet): static
|
||||
{
|
||||
$this->bankguichet = $bankguichet;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getBanknum(): ?string
|
||||
{
|
||||
return $this->banknum;
|
||||
}
|
||||
|
||||
public function setBanknum(?string $banknum): static
|
||||
{
|
||||
$this->banknum = $banknum;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getBankkey(): ?string
|
||||
{
|
||||
return $this->bankkey;
|
||||
}
|
||||
|
||||
public function setBankkey(?string $bankkey): static
|
||||
{
|
||||
$this->bankkey = $bankkey;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getBanklocality(): ?string
|
||||
{
|
||||
return $this->banklocality;
|
||||
}
|
||||
|
||||
public function setBanklocality(?string $banklocality): static
|
||||
{
|
||||
$this->banklocality = $banklocality;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getBankiban(): ?string
|
||||
{
|
||||
return $this->bankiban;
|
||||
}
|
||||
|
||||
public function setBankiban(?string $bankiban): static
|
||||
{
|
||||
$this->bankiban = $bankiban;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getBankbic(): ?string
|
||||
{
|
||||
return $this->bankbic;
|
||||
}
|
||||
|
||||
public function setBankbic(?string $bankbic): static
|
||||
{
|
||||
$this->bankbic = $bankbic;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, Accounting>
|
||||
*/
|
||||
public function getAccountings(): Collection
|
||||
{
|
||||
return $this->accountings;
|
||||
}
|
||||
|
||||
public function addAccounting(Accounting $accounting): static
|
||||
{
|
||||
if (!$this->accountings->contains($accounting)) {
|
||||
$this->accountings->add($accounting);
|
||||
$accounting->setCompany($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeAccounting(Accounting $accounting): static
|
||||
{
|
||||
if ($this->accountings->removeElement($accounting)) {
|
||||
// set the owning side to null (unless already changed)
|
||||
if ($accounting->getCompany() === $this) {
|
||||
$accounting->setCompany(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, User>
|
||||
*/
|
||||
public function getUsers(): Collection
|
||||
{
|
||||
return $this->users;
|
||||
}
|
||||
|
||||
public function addUser(User $user): static
|
||||
{
|
||||
if (!$this->users->contains($user)) {
|
||||
$this->users->add($user);
|
||||
$user->addCompany($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeUser(User $user): static
|
||||
{
|
||||
if ($this->users->removeElement($user)) {
|
||||
$user->removeCompany($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
98
src/Entity/Operation.php
Normal file
98
src/Entity/Operation.php
Normal file
@ -0,0 +1,98 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\OperationRepository;
|
||||
use Doctrine\DBAL\Types\Types;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: OperationRepository::class)]
|
||||
class Operation
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column]
|
||||
private ?int $id = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
private ?string $title = null;
|
||||
|
||||
#[ORM\Column(type: Types::DATETIME_MUTABLE)]
|
||||
private ?\DateTimeInterface $date = null;
|
||||
|
||||
#[ORM\Column(type: Types::DECIMAL, precision: 10, scale: 2)]
|
||||
private ?string $montant = null;
|
||||
|
||||
#[ORM\ManyToOne(inversedBy: 'credits')]
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
private ?Accounting $credit = null;
|
||||
|
||||
#[ORM\ManyToOne(inversedBy: 'debits')]
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
private ?Accounting $debit = null;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getTitle(): ?string
|
||||
{
|
||||
return $this->title;
|
||||
}
|
||||
|
||||
public function setTitle(string $title): static
|
||||
{
|
||||
$this->title = $title;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getDate(): ?\DateTimeInterface
|
||||
{
|
||||
return $this->date;
|
||||
}
|
||||
|
||||
public function setDate(\DateTimeInterface $date): static
|
||||
{
|
||||
$this->date = $date;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getMontant(): ?string
|
||||
{
|
||||
return $this->montant;
|
||||
}
|
||||
|
||||
public function setMontant(string $montant): static
|
||||
{
|
||||
$this->montant = $montant;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getCredit(): ?Accounting
|
||||
{
|
||||
return $this->credit;
|
||||
}
|
||||
|
||||
public function setCredit(?Accounting $credit): static
|
||||
{
|
||||
$this->credit = $credit;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getDebit(): ?Accounting
|
||||
{
|
||||
return $this->debit;
|
||||
}
|
||||
|
||||
public function setDebit(?Accounting $debit): static
|
||||
{
|
||||
$this->debit = $debit;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
145
src/Entity/User.php
Normal file
145
src/Entity/User.php
Normal file
@ -0,0 +1,145 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\UserRepository;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
|
||||
use Symfony\Component\Security\Core\User\UserInterface;
|
||||
|
||||
#[ORM\Entity(repositoryClass: UserRepository::class)]
|
||||
#[ORM\UniqueConstraint(name: 'UNIQ_IDENTIFIER_USERNAME', fields: ['username'])]
|
||||
class User implements UserInterface, PasswordAuthenticatedUserInterface
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column]
|
||||
private ?int $id = null;
|
||||
|
||||
#[ORM\Column(length: 180)]
|
||||
private ?string $username = null;
|
||||
|
||||
/**
|
||||
* @var list<string> The user roles
|
||||
*/
|
||||
#[ORM\Column]
|
||||
private array $roles = [];
|
||||
|
||||
/**
|
||||
* @var string The hashed password
|
||||
*/
|
||||
#[ORM\Column]
|
||||
private ?string $password = null;
|
||||
|
||||
/**
|
||||
* @var Collection<int, Company>
|
||||
*/
|
||||
#[ORM\ManyToMany(targetEntity: Company::class, inversedBy: 'users')]
|
||||
private Collection $companys;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->companys = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getUsername(): ?string
|
||||
{
|
||||
return $this->username;
|
||||
}
|
||||
|
||||
public function setUsername(string $username): static
|
||||
{
|
||||
$this->username = $username;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A visual identifier that represents this user.
|
||||
*
|
||||
* @see UserInterface
|
||||
*/
|
||||
public function getUserIdentifier(): string
|
||||
{
|
||||
return (string) $this->username;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see UserInterface
|
||||
*
|
||||
* @return list<string>
|
||||
*/
|
||||
public function getRoles(): array
|
||||
{
|
||||
$roles = $this->roles;
|
||||
// guarantee every user at least has ROLE_USER
|
||||
$roles[] = 'ROLE_USER';
|
||||
|
||||
return array_unique($roles);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param list<string> $roles
|
||||
*/
|
||||
public function setRoles(array $roles): static
|
||||
{
|
||||
$this->roles = $roles;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see PasswordAuthenticatedUserInterface
|
||||
*/
|
||||
public function getPassword(): ?string
|
||||
{
|
||||
return $this->password;
|
||||
}
|
||||
|
||||
public function setPassword(string $password): static
|
||||
{
|
||||
$this->password = $password;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see UserInterface
|
||||
*/
|
||||
public function eraseCredentials(): void
|
||||
{
|
||||
// If you store any temporary, sensitive data on the user, clear it here
|
||||
// $this->plainPassword = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, Company>
|
||||
*/
|
||||
public function getCompanys(): Collection
|
||||
{
|
||||
return $this->companys;
|
||||
}
|
||||
|
||||
public function addCompany(Company $company): static
|
||||
{
|
||||
if (!$this->companys->contains($company)) {
|
||||
$this->companys->add($company);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeCompany(Company $company): static
|
||||
{
|
||||
$this->companys->removeElement($company);
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
43
src/Repository/AccountingRepository.php
Normal file
43
src/Repository/AccountingRepository.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\Accounting;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @extends ServiceEntityRepository<Accounting>
|
||||
*/
|
||||
class AccountingRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, Accounting::class);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return Accounting[] Returns an array of Accounting objects
|
||||
// */
|
||||
// public function findByExampleField($value): array
|
||||
// {
|
||||
// return $this->createQueryBuilder('a')
|
||||
// ->andWhere('a.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->orderBy('a.id', 'ASC')
|
||||
// ->setMaxResults(10)
|
||||
// ->getQuery()
|
||||
// ->getResult()
|
||||
// ;
|
||||
// }
|
||||
|
||||
// public function findOneBySomeField($value): ?Accounting
|
||||
// {
|
||||
// return $this->createQueryBuilder('a')
|
||||
// ->andWhere('a.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->getQuery()
|
||||
// ->getOneOrNullResult()
|
||||
// ;
|
||||
// }
|
||||
}
|
43
src/Repository/CompanyRepository.php
Normal file
43
src/Repository/CompanyRepository.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\Company;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @extends ServiceEntityRepository<Company>
|
||||
*/
|
||||
class CompanyRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, Company::class);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return Company[] Returns an array of Company objects
|
||||
// */
|
||||
// public function findByExampleField($value): array
|
||||
// {
|
||||
// return $this->createQueryBuilder('c')
|
||||
// ->andWhere('c.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->orderBy('c.id', 'ASC')
|
||||
// ->setMaxResults(10)
|
||||
// ->getQuery()
|
||||
// ->getResult()
|
||||
// ;
|
||||
// }
|
||||
|
||||
// public function findOneBySomeField($value): ?Company
|
||||
// {
|
||||
// return $this->createQueryBuilder('c')
|
||||
// ->andWhere('c.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->getQuery()
|
||||
// ->getOneOrNullResult()
|
||||
// ;
|
||||
// }
|
||||
}
|
43
src/Repository/OperationRepository.php
Normal file
43
src/Repository/OperationRepository.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\Operation;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @extends ServiceEntityRepository<Operation>
|
||||
*/
|
||||
class OperationRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, Operation::class);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return Operation[] Returns an array of Operation objects
|
||||
// */
|
||||
// public function findByExampleField($value): array
|
||||
// {
|
||||
// return $this->createQueryBuilder('o')
|
||||
// ->andWhere('o.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->orderBy('o.id', 'ASC')
|
||||
// ->setMaxResults(10)
|
||||
// ->getQuery()
|
||||
// ->getResult()
|
||||
// ;
|
||||
// }
|
||||
|
||||
// public function findOneBySomeField($value): ?Operation
|
||||
// {
|
||||
// return $this->createQueryBuilder('o')
|
||||
// ->andWhere('o.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->getQuery()
|
||||
// ->getOneOrNullResult()
|
||||
// ;
|
||||
// }
|
||||
}
|
60
src/Repository/UserRepository.php
Normal file
60
src/Repository/UserRepository.php
Normal file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\User;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
use Symfony\Component\Security\Core\Exception\UnsupportedUserException;
|
||||
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
|
||||
use Symfony\Component\Security\Core\User\PasswordUpgraderInterface;
|
||||
|
||||
/**
|
||||
* @extends ServiceEntityRepository<User>
|
||||
*/
|
||||
class UserRepository extends ServiceEntityRepository implements PasswordUpgraderInterface
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, User::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to upgrade (rehash) the user's password automatically over time.
|
||||
*/
|
||||
public function upgradePassword(PasswordAuthenticatedUserInterface $user, string $newHashedPassword): void
|
||||
{
|
||||
if (!$user instanceof User) {
|
||||
throw new UnsupportedUserException(sprintf('Instances of "%s" are not supported.', $user::class));
|
||||
}
|
||||
|
||||
$user->setPassword($newHashedPassword);
|
||||
$this->getEntityManager()->persist($user);
|
||||
$this->getEntityManager()->flush();
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return User[] Returns an array of User objects
|
||||
// */
|
||||
// public function findByExampleField($value): array
|
||||
// {
|
||||
// return $this->createQueryBuilder('u')
|
||||
// ->andWhere('u.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->orderBy('u.id', 'ASC')
|
||||
// ->setMaxResults(10)
|
||||
// ->getQuery()
|
||||
// ->getResult()
|
||||
// ;
|
||||
// }
|
||||
|
||||
// public function findOneBySomeField($value): ?User
|
||||
// {
|
||||
// return $this->createQueryBuilder('u')
|
||||
// ->andWhere('u.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->getQuery()
|
||||
// ->getOneOrNullResult()
|
||||
// ;
|
||||
// }
|
||||
}
|
@ -12,6 +12,44 @@
|
||||
{% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
{% block body %}{% endblock %}
|
||||
<nav class="navbar navbar-expand-lg bg-dark" data-bs-theme="dark">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" href="#"><img src="{{asset("medias/logo/logo.png")}}"> {{appName}}</a>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarColor02" aria-controls="navbarColor02" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarColor02">
|
||||
<ul class="navbar-nav me-auto">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" href="#">Home
|
||||
<span class="visually-hidden">(current)</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Features</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Pricing</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">About</a>
|
||||
</li>
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">Dropdown</a>
|
||||
<div class="dropdown-menu">
|
||||
<a class="dropdown-item" href="#">Action</a>
|
||||
<a class="dropdown-item" href="#">Another action</a>
|
||||
<a class="dropdown-item" href="#">Something else here</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item" href="#">Separated link</a>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
{% block body %}
|
||||
{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
|
20
templates/home/index.html.twig
Normal file
20
templates/home/index.html.twig
Normal file
@ -0,0 +1,20 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Hello HomeController!{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<style>
|
||||
.example-wrapper { margin: 1em auto; max-width: 800px; width: 95%; font: 18px/1.5 sans-serif; }
|
||||
.example-wrapper code { background: #F5F5F5; padding: 2px 6px; }
|
||||
</style>
|
||||
|
||||
<div class="example-wrapper">
|
||||
<h1>Hello {{ controller_name }}! ✅</h1>
|
||||
|
||||
This friendly message is coming from:
|
||||
<ul>
|
||||
<li>Your controller at <code>/home/afornerot/cadoles/nine-project/ninecompta/src/Controller/HomeController.php</code></li>
|
||||
<li>Your template at <code>/home/afornerot/cadoles/nine-project/ninecompta/templates/home/index.html.twig</code></li>
|
||||
</ul>
|
||||
</div>
|
||||
{% endblock %}
|
Loading…
Reference in New Issue
Block a user