diff options
Diffstat (limited to 'src/sections/1_new_service.php')
-rw-r--r-- | src/sections/1_new_service.php | 53 |
1 files changed, 44 insertions, 9 deletions
diff --git a/src/sections/1_new_service.php b/src/sections/1_new_service.php index aaf441a..656b45f 100644 --- a/src/sections/1_new_service.php +++ b/src/sections/1_new_service.php | |||
@@ -130,7 +130,7 @@ function newService(): int // code de retour, si 0 retour menu principal, si 2 a | |||
130 | case ZenitySetup::$menu_enregistrement_entrees[4]: // "Prestation non vendue" | 130 | case ZenitySetup::$menu_enregistrement_entrees[4]: // "Prestation non vendue" |
131 | $Presta->setTypePresta('non_vendue'); | 131 | $Presta->setTypePresta('non_vendue'); |
132 | break; | 132 | break; |
133 | default: // inutile normallement, cas déjà géré plus haut | 133 | default: // inutile normallement, cas déjà géré avant |
134 | echo "debug: sortie du menu enregistrement incorrect\n"; | 134 | echo "debug: sortie du menu enregistrement incorrect\n"; |
135 | return(0); | 135 | return(0); |
136 | } | 136 | } |
@@ -167,14 +167,49 @@ function newService(): int // code de retour, si 0 retour menu principal, si 2 a | |||
167 | 167 | ||
168 | // -- partie 3: LaTeX -- | 168 | // -- partie 3: LaTeX -- |
169 | 169 | ||
170 | // création fichiers LaTeX et PDF | 170 | // créer le chemin et un sous-dossier avec l'année en cours |
171 | //~ $latex_path = '../data/latex/'; // noms de variables dans le config.php | 171 | $latex_year_folder = Config::$latex_path . date('Y') . '/'; |
172 | //~ $file_name = 'devis.tex'; | 172 | makeFolder($latex_year_folder); |
173 | //~ $template = 'devis'; // vaut 'devis' ou 'enveloppe_recto' ou 'enveloppe_verso' ou 'facture' ou 'location' | 173 | |
174 | //~ $latex = getLatexFromTemplate($template); | 174 | $pdf_year_folder = Config::$pdf_path . date('Y') . '/'; |
175 | //~ file_put_contents($latex_path . $file_name, $latex); // injection des variables & écriture du fichier | 175 | makeFolder($pdf_year_folder); |
176 | //~ $pdf_path = '../data/pdf/'; | 176 | |
177 | //~ latexToPdf($latex_path, $file_name, $pdf_path); | 177 | // document de la prestation |
178 | switch($choix_niv2) | ||
179 | { | ||
180 | case ZenitySetup::$menu_enregistrement_entrees[0]: // "Devis" | ||
181 | $file_name = 'devis.tex'; | ||
182 | $template = 'devis'; | ||
183 | makeLatexAndPdfDocument($file_name, $template, $Client, $Presta, $Details); | ||
184 | break; | ||
185 | case ZenitySetup::$menu_enregistrement_entrees[1]: // "Facture" | ||
186 | $file_name = 'facture.tex'; | ||
187 | $template = 'facture'; | ||
188 | makeLatexAndPdfDocument($file_name, $template, $Client, $Presta, $Details); | ||
189 | break; | ||
190 | case ZenitySetup::$menu_enregistrement_entrees[2]: // "CESU" | ||
191 | // pas de facture | ||
192 | break; | ||
193 | case ZenitySetup::$menu_enregistrement_entrees[3]: // "Location" | ||
194 | $file_name = 'location.tex'; | ||
195 | $template = 'location'; | ||
196 | makeLatexAndPdfDocument($file_name, $template, $Client, $Presta, $Details); | ||
197 | break; | ||
198 | case ZenitySetup::$menu_enregistrement_entrees[4]: // "Prestation non vendue" | ||
199 | // pas de facture | ||
200 | break; | ||
201 | default: // inutile normallement, cas déjà géré avant | ||
202 | echo "debug: sortie du menu enregistrement incorrect\n"; | ||
203 | return(0); | ||
204 | } | ||
205 | |||
206 | // enveloppe | ||
207 | $file_name = 'enveloppe_recto.tex'; | ||
208 | $template = 'enveloppe_recto'; | ||
209 | makeLatexAndPdfDocument($file_name, $template, $Client); | ||
210 | $file_name = 'enveloppe_verso.tex'; | ||
211 | $template = 'enveloppe_verso'; | ||
212 | makeLatexAndPdfDocument($file_name, $template, $Client); | ||
178 | 213 | ||
179 | 214 | ||
180 | // -- partie 4: récapitulatif -- | 215 | // -- partie 4: récapitulatif -- |