dolibarr  13.0.2
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 <https://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->amountWithoutTax(), 'MT'), 0, $langs, 0, 0, -1, $conf->currency); ?></td></tr>
39 <?php
40 // Affichage de la tva par taux
41 if ($obj_facturation->amountVat()) {
42  echo ('<tr><td class="resume_label">'.$langs->trans("VAT").'</td><td>'.price(price2num($obj_facturation->amountVat(), 'MT'), 0, $langs, 0, 0, -1, $conf->currency).'</td></tr>');
43 } else {
44  echo ('<tr><td class="resume_label">'.$langs->trans("VAT").'</td><td>'.$langs->trans("NoVAT").'</td></tr>');
45 }
46 ?>
47  <tr><td class="resume_label"><?php echo $langs->trans("TotalTTC"); ?> </td><td><?php echo price(price2num($obj_facturation->amountWithTax(), 'MT'), 0, $langs, 0, 0, -1, $conf->currency); ?></td></tr>
48  <tr><td class="resume_label"><?php echo $langs->trans("PaymentMode"); ?> </td><td>
49  <?php
50  switch ($obj_facturation->getSetPaymentMode())
51  {
52  case 'ESP':
53  echo $langs->trans("Cash");
54  $filtre = 'courant=2';
55  if (!empty($_SESSION["CASHDESK_ID_BANKACCOUNT_CASH"]))
56  $selected = $_SESSION["CASHDESK_ID_BANKACCOUNT_CASH"];
57  break;
58  case 'CB':
59  echo $langs->trans("CreditCard");
60  $filtre = 'courant=1';
61  if (!empty($_SESSION["CASHDESK_ID_BANKACCOUNT_CB"]))
62  $selected = $_SESSION["CASHDESK_ID_BANKACCOUNT_CB"];
63  break;
64  case 'CHQ':
65  echo $langs->trans("Cheque");
66  $filtre = 'courant=1';
67  if (!empty($_SESSION["CASHDESK_ID_BANKACCOUNT_CHEQUE"]))
68  $selected = $_SESSION["CASHDESK_ID_BANKACCOUNT_CHEQUE"];
69  break;
70  case 'DIF':
71  echo $langs->trans("Reported");
72  $filtre = 'courant=1 OR courant=2';
73  $selected = '';
74  break;
75  default:
76  $filtre = 'courant=1 OR courant=2';
77  $selected = '';
78  }
79 
80  ?>
81  </td></tr>
82 
83 <?php
84 // Affichage des infos en fonction du mode de paiement
85 if ($obj_facturation->getsetPaymentMode() == 'DIF') {
86  echo ('<tr><td class="resume_label">'.$langs->trans("DateDue").'</td><td>'.$obj_facturation->paiementLe().'</td></tr>');
87 } else {
88  echo ('<tr><td class="resume_label">'.$langs->trans("Received").'</td><td>'.price(price2num($obj_facturation->amountCollected(), 'MT'), 0, $langs, 0, 0, -1, $conf->currency).'</td></tr>');
89 }
90 
91 // Affichage du montant rendu (reglement en especes)
92 if ($obj_facturation->amountReturned()) {
93  echo ('<tr><td class="resume_label">'.$langs->trans("Change").'</td><td>'.price(price2num($obj_facturation->amountReturned(), 'MT'), 0, $langs, 0, 0, -1, $conf->currency).'</td></tr>');
94 }
95 
96 ?>
97 
98  </table>
99 
100  <form id="frmValidation" class="formulaire2" method="post" action="validation_verif.php?action=validate_invoice">
101  <input type="hidden" name="token" value="<?php echo newToken(); ?>" />
102  <p class="note_label">
103  <?php
104  echo $langs->trans("BankToPay")."<br>";
105  $form->select_comptes($selected, 'cashdeskbank', 0, $filtre);
106  ?>
107  </p>
108  <p class="note_label"><?php echo $langs->trans("Notes"); ?><br><textarea class="textarea_note" name="txtaNotes"></textarea></p>
109 
110  <div class="center"><input class="button" type="submit" name="btnValider" value="<?php echo $langs->trans("ValidateInvoice"); ?>" /><br>
111  <br><a class="lien1" href="affIndex.php?menutpl=facturation"><?php echo $langs->trans("RestartSelling"); ?></a>
112  </div>
113  </form>
114 
115 
116 
117 </fieldset>
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition: repair.php:108
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= '', $option=0)
Function that return a number with universal decimal format (decimal separator is &#39;...
print
Draft customers invoices.
Definition: index.php:89
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
Definition: repair.php:105