Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
f0c8c1805f
@ -38,7 +38,7 @@ jQuery jqueryFileTree 1.0.1 GPL and MIT Licence Yes JS library for colo
|
|||||||
jQuery jquerytreeview 1.4.1 MIT Licence Yes JS library for color picker with not defined list of colors
|
jQuery jquerytreeview 1.4.1 MIT Licence Yes JS library for color picker with not defined list of colors
|
||||||
jQuery Layout 1.3.0 GPL and MIT Licence Yes JS library plugin Layout (RC-29.15)
|
jQuery Layout 1.3.0 GPL and MIT Licence Yes JS library plugin Layout (RC-29.15)
|
||||||
jQuery Mobile 1.3 GPL and MIT Licence Yes JS library for smartphone (not used)
|
jQuery Mobile 1.3 GPL and MIT Licence Yes JS library for smartphone (not used)
|
||||||
jQuery TableDnD 0.5 GPL and MIT Licence Yes JS library plugin TableDnD (to reorder table rows)
|
jQuery TableDnD 0.6 GPL and MIT Licence Yes JS library plugin TableDnD (to reorder table rows)
|
||||||
jQuery Timepicker 1.1.0 GPL and MIT Licence Yes JS library Timepicker addon for Datepicker
|
jQuery Timepicker 1.1.0 GPL and MIT Licence Yes JS library Timepicker addon for Datepicker
|
||||||
jQuery Tiptip 1.3 GPL and MIT Licence Yes JS library for tooltips
|
jQuery Tiptip 1.3 GPL and MIT Licence Yes JS library for tooltips
|
||||||
JSGantt 1.2 BSD Licence Yes JS library (to build Gantt reports)
|
JSGantt 1.2 BSD Licence Yes JS library (to build Gantt reports)
|
||||||
|
|||||||
@ -62,14 +62,14 @@ else
|
|||||||
|
|
||||||
$remise = $tab[$i]['remise'];
|
$remise = $tab[$i]['remise'];
|
||||||
|
|
||||||
echo ('<p>'.$tab[$i]['qte'].' x '.price2num($tab[$i]['price'], 'MT').$remise_percent.' = '.price2num($tab[$i]['total_ht'], 'MT').' '.$conf->currency.' '.$langs->trans("HT").' ('.price2num($tab[$i]['total_ttc'], 'MT').' '.$conf->currency.' '.$langs->trans("TTC").')</p>'."\n");
|
echo ('<p>'.$tab[$i]['qte'].' x '.price2num($tab[$i]['price'], 'MT').$remise_percent.' = '.price(price2num($tab[$i]['total_ht'], 'MT'),0,$langs,0,0,-1,$conf->currency).' '.$langs->trans("HT").' ('.price(price2num($tab[$i]['total_ttc'], 'MT'),0,$langs,0,0,-1,$conf->currency).' '.$langs->trans("TTC").')</p>'."\n");
|
||||||
echo ('</div>'."\n");
|
echo ('</div>'."\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$obj_facturation->calculTotaux();
|
$obj_facturation->calculTotaux();
|
||||||
$total_ttc = $obj_facturation->prixTotalTtc();
|
$total_ttc = $obj_facturation->prixTotalTtc();
|
||||||
echo ('<p class="cadre_prix_total">'.$langs->trans("Total").' : '.price2num($total_ttc, 'MT').' '.$conf->currency.'<br></p>'."\n");
|
echo ('<p class="cadre_prix_total">'.$langs->trans("Total").' : '.price(price2num($total_ttc, 'MT'),0,$langs,0,0,-1,$conf->currency).'<br></p>'."\n");
|
||||||
|
|
||||||
?></div>
|
?></div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -132,7 +132,7 @@ print $object->ref;
|
|||||||
for($i=0;$i < $tab_size;$i++)
|
for($i=0;$i < $tab_size;$i++)
|
||||||
{
|
{
|
||||||
$remise = $tab[$i]['remise'];
|
$remise = $tab[$i]['remise'];
|
||||||
echo ('<tr><td>'.$tab[$i]['ref'].'</td><td>'.$tab[$i]['label'].'</td><td>'.$tab[$i]['qte'].'</td><td>'.$tab[$i]['remise_percent'].'</td><td class="total">'.price2num($tab[$i]['total_ht'],'MT').' '.$conf->currency.'</td></tr>'."\n");
|
echo ('<tr><td>'.$tab[$i]['ref'].'</td><td>'.$tab[$i]['label'].'</td><td>'.$tab[$i]['qte'].'</td><td>'.$tab[$i]['remise_percent'].'</td><td class="total">'.price(price2num($tab[$i]['total_ht'],'MT'),0,$langs,0,0,-1,$conf->currency).'</td></tr>'."\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -26,12 +26,12 @@ $langs->load("main");
|
|||||||
<table class="table_resume">
|
<table class="table_resume">
|
||||||
|
|
||||||
<tr><td class="resume_label"><?php echo $langs->trans("Invoice"); ?></td><td><?php echo $obj_facturation->numInvoice(); ?></td></tr>
|
<tr><td class="resume_label"><?php echo $langs->trans("Invoice"); ?></td><td><?php echo $obj_facturation->numInvoice(); ?></td></tr>
|
||||||
<tr><td class="resume_label"><?php echo $langs->trans("TotalHT"); ?></td><td><?php echo price2num($obj_facturation->prixTotalHt(),'MT').' '.$conf->currency; ?></td></tr>
|
<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>
|
||||||
<?php
|
<?php
|
||||||
// Affichage de la tva par taux
|
// Affichage de la tva par taux
|
||||||
if ( $obj_facturation->montantTva() ) {
|
if ( $obj_facturation->montantTva() ) {
|
||||||
|
|
||||||
echo ('<tr><td class="resume_label">'.$langs->trans("VAT").'</td><td>'.price2num($obj_facturation->montantTva(),'MT').' '.$conf->currency.'</td></tr>');
|
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>');
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -41,7 +41,7 @@ $langs->load("main");
|
|||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<tr><td class="resume_label"><?php echo $langs->trans("TotalTTC"); ?> </td><td><?php echo price2num($obj_facturation->prixTotalTtc(),'MT').' '.$conf->currency; ?></td></tr>
|
<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>
|
||||||
<tr><td class="resume_label"><?php echo $langs->trans("PaymentMode"); ?> </td><td>
|
<tr><td class="resume_label"><?php echo $langs->trans("PaymentMode"); ?> </td><td>
|
||||||
<?php
|
<?php
|
||||||
switch ($obj_facturation->getSetPaymentMode())
|
switch ($obj_facturation->getSetPaymentMode())
|
||||||
@ -85,14 +85,14 @@ $langs->load("main");
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
echo ('<tr><td class="resume_label">'.$langs->trans("Received").'</td><td>'.price2num($obj_facturation->montantEncaisse(),'MT').' '.$conf->currency.'</td></tr>');
|
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>');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Affichage du montant rendu (reglement en especes)
|
// Affichage du montant rendu (reglement en especes)
|
||||||
if ( $obj_facturation->montantRendu() ) {
|
if ( $obj_facturation->montantRendu() ) {
|
||||||
|
|
||||||
echo ('<tr><td class="resume_label">'.$langs->trans("Change").'</td><td>'.price2num($obj_facturation->montantRendu(),'MT').' '.$conf->currency.'</td></tr>');
|
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>');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -796,7 +796,7 @@ else if ($action == "addline" && $user->rights->propal->creer)
|
|||||||
|
|
||||||
if (! empty($price_min) && (price2num($pu_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min)))
|
if (! empty($price_min) && (price2num($pu_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min)))
|
||||||
{
|
{
|
||||||
$mesg = $langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').$langs->getCurrencySymbol($conf->currency));
|
$mesg = $langs->trans("CantBeLessThanMinPrice",price(price2num($price_min,'MU'),0,$langs,0,0,-1,$conf->currency));
|
||||||
setEventMessage($mesg, 'errors');
|
setEventMessage($mesg, 'errors');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -927,7 +927,7 @@ else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('sa
|
|||||||
|
|
||||||
if ($price_min && (price2num($pu_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min)))
|
if ($price_min && (price2num($pu_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min)))
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("CantBeLessThanMinPrice", price2num($price_min,'MU')).$langs->getCurrencySymbol($conf->currency), 'errors');
|
setEventMessage($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min,'MU'),0,$langs,0,0,-1,$conf->currency)), 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -732,7 +732,7 @@ else if ($action == 'addline' && $user->rights->commande->creer)
|
|||||||
|
|
||||||
if (! empty($price_min) && (price2num($pu_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min)))
|
if (! empty($price_min) && (price2num($pu_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min)))
|
||||||
{
|
{
|
||||||
$mesg = $langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').$langs->getCurrencySymbol($conf->currency));
|
$mesg = $langs->trans("CantBeLessThanMinPrice",price(price2num($price_min,'MU'),0,$langs,0,0,-1,$conf->currency));
|
||||||
setEventMessage($mesg, 'errors');
|
setEventMessage($mesg, 'errors');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -865,7 +865,7 @@ else if ($action == 'updateligne' && $user->rights->commande->creer && GETPOST('
|
|||||||
|
|
||||||
if ($price_min && (price2num($pu_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min)))
|
if ($price_min && (price2num($pu_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min)))
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("CantBeLessThanMinPrice", price2num($price_min,'MU')).$langs->getCurrencySymbol($conf->currency), 'errors');
|
setEventMessage($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min,'MU'),0,$langs,0,0,-1,$conf->currency)), 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -482,7 +482,7 @@ if (! empty($id) && $action != 'edit')
|
|||||||
print '<td rowspan="'.$nbrows.'" valign="top" width="50%">'.$langs->trans("Comments").' :<br>';
|
print '<td rowspan="'.$nbrows.'" valign="top" width="50%">'.$langs->trans("Comments").' :<br>';
|
||||||
print nl2br($don->note_private).'</td></tr>';
|
print nl2br($don->note_private).'</td></tr>';
|
||||||
|
|
||||||
print "<tr>".'<td>'.$langs->trans("Amount").'</td><td>'.price($don->amount).' '.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
print "<tr>".'<td>'.$langs->trans("Amount").'</td><td>'.price($don->amount,0,$langs,0,0,-1,$conf->currency).'</td></tr>';
|
||||||
|
|
||||||
print "<tr><td>".$langs->trans("PublicDonation")."</td><td>";
|
print "<tr><td>".$langs->trans("PublicDonation")."</td><td>";
|
||||||
print yn($don->public);
|
print yn($don->public);
|
||||||
|
|||||||
@ -1,28 +1,28 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2002-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2002-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||||
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
||||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
|
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||||
* Copyright (C) 2013 Jean-Francois FERRY <jfefe@aternatik.fr>
|
* Copyright (C) 2013 Jean-Francois FERRY <jfefe@aternatik.fr>
|
||||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 3 of the License, or
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* This program is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/compta/facture.php
|
* \file htdocs/compta/facture.php
|
||||||
@ -1304,7 +1304,7 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights-
|
|||||||
|
|
||||||
if (! empty($price_min) && (price2num($pu_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min)))
|
if (! empty($price_min) && (price2num($pu_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min)))
|
||||||
{
|
{
|
||||||
$mesg = $langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').$langs->getCurrencySymbol($conf->currency));
|
$mesg = $langs->trans("CantBeLessThanMinPrice",price(price2num($price_min,'MU'),0,$langs,0,0,-1,$conf->currency));
|
||||||
setEventMessage($mesg, 'errors');
|
setEventMessage($mesg, 'errors');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1443,7 +1443,7 @@ else if ($action == 'updateligne' && $user->rights->facture->creer && $_POST['sa
|
|||||||
|
|
||||||
if ($price_min && (price2num($pu_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min)))
|
if ($price_min && (price2num($pu_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min)))
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("CantBeLessThanMinPrice", price2num($price_min,'MU')).$langs->getCurrencySymbol($conf->currency), 'errors');
|
setEventMessage($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min,'MU'),0,$langs,0,0,-1,$conf->currency)), 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -367,13 +367,13 @@ if ($resql)
|
|||||||
print $thirdparty->getNomUrl(1,'customer');
|
print $thirdparty->getNomUrl(1,'customer');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td align="right">'.price($objp->total_ht).' '.$langs->getCurrencySymbol($conf->currency).'</td>';
|
print '<td align="right">'.price($objp->total_ht,0,$langs,0,0,-1,$conf->currency).'</td>';
|
||||||
|
|
||||||
print '<td align="right">'.price($objp->total_tva).' '.$langs->getCurrencySymbol($conf->currency).'</td>';
|
print '<td align="right">'.price($objp->total_tva,0,$langs,0,0,-1,$conf->currency).'</td>';
|
||||||
|
|
||||||
print '<td align="right">'.price($objp->total_ttc).' '.$langs->getCurrencySymbol($conf->currency).'</td>';
|
print '<td align="right">'.price($objp->total_ttc,0,$langs,0,0,-1,$conf->currency).'</td>';
|
||||||
|
|
||||||
print '<td align="right">'.(! empty($paiement)?price($paiement).' '.$langs->getCurrencySymbol($conf->currency):' ').'</td>';
|
print '<td align="right">'.(! empty($paiement)?price($paiement,0,$langs,0,0,-1,$conf->currency):' ').'</td>';
|
||||||
|
|
||||||
// Affiche statut de la facture
|
// Affiche statut de la facture
|
||||||
print '<td align="right" class="nowrap">';
|
print '<td align="right" class="nowrap">';
|
||||||
@ -393,10 +393,10 @@ if ($resql)
|
|||||||
// Print total
|
// Print total
|
||||||
print '<tr class="liste_total">';
|
print '<tr class="liste_total">';
|
||||||
print '<td class="liste_total" colspan="4" align="left">'.$langs->trans('Total').'</td>';
|
print '<td class="liste_total" colspan="4" align="left">'.$langs->trans('Total').'</td>';
|
||||||
print '<td class="liste_total" align="right">'.price($total_ht).' '.$langs->getCurrencySymbol($conf->currency).'</td>';
|
print '<td class="liste_total" align="right">'.price($total_ht,0,$langs,0,0,-1,$conf->currency).'</td>';
|
||||||
print '<td class="liste_total" align="right">'.price($total_tva).' '.$langs->getCurrencySymbol($conf->currency).'</td>';
|
print '<td class="liste_total" align="right">'.price($total_tva,0,$langs,0,0,-1,$conf->currency).'</td>';
|
||||||
print '<td class="liste_total" align="right">'.price($total_ttc).' '.$langs->getCurrencySymbol($conf->currency).'</td>';
|
print '<td class="liste_total" align="right">'.price($total_ttc,0,$langs,0,0,-1,$conf->currency).'</td>';
|
||||||
print '<td class="liste_total" align="right">'.price($totalrecu).' '.$langs->getCurrencySymbol($conf->currency).'</td>';
|
print '<td class="liste_total" align="right">'.price($totalrecu,0,$langs,0,0,-1,$conf->currency).'</td>';
|
||||||
print '<td class="liste_total" align="center"> </td>';
|
print '<td class="liste_total" align="center"> </td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -201,7 +201,7 @@ if ($resql)
|
|||||||
print $thirdpartystatic->getNomUrl(1,'customer');
|
print $thirdpartystatic->getNomUrl(1,'customer');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td align="right">';
|
print '<td align="right">';
|
||||||
print price($obj->total_ttc).' '.$langs->trans("Currency".$conf->currency);
|
print price($obj->total_ttc,0,$langs,0,0,-1,$conf->currency);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
// Date
|
// Date
|
||||||
print '<td align="right">';
|
print '<td align="right">';
|
||||||
@ -261,7 +261,7 @@ if ($result)
|
|||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
print '<td align="center">'.dol_print_date($db->jdate($obj->datec),'day')."</td>\n";
|
print '<td align="center">'.dol_print_date($db->jdate($obj->datec),'day')."</td>\n";
|
||||||
|
|
||||||
print '<td align="right">'.price($obj->amount).' '.$langs->trans("Currency".$conf->currency)."</td>\n";
|
print '<td align="right">'.price($obj->amount,0,$langs,0,0,-1,$conf->currency)."</td>\n";
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$i++;
|
$i++;
|
||||||
|
|||||||
@ -459,7 +459,7 @@ else if ($action == 'addline' && $user->rights->contrat->creer)
|
|||||||
|
|
||||||
if($price_min && (price2num($pu_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min)))
|
if($price_min && (price2num($pu_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min)))
|
||||||
{
|
{
|
||||||
$object->error = $langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').' '.$langs->trans("Currency".$conf->currency));
|
$object->error = $langs->trans("CantBeLessThanMinPrice",price(price2num($price_min,'MU'),0,$langs,0,0,-1,$conf->currency));
|
||||||
$result = -1 ;
|
$result = -1 ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -118,7 +118,7 @@ class box_activity extends ModeleBoxes
|
|||||||
);
|
);
|
||||||
|
|
||||||
$this->info_box_contents[$i][3] = array('td' => 'align="right"',
|
$this->info_box_contents[$i][3] = array('td' => 'align="right"',
|
||||||
'text' => dol_trunc(number_format($objp->Mnttot, 0, ',', ' '),40)." ".$langs->getCurrencySymbol($conf->currency)
|
'text' => price($objp->Mnttot,1,$langs,0,0,-1,$conf->currency)
|
||||||
);
|
);
|
||||||
|
|
||||||
// We add only for the current year
|
// We add only for the current year
|
||||||
@ -165,7 +165,7 @@ class box_activity extends ModeleBoxes
|
|||||||
);
|
);
|
||||||
$totalnb += $objp->nb;
|
$totalnb += $objp->nb;
|
||||||
$this->info_box_contents[$i][3] = array('td' => 'align="right"',
|
$this->info_box_contents[$i][3] = array('td' => 'align="right"',
|
||||||
'text' => dol_trunc(number_format($objp->Mnttot, 0, ',', ' '),40)." ".$langs->getCurrencySymbol($conf->currency)
|
'text' => price($objp->Mnttot,1,$langs,0,0,-1,$conf->currency)
|
||||||
);
|
);
|
||||||
$totalMnt += $objp->Mnttot;
|
$totalMnt += $objp->Mnttot;
|
||||||
$this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"',
|
$this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"',
|
||||||
@ -219,7 +219,7 @@ class box_activity extends ModeleBoxes
|
|||||||
$totalnb += $objp->nb;
|
$totalnb += $objp->nb;
|
||||||
|
|
||||||
$this->info_box_contents[$i][3] = array('td' => 'align="right"',
|
$this->info_box_contents[$i][3] = array('td' => 'align="right"',
|
||||||
'text' => dol_trunc(number_format($objp->Mnttot, 0, ',', ' '),40)." ".$langs->getCurrencySymbol($conf->currency)
|
'text' => price($objp->Mnttot,1,$langs,0,0,-1,$conf->currency)
|
||||||
);
|
);
|
||||||
$totalMnt += $objp->Mnttot;
|
$totalMnt += $objp->Mnttot;
|
||||||
$this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"', 'text' => $commandestatic->LibStatut($objp->fk_statut,0,3));
|
$this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"', 'text' => $commandestatic->LibStatut($objp->fk_statut,0,3));
|
||||||
@ -270,7 +270,7 @@ class box_activity extends ModeleBoxes
|
|||||||
$totalnb += $objp->nb;
|
$totalnb += $objp->nb;
|
||||||
|
|
||||||
$this->info_box_contents[$i][3] = array('td' => 'align="right"',
|
$this->info_box_contents[$i][3] = array('td' => 'align="right"',
|
||||||
'text' => dol_trunc(number_format($objp->Mnttot, 0, ',', ' '),40)." ".$langs->getCurrencySymbol($conf->currency)
|
'text' => price($objp->Mnttot,1,$langs,0,0,-1,$conf->currency)
|
||||||
);
|
);
|
||||||
$totalMnt += $objp->Mnttot;
|
$totalMnt += $objp->Mnttot;
|
||||||
$this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"', 'text' => $propalstatic->LibStatut($objp->fk_statut,3));
|
$this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"', 'text' => $propalstatic->LibStatut($objp->fk_statut,3));
|
||||||
@ -283,8 +283,8 @@ class box_activity extends ModeleBoxes
|
|||||||
|
|
||||||
// Add the sum in the bottom of the boxes
|
// Add the sum in the bottom of the boxes
|
||||||
$this->info_box_contents[$i][1] = array('td' => 'align="left" ', 'text' => $langs->trans("Total")." ".$textHead);
|
$this->info_box_contents[$i][1] = array('td' => 'align="left" ', 'text' => $langs->trans("Total")." ".$textHead);
|
||||||
$this->info_box_contents[$i][2] = array('td' => 'align="right" ', 'text' => number_format($totalnb, 0, ',', ' '));
|
$this->info_box_contents[$i][2] = array('td' => 'align="right" ', 'text' => price($totalnb,1,$langs,0,0,-1,$conf->currency));
|
||||||
$this->info_box_contents[$i][3] = array('td' => 'align="right" ', 'text' => number_format($totalMnt, 0, ',', ' ')." ".$langs->getCurrencySymbol($conf->currency));
|
$this->info_box_contents[$i][3] = array('td' => 'align="right" ', 'text' => price($totalMnt,1,$langs,0,0,-1,$conf->currency));
|
||||||
$this->info_box_contents[$i][4] = array('td' => 'align="right" ', 'text' => "");
|
$this->info_box_contents[$i][4] = array('td' => 'align="right" ', 'text' => "");
|
||||||
$this->info_box_contents[$i][5] = array('td' => 'align="right"', 'text' => "");
|
$this->info_box_contents[$i][5] = array('td' => 'align="right"', 'text' => "");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -141,7 +141,7 @@ class box_comptes extends ModeleBoxes
|
|||||||
$this->info_box_contents[$i][2] = array('td' => 'align="right" class="liste_total"',
|
$this->info_box_contents[$i][2] = array('td' => 'align="right" class="liste_total"',
|
||||||
'text' => ' '
|
'text' => ' '
|
||||||
);
|
);
|
||||||
$totalamount=price($solde_total).' '.$langs->trans("Currency".$conf->currency);
|
$totalamount=price($solde_total,0,$langs,0,0,-1,$conf->currency);
|
||||||
$this->info_box_contents[$i][3] = array('td' => 'align="right" class="liste_total"',
|
$this->info_box_contents[$i][3] = array('td' => 'align="right" class="liste_total"',
|
||||||
'text' => $totalamount
|
'text' => $totalamount
|
||||||
);
|
);
|
||||||
|
|||||||
@ -185,7 +185,7 @@ abstract class CommonDocGenerator
|
|||||||
{
|
{
|
||||||
if($extrafields->attribute_type[$key] == 'price')
|
if($extrafields->attribute_type[$key] == 'price')
|
||||||
{
|
{
|
||||||
$object->array_options['options_'.$key] = price($object->array_options['options_'.$key]).' '.$outputlangs->getCurrencySymbol($conf->currency);
|
$object->array_options['options_'.$key] = price($object->array_options['options_'.$key],0,$outputlangs,0,0,-1,$conf->currency);
|
||||||
}
|
}
|
||||||
else if($extrafields->attribute_type[$key] == 'select')
|
else if($extrafields->attribute_type[$key] == 'select')
|
||||||
{
|
{
|
||||||
@ -322,8 +322,8 @@ abstract class CommonDocGenerator
|
|||||||
{
|
{
|
||||||
if($extrafields->attribute_type[$key] == 'price')
|
if($extrafields->attribute_type[$key] == 'price')
|
||||||
{
|
{
|
||||||
$object->array_options['options_'.$key] = price2num($object->array_options['options_'.$key],2);
|
$object->array_options['options_'.$key] = price2num($object->array_options['options_'.$key]);
|
||||||
$object->array_options['options_'.$key.'_currency'] = $object->array_options['options_'.$key].' '.$outputlangs->getCurrencySymbol($conf->currency);
|
$object->array_options['options_'.$key.'_currency'] = price($object->array_options['options_'.$key],0,$outputlangs,0,0,-1,$conf->currency);
|
||||||
//Add value to store price with currency
|
//Add value to store price with currency
|
||||||
$array_to_fill=array_merge($array_to_fill,array($array_key.'_options_'.$key.'_currency' => $object->array_options['options_'.$key.'_currency']));
|
$array_to_fill=array_merge($array_to_fill,array($array_key.'_options_'.$key.'_currency' => $object->array_options['options_'.$key.'_currency']));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -828,7 +828,7 @@ class ExtraFields
|
|||||||
}
|
}
|
||||||
elseif ($type == 'price')
|
elseif ($type == 'price')
|
||||||
{
|
{
|
||||||
$value=price($value).' '.$langs->getCurrencySymbol($conf->currency);
|
$value=price($value,0,$langs,0,0,-1,$conf->currency);
|
||||||
}
|
}
|
||||||
elseif ($type == 'select')
|
elseif ($type == 'select')
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1461,10 +1461,6 @@ class Form
|
|||||||
$outval.=$objRef.' - '.dol_trunc($label,32).' - ';
|
$outval.=$objRef.' - '.dol_trunc($label,32).' - ';
|
||||||
|
|
||||||
$found=0;
|
$found=0;
|
||||||
$currencytext=$langs->trans("Currency".$conf->currency);
|
|
||||||
$currencytextnoent=$langs->transnoentities("Currency".$conf->currency);
|
|
||||||
if (dol_strlen($currencytext) > 10) $currencytext=$conf->currency; // If text is too long, we use the short code
|
|
||||||
if (dol_strlen($currencytextnoent) > 10) $currencytextnoent=$conf->currency; // If text is too long, we use the short code
|
|
||||||
|
|
||||||
// Multiprice
|
// Multiprice
|
||||||
if ($price_level >= 1) // If we need a particular price level (from 1 to 6)
|
if ($price_level >= 1) // If we need a particular price level (from 1 to 6)
|
||||||
@ -1486,13 +1482,13 @@ class Form
|
|||||||
$found=1;
|
$found=1;
|
||||||
if ($objp2->price_base_type == 'HT')
|
if ($objp2->price_base_type == 'HT')
|
||||||
{
|
{
|
||||||
$opt.= price($objp2->price,1).' '.$currencytext.' '.$langs->trans("HT");
|
$opt.= price($objp2->price,1,$langs,0,0,-1,$conf->currency).' '.$langs->trans("HT");
|
||||||
$outval.= price($objp2->price,1).' '.$currencytextnoent.' '.$langs->transnoentities("HT");
|
$outval.= price($objp2->price,0,$langs,0,0,-1,$conf->currency).' '.$langs->transnoentities("HT");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$opt.= price($objp2->price_ttc,1).' '.$currencytext.' '.$langs->trans("TTC");
|
$opt.= price($objp2->price_ttc,1,$langs,0,0,-1,$conf->currency).' '.$langs->trans("TTC");
|
||||||
$outval.= price($objp2->price_ttc,1).' '.$currencytextnoent.' '.$langs->transnoentities("TTC");
|
$outval.= price($objp2->price_ttc,0,$langs,0,0,-1,$conf->currency).' '.$langs->transnoentities("TTC");
|
||||||
}
|
}
|
||||||
$outprice_ht=price($objp2->price);
|
$outprice_ht=price($objp2->price);
|
||||||
$outprice_ttc=price($objp2->price_ttc);
|
$outprice_ttc=price($objp2->price_ttc);
|
||||||
@ -1514,15 +1510,15 @@ class Form
|
|||||||
$outdiscount=$objp->remise_percent;
|
$outdiscount=$objp->remise_percent;
|
||||||
if ($objp->quantity == 1)
|
if ($objp->quantity == 1)
|
||||||
{
|
{
|
||||||
$opt.= price($objp->unitprice).' '.$currencytext."/";
|
$opt.= price($objp->unitprice,1,$langs,0,0,-1,$conf->currency)."/";
|
||||||
$outval.= price($objp->unitprice).' '.$currencytextnoent."/";
|
$outval.= price($objp->unitprice,0,$langs,0,0,-1,$conf->currency)."/";
|
||||||
$opt.= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding
|
$opt.= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding
|
||||||
$outval.=$langs->transnoentities("Unit");
|
$outval.=$langs->transnoentities("Unit");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$opt.= price($objp->price).' '.$currencytext."/".$objp->quantity;
|
$opt.= price($objp->price,1,$langs,0,0,-1,$conf->currency)."/".$objp->quantity;
|
||||||
$outval.= price($objp->price).' '.$currencytextnoent."/".$objp->quantity;
|
$outval.= price($objp->price,0,$langs,0,0,-1,$conf->currency)."/".$objp->quantity;
|
||||||
$opt.= $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
|
$opt.= $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
|
||||||
$outval.=$langs->transnoentities("Units");
|
$outval.=$langs->transnoentities("Units");
|
||||||
}
|
}
|
||||||
@ -1534,8 +1530,8 @@ class Form
|
|||||||
}
|
}
|
||||||
if (!empty($objp->quantity) && $objp->quantity >= 1)
|
if (!empty($objp->quantity) && $objp->quantity >= 1)
|
||||||
{
|
{
|
||||||
$opt.=" (".price($objp->unitprice).' '.$currencytext."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
|
$opt.=" (".price($objp->unitprice,1,$langs,0,0,-1,$conf->currency)."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
|
||||||
$outval.=" (".price($objp->unitprice).' '.$currencytextnoent."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
|
$outval.=" (".price($objp->unitprice,0,$langs,0,0,-1,$conf->currency)."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
|
||||||
}
|
}
|
||||||
if (!empty($objp->remise_percent) && $objp->remise_percent >= 1)
|
if (!empty($objp->remise_percent) && $objp->remise_percent >= 1)
|
||||||
{
|
{
|
||||||
@ -1548,13 +1544,13 @@ class Form
|
|||||||
{
|
{
|
||||||
if ($objp->price_base_type == 'HT')
|
if ($objp->price_base_type == 'HT')
|
||||||
{
|
{
|
||||||
$opt.= price($objp->price,1).' '.$currencytext.' '.$langs->trans("HT");
|
$opt.= price($objp->price,1,$langs,0,0,-1,$conf->currency).' '.$langs->trans("HT");
|
||||||
$outval.= price($objp->price,1).' '.$currencytextnoent.' '.$langs->transnoentities("HT");
|
$outval.= price($objp->price,0,$langs,0,0,-1,$conf->currency).' '.$langs->transnoentities("HT");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$opt.= price($objp->price_ttc,1).' '.$currencytext.' '.$langs->trans("TTC");
|
$opt.= price($objp->price_ttc,1,$langs,0,0,-1,$conf->currency).' '.$langs->trans("TTC");
|
||||||
$outval.= price($objp->price_ttc,1).' '.$currencytextnoent.' '.$langs->transnoentities("TTC");
|
$outval.= price($objp->price_ttc,0,$langs,0,0,-1,$conf->currency).' '.$langs->transnoentities("TTC");
|
||||||
}
|
}
|
||||||
$outprice_ht=price($objp->price);
|
$outprice_ht=price($objp->price);
|
||||||
$outprice_ttc=price($objp->price_ttc);
|
$outprice_ttc=price($objp->price_ttc);
|
||||||
@ -1720,33 +1716,27 @@ class Form
|
|||||||
|
|
||||||
if (! empty($objp->idprodfournprice))
|
if (! empty($objp->idprodfournprice))
|
||||||
{
|
{
|
||||||
$currencytext=$langs->trans("Currency".$conf->currency);
|
|
||||||
$currencytextnoent=$langs->transnoentities("Currency".$conf->currency);
|
|
||||||
if (dol_strlen($currencytext) > 10) $currencytext=$conf->currency; // If text is too long, we use the short code
|
|
||||||
if (dol_strlen($currencytextnoent) > 10) $currencytextnoent=$conf->currency; // If text is too long, we use the short code
|
|
||||||
|
|
||||||
|
|
||||||
$outqty=$objp->quantity;
|
$outqty=$objp->quantity;
|
||||||
$outdiscount=$objp->remise_percent;
|
$outdiscount=$objp->remise_percent;
|
||||||
if ($objp->quantity == 1)
|
if ($objp->quantity == 1)
|
||||||
{
|
{
|
||||||
$opt.= price($objp->fprice).' '.$currencytext."/";
|
$opt.= price($objp->fprice,1,$langs,0,0,-1,$conf->currency)."/";
|
||||||
$outval.= price($objp->fprice).' '.$currencytextnoent."/";
|
$outval.= price($objp->fprice,0,$langs,0,0,-1,$conf->currency)."/";
|
||||||
$opt.= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding
|
$opt.= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding
|
||||||
$outval.=$langs->transnoentities("Unit");
|
$outval.=$langs->transnoentities("Unit");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$opt.= price($objp->fprice).' '.$currencytext."/".$objp->quantity;
|
$opt.= price($objp->fprice,1,$langs,0,0,-1,$conf->currency)."/".$objp->quantity;
|
||||||
$outval.= price($objp->fprice).' '.$currencytextnoent."/".$objp->quantity;
|
$outval.= price($objp->fprice,0,$langs,0,0,-1,$conf->currency)."/".$objp->quantity;
|
||||||
$opt.= $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
|
$opt.= $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding
|
||||||
$outval.= $langs->transnoentities("Units");
|
$outval.= $langs->transnoentities("Units");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($objp->quantity >= 1)
|
if ($objp->quantity >= 1)
|
||||||
{
|
{
|
||||||
$opt.=" (".price($objp->unitprice).' '.$currencytext."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
|
$opt.=" (".price($objp->unitprice,1,$langs,0,0,-1,$conf->currency)."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
|
||||||
$outval.=" (".price($objp->unitprice).' '.$currencytextnoent."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
|
$outval.=" (".price($objp->unitprice,0,$langs,0,0,-1,$conf->currency)."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding
|
||||||
}
|
}
|
||||||
if ($objp->remise_percent >= 1)
|
if ($objp->remise_percent >= 1)
|
||||||
{
|
{
|
||||||
@ -1853,24 +1843,23 @@ class Form
|
|||||||
|
|
||||||
if ($objp->quantity == 1)
|
if ($objp->quantity == 1)
|
||||||
{
|
{
|
||||||
$opt.= price($objp->fprice);
|
$opt.= price($objp->fprice,1,$langs,0,0,-1,$conf->currency)."/";
|
||||||
$opt.= $langs->trans("Currency".$conf->currency)."/";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$opt.= $objp->quantity.' ';
|
$opt.= $objp->quantity.' ';
|
||||||
|
|
||||||
if ($objp->quantity == 1)
|
if ($objp->quantity == 1)
|
||||||
{
|
{
|
||||||
$opt.= strtolower($langs->trans("Unit"));
|
$opt.= $langs->trans("Unit");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$opt.= strtolower($langs->trans("Units"));
|
$opt.= $langs->trans("Units");
|
||||||
}
|
}
|
||||||
if ($objp->quantity > 1)
|
if ($objp->quantity > 1)
|
||||||
{
|
{
|
||||||
$opt.=" - ";
|
$opt.=" - ";
|
||||||
$opt.= price($objp->unitprice).$langs->trans("Currency".$conf->currency)."/".strtolower($langs->trans("Unit"));
|
$opt.= price($objp->unitprice,1,$langs,0,0,-1,$conf->currency)."/".$langs->trans("Unit");
|
||||||
}
|
}
|
||||||
if ($objp->duration) $opt .= " - ".$objp->duration;
|
if ($objp->duration) $opt .= " - ".$objp->duration;
|
||||||
$opt .= "</option>\n";
|
$opt .= "</option>\n";
|
||||||
@ -2987,13 +2976,13 @@ class Form
|
|||||||
print '<tr><td class="nowrap">';
|
print '<tr><td class="nowrap">';
|
||||||
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS))
|
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS))
|
||||||
{
|
{
|
||||||
if (! $filter || $filter=="fk_facture_source IS NULL") print $langs->trans("CompanyHasAbsoluteDiscount",price($amount),$langs->transnoentities("Currency".$conf->currency)).': '; // If we want deposit to be substracted to payments only and not to total of final invoice
|
if (! $filter || $filter=="fk_facture_source IS NULL") print $langs->trans("CompanyHasAbsoluteDiscount",price($amount,1,$langs,0,0,-1,$conf->currency)).': '; // If we want deposit to be substracted to payments only and not to total of final invoice
|
||||||
else print $langs->trans("CompanyHasCreditNote",price($amount),$langs->transnoentities("Currency".$conf->currency)).': ';
|
else print $langs->trans("CompanyHasCreditNote",price($amount,1,$langs,0,0,-1,$conf->currency)).': ';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (! $filter || $filter=="fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND description='(DEPOSIT)')") print $langs->trans("CompanyHasAbsoluteDiscount",price($amount),$langs->transnoentities("Currency".$conf->currency)).': ';
|
if (! $filter || $filter=="fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND description='(DEPOSIT)')") print $langs->trans("CompanyHasAbsoluteDiscount",price($amount,1,$langs,0,0,-1,$conf->currency)).': ';
|
||||||
else print $langs->trans("CompanyHasCreditNote",price($amount),$langs->transnoentities("Currency".$conf->currency)).': ';
|
else print $langs->trans("CompanyHasCreditNote",price($amount,1,$langs,0,0,-1,$conf->currency)).': ';
|
||||||
}
|
}
|
||||||
$newfilter='fk_facture IS NULL AND fk_facture_line IS NULL'; // Remises disponibles
|
$newfilter='fk_facture IS NULL AND fk_facture_line IS NULL'; // Remises disponibles
|
||||||
if ($filter) $newfilter.=' AND ('.$filter.')';
|
if ($filter) $newfilter.=' AND ('.$filter.')';
|
||||||
|
|||||||
@ -163,21 +163,6 @@ function getParentCompanyTimeZoneInt($refgmtdate='now')
|
|||||||
}*/
|
}*/
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add a delay of a timezone to a date
|
|
||||||
*
|
|
||||||
* @param timestamp $time Date timestamp
|
|
||||||
* @param string $timezone Timezone
|
|
||||||
* @return timestamp New timestamp
|
|
||||||
*/
|
|
||||||
function dol_time_plus_timezone($time,$timezone)
|
|
||||||
{
|
|
||||||
// TODO Finish function
|
|
||||||
|
|
||||||
return $time;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a delay to a date
|
* Add a delay to a date
|
||||||
*
|
*
|
||||||
@ -329,14 +314,12 @@ function convertSecondToTime($iSecond,$format='all',$lengthOfDay=86400,$lengthOf
|
|||||||
* DD/MM/YY HH:MM:SS or DD/MM/YYYY HH:MM:SS (this format should not be used anymore)
|
* DD/MM/YY HH:MM:SS or DD/MM/YYYY HH:MM:SS (this format should not be used anymore)
|
||||||
* @param int $gm 1 =Input date is GM date,
|
* @param int $gm 1 =Input date is GM date,
|
||||||
* 0 =Input date is local date using PHP server timezone
|
* 0 =Input date is local date using PHP server timezone
|
||||||
* -1=Input date is local date using timezone provided as third parameter
|
|
||||||
* @param string $tz Timezone to use. This means param $gm=-1
|
|
||||||
* @return date Date
|
* @return date Date
|
||||||
* 19700101020000 -> 7200 with gm=1
|
* 19700101020000 -> 7200 with gm=1
|
||||||
*
|
*
|
||||||
* @see dol_print_date, dol_mktime, dol_getdate
|
* @see dol_print_date, dol_mktime, dol_getdate
|
||||||
*/
|
*/
|
||||||
function dol_stringtotime($string, $gm=1, $tz='')
|
function dol_stringtotime($string, $gm=1)
|
||||||
{
|
{
|
||||||
// Convert date with format DD/MM/YYY HH:MM:SS. This part of code should not be used.
|
// Convert date with format DD/MM/YYY HH:MM:SS. This part of code should not be used.
|
||||||
if (preg_match('/^([0-9]+)\/([0-9]+)\/([0-9]+)\s?([0-9]+)?:?([0-9]+)?:?([0-9]+)?/i',$string,$reg))
|
if (preg_match('/^([0-9]+)\/([0-9]+)\/([0-9]+)\s?([0-9]+)?:?([0-9]+)?:?([0-9]+)?/i',$string,$reg))
|
||||||
@ -380,10 +363,6 @@ function dol_stringtotime($string, $gm=1, $tz='')
|
|||||||
$string=preg_replace('/([^0-9])/i','',$string);
|
$string=preg_replace('/([^0-9])/i','',$string);
|
||||||
$tmp=$string.'000000';
|
$tmp=$string.'000000';
|
||||||
$date=dol_mktime(substr($tmp,8,2),substr($tmp,10,2),substr($tmp,12,2),substr($tmp,4,2),substr($tmp,6,2),substr($tmp,0,4),($gm?1:0));
|
$date=dol_mktime(substr($tmp,8,2),substr($tmp,10,2),substr($tmp,12,2),substr($tmp,4,2),substr($tmp,6,2),substr($tmp,0,4),($gm?1:0));
|
||||||
if ($gm == -1)
|
|
||||||
{
|
|
||||||
$date=dol_time_plus_timezone($date,$tz);
|
|
||||||
}
|
|
||||||
return $date;
|
return $date;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2616,8 +2616,8 @@ function vatrate($rate,$addpercent=false,$info_bits=0,$usestarfornpr=0)
|
|||||||
* @param string $form Type of format, HTML or not (not by default)
|
* @param string $form Type of format, HTML or not (not by default)
|
||||||
* @param Translate $outlangs Object langs for output
|
* @param Translate $outlangs Object langs for output
|
||||||
* @param int $trunc 1=Truncate if there is too much decimals (default), 0=Does not truncate
|
* @param int $trunc 1=Truncate if there is too much decimals (default), 0=Does not truncate
|
||||||
* @param int $rounding Minimum number of decimal to show. If not defined we use min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOTAL)
|
* @param int $rounding Minimum number of decimal to show. If 0, no change, if -1, we use min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOTAL)
|
||||||
* @param int $forcerounding Force the number of decimal fo forcerounding decimal (-1=do not force)
|
* @param int $forcerounding Force the number of decimal to forcerounding decimal (-1=do not force)
|
||||||
* @param string $currency_code To add currency symbol (''=add nothing, 'XXX'=add currency symbols for XXX currency)
|
* @param string $currency_code To add currency symbol (''=add nothing, 'XXX'=add currency symbols for XXX currency)
|
||||||
* @return string Chaine avec montant formate
|
* @return string Chaine avec montant formate
|
||||||
*
|
*
|
||||||
|
|||||||
@ -76,8 +76,7 @@ if (! empty($idprod))
|
|||||||
|
|
||||||
if ($objp->quantity == 1)
|
if ($objp->quantity == 1)
|
||||||
{
|
{
|
||||||
$title.= price($objp->fprice);
|
$title.= price($objp->fprice,0,$langs,0,0,-1,$conf->currency)."/";
|
||||||
$title.= $langs->getCurrencySymbol($conf->currency)."/";
|
|
||||||
|
|
||||||
$price = $objp->fprice;
|
$price = $objp->fprice;
|
||||||
}
|
}
|
||||||
@ -95,18 +94,18 @@ if (! empty($idprod))
|
|||||||
if ($objp->quantity > 1)
|
if ($objp->quantity > 1)
|
||||||
{
|
{
|
||||||
$title.=" - ";
|
$title.=" - ";
|
||||||
$title.= price($objp->unitprice).$langs->getCurrencySymbol($conf->currency)."/".strtolower($langs->trans("Unit"));
|
$title.= price($objp->unitprice,0,$langs,0,0,-1,$conf->currency)."/".$langs->trans("Unit");
|
||||||
|
|
||||||
$price = $objp->unitprice;
|
$price = $objp->unitprice;
|
||||||
}
|
}
|
||||||
if ($objp->unitcharges > 0 && ($conf->global->MARGIN_TYPE == "2")) {
|
if ($objp->unitcharges > 0 && ($conf->global->MARGIN_TYPE == "2")) {
|
||||||
$title.=" + ";
|
$title.=" + ";
|
||||||
$title.= price($objp->unitcharges).$langs->getCurrencySymbol($conf->currency);
|
$title.= price($objp->unitcharges,0,$langs,0,0,-1,$conf->currency);
|
||||||
$price += $objp->unitcharges;
|
$price += $objp->unitcharges;
|
||||||
}
|
}
|
||||||
if ($objp->duration) $label .= " - ".$objp->duration;
|
if ($objp->duration) $label .= " - ".$objp->duration;
|
||||||
|
|
||||||
$label = price($price).$langs->getCurrencySymbol($conf->currency)."/".strtolower($langs->trans("Unit"));
|
$label = price($price,0,$langs,0,0,-1,$conf->currency)."/".$langs->trans("Unit");
|
||||||
|
|
||||||
$prices[] = array("id" => $objp->idprodfournprice, "price" => price($price,0,'',0), "label" => $label, "title" => $title);
|
$prices[] = array("id" => $objp->idprodfournprice, "price" => price($price,0,'',0), "label" => $label, "title" => $title);
|
||||||
$i++;
|
$i++;
|
||||||
|
|||||||
3
htdocs/includes/jquery/plugins/tablednd/README.txt
Normal file
3
htdocs/includes/jquery/plugins/tablednd/README.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
----- jquery.tablednd -----
|
||||||
|
- New versions are found into directory js of https://github.com/isocra/TableDnD
|
||||||
|
- Version 0.7, 0.8 seems to be not compatible.
|
||||||
1
htdocs/includes/jquery/plugins/tablednd/jquery.tablednd.0.6.min.js
vendored
Normal file
1
htdocs/includes/jquery/plugins/tablednd/jquery.tablednd.0.6.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -1,382 +0,0 @@
|
|||||||
/**
|
|
||||||
* TableDnD plug-in for JQuery, allows you to drag and drop table rows
|
|
||||||
* You can set up various options to control how the system will work
|
|
||||||
* Copyright (c) Denis Howlett <denish@isocra.com>
|
|
||||||
* Licensed like jQuery, see http://docs.jquery.com/License.
|
|
||||||
*
|
|
||||||
* Configuration options:
|
|
||||||
*
|
|
||||||
* onDragStyle
|
|
||||||
* This is the style that is assigned to the row during drag. There are limitations to the styles that can be
|
|
||||||
* associated with a row (such as you can't assign a border--well you can, but it won't be
|
|
||||||
* displayed). (So instead consider using onDragClass.) The CSS style to apply is specified as
|
|
||||||
* a map (as used in the jQuery css(...) function).
|
|
||||||
* onDropStyle
|
|
||||||
* This is the style that is assigned to the row when it is dropped. As for onDragStyle, there are limitations
|
|
||||||
* to what you can do. Also this replaces the original style, so again consider using onDragClass which
|
|
||||||
* is simply added and then removed on drop.
|
|
||||||
* onDragClass
|
|
||||||
* This class is added for the duration of the drag and then removed when the row is dropped. It is more
|
|
||||||
* flexible than using onDragStyle since it can be inherited by the row cells and other content. The default
|
|
||||||
* is class is tDnD_whileDrag. So to use the default, simply customise this CSS class in your
|
|
||||||
* stylesheet.
|
|
||||||
* onDrop
|
|
||||||
* Pass a function that will be called when the row is dropped. The function takes 2 parameters: the table
|
|
||||||
* and the row that was dropped. You can work out the new order of the rows by using
|
|
||||||
* table.rows.
|
|
||||||
* onDragStart
|
|
||||||
* Pass a function that will be called when the user starts dragging. The function takes 2 parameters: the
|
|
||||||
* table and the row which the user has started to drag.
|
|
||||||
* onAllowDrop
|
|
||||||
* Pass a function that will be called as a row is over another row. If the function returns true, allow
|
|
||||||
* dropping on that row, otherwise not. The function takes 2 parameters: the dragged row and the row under
|
|
||||||
* the cursor. It returns a boolean: true allows the drop, false doesn't allow it.
|
|
||||||
* scrollAmount
|
|
||||||
* This is the number of pixels to scroll if the user moves the mouse cursor to the top or bottom of the
|
|
||||||
* window. The page should automatically scroll up or down as appropriate (tested in IE6, IE7, Safari, FF2,
|
|
||||||
* FF3 beta
|
|
||||||
* dragHandle
|
|
||||||
* This is the name of a class that you assign to one or more cells in each row that is draggable. If you
|
|
||||||
* specify this class, then you are responsible for setting cursor: move in the CSS and only these cells
|
|
||||||
* will have the drag behaviour. If you do not specify a dragHandle, then you get the old behaviour where
|
|
||||||
* the whole row is draggable.
|
|
||||||
*
|
|
||||||
* Other ways to control behaviour:
|
|
||||||
*
|
|
||||||
* Add class="nodrop" to any rows for which you don't want to allow dropping, and class="nodrag" to any rows
|
|
||||||
* that you don't want to be draggable.
|
|
||||||
*
|
|
||||||
* Inside the onDrop method you can also call $.tableDnD.serialize() this returns a string of the form
|
|
||||||
* <tableID>[]=<rowID1>&<tableID>[]=<rowID2> so that you can send this back to the server. The table must have
|
|
||||||
* an ID as must all the rows.
|
|
||||||
*
|
|
||||||
* Other methods:
|
|
||||||
*
|
|
||||||
* $("...").tableDnDUpdate()
|
|
||||||
* Will update all the matching tables, that is it will reapply the mousedown method to the rows (or handle cells).
|
|
||||||
* This is useful if you have updated the table rows using Ajax and you want to make the table draggable again.
|
|
||||||
* The table maintains the original configuration (so you don't have to specify it again).
|
|
||||||
*
|
|
||||||
* $("...").tableDnDSerialize()
|
|
||||||
* Will serialize and return the serialized string as above, but for each of the matching tables--so it can be
|
|
||||||
* called from anywhere and isn't dependent on the currentTable being set up correctly before calling
|
|
||||||
*
|
|
||||||
* Known problems:
|
|
||||||
* - Auto-scoll has some problems with IE7 (it scrolls even when it shouldn't), work-around: set scrollAmount to 0
|
|
||||||
*
|
|
||||||
* Version 0.2: 2008-02-20 First public version
|
|
||||||
* Version 0.3: 2008-02-07 Added onDragStart option
|
|
||||||
* Made the scroll amount configurable (default is 5 as before)
|
|
||||||
* Version 0.4: 2008-03-15 Changed the noDrag/noDrop attributes to nodrag/nodrop classes
|
|
||||||
* Added onAllowDrop to control dropping
|
|
||||||
* Fixed a bug which meant that you couldn't set the scroll amount in both directions
|
|
||||||
* Added serialize method
|
|
||||||
* Version 0.5: 2008-05-16 Changed so that if you specify a dragHandle class it doesn't make the whole row
|
|
||||||
* draggable
|
|
||||||
* Improved the serialize method to use a default (and settable) regular expression.
|
|
||||||
* Added tableDnDupate() and tableDnDSerialize() to be called when you are outside the table
|
|
||||||
*/
|
|
||||||
jQuery.tableDnD = {
|
|
||||||
/** Keep hold of the current table being dragged */
|
|
||||||
currentTable : null,
|
|
||||||
/** Keep hold of the current drag object if any */
|
|
||||||
dragObject: null,
|
|
||||||
/** The current mouse offset */
|
|
||||||
mouseOffset: null,
|
|
||||||
/** Remember the old value of Y so that we don't do too much processing */
|
|
||||||
oldY: 0,
|
|
||||||
|
|
||||||
/** Actually build the structure */
|
|
||||||
build: function(options) {
|
|
||||||
// Set up the defaults if any
|
|
||||||
|
|
||||||
this.each(function() {
|
|
||||||
// This is bound to each matching table, set up the defaults and override with user options
|
|
||||||
this.tableDnDConfig = jQuery.extend({
|
|
||||||
onDragStyle: null,
|
|
||||||
onDropStyle: null,
|
|
||||||
// Add in the default class for whileDragging
|
|
||||||
onDragClass: "tDnD_whileDrag",
|
|
||||||
onDrop: null,
|
|
||||||
onDragStart: null,
|
|
||||||
scrollAmount: 5,
|
|
||||||
serializeRegexp: /[^\-]*$/, // The regular expression to use to trim row IDs
|
|
||||||
serializeParamName: null, // If you want to specify another parameter name instead of the table ID
|
|
||||||
dragHandle: null // If you give the name of a class here, then only Cells with this class will be draggable
|
|
||||||
}, options || {});
|
|
||||||
// Now make the rows draggable
|
|
||||||
jQuery.tableDnD.makeDraggable(this);
|
|
||||||
});
|
|
||||||
|
|
||||||
// Now we need to capture the mouse up and mouse move event
|
|
||||||
// We can use bind so that we don't interfere with other event handlers
|
|
||||||
jQuery(document)
|
|
||||||
.bind('mousemove', jQuery.tableDnD.mousemove)
|
|
||||||
.bind('mouseup', jQuery.tableDnD.mouseup);
|
|
||||||
|
|
||||||
// Don't break the chain
|
|
||||||
return this;
|
|
||||||
},
|
|
||||||
|
|
||||||
/** This function makes all the rows on the table draggable apart from those marked as "NoDrag" */
|
|
||||||
makeDraggable: function(table) {
|
|
||||||
var config = table.tableDnDConfig;
|
|
||||||
if (table.tableDnDConfig.dragHandle) {
|
|
||||||
// We only need to add the event to the specified cells
|
|
||||||
var cells = jQuery("td."+table.tableDnDConfig.dragHandle, table);
|
|
||||||
cells.each(function() {
|
|
||||||
// The cell is bound to "this"
|
|
||||||
jQuery(this).mousedown(function(ev) {
|
|
||||||
jQuery.tableDnD.dragObject = this.parentNode;
|
|
||||||
jQuery.tableDnD.currentTable = table;
|
|
||||||
jQuery.tableDnD.mouseOffset = jQuery.tableDnD.getMouseOffset(this, ev);
|
|
||||||
if (config.onDragStart) {
|
|
||||||
// Call the onDrop method if there is one
|
|
||||||
config.onDragStart(table, this);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
// For backwards compatibility, we add the event to the whole row
|
|
||||||
var rows = jQuery("tr", table); // get all the rows as a wrapped set
|
|
||||||
rows.each(function() {
|
|
||||||
// Iterate through each row, the row is bound to "this"
|
|
||||||
var row = jQuery(this);
|
|
||||||
if (! row.hasClass("nodrag")) {
|
|
||||||
row.mousedown(function(ev) {
|
|
||||||
if (ev.target.tagName == "TD") {
|
|
||||||
jQuery.tableDnD.dragObject = this;
|
|
||||||
jQuery.tableDnD.currentTable = table;
|
|
||||||
jQuery.tableDnD.mouseOffset = jQuery.tableDnD.getMouseOffset(this, ev);
|
|
||||||
if (config.onDragStart) {
|
|
||||||
// Call the onDrop method if there is one
|
|
||||||
config.onDragStart(table, this);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}).css("cursor", "move"); // Store the tableDnD object
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
updateTables: function() {
|
|
||||||
this.each(function() {
|
|
||||||
// this is now bound to each matching table
|
|
||||||
if (this.tableDnDConfig) {
|
|
||||||
jQuery.tableDnD.makeDraggable(this);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
/** Get the mouse coordinates from the event (allowing for browser differences) */
|
|
||||||
mouseCoords: function(ev){
|
|
||||||
if(ev.pageX || ev.pageY){
|
|
||||||
return {x:ev.pageX, y:ev.pageY};
|
|
||||||
}
|
|
||||||
return {
|
|
||||||
x:ev.clientX + document.body.scrollLeft - document.body.clientLeft,
|
|
||||||
y:ev.clientY + document.body.scrollTop - document.body.clientTop
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
/** Given a target element and a mouse event, get the mouse offset from that element.
|
|
||||||
To do this we need the element's position and the mouse position */
|
|
||||||
getMouseOffset: function(target, ev) {
|
|
||||||
ev = ev || window.event;
|
|
||||||
|
|
||||||
var docPos = this.getPosition(target);
|
|
||||||
var mousePos = this.mouseCoords(ev);
|
|
||||||
return {x:mousePos.x - docPos.x, y:mousePos.y - docPos.y};
|
|
||||||
},
|
|
||||||
|
|
||||||
/** Get the position of an element by going up the DOM tree and adding up all the offsets */
|
|
||||||
getPosition: function(e){
|
|
||||||
var left = 0;
|
|
||||||
var top = 0;
|
|
||||||
/** Safari fix -- thanks to Luis Chato for this! */
|
|
||||||
if (e.offsetHeight == 0) {
|
|
||||||
/** Safari 2 doesn't correctly grab the offsetTop of a table row
|
|
||||||
this is detailed here:
|
|
||||||
http://jacob.peargrove.com/blog/2006/technical/table-row-offsettop-bug-in-safari/
|
|
||||||
the solution is likewise noted there, grab the offset of a table cell in the row - the firstChild.
|
|
||||||
note that firefox will return a text node as a first child, so designing a more thorough
|
|
||||||
solution may need to take that into account, for now this seems to work in firefox, safari, ie */
|
|
||||||
e = e.firstChild; // a table cell
|
|
||||||
}
|
|
||||||
|
|
||||||
while (e.offsetParent){
|
|
||||||
left += e.offsetLeft;
|
|
||||||
top += e.offsetTop;
|
|
||||||
e = e.offsetParent;
|
|
||||||
}
|
|
||||||
|
|
||||||
left += e.offsetLeft;
|
|
||||||
top += e.offsetTop;
|
|
||||||
|
|
||||||
return {x:left, y:top};
|
|
||||||
},
|
|
||||||
|
|
||||||
mousemove: function(ev) {
|
|
||||||
if (jQuery.tableDnD.dragObject == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var dragObj = jQuery(jQuery.tableDnD.dragObject);
|
|
||||||
var config = jQuery.tableDnD.currentTable.tableDnDConfig;
|
|
||||||
var mousePos = jQuery.tableDnD.mouseCoords(ev);
|
|
||||||
var y = mousePos.y - jQuery.tableDnD.mouseOffset.y;
|
|
||||||
//auto scroll the window
|
|
||||||
var yOffset = window.pageYOffset;
|
|
||||||
if (document.all) {
|
|
||||||
// Windows version
|
|
||||||
//yOffset=document.body.scrollTop;
|
|
||||||
if (typeof document.compatMode != 'undefined' &&
|
|
||||||
document.compatMode != 'BackCompat') {
|
|
||||||
yOffset = document.documentElement.scrollTop;
|
|
||||||
}
|
|
||||||
else if (typeof document.body != 'undefined') {
|
|
||||||
yOffset=document.body.scrollTop;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mousePos.y-yOffset < config.scrollAmount) {
|
|
||||||
window.scrollBy(0, -config.scrollAmount);
|
|
||||||
} else {
|
|
||||||
var windowHeight = window.innerHeight ? window.innerHeight
|
|
||||||
: document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight;
|
|
||||||
if (windowHeight-(mousePos.y-yOffset) < config.scrollAmount) {
|
|
||||||
window.scrollBy(0, config.scrollAmount);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (y != jQuery.tableDnD.oldY) {
|
|
||||||
// work out if we're going up or down...
|
|
||||||
var movingDown = y > jQuery.tableDnD.oldY;
|
|
||||||
// update the old value
|
|
||||||
jQuery.tableDnD.oldY = y;
|
|
||||||
// update the style to show we're dragging
|
|
||||||
if (config.onDragClass) {
|
|
||||||
dragObj.addClass(config.onDragClass);
|
|
||||||
} else {
|
|
||||||
dragObj.css(config.onDragStyle);
|
|
||||||
}
|
|
||||||
// If we're over a row then move the dragged row to there so that the user sees the
|
|
||||||
// effect dynamically
|
|
||||||
var currentRow = jQuery.tableDnD.findDropTargetRow(dragObj, y);
|
|
||||||
if (currentRow) {
|
|
||||||
// TODO worry about what happens when there are multiple TBODIES
|
|
||||||
if (movingDown && jQuery.tableDnD.dragObject != currentRow) {
|
|
||||||
jQuery.tableDnD.dragObject.parentNode.insertBefore(jQuery.tableDnD.dragObject, currentRow.nextSibling);
|
|
||||||
} else if (! movingDown && jQuery.tableDnD.dragObject != currentRow) {
|
|
||||||
jQuery.tableDnD.dragObject.parentNode.insertBefore(jQuery.tableDnD.dragObject, currentRow);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
},
|
|
||||||
|
|
||||||
/** We're only worried about the y position really, because we can only move rows up and down */
|
|
||||||
findDropTargetRow: function(draggedRow, y) {
|
|
||||||
var rows = jQuery.tableDnD.currentTable.rows;
|
|
||||||
for (var i=0; i<rows.length; i++) {
|
|
||||||
var row = rows[i];
|
|
||||||
var rowY = this.getPosition(row).y;
|
|
||||||
var rowHeight = parseInt(row.offsetHeight)/2;
|
|
||||||
if (row.offsetHeight == 0) {
|
|
||||||
rowY = this.getPosition(row.firstChild).y;
|
|
||||||
rowHeight = parseInt(row.firstChild.offsetHeight)/2;
|
|
||||||
}
|
|
||||||
// Because we always have to insert before, we need to offset the height a bit
|
|
||||||
if ((y > rowY - rowHeight) && (y < (rowY + rowHeight))) {
|
|
||||||
// that's the row we're over
|
|
||||||
// If it's the same as the current row, ignore it
|
|
||||||
if (row == draggedRow) {return null;}
|
|
||||||
var config = jQuery.tableDnD.currentTable.tableDnDConfig;
|
|
||||||
if (config.onAllowDrop) {
|
|
||||||
if (config.onAllowDrop(draggedRow, row)) {
|
|
||||||
return row;
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// If a row has nodrop class, then don't allow dropping (inspired by John Tarr and Famic)
|
|
||||||
var nodrop = jQuery(row).hasClass("nodrop");
|
|
||||||
if (! nodrop) {
|
|
||||||
return row;
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return row;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
},
|
|
||||||
|
|
||||||
mouseup: function(e) {
|
|
||||||
if (jQuery.tableDnD.currentTable && jQuery.tableDnD.dragObject) {
|
|
||||||
var droppedRow = jQuery.tableDnD.dragObject;
|
|
||||||
var config = jQuery.tableDnD.currentTable.tableDnDConfig;
|
|
||||||
// If we have a dragObject, then we need to release it,
|
|
||||||
// The row will already have been moved to the right place so we just reset stuff
|
|
||||||
if (config.onDragClass) {
|
|
||||||
jQuery(droppedRow).removeClass(config.onDragClass);
|
|
||||||
} else {
|
|
||||||
jQuery(droppedRow).css(config.onDropStyle);
|
|
||||||
}
|
|
||||||
jQuery.tableDnD.dragObject = null;
|
|
||||||
if (config.onDrop) {
|
|
||||||
// Call the onDrop method if there is one
|
|
||||||
config.onDrop(jQuery.tableDnD.currentTable, droppedRow);
|
|
||||||
}
|
|
||||||
jQuery.tableDnD.currentTable = null; // let go of the table too
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
serialize: function() {
|
|
||||||
if (jQuery.tableDnD.currentTable) {
|
|
||||||
return jQuery.tableDnD.serializeTable(jQuery.tableDnD.currentTable);
|
|
||||||
} else {
|
|
||||||
return "Error: No Table id set, you need to set an id on your table and every row";
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
serializeTable: function(table) {
|
|
||||||
var result = "";
|
|
||||||
var tableId = table.id;
|
|
||||||
var rows = table.rows;
|
|
||||||
for (var i=0; i<rows.length; i++) {
|
|
||||||
if (result.length > 0) result += "&";
|
|
||||||
var rowId = rows[i].id;
|
|
||||||
if (rowId && rowId && table.tableDnDConfig && table.tableDnDConfig.serializeRegexp) {
|
|
||||||
rowId = rowId.match(table.tableDnDConfig.serializeRegexp)[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
result += tableId + '[]=' + rowId;
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
},
|
|
||||||
|
|
||||||
serializeTables: function() {
|
|
||||||
var result = "";
|
|
||||||
this.each(function() {
|
|
||||||
// this is now bound to each matching table
|
|
||||||
result += jQuery.tableDnD.serializeTable(this);
|
|
||||||
});
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
jQuery.fn.extend(
|
|
||||||
{
|
|
||||||
tableDnD : jQuery.tableDnD.build,
|
|
||||||
tableDnDUpdate : jQuery.tableDnD.updateTables,
|
|
||||||
tableDnDSerialize: jQuery.tableDnD.serializeTables
|
|
||||||
}
|
|
||||||
);
|
|
||||||
@ -1054,7 +1054,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
|
|||||||
else print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/js/jquery-latest.min'.$ext.'"></script>'."\n";
|
else print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/js/jquery-latest.min'.$ext.'"></script>'."\n";
|
||||||
if (constant('JS_JQUERY_UI')) print '<script type="text/javascript" src="'.JS_JQUERY_UI.'jquery-ui.min.js"></script>'."\n";
|
if (constant('JS_JQUERY_UI')) print '<script type="text/javascript" src="'.JS_JQUERY_UI.'jquery-ui.min.js"></script>'."\n";
|
||||||
else print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/js/jquery-ui-latest.custom.min'.$ext.'"></script>'."\n";
|
else print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/js/jquery-ui-latest.custom.min'.$ext.'"></script>'."\n";
|
||||||
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/tablednd/jquery.tablednd_0_5'.$ext.'"></script>'."\n";
|
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/tablednd/jquery.tablednd.0.6.min'.$ext.'"></script>'."\n";
|
||||||
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/tiptip/jquery.tipTip.min'.$ext.'"></script>'."\n";
|
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/tiptip/jquery.tipTip.min'.$ext.'"></script>'."\n";
|
||||||
// jQuery Layout
|
// jQuery Layout
|
||||||
if (! empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT) || defined('REQUIRE_JQUERY_LAYOUT'))
|
if (! empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT) || defined('REQUIRE_JQUERY_LAYOUT'))
|
||||||
|
|||||||
@ -127,8 +127,8 @@ if ($result)
|
|||||||
|
|
||||||
print '<tr class="liste_total">';
|
print '<tr class="liste_total">';
|
||||||
print '<td colspan="2" align="right">'.$langs->trans("Total").'</td>';
|
print '<td colspan="2" align="right">'.$langs->trans("Total").'</td>';
|
||||||
print '<td align="right">'.price(price2num($total,'MT')).' '.$langs->trans('Currency'.$conf->currency).'</td>';
|
print '<td align="right">'.price(price2num($total,'MT'),1,$langs,0,0,-1,$conf->currency).'</td>';
|
||||||
print '<td align="right">'.price(price2num($totalsell,'MT')).' '.$langs->trans('Currency'.$conf->currency).'</td>';
|
print '<td align="right">'.price(price2num($totalsell,'MT'),1,$langs,0,0,-1,$conf->currency).'</td>';
|
||||||
print '<td align="right"> </td>';
|
print '<td align="right"> </td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
@ -158,7 +158,8 @@ else
|
|||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->close();
|
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
|
$db->close();
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -194,6 +194,8 @@ class CompanyBankAccount extends Account
|
|||||||
*/
|
*/
|
||||||
function getRibLabel()
|
function getRibLabel()
|
||||||
{
|
{
|
||||||
|
global $langs;
|
||||||
|
|
||||||
if ($this->code_banque || $this->code_guichet || $this->number || $this->cle_rib)
|
if ($this->code_banque || $this->code_guichet || $this->number || $this->cle_rib)
|
||||||
{
|
{
|
||||||
$rib = $this->code_banque." ".$this->code_guichet." ".$this->number;
|
$rib = $this->code_banque." ".$this->code_guichet." ".$this->number;
|
||||||
|
|||||||
@ -76,9 +76,10 @@ session_name($sessionname);
|
|||||||
session_destroy();
|
session_destroy();
|
||||||
dol_syslog("End of session ".$sessionname);
|
dol_syslog("End of session ".$sessionname);
|
||||||
|
|
||||||
// TODO Not sure this is required
|
// Not sure this is required
|
||||||
unset($_SESSION['dol_login']);
|
unset($_SESSION['dol_login']);
|
||||||
unset($_SESSION['dol_entity']);
|
unset($_SESSION['dol_entity']);
|
||||||
|
|
||||||
header("Location: ".$url);
|
if (GETPOST('noredirect')) return;
|
||||||
|
header("Location: ".$url); // Default behaviour is redirect to index.php page
|
||||||
?>
|
?>
|
||||||
Loading…
Reference in New Issue
Block a user