diff options
Diffstat (limited to 'src/sections/2_service.php')
| -rw-r--r-- | src/sections/2_service.php | 62 |
1 files changed, 42 insertions, 20 deletions
diff --git a/src/sections/2_service.php b/src/sections/2_service.php index 8109b31..2680db6 100644 --- a/src/sections/2_service.php +++ b/src/sections/2_service.php | |||
| @@ -13,7 +13,7 @@ function newService($Client): array // $Client est un Client ou null | |||
| 13 | $FormulaireCesu = new ZenityForms(ZenitySetup::$formulaire_text, ZenitySetup::$formulaire_cesu_entrees); | 13 | $FormulaireCesu = new ZenityForms(ZenitySetup::$formulaire_text, ZenitySetup::$formulaire_cesu_entrees); |
| 14 | $FormulaireLocation = new ZenityForms(ZenitySetup::$formulaire_text, ZenitySetup::$formulaire_location_entrees); | 14 | $FormulaireLocation = new ZenityForms(ZenitySetup::$formulaire_text, ZenitySetup::$formulaire_location_entrees); |
| 15 | $CommentairePrestation = new ZenityEntry(ZenitySetup::$commentaire_prestation_text); | 15 | $CommentairePrestation = new ZenityEntry(ZenitySetup::$commentaire_prestation_text); |
| 16 | $Recapitulatif = new ZenityList(ZenitySetup::$recapitulatif_text, ZenitySetup::$recapitulatif_entrees); // tableau à multiples colonnes | 16 | //$Recapitulatif = new ZenityList(ZenitySetup::$recapitulatif_text, ZenitySetup::$recapitulatif_entrees); // tableau à multiples colonnes |
| 17 | //$QuestionModifierPrestation = new ZenityQuestion(ZenitySetup::$question_modification_text); | 17 | //$QuestionModifierPrestation = new ZenityQuestion(ZenitySetup::$question_modification_text); |
| 18 | $FinSection2 = new ZenityList(ZenitySetup::$fin_section_2_text, ZenitySetup::$fin_section_2_entrees); | 18 | $FinSection2 = new ZenityList(ZenitySetup::$fin_section_2_text, ZenitySetup::$fin_section_2_entrees); |
| 19 | 19 | ||
| @@ -32,7 +32,7 @@ function newService($Client): array // $Client est un Client ou null | |||
| 32 | 32 | ||
| 33 | // -- partie 2: la prestation -- | 33 | // -- partie 2: la prestation -- |
| 34 | 34 | ||
| 35 | // niveau 2: type comptable d'enregistrement: devis, facture, cesu, location ou pas de prestation | 35 | // niveau 2: type comptable d'enregistrement: devis, facture, cesu, location ou prestation non vendue |
| 36 | $choix_niv2 = exec($MenuEnregistrement->get()); | 36 | $choix_niv2 = exec($MenuEnregistrement->get()); |
| 37 | if($choix_niv2 === '') | 37 | if($choix_niv2 === '') |
| 38 | { | 38 | { |
| @@ -40,9 +40,6 @@ function newService($Client): array // $Client est un Client ou null | |||
| 40 | return [0, null]; // menu principal | 40 | return [0, null]; // menu principal |
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | $Presta = new Prestations($Client->getID()); | ||
| 44 | |||
| 45 | // détail de la prestation | ||
| 46 | // calendrier - étape 1/3 | 43 | // calendrier - étape 1/3 |
| 47 | $Date = new Dates(exec($Calendrier->get())); // exec() renvoie soit une chaîne soit un false | 44 | $Date = new Dates(exec($Calendrier->get())); // exec() renvoie soit une chaîne soit un false |
| 48 | if($Date->getDate() == '') // on n'a pas cliqué sur "annuler" | 45 | if($Date->getDate() == '') // on n'a pas cliqué sur "annuler" |
| @@ -51,32 +48,56 @@ function newService($Client): array // $Client est un Client ou null | |||
| 51 | return [0, null]; // menu principal | 48 | return [0, null]; // menu principal |
| 52 | } | 49 | } |
| 53 | 50 | ||
| 51 | $Presta = new Prestations($Client->getID()); | ||
| 54 | $Presta->setDate($Date->getTimestamp()); // un entier pour la BDD | 52 | $Presta->setDate($Date->getTimestamp()); // un entier pour la BDD |
| 55 | 53 | ||
| 54 | // formulaire - étape 2/3 | ||
| 56 | switch($choix_niv2) | 55 | switch($choix_niv2) |
| 57 | { | 56 | { |
| 58 | // formulaire - étape 2/3 | 57 | // comparaison retour de $MenuEnregistrement->get() avec les noms des entrées du même menu |
| 59 | //~ case ZenitySetup::$menu_enregistrement_entrees[0]: // "Devis" | 58 | case ZenitySetup::$menu_enregistrement_entrees[0]: // "Devis" |
| 60 | //~ $PrestaDetails = new DevisFactures('devis'); | 59 | $PrestaDetails = new DevisFactures('devis'); |
| 61 | //~ $Presta->setTypePresta('devis'); | 60 | $Presta->setTypePresta('devis'); |
| 62 | //~ $input = exec($FormulaireDevis->get()); | 61 | $input = exec($FormulaireDevis->get()); |
| 63 | //~ break; | 62 | break; |
| 64 | case ZenitySetup::$menu_enregistrement_entrees[0]: // "Facture" | 63 | case ZenitySetup::$menu_enregistrement_entrees[1]: // "Facture" |
| 65 | $PrestaDetails = new DevisFactures('factures'); // 'factures' est le nom de la table, pas le type de presta | 64 | $PrestaDetails = new DevisFactures('factures'); |
| 66 | $Presta->setTypePresta('facture'); | 65 | $Presta->setTypePresta('facture'); |
| 67 | $input =exec($FormulaireFacture->get()); | 66 | $input =exec($FormulaireFacture->get()); |
| 68 | break; | 67 | break; |
| 69 | case ZenitySetup::$menu_enregistrement_entrees[1]: // "CESU" | 68 | |
| 69 | //~ case ZenitySetup::$menu_enregistrement_entrees[2]: // "Facture à partir d'un devis" | ||
| 70 | //~ $PrestaDetails = new DevisFactures('facture'); | ||
| 71 | //~ $Presta->setTypePresta('facture'); | ||
| 72 | // 1 choix d'un devis | ||
| 73 | //makeObjectService(); // liste les devis existants pour ce client | ||
| 74 | // | ||
| 75 | // 2 hydratation | ||
| 76 | // | ||
| 77 | // 3 préremplissage du formulaire | ||
| 78 | //$FormulaireFacture->set($Data) | ||
| 79 | // | ||
| 80 | // et plus loin: | ||
| 81 | // 4 édition de la facture | ||
| 82 | //$input = exec($FormulaireFacture->get()); | ||
| 83 | // | ||
| 84 | // 5 hydratation avec les changements | ||
| 85 | // | ||
| 86 | //echo $FormulaireFacture->get() . "\n"; | ||
| 87 | //~ $input = exec($FormulaireFacture->get()); | ||
| 88 | //~ break; | ||
| 89 | |||
| 90 | case ZenitySetup::$menu_enregistrement_entrees[3]: // "CESU" | ||
| 70 | $PrestaDetails = new CESU(); | 91 | $PrestaDetails = new CESU(); |
| 71 | $Presta->setTypePresta('cesu'); | 92 | $Presta->setTypePresta('cesu'); |
| 72 | $input = exec($FormulaireCesu->get()); | 93 | $input = exec($FormulaireCesu->get()); |
| 73 | break; | 94 | break; |
| 74 | case ZenitySetup::$menu_enregistrement_entrees[2]: // "Location" | 95 | case ZenitySetup::$menu_enregistrement_entrees[4]: // "Location" |
| 75 | $PrestaDetails = new Locations(); | 96 | $PrestaDetails = new Locations(); |
| 76 | $Presta->setTypePresta('location'); | 97 | $Presta->setTypePresta('location'); |
| 77 | $input = exec($FormulaireLocation->get()); | 98 | $input = exec($FormulaireLocation->get()); |
| 78 | break; | 99 | break; |
| 79 | case ZenitySetup::$menu_enregistrement_entrees[3]: // "Prestation non vendue" | 100 | case ZenitySetup::$menu_enregistrement_entrees[5]: // "Prestation non vendue" |
| 80 | $Presta->setTypePresta('non_vendue'); | 101 | $Presta->setTypePresta('non_vendue'); |
| 81 | break; | 102 | break; |
| 82 | default: // inutile normallement, cas déjà géré avant | 103 | default: // inutile normallement, cas déjà géré avant |
| @@ -86,7 +107,8 @@ function newService($Client): array // $Client est un Client ou null | |||
| 86 | 107 | ||
| 87 | $Presta->makeCodePresta($Date, $Client->getCodeClient()); // d'un objet à l'autre | 108 | $Presta->makeCodePresta($Date, $Client->getCodeClient()); // d'un objet à l'autre |
| 88 | 109 | ||
| 89 | if($choix_niv2 != ZenitySetup::$menu_enregistrement_entrees[3]) // si presta non vendue, saut étape 3/3 | 110 | // hydratation ou saut étape 3/3 si presta non vendu |
| 111 | if($choix_niv2 != ZenitySetup::$menu_enregistrement_entrees[5]) | ||
| 90 | { | 112 | { |
| 91 | if($input == '') // annulation | 113 | if($input == '') // annulation |
| 92 | { | 114 | { |
| @@ -154,9 +176,9 @@ function newService($Client): array // $Client est un Client ou null | |||
| 154 | //~ {} | 176 | //~ {} |
| 155 | 177 | ||
| 156 | // fabrique d'objets (sans connaître les noms des classes) | 178 | // fabrique d'objets (sans connaître les noms des classes) |
| 157 | $EnveloppeRecto = Latex::makeLatexSubClass('enveloppe_recto'); | 179 | $EnveloppeRecto = Latex::makeInstance('enveloppe_recto'); |
| 158 | $EnveloppeVerso = Latex::makeLatexSubClass('enveloppe_verso'); | 180 | $EnveloppeVerso = Latex::makeInstance('enveloppe_verso'); |
| 159 | $DocumentPresta = Latex::makeLatexSubClass($Presta->getTypePresta()); // $type = facture, devis, location | 181 | $DocumentPresta = Latex::makeInstance($Presta->getTypePresta()); // $type = facture, devis, location |
| 160 | 182 | ||
| 161 | // génération du latex | 183 | // génération du latex |
| 162 | $EnveloppeRecto->setData($Client); | 184 | $EnveloppeRecto->setData($Client); |
