dolibarr  7.0.0-beta
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 
27 $langs->load("main");
28 $langs->load("bills");
29 $langs->load("banks");
30 
31 // Object $form must de defined
32 
33 ?>
34 
35 <fieldset class="cadre_facturation"><legend class="titre1"><?php echo $langs->trans("Summary"); ?></legend>
36 
37  <table class="table_resume">
38 
39  <tr><td class="resume_label"><?php echo $langs->trans("Invoice"); ?></td><td><?php echo $obj_facturation->numInvoice(); ?></td></tr>
40  <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>
41  <?php
42  // Affichage de la tva par taux
43  if ( $obj_facturation->montantTva() ) {
44 
45  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>');
46 
47  }
48  else
49  {
50 
51  echo ('<tr><td class="resume_label">'.$langs->trans("VAT").'</td><td>'.$langs->trans("NoVAT").'</td></tr>');
52 
53  }
54  ?>
55  <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>
56  <tr><td class="resume_label"><?php echo $langs->trans("PaymentMode"); ?> </td><td>
57  <?php
58  switch ($obj_facturation->getSetPaymentMode())
59  {
60  case 'ESP':
61  echo $langs->trans("Cash");
62  $filtre='courant=2';
63  if (!empty($_SESSION["CASHDESK_ID_BANKACCOUNT_CASH"]))
64  $selected = $_SESSION["CASHDESK_ID_BANKACCOUNT_CASH"];
65  break;
66  case 'CB':
67  echo $langs->trans("CreditCard");
68  $filtre='courant=1';
69  if (!empty($_SESSION["CASHDESK_ID_BANKACCOUNT_CB"]))
70  $selected = $_SESSION["CASHDESK_ID_BANKACCOUNT_CB"];
71  break;
72  case 'CHQ':
73  echo $langs->trans("Cheque");
74  $filtre='courant=1';
75  if (!empty($_SESSION["CASHDESK_ID_BANKACCOUNT_CHEQUE"]))
76  $selected = $_SESSION["CASHDESK_ID_BANKACCOUNT_CHEQUE"];
77  break;
78  case 'DIF':
79  echo $langs->trans("Reported");
80  $filtre='courant=1 OR courant=2';
81  $selected='';
82  break;
83  default:
84  $filtre='courant=1 OR courant=2';
85  $selected='';
86  }
87 
88  ?>
89  </td></tr>
90 
91  <?php
92  // Affichage des infos en fonction du mode de paiement
93  if ( $obj_facturation->getsetPaymentMode() == 'DIF' ) {
94 
95  echo ('<tr><td class="resume_label">'.$langs->trans("DateDue").'</td><td>'.$obj_facturation->paiementLe().'</td></tr>');
96 
97  } else {
98 
99  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>');
100 
101  }
102 
103  // Affichage du montant rendu (reglement en especes)
104  if ( $obj_facturation->montantRendu() ) {
105 
106  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>');
107 
108  }
109 
110  ?>
111 
112  </table>
113 
114  <form id="frmValidation" class="formulaire2" method="post" action="validation_verif.php?action=valide_facture">
115  <input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>" />
116  <p class="note_label">
117  <?php
118  echo $langs->trans("BankToPay"). "<br>";
119  $form->select_comptes($selected,'cashdeskbank',0,$filtre);
120  ?>
121  </p>
122  <p class="note_label"><?php echo $langs->trans("Notes"); ?><br><textarea class="textarea_note" name="txtaNotes"></textarea></p>
123 
124  <div class="center"><input class="button" type="submit" name="btnValider" value="<?php echo $langs->trans("ValidateInvoice"); ?>" /><br>
125  <br><a class="lien1" href="affIndex.php?menutpl=facturation"><?php echo $langs->trans("RestartSelling"); ?></a>
126  </div>
127  </form>
128 
129 
130 
131 </fieldset>
if(empty($reshook)) $form
View.
Definition: perms.php:103
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition: repair.php:104
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...
print
Draft customers invoices.
Definition: index.php:91
type
Definition: viewcat.php:283
price2num($amount, $rounding='', $alreadysqlnb=0)
Function that return a number with universal decimal format (decimal separator is '...