validation1.tpl.php 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <?php
  2. /* Copyright (C) 2007-2008 Jeremie Ollivier <jeremie.o@laposte.net>
  3. * Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  17. */
  18. // Protection to avoid direct call of template
  19. if (empty($langs) || !is_object($langs))
  20. {
  21. print "Error, template page can't be called as URL";
  22. exit;
  23. }
  24. // Load translation files required by the page
  25. $langs->loadLangs(array("main", "bills", "banks"));
  26. // Object $form must de defined
  27. ?>
  28. <fieldset class="cadre_facturation"><legend class="titre1"><?php echo $langs->trans("Summary"); ?></legend>
  29. <table class="table_resume">
  30. <tr><td class="resume_label"><?php echo $langs->trans("Invoice"); ?></td><td><?php echo $obj_facturation->numInvoice(); ?></td></tr>
  31. <tr><td class="resume_label"><?php echo $langs->trans("TotalHT"); ?></td><td><?php echo price(price2num($obj_facturation->prixTotalHt(), 'MT'), 0, $langs, 0, 0, -1, $conf->currency); ?></td></tr>
  32. <?php
  33. // Affichage de la tva par taux
  34. if ($obj_facturation->montantTva()) {
  35. echo ('<tr><td class="resume_label">'.$langs->trans("VAT").'</td><td>'.price(price2num($obj_facturation->montantTva(), 'MT'), 0, $langs, 0, 0, -1, $conf->currency).'</td></tr>');
  36. }
  37. else
  38. {
  39. echo ('<tr><td class="resume_label">'.$langs->trans("VAT").'</td><td>'.$langs->trans("NoVAT").'</td></tr>');
  40. }
  41. ?>
  42. <tr><td class="resume_label"><?php echo $langs->trans("TotalTTC"); ?> </td><td><?php echo price(price2num($obj_facturation->prixTotalTtc(), 'MT'), 0, $langs, 0, 0, -1, $conf->currency); ?></td></tr>
  43. <tr><td class="resume_label"><?php echo $langs->trans("PaymentMode"); ?> </td><td>
  44. <?php
  45. switch ($obj_facturation->getSetPaymentMode())
  46. {
  47. case 'ESP':
  48. echo $langs->trans("Cash");
  49. $filtre = 'courant=2';
  50. if (!empty($_SESSION["CASHDESK_ID_BANKACCOUNT_CASH"]))
  51. $selected = $_SESSION["CASHDESK_ID_BANKACCOUNT_CASH"];
  52. break;
  53. case 'CB':
  54. echo $langs->trans("CreditCard");
  55. $filtre = 'courant=1';
  56. if (!empty($_SESSION["CASHDESK_ID_BANKACCOUNT_CB"]))
  57. $selected = $_SESSION["CASHDESK_ID_BANKACCOUNT_CB"];
  58. break;
  59. case 'CHQ':
  60. echo $langs->trans("Cheque");
  61. $filtre = 'courant=1';
  62. if (!empty($_SESSION["CASHDESK_ID_BANKACCOUNT_CHEQUE"]))
  63. $selected = $_SESSION["CASHDESK_ID_BANKACCOUNT_CHEQUE"];
  64. break;
  65. case 'DIF':
  66. echo $langs->trans("Reported");
  67. $filtre = 'courant=1 OR courant=2';
  68. $selected = '';
  69. break;
  70. default:
  71. $filtre = 'courant=1 OR courant=2';
  72. $selected = '';
  73. }
  74. ?>
  75. </td></tr>
  76. <?php
  77. // Affichage des infos en fonction du mode de paiement
  78. if ($obj_facturation->getsetPaymentMode() == 'DIF') {
  79. echo ('<tr><td class="resume_label">'.$langs->trans("DateDue").'</td><td>'.$obj_facturation->paiementLe().'</td></tr>');
  80. } else {
  81. echo ('<tr><td class="resume_label">'.$langs->trans("Received").'</td><td>'.price(price2num($obj_facturation->montantEncaisse(), 'MT'), 0, $langs, 0, 0, -1, $conf->currency).'</td></tr>');
  82. }
  83. // Affichage du montant rendu (reglement en especes)
  84. if ($obj_facturation->montantRendu()) {
  85. echo ('<tr><td class="resume_label">'.$langs->trans("Change").'</td><td>'.price(price2num($obj_facturation->montantRendu(), 'MT'), 0, $langs, 0, 0, -1, $conf->currency).'</td></tr>');
  86. }
  87. ?>
  88. </table>
  89. <form id="frmValidation" class="formulaire2" method="post" action="validation_verif.php?action=valide_facture">
  90. <input type="hidden" name="token" value="<?php echo newToken(); ?>" />
  91. <p class="note_label">
  92. <?php
  93. echo $langs->trans("BankToPay")."<br>";
  94. $form->select_comptes($selected, 'cashdeskbank', 0, $filtre);
  95. ?>
  96. </p>
  97. <p class="note_label"><?php echo $langs->trans("Notes"); ?><br><textarea class="textarea_note" name="txtaNotes"></textarea></p>
  98. <div class="center"><input class="button" type="submit" name="btnValider" value="<?php echo $langs->trans("ValidateInvoice"); ?>" /><br>
  99. <br><a class="lien1" href="affIndex.php?menutpl=facturation"><?php echo $langs->trans("RestartSelling"); ?></a>
  100. </div>
  101. </form>
  102. </fieldset>