dolibarr  9.0.0
validation1.tpl.php
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 <http://www.gnu.org/licenses/>.
17  */
18 
19 // Protection to avoid direct call of template
20 if (empty($langs) || ! is_object($langs))
21 {
22  print "Error, template page can't be called as URL";
23  exit;
24 }
25 
26 // Load translation files required by the page
27 $langs->loadLangs(array("main","bills","banks"));
28 
29 // Object $form must de defined
30 
31 ?>
32 
33 <fieldset class="cadre_facturation"><legend class="titre1"><?php echo $langs->trans("Summary"); ?></legend>
34 
35  <table class="table_resume">
36 
37  <tr><td class="resume_label"><?php echo $langs->trans("Invoice"); ?></td><td><?php echo $obj_facturation->numInvoice(); ?></td></tr>
38  <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>
39  <?php
40  // Affichage de la tva par taux
41  if ( $obj_facturation->montantTva() ) {
42 
43  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>');
44  }
45  else
46  {
47 
48  echo ('<tr><td class="resume_label">'.$langs->trans("VAT").'</td><td>'.$langs->trans("NoVAT").'</td></tr>');
49  }
50  ?>
51  <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>
52  <tr><td class="resume_label"><?php echo $langs->trans("PaymentMode"); ?> </td><td>
53  <?php
54  switch ($obj_facturation->getSetPaymentMode())
55  {
56  case 'ESP':
57  echo $langs->trans("Cash");
58  $filtre='courant=2';
59  if (!empty($_SESSION["CASHDESK_ID_BANKACCOUNT_CASH"]))
60  $selected = $_SESSION["CASHDESK_ID_BANKACCOUNT_CASH"];
61  break;
62  case 'CB':
63  echo $langs->trans("CreditCard");
64  $filtre='courant=1';
65  if (!empty($_SESSION["CASHDESK_ID_BANKACCOUNT_CB"]))
66  $selected = $_SESSION["CASHDESK_ID_BANKACCOUNT_CB"];
67  break;
68  case 'CHQ':
69  echo $langs->trans("Cheque");
70  $filtre='courant=1';
71  if (!empty($_SESSION["CASHDESK_ID_BANKACCOUNT_CHEQUE"]))
72  $selected = $_SESSION["CASHDESK_ID_BANKACCOUNT_CHEQUE"];
73  break;
74  case 'DIF':
75  echo $langs->trans("Reported");
76  $filtre='courant=1 OR courant=2';
77  $selected='';
78  break;
79  default:
80  $filtre='courant=1 OR courant=2';
81  $selected='';
82  }
83 
84  ?>
85  </td></tr>
86 
87  <?php
88  // Affichage des infos en fonction du mode de paiement
89  if ( $obj_facturation->getsetPaymentMode() == 'DIF' ) {
90 
91  echo ('<tr><td class="resume_label">'.$langs->trans("DateDue").'</td><td>'.$obj_facturation->paiementLe().'</td></tr>');
92  } else {
93 
94  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>');
95  }
96 
97  // Affichage du montant rendu (reglement en especes)
98  if ( $obj_facturation->montantRendu() ) {
99 
100  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>');
101  }
102 
103  ?>
104 
105  </table>
106 
107  <form id="frmValidation" class="formulaire2" method="post" action="validation_verif.php?action=valide_facture">
108  <input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>" />
109  <p class="note_label">
110  <?php
111  echo $langs->trans("BankToPay"). "<br>";
112  $form->select_comptes($selected,'cashdeskbank',0,$filtre);
113  ?>
114  </p>
115  <p class="note_label"><?php echo $langs->trans("Notes"); ?><br><textarea class="textarea_note" name="txtaNotes"></textarea></p>
116 
117  <div class="center"><input class="button" type="submit" name="btnValider" value="<?php echo $langs->trans("ValidateInvoice"); ?>" /><br>
118  <br><a class="lien1" href="affIndex.php?menutpl=facturation"><?php echo $langs->trans("RestartSelling"); ?></a>
119  </div>
120  </form>
121 
122 
123 
124 </fieldset>
print
Draft customers invoices.
Definition: index.php:91
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition: repair.php:103
type
Definition: viewcat.php:284
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages...
price2num($amount, $rounding='', $alreadysqlnb=0)
Function that return a number with universal decimal format (decimal separator is &#39;...