dolibarr  13.0.2
pay.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2018 Andreu Bisquerra <jove@bisquerra.com>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <https://www.gnu.org/licenses/>.
16  */
17 
24 //if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Not disabled cause need to load personalized language
25 //if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Not disabled cause need to load personalized language
26 //if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1');
27 //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1');
28 if (!defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1');
29 if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1');
30 if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1');
31 if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1');
32 if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1');
33 
34 require '../main.inc.php'; // Load $user and permissions
35 require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
36 
37 $langs->loadLangs(array("main", "bills", "cashdesk", "banks"));
38 
39 $place = (GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : '0'); // $place is id of table for Bar or Restaurant
40 
41 $invoiceid = GETPOST('invoiceid', 'int');
42 
43 if (empty($user->rights->takepos->run)) {
45 }
46 
47 
48 /*
49  * View
50  */
51 
52 $invoice = new Facture($db);
53 if ($invoiceid > 0)
54 {
55  $invoice->fetch($invoiceid);
56 } else {
57  $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")'";
58  $resql = $db->query($sql);
59  $obj = $db->fetch_object($resql);
60  if ($obj)
61  {
62  $invoiceid = $obj->rowid;
63  }
64  if (!$invoiceid)
65  {
66  $invoiceid = 0; // Invoice does not exist yet
67  } else {
68  $invoice->fetch($invoiceid);
69  }
70 }
71 
72 $arrayofcss = array('/takepos/css/pos.css.php');
73 $arrayofjs = array();
74 
75 $head = '';
76 $title = '';
77 $disablejs = 0;
78 $disablehead = 0;
79 
80 top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
81 
82 // Define list of possible payments
83 $arrayOfValidPaymentModes = array();
84 $arrayOfValidBankAccount = array();
85 
86 $sql = "SELECT code, libelle as label FROM ".MAIN_DB_PREFIX."c_paiement";
87 $sql .= " WHERE entity IN (".getEntity('c_paiement').")";
88 $sql .= " AND active = 1";
89 $sql .= " ORDER BY libelle";
90 $resql = $db->query($sql);
91 
92 if ($resql) {
93  while ($obj = $db->fetch_object($resql)) {
94  $paycode = $obj->code;
95  if ($paycode == 'LIQ') $paycode = 'CASH';
96  if ($paycode == 'CB') $paycode = 'CB';
97  if ($paycode == 'CHQ') $paycode = 'CHEQUE';
98 
99  $accountname = "CASHDESK_ID_BANKACCOUNT_".$paycode.$_SESSION["takeposterminal"];
100  if (!empty($conf->global->$accountname) && $conf->global->$accountname > 0) {
101  $arrayOfValidBankAccount[$conf->global->$accountname] = $conf->global->$accountname;
102  $arrayOfValidPaymentModes[] = $obj;
103  }
104  }
105 }
106 ?>
107 <link rel="stylesheet" href="css/pos.css.php">
108 <?php
109 if ($conf->global->TAKEPOS_COLOR_THEME == 1) print '<link rel="stylesheet" href="css/colorful.css">';
110 ?>
111 </head>
112 <body>
113 
114 <script>
115 <?php
116 $remaintopay = 0;
117 if ($invoice->id > 0)
118 {
119  $remaintopay = $invoice->getRemainToPay();
120 }
121 $alreadypayed = (is_object($invoice) ? ($invoice->total_ttc - $remaintopay) : 0);
122 
123 if ($conf->global->TAKEPOS_NUMPAD == 0) print "var received='';";
124 else print "var received=0;";
125 
126 ?>
127  var alreadypayed = <?php echo $alreadypayed ?>;
128 
129  function addreceived(price)
130  {
131  <?php
132  if (empty($conf->global->TAKEPOS_NUMPAD)) print 'received+=String(price);'."\n";
133  else print 'received+=parseFloat(price);'."\n";
134  ?>
135  $('.change1').html(pricejs(parseFloat(received), 'MT'));
136  $('.change1').val(parseFloat(received));
137  alreadypaydplusreceived=price2numjs(alreadypayed + parseFloat(received));
138  //console.log("already+received = "+alreadypaydplusreceived);
139  //console.log("total_ttc = "+<?php echo $invoice->total_ttc; ?>);
140  if (alreadypaydplusreceived > <?php echo $invoice->total_ttc; ?>)
141  {
142  var change=parseFloat(alreadypayed + parseFloat(received) - <?php echo $invoice->total_ttc; ?>);
143  $('.change2').html(pricejs(change, 'MT'));
144  $('.change2').val(change);
145  $('.change1').removeClass('colorred');
146  $('.change1').addClass('colorgreen');
147  $('.change2').removeClass('colorwhite');
148  $('.change2').addClass('colorred');
149  }
150  else
151  {
152  $('.change2').html(pricejs(0, 'MT'));
153  $('.change2').val(0);
154  if (alreadypaydplusreceived == <?php echo $invoice->total_ttc; ?>)
155  {
156  $('.change1').removeClass('colorred');
157  $('.change1').addClass('colorgreen');
158  $('.change2').removeClass('colorred');
159  $('.change2').addClass('colorwhite');
160  }
161  else
162  {
163  $('.change1').removeClass('colorgreen');
164  $('.change1').addClass('colorred');
165  $('.change2').removeClass('colorred');
166  $('.change2').addClass('colorwhite');
167  }
168  }
169  }
170 
171  function reset()
172  {
173  received=0;
174  $('.change1').html(pricejs(received, 'MT'));
175  $('.change1').val(price2numjs(received));
176  $('.change2').html(pricejs(received, 'MT'));
177  $('.change2').val(price2numjs(received));
178  $('.change1').removeClass('colorgreen');
179  $('.change1').addClass('colorred');
180  $('.change2').removeClass('colorred');
181  $('.change2').addClass('colorwhite');
182  }
183 
184  function Validate(payment)
185  {
186  var invoiceid = <?php echo ($invoiceid > 0 ? $invoiceid : 0); ?>;
187  var accountid = $("#selectaccountid").val();
188  var amountpayed = $("#change1").val();
189  var excess = $("#change2").val();
190  if (amountpayed > <?php echo $invoice->total_ttc; ?>) {
191  amountpayed = <?php echo $invoice->total_ttc; ?>;
192  }
193  console.log("We click on the payment mode to pay amount = "+amountpayed);
194  parent.$("#poslines").load("invoice.php?place=<?php echo $place; ?>&action=valid&pay="+payment+"&amount="+amountpayed+"&excess="+excess+"&invoiceid="+invoiceid+"&accountid="+accountid, function() {
195  if (amountpayed > <?php echo $remaintopay; ?> || amountpayed == <?php echo $remaintopay; ?> || amountpayed==0 ) {
196  console.log("Close popup");
197  parent.$.colorbox.close();
198  }
199  else {
200  console.log("Amount is not comple, so we do NOT close popup and reload it.");
201  location.reload();
202  }
203  });
204  }
205 
206  function ValidateSumup() {
207  console.log("Launch ValidateSumup");
208  <?php $_SESSION['SMP_CURRENT_PAYMENT'] = "NEW" ?>
209  var invoiceid = <?php echo($invoiceid > 0 ? $invoiceid : 0); ?>;
210  var amountpayed = $("#change1").val();
211  if (amountpayed > <?php echo $invoice->total_ttc; ?>) {
212  amountpayed = <?php echo $invoice->total_ttc; ?>;
213  }
214 
215  // Starting sumup app
216  window.open('sumupmerchant://pay/1.0?affiliate-key=<?php echo $conf->global->TAKEPOS_SUMUP_AFFILIATE ?>&app-id=<?php echo $conf->global->TAKEPOS_SUMUP_APPID ?>&total=' + amountpayed + '&currency=EUR&title=' + invoiceid + '&callback=<?php echo DOL_MAIN_URL_ROOT ?>/takepos/smpcb.php');
217 
218  var loop = window.setInterval(function () {
219  $.ajax('<?php echo DOL_URL_ROOT ?>/takepos/smpcb.php?status').done(function (data) {
220  console.log(data);
221  if (data === "SUCCESS") {
222  parent.$("#poslines").load("invoice.php?place=<?php echo $place; ?>&action=valid&pay=CB&amount=" + amountpayed + "&invoiceid=" + invoiceid, function () {
223  //parent.$("#poslines").scrollTop(parent.$("#poslines")[0].scrollHeight);
224  parent.$.colorbox.close();
225  //parent.setFocusOnSearchField(); // This does not have effect
226  });
227  clearInterval(loop);
228  } else if (data === "FAILED") {
229  parent.$.colorbox.close();
230  clearInterval(loop);
231  }
232  });
233  }, 2500);
234  }
235 </script>
236 
237 <div style="position:relative; padding-top: 20px; left:5%; height:150px; width:90%;">
238 
239 <div class="paymentbordline paymentbordlinetotal">
240  <center><span class="takepospay"><font color="white"><?php echo $langs->trans('TotalTTC'); ?>: </font><span id="totaldisplay" class="colorwhite"><?php echo price($invoice->total_ttc, 1, '', 1, -1, -1, $invoice->multicurrency_code); ?></span></span></center>
241 </div>
242 <?php if ($remaintopay != $invoice->total_ttc) { ?>
243 <div class="paymentbordline paymentbordlineremain">
244  <center><span class="takepospay"><font color="white"><?php echo $langs->trans('RemainToPay'); ?>: </font><span id="remaintopaydisplay" class="colorwhite"><?php echo price($remaintopay, 1, '', 1, -1, -1, $invoice->multicurrency_code); ?></span></span></center>
245 </div>
246 <?php } ?>
247 <div class="paymentbordline paymentbordlinereceived">
248  <center><span class="takepospay"><font color="white"><?php echo $langs->trans("Received"); ?>: </font><span class="change1 colorred"><?php echo price(0, 1, '', 1, -1, -1, $invoice->multicurrency_code); ?></span><input type="hidden" id="change1" class="change1" value="0"></span></center>
249 </div>
250 <div class="paymentbordline paymentbordlinechange">
251  <center><span class="takepospay"><font color="white"><?php echo $langs->trans("Change"); ?>: </font><span class="change2 colorwhite"><?php echo price(0, 1, '', 1, -1, -1, $invoice->multicurrency_code); ?></span><input type="hidden" id="change2" class="change2" value="0"></span></center>
252 </div>
253 <?php
254 if (!empty($conf->global->TAKEPOS_CAN_FORCE_BANK_ACCOUNT_DURING_PAYMENT)) {
255  print '<div class="paymentbordline paddingtop paddingbottom">
256  <center>';
257  $filter = '';
258  $form = new Form($db);
259  print '<span class="takepospay"><font color="white">'.$langs->trans("BankAccount").': </font></span>';
260  $form->select_comptes(0, 'accountid', 0, $filter, 1, '');
261  print ajax_combobox('selectaccountid');
262  print '</center>
263  </div>';
264 }
265 ?>
266 
267 </div>
268 
269 
270 <div style="position:absolute; left:5%; height:52%; width:90%;">
271 <?php
272 $action_buttons = array(
273  array(
274  "function" =>"reset()",
275  "span" => "style='font-size: 150%;'",
276  "text" => "C",
277  "class" => "poscolorblue"
278  ),
279  array(
280  "function" => "parent.$.colorbox.close();",
281  "span" => "id='printtext' style='font-weight: bold; font-size: 18pt;'",
282  "text" => "X",
283  "class" => "poscolordelete"
284  ),
285 );
286 $numpad = $conf->global->TAKEPOS_NUMPAD;
287 
288 print '<button type="button" class="calcbutton" onclick="addreceived('.($numpad == 0 ? '7' : '10').');">'.($numpad == 0 ? '7' : '10').'</button>';
289 print '<button type="button" class="calcbutton" onclick="addreceived('.($numpad == 0 ? '8' : '20').');">'.($numpad == 0 ? '8' : '20').'</button>';
290 print '<button type="button" class="calcbutton" onclick="addreceived('.($numpad == 0 ? '9' : '50').');">'.($numpad == 0 ? '9' : '50').'</button>';
291 ?>
292 <?php if (count($arrayOfValidPaymentModes) > 0) {
293  $paycode = $arrayOfValidPaymentModes[0]->code;
294  $payIcon = '';
295  if ($paycode == 'LIQ') {
296  $paycode = 'cash';
297  if (!isset($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON) || !empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) $payIcon = 'coins';
298  } elseif ($paycode == 'CB') {
299  $paycode = 'card';
300  if (!isset($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON) || !empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) $payIcon = 'credit-card';
301  } elseif ($paycode == 'CHQ') {
302  $paycode = 'cheque';
303  if (!isset($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON) || !empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) $payIcon = 'money-check';
304  }
305 
306  print '<button type="button" class="calcbutton2" onclick="Validate(\''.$langs->trans($paycode).'\');">'.(!empty($payIcon) ? '<span class="fa fa-2x fa-'.$payIcon.' iconwithlabel"></span><span class="hideonsmartphone"><br>'. $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[0]->code) : $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[0]->code)).'</span></button>';
307 } else {
308  print '<button type="button" class="calcbutton2">'.$langs->trans("NoPaimementModesDefined").'</button>';
309 }
310 
311 print '<button type="button" class="calcbutton" onclick="addreceived('.($numpad == 0 ? '4' : '1').');">'.($numpad == 0 ? '4' : '1').'</button>';
312 print '<button type="button" class="calcbutton" onclick="addreceived('.($numpad == 0 ? '5' : '2').');">'.($numpad == 0 ? '5' : '2').'</button>';
313 print '<button type="button" class="calcbutton" onclick="addreceived('.($numpad == 0 ? '6' : '5').');">'.($numpad == 0 ? '6' : '5').'</button>';
314 ?>
315 <?php if (count($arrayOfValidPaymentModes) > 1) {
316  $paycode = $arrayOfValidPaymentModes[1]->code;
317  $payIcon = '';
318  if ($paycode == 'LIQ') {
319  $paycode = 'cash';
320  if (!isset($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON) || !empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) $payIcon = 'coins';
321  } elseif ($paycode == 'CB') {
322  $paycode = 'card';
323  if (!isset($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON) || !empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) $payIcon = 'credit-card';
324  } elseif ($paycode == 'CHQ') {
325  $paycode = 'cheque';
326  if (!isset($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON) || !empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) $payIcon = 'money-check';
327  }
328 
329  print '<button type="button" class="calcbutton2" onclick="Validate(\''.$langs->trans($paycode).'\');">'.(!empty($payIcon) ? '<span class="fa fa-2x fa-'.$payIcon.' iconwithlabel"></span><br> '. $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[1]->code) : $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[1]->code)).'</button>';
330 } else {
331  $button = array_pop($action_buttons);
332  print '<button type="button" class="calcbutton2" onclick="'.$button["function"].'"><span '.$button["span"].'>'.$button["text"].'</span></button>';
333 }
334 
335 print '<button type="button" class="calcbutton" onclick="addreceived('.($numpad == 0 ? '1' : '0.10').');">'.($numpad == 0 ? '1' : '0.10').'</button>';
336 print '<button type="button" class="calcbutton" onclick="addreceived('.($numpad == 0 ? '2' : '0.20').');">'.($numpad == 0 ? '2' : '0.20').'</button>';
337 print '<button type="button" class="calcbutton" onclick="addreceived('.($numpad == 0 ? '3' : '0.50').');">'.($numpad == 0 ? '3' : '0.50').'</button>';
338 ?>
339 <?php if (count($arrayOfValidPaymentModes) > 2) {
340  $paycode = $arrayOfValidPaymentModes[2]->code;
341  $payIcon = '';
342  if ($paycode == 'LIQ') {
343  $paycode = 'cash';
344  if (!isset($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON) || !empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) $payIcon = 'coins';
345  } elseif ($paycode == 'CB') {
346  $paycode = 'card';
347  if (!isset($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON) || !empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) $payIcon = 'credit-card';
348  } elseif ($paycode == 'CHQ') {
349  $paycode = 'cheque';
350  if (!isset($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON) || !empty($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON)) $payIcon = 'money-check';
351  }
352 
353  print '<button type="button" class="calcbutton2" onclick="Validate(\''.$langs->trans($paycode).'\');">'.(!empty($payIcon) ? '<span class="fa fa-2x fa-'.$payIcon.' iconwithlabel"></span>'.(!empty($conf->global->TAKEPOS_NUMPAD_FORCE_PAYMENT_ICONS_LABELS) ? '<br> '. $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[2]->code) : '') : $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[2]->code)).'</button>';
354 } else {
355  $button = array_pop($action_buttons);
356  print '<button type="button" class="calcbutton2" onclick="'.$button["function"].'"><span '.$button["span"].'>'.$button["text"].'</span></button>';
357 }
358 
359 print '<button type="button" class="calcbutton" onclick="addreceived('.($numpad == 0 ? '0' : '0.01').');">'.($numpad == 0 ? '0' : '0.01').'</button>';
360 print '<button type="button" class="calcbutton" onclick="addreceived('.($numpad == 0 ? '\'000\'' : '0.02').');">'.($numpad == 0 ? '000' : '0.02').'</button>';
361 print '<button type="button" class="calcbutton" onclick="addreceived('.($numpad == 0 ? '\'.\'' : '0.05').');">'.($numpad == 0 ? '.' : '0.05').'</button>';
362 
363 $i = 3;
364 while ($i < count($arrayOfValidPaymentModes)) {
365  print '<button type="button" class="calcbutton2" onclick="Validate(\''.$langs->trans($arrayOfValidPaymentModes[$i]->code).'\');">'.$langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[$i]->code).'</button>';
366  $i = $i + 1;
367 }
368 
369 $keyforsumupbank = "CASHDESK_ID_BANKACCOUNT_SUMUP".$_SESSION["takeposterminal"];
370 if ($conf->global->TAKEPOS_ENABLE_SUMUP) {
371  if (!empty($conf->global->$keyforsumupbank)) {
372  print '<button type="button" class="calcbutton2" onclick="ValidateSumup();">Sumup</button>';
373  } else {
374  $langs->loadLangs(array("errors", "admin"));
375  print '<button type="button" class="calcbutton2 disabled" title="'.$langs->trans("SetupNotComplete").'">Sumup</button>';
376  }
377 }
378 
379 $class = ($i == 3) ? "calcbutton3" : "calcbutton2";
380 foreach ($action_buttons as $button) {
381  $newclass = $class.($button["class"] ? " ".$button["class"] : "");
382  print '<button type="button" class="'.$newclass.'" onclick="'.$button["function"].'"><span '.$button["span"].'>'.$button["text"].'</span></button>';
383 }
384 
385 if ($conf->global->TAKEPOS_DELAYED_PAYMENT) {
386  print '<button type="button" class="calcbutton2" onclick="Validate(\'delayed\');">'.$langs->trans("Reported").'</button>';
387 }
388 ?>
389 </div>
390 
391 </body>
392 </html>
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
pricejs(amount, mode)
Function similar to PHP price()
if(!empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'] country if(!empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'] typent code
Definition: list.php:566
ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $forcefocus=0, $widthTypeOfAutocomplete= 'resolve')
Convert a html select field into an ajax combobox.
Definition: ajax.lib.php:391
top_htmlhead($head, $title= '', $disablejs=0, $disablehead=0, $arrayofjs= '', $arrayofcss= '', $disablejmobile=0, $disablenofollow=0)
Ouput html header of a page.
Definition: main.inc.php:1280
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...
price2numjs(amount)
Function similar to PHP price2num()
Class to manage generation of HTML components Only common components must be here.
accessforbidden($message= '', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
print
Draft customers invoices.
Definition: index.php:89
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
Definition: index.php:1232
Class to manage invoices.
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
Definition: repair.php:105