diff options
| author | polo <ordipolo@gmx.fr> | 2023-07-04 15:52:55 +0200 |
|---|---|---|
| committer | polo <ordipolo@gmx.fr> | 2023-07-04 15:52:55 +0200 |
| commit | 884493c1fb985adaaa537c11f4350d940cc68cb1 (patch) | |
| tree | 0f69be88efac2577ed0c203e094b08dcbda1af96 /src/Latex.php | |
| parent | 22b941b3526dd3aaf6976eb4ed30aa2ecc30f921 (diff) | |
| download | AppliGestionPHP-884493c1fb985adaaa537c11f4350d940cc68cb1.tar.gz AppliGestionPHP-884493c1fb985adaaa537c11f4350d940cc68cb1.tar.bz2 AppliGestionPHP-884493c1fb985adaaa537c11f4350d940cc68cb1.zip | |
fonctions fichiers séparées
Diffstat (limited to 'src/Latex.php')
| -rw-r--r-- | src/Latex.php | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/src/Latex.php b/src/Latex.php index 9ae9435..a766fd6 100644 --- a/src/Latex.php +++ b/src/Latex.php | |||
| @@ -9,6 +9,30 @@ abstract class Latex | |||
| 9 | protected $latexPath = ''; | 9 | protected $latexPath = ''; |
| 10 | protected $pdfPath = ''; | 10 | protected $pdfPath = ''; |
| 11 | 11 | ||
| 12 | static function makeLatexSubClass(string $type): Object | ||
| 13 | { | ||
| 14 | switch($type) | ||
| 15 | { | ||
| 16 | // documents pour les clients | ||
| 17 | case 'devis': | ||
| 18 | return new DevisLatex(); | ||
| 19 | case 'facture': | ||
| 20 | return new FactireLatex(); | ||
| 21 | case 'location': | ||
| 22 | return new LocationLatex(); | ||
| 23 | case 'enveloppe_recto': | ||
| 24 | return new EnveloppeRectoLatex(); | ||
| 25 | case 'enveloppe_verso': | ||
| 26 | return new EnveloppeVersoLatex(); | ||
| 27 | |||
| 28 | // documents pour la compta | ||
| 29 | |||
| 30 | // erreur | ||
| 31 | default: | ||
| 32 | echo 'erreur, la sous-classe latex à initialiser n\'existe pas'; | ||
| 33 | } | ||
| 34 | } | ||
| 35 | |||
| 12 | protected function createFile(string $latex, string $fileName, string $latexPath) | 36 | protected function createFile(string $latex, string $fileName, string $latexPath) |
| 13 | { | 37 | { |
| 14 | // nom du fichier créé = nom.tex | 38 | // nom du fichier créé = nom.tex |
| @@ -24,6 +48,7 @@ abstract class Latex | |||
| 24 | } | 48 | } |
| 25 | 49 | ||
| 26 | 50 | ||
| 51 | |||
| 27 | abstract class PrestaLatex extends Latex | 52 | abstract class PrestaLatex extends Latex |
| 28 | { | 53 | { |
| 29 | public function __construct(string $quoi, string $codePresta) | 54 | public function __construct(string $quoi, string $codePresta) |
| @@ -38,21 +63,23 @@ abstract class PrestaLatex extends Latex | |||
| 38 | } | 63 | } |
| 39 | } | 64 | } |
| 40 | 65 | ||
| 66 | //~ class PrestaClassFactory extends PrestaLatex | ||
| 67 | //~ {} | ||
| 68 | |||
| 41 | class DevisLatex extends PrestaLatex | 69 | class DevisLatex extends PrestaLatex |
| 42 | {} | 70 | {} |
| 43 | |||
| 44 | class FactureLatex extends PrestaLatex | 71 | class FactureLatex extends PrestaLatex |
| 45 | {} | 72 | {} |
| 46 | |||
| 47 | class LocationLatex extends PrestaLatex | 73 | class LocationLatex extends PrestaLatex |
| 48 | {} | 74 | {} |
| 49 | 75 | ||
| 50 | class EnveloppeRectoLatex extends PrestaLatex | 76 | class EnveloppeRectoLatex// extends PrestaLatex |
| 51 | {} | 77 | {} |
| 52 | class EnveloppeVersoLatex extends PrestaLatex | 78 | class EnveloppeVersoLatex// extends PrestaLatex |
| 53 | {} | 79 | {} |
| 54 | 80 | ||
| 55 | 81 | ||
| 82 | |||
| 56 | abstract class ComptaLatex extends Latex | 83 | abstract class ComptaLatex extends Latex |
| 57 | { | 84 | { |
| 58 | public function __construct(string $quoi, string $annee, int $numeroMois = 0) | 85 | public function __construct(string $quoi, string $annee, int $numeroMois = 0) |
