Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
e170c477a3
@ -27,6 +27,7 @@ For users:
|
||||
- New: Add hidden option PROJECT_HIDE_UNSELECTABLES to hide project you can't select into combo list.
|
||||
- New: Add option INVOICE_POSITIVE_CREDIT_NOTE.
|
||||
- New: Support zip/town autocompletion into warehouses.
|
||||
- New: Add box for last expired services.
|
||||
- Fix: Can use POS module with several concurrent users.
|
||||
|
||||
For developers:
|
||||
|
||||
@ -55,7 +55,6 @@ $user->getrights();
|
||||
|
||||
print "***** ".$script_file." (".$version.") *****\n";
|
||||
|
||||
|
||||
// Start of transaction
|
||||
$db->begin();
|
||||
|
||||
@ -63,6 +62,7 @@ require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php");
|
||||
|
||||
// Create invoice object
|
||||
$obj = new Facture($db);
|
||||
//$obj->initAsSpecimen();
|
||||
|
||||
$obj->ref = 'ABCDE';
|
||||
$obj->socid = 4; // Put id of third party (rowid in llx_societe table)
|
||||
|
||||
@ -403,7 +403,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $
|
||||
}
|
||||
|
||||
// Update fk_bank for subscriptions
|
||||
$sql = 'UPDATE llx_cotisation set fk_bank='.$bank_line_id;
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.'cotisation SET fk_bank='.$bank_line_id;
|
||||
$sql.= ' WHERE rowid='.$crowid;
|
||||
dol_syslog('sql='.$sql);
|
||||
$result = $db->query($sql);
|
||||
@ -854,7 +854,7 @@ if ($rowid)
|
||||
if ($adht->cotisation)
|
||||
{
|
||||
// Amount
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input type="text" name="cotisation" size="6" value="'.$_POST["cotisation"].'"> '.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input type="text" name="cotisation" size="6" value="'.$_POST["cotisation"].'"> '.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
|
||||
// Label
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td>';
|
||||
|
||||
@ -435,7 +435,8 @@ class Adherent extends CommonObject
|
||||
include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php');
|
||||
$hookmanager=new HookManager($this->db);
|
||||
$hookmanager->callHooks(array('memberdao'));
|
||||
$parameters=array('socid'=>$socid);
|
||||
$parameters=array('id'=>$this->id);
|
||||
$action='';
|
||||
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
||||
if (empty($reshook))
|
||||
{
|
||||
|
||||
@ -101,7 +101,7 @@ print "<br>\n";
|
||||
// Cas des autres param<61>tres COMPTA_*
|
||||
/*
|
||||
$sql ="SELECT rowid, name, value, type, note";
|
||||
$sql.=" FROM llx_const";
|
||||
$sql.=" FROM ".MAIN_DB_PREFIX."const";
|
||||
$sql.=" WHERE name like 'COMPTA_%' and name not in ('COMPTA_MODE')";
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
|
||||
@ -217,13 +217,13 @@ if ($resql)
|
||||
if (preg_match("/[13579]{1}/",substr($record['box_order'],-1)))
|
||||
{
|
||||
$box_order = "A0".$record['box_order'];
|
||||
$sql="update llx_boxes set box_order = '".$box_order."' where box_order = ".$record['box_order'];
|
||||
$sql="UPDATE ".MAIN_DB_PREFIX."boxes SET box_order = '".$box_order."' WHERE box_order = ".$record['box_order'];
|
||||
$resql = $db->query($sql);
|
||||
}
|
||||
else if (preg_match("/[02468]{1}/",substr($record['box_order'],-1)))
|
||||
{
|
||||
$box_order = "B0".$record['box_order'];
|
||||
$sql="update llx_boxes set box_order = '".$box_order."' where box_order = ".$record['box_order'];
|
||||
$sql="UPDATE ".MAIN_DB_PREFIX."boxes SET box_order = '".$box_order."' WHERE box_order = ".$record['box_order'];
|
||||
$resql = $db->query($sql);
|
||||
}
|
||||
}
|
||||
@ -232,13 +232,13 @@ if ($resql)
|
||||
if (preg_match("/[13579]{1}/",substr($record['box_order'],-1)))
|
||||
{
|
||||
$box_order = "A".$record['box_order'];
|
||||
$sql="update llx_boxes set box_order = '".$box_order."' where box_order = ".$record['box_order'];
|
||||
$sql="UPDATE ".MAIN_DB_PREFIX."boxes SET box_order = '".$box_order."' WHERE box_order = ".$record['box_order'];
|
||||
$resql = $db->query($sql);
|
||||
}
|
||||
else if (preg_match("/[02468]{1}/",substr($record['box_order'],-1)))
|
||||
{
|
||||
$box_order = "B".$record['box_order'];
|
||||
$sql="update llx_boxes set box_order = '".$box_order."' where box_order = ".$record['box_order'];
|
||||
$sql="UPDATE ".MAIN_DB_PREFIX."boxes SET box_order = '".$box_order."' WHERE box_order = ".$record['box_order'];
|
||||
$resql = $db->query($sql);
|
||||
}
|
||||
}
|
||||
@ -267,7 +267,7 @@ $sql = "SELECT rowid, file, note, tms";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."boxes_def";
|
||||
$sql.= " WHERE entity = ".$conf->entity;
|
||||
$resql = $db->query($sql);
|
||||
$var=True;
|
||||
$var=true;
|
||||
|
||||
if ($resql)
|
||||
{
|
||||
@ -325,6 +325,7 @@ if ($resql)
|
||||
$logo=preg_replace("/^object_/i","",$box->boximg);
|
||||
}
|
||||
|
||||
print "\n".'<!-- Box '.$box->boxcode.' -->'."\n";
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<tr '.$bc[$var].'>';
|
||||
@ -421,6 +422,7 @@ if ($resql)
|
||||
$logo=preg_replace("/^object_/i","",$box->boximg);
|
||||
}
|
||||
|
||||
print "\n".'<!-- Box '.$box->boxcode.' -->'."\n";
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td>'.img_object("",$logo).' '.$box->boxlabel.'</td>';
|
||||
print '<td>' . ($obj->note?$obj->note:' ') . '</td>';
|
||||
|
||||
@ -97,7 +97,7 @@ if ($action=='purge' && ! preg_match('/^confirm/i',$choice) && ($choice != 'allf
|
||||
if ($conf->ecm->enabled && $choice=='allfiles')
|
||||
{
|
||||
require_once(DOL_DOCUMENT_ROOT."/ecm/class/ecmdirectory.class.php");
|
||||
$ecmdirstatic = new ECMDirectory($db);
|
||||
$ecmdirstatic = new EcmDirectory($db);
|
||||
$result = $ecmdirstatic->refreshcachenboffile(1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -66,7 +66,7 @@ if ($_POST["save"])
|
||||
}
|
||||
elseif ($_POST["test"])
|
||||
{
|
||||
//$resql=$db->query("select count(*) from llx_const");
|
||||
//$resql=$db->query("select count(*) from ".MAIN_DB_PREFIX."const");
|
||||
//print "< ".$db." - ".$db->db." - ".$resql." - ".$db->error()."><br>\n";
|
||||
|
||||
// Test de la connexion a la database webcalendar
|
||||
@ -111,7 +111,7 @@ elseif ($_POST["test"])
|
||||
$mesg.="</div>";
|
||||
}
|
||||
|
||||
//$resql=$db->query("select count(*) from llx_const");
|
||||
//$resql=$db->query("select count(*) from ".MAIN_DB_PREFIX."const");
|
||||
//print "< ".$db." - ".$db->db." - ".$resql." - ".$db->error()."><br>\n";
|
||||
}
|
||||
|
||||
|
||||
@ -125,11 +125,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
</td>
|
||||
<!-- Affichage du prix unitaire -->
|
||||
<td><input class="texte1_off" type="text" name="txtPrixUnit" value="<?php echo price2num($obj_facturation->prix(), 'MU'); ?>" disabled="disabled" /></td>
|
||||
<td><?php echo $conf->monnaie; ?></td>
|
||||
<td><?php echo $conf->currency; ?></td>
|
||||
<!-- Choix de la remise -->
|
||||
<td><input class="texte1" type="text" name="txtRemise" value="0" onkeyup="javascript: modif();" onfocus="javascript: this.select();"/></td>
|
||||
<!-- Affichage du total HT -->
|
||||
<td><input class="texte1_off" type="text" name="txtTotal" value="" disabled="disabled" /></td><td><?php echo $conf->monnaie; ?></td>
|
||||
<td><input class="texte1_off" type="text" name="txtTotal" value="" disabled="disabled" /></td><td><?php echo $conf->currency; ?></td>
|
||||
<!-- Choix du taux de TVA -->
|
||||
<td class="select_tva">
|
||||
<select name="selTva" onchange="javascript: modif();" >
|
||||
|
||||
@ -61,14 +61,14 @@ else
|
||||
|
||||
$remise = $tab[$i]['remise'];
|
||||
|
||||
echo ('<p>'.$tab[$i]['qte'].' x '.price2num($tab[$i]['price'], 'MT').$remise_percent.' = '.price2num($tab[$i]['total_ht'], 'MT').' '.$conf->monnaie.' '.$langs->trans("HT").' ('.price2num($tab[$i]['total_ttc'], 'MT').' '.$conf->monnaie.' '.$langs->trans("TTC").')</p>'."\n");
|
||||
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 ('</div>'."\n");
|
||||
}
|
||||
}
|
||||
|
||||
$obj_facturation->calculTotaux();
|
||||
$total_ttc = $obj_facturation->prix_total_ttc();
|
||||
echo ('<p class="cadre_prix_total">'.$langs->trans("Total").' : '.price2num($total_ttc, 'MT').' '.$conf->monnaie.'<br></p>'."\n");
|
||||
echo ('<p class="cadre_prix_total">'.$langs->trans("Total").' : '.price2num($total_ttc, 'MT').' '.$conf->currency.'<br></p>'."\n");
|
||||
|
||||
?></div>
|
||||
</div>
|
||||
|
||||
@ -130,7 +130,7 @@ print $object->ref;
|
||||
for($i=0;$i < $tab_size;$i++)
|
||||
{
|
||||
$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->monnaie.'</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">'.price2num($tab[$i]['total_ht'],'MT').' '.$conf->currency.'</td></tr>'."\n");
|
||||
}
|
||||
|
||||
?>
|
||||
@ -138,9 +138,9 @@ print $object->ref;
|
||||
|
||||
<table class="totaux">
|
||||
<?php
|
||||
echo '<tr><th nowrap="nowrap">'.$langs->trans("TotalHT").'</th><td nowrap="nowrap">'.price2num($obj_facturation->prix_total_ht(),'MT')." ".$conf->monnaie."</td></tr>\n";
|
||||
echo '<tr><th nowrap="nowrap">'.$langs->trans("TotalVAT").'</th><td nowrap="nowrap">'.price2num($obj_facturation->montant_tva(),'MT')." ".$conf->monnaie."</td></tr>\n";
|
||||
echo '<tr><th nowrap="nowrap">'.$langs->trans("TotalTTC").'</th><td nowrap="nowrap">'.price2num($obj_facturation->prix_total_ttc(),'MT')." ".$conf->monnaie."</td></tr>\n";
|
||||
echo '<tr><th nowrap="nowrap">'.$langs->trans("TotalHT").'</th><td nowrap="nowrap">'.price2num($obj_facturation->prix_total_ht(),'MT')." ".$conf->currency."</td></tr>\n";
|
||||
echo '<tr><th nowrap="nowrap">'.$langs->trans("TotalVAT").'</th><td nowrap="nowrap">'.price2num($obj_facturation->montant_tva(),'MT')." ".$conf->currency."</td></tr>\n";
|
||||
echo '<tr><th nowrap="nowrap">'.$langs->trans("TotalTTC").'</th><td nowrap="nowrap">'.price2num($obj_facturation->prix_total_ttc(),'MT')." ".$conf->currency."</td></tr>\n";
|
||||
?>
|
||||
</table>
|
||||
|
||||
|
||||
@ -22,12 +22,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
<table class="table_resume">
|
||||
|
||||
<tr><td class="resume_label"><?php echo $langs->trans("Invoice"); ?></td><td><?php echo $obj_facturation->num_facture(); ?></td></tr>
|
||||
<tr><td class="resume_label"><?php echo $langs->trans("TotalHT"); ?></td><td><?php echo price2num($obj_facturation->prix_total_ht(),'MT').' '.$conf->monnaie; ?></td></tr>
|
||||
<tr><td class="resume_label"><?php echo $langs->trans("TotalHT"); ?></td><td><?php echo price2num($obj_facturation->prix_total_ht(),'MT').' '.$conf->currency; ?></td></tr>
|
||||
<?php
|
||||
// Affichage de la tva par taux
|
||||
if ( $obj_facturation->montant_tva() ) {
|
||||
|
||||
echo ('<tr><td class="resume_label">'.$langs->trans("VAT").'</td><td>'.price2num($obj_facturation->montant_tva(),'MT').' '.$conf->monnaie.'</td></tr>');
|
||||
echo ('<tr><td class="resume_label">'.$langs->trans("VAT").'</td><td>'.price2num($obj_facturation->montant_tva(),'MT').' '.$conf->currency.'</td></tr>');
|
||||
|
||||
}
|
||||
else
|
||||
@ -37,7 +37,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
}
|
||||
?>
|
||||
<tr><td class="resume_label"><?php echo $langs->trans("TotalTTC"); ?> </td><td><?php echo price2num($obj_facturation->prix_total_ttc(),'MT').' '.$conf->monnaie; ?></td></tr>
|
||||
<tr><td class="resume_label"><?php echo $langs->trans("TotalTTC"); ?> </td><td><?php echo price2num($obj_facturation->prix_total_ttc(),'MT').' '.$conf->currency; ?></td></tr>
|
||||
<tr><td class="resume_label"><?php echo $langs->trans("PaymentMode"); ?> </td><td>
|
||||
<?php
|
||||
switch ($obj_facturation->mode_reglement())
|
||||
@ -81,14 +81,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
} else {
|
||||
|
||||
echo ('<tr><td class="resume_label">'.$langs->trans("Received").'</td><td>'.price2num($obj_facturation->montant_encaisse(),'MT').' '.$conf->monnaie.'</td></tr>');
|
||||
echo ('<tr><td class="resume_label">'.$langs->trans("Received").'</td><td>'.price2num($obj_facturation->montant_encaisse(),'MT').' '.$conf->currency.'</td></tr>');
|
||||
|
||||
}
|
||||
|
||||
// Affichage du montant rendu (reglement en especes)
|
||||
if ( $obj_facturation->montant_rendu() ) {
|
||||
|
||||
echo ('<tr><td class="resume_label">'.$langs->trans("Change").'</td><td>'.price2num($obj_facturation->montant_rendu(),'MT').' '.$conf->monnaie.'</td></tr>');
|
||||
echo ('<tr><td class="resume_label">'.$langs->trans("Change").'</td><td>'.price2num($obj_facturation->montant_rendu(),'MT').' '.$conf->currency.'</td></tr>');
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -114,8 +114,8 @@ switch ($action)
|
||||
$mode_reglement_id = dol_getIdFromCode($db,'LIQ','c_paiement');
|
||||
$cond_reglement_id = 0;
|
||||
$note .= $langs->trans("Cash")."\n";
|
||||
$note .= $langs->trans("Received").' : '.$obj_facturation->montant_encaisse()." ".$conf->monnaie."\n";
|
||||
$note .= $langs->trans("Rendu").' : '.$obj_facturation->montant_rendu()." ".$conf->monnaie."\n";
|
||||
$note .= $langs->trans("Received").' : '.$obj_facturation->montant_encaisse()." ".$conf->currency."\n";
|
||||
$note .= $langs->trans("Rendu").' : '.$obj_facturation->montant_rendu()." ".$conf->currency."\n";
|
||||
$note .= "\n";
|
||||
$note .= '--------------------------------------'."\n\n";
|
||||
break;
|
||||
|
||||
@ -146,7 +146,7 @@ if ($_GET["action"] == 'create')
|
||||
else print $langs->trans("CompanyHasNoRelativeDiscount");
|
||||
$absolute_discount=$soc->getAvailableDiscounts();
|
||||
print '. ';
|
||||
if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->trans("Currency".$conf->monnaie));
|
||||
if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->trans("Currency".$conf->currency));
|
||||
else print $langs->trans("CompanyHasNoAbsoluteDiscount");
|
||||
print '.';
|
||||
print '</td></tr>';
|
||||
|
||||
@ -361,7 +361,7 @@ if ($id > 0)
|
||||
print '<td colspan="3">';
|
||||
$amount_discount=$object->getAvailableDiscounts();
|
||||
if ($amount_discount < 0) dol_print_error($db,$object->error);
|
||||
if ($amount_discount > 0) print '<a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?socid='.$object->id).'">'.price($amount_discount).'</a> '.$langs->trans("Currency".$conf->monnaie);
|
||||
if ($amount_discount > 0) print '<a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?socid='.$object->id).'">'.price($amount_discount).'</a> '.$langs->trans("Currency".$conf->currency);
|
||||
else print $langs->trans("DiscountNone");
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -720,7 +720,7 @@ if ($_POST['action'] == "addline" && $user->rights->propale->creer)
|
||||
|
||||
if ($price_min && (price2num($pu_ht)*(1-price2num($_POST['remise_percent'])/100) < price2num($price_min)))
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').' '.$langs->trans("Currency".$conf->monnaie)).'</div>' ;
|
||||
$mesg = '<div class="error">'.$langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').' '.$langs->trans("Currency".$conf->currency)).'</div>' ;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -810,7 +810,7 @@ if ($_POST['action'] == 'updateligne' && $user->rights->propale->creer && $_POST
|
||||
}
|
||||
if ($productid && $price_min && (price2num($up_ht)*(1-price2num($_POST['remise_percent'])/100) < price2num($price_min)))
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').' '.$langs->trans("Currency".$conf->monnaie)).'</div>' ;
|
||||
$mesg = '<div class="error">'.$langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').' '.$langs->trans("Currency".$conf->currency)).'</div>' ;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1140,7 +1140,7 @@ if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
if ($object->statut > 0)
|
||||
{
|
||||
print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->monnaie));
|
||||
print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->currency));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1152,7 +1152,7 @@ if ($id > 0 || ! empty($ref))
|
||||
}
|
||||
if ($absolute_creditnote)
|
||||
{
|
||||
print $langs->trans("CompanyHasCreditNote",price($absolute_creditnote),$langs->transnoentities("Currency".$conf->monnaie)).'. ';
|
||||
print $langs->trans("CompanyHasCreditNote",price($absolute_creditnote),$langs->transnoentities("Currency".$conf->currency)).'. ';
|
||||
}
|
||||
if (! $absolute_discount && ! $absolute_creditnote) print $langs->trans("CompanyHasNoAbsoluteDiscount").'.';
|
||||
print '</td></tr>';
|
||||
@ -1412,12 +1412,12 @@ if ($id > 0 || ! empty($ref))
|
||||
// Amount HT
|
||||
print '<tr><td height="10">'.$langs->trans('AmountHT').'</td>';
|
||||
print '<td align="right" colspan="2" nowrap><b>'.price($object->total_ht).'</b></td>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
|
||||
// Amount VAT
|
||||
print '<tr><td height="10">'.$langs->trans('AmountVAT').'</td>';
|
||||
print '<td align="right" colspan="2" nowrap>'.price($object->total_tva).'</td>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
|
||||
// Amount Local Taxes
|
||||
if ($mysoc->pays_code=='ES')
|
||||
@ -1426,20 +1426,20 @@ if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
print '<tr><td height="10">'.$langs->transcountry("AmountLT1",$mysoc->pays_code).'</td>';
|
||||
print '<td align="right" colspan="2" nowrap>'.price($object->total_localtax1).'</td>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
}
|
||||
if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF
|
||||
{
|
||||
print '<tr><td height="10">'.$langs->transcountry("AmountLT2",$mysoc->pays_code).'</td>';
|
||||
print '<td align="right" colspan="2" nowrap>'.price($object->total_localtax2).'</td>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
}
|
||||
}
|
||||
|
||||
// Amount TTC
|
||||
print '<tr><td height="10">'.$langs->trans('AmountTTC').'</td>';
|
||||
print '<td align="right" colspan="2" nowrap>'.price($object->total_ttc).'</td>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
|
||||
// Statut
|
||||
print '<tr><td height="10">'.$langs->trans('Status').'</td><td align="left" colspan="3">'.$object->getLibStatut(4).'</td></tr>';
|
||||
|
||||
@ -101,7 +101,7 @@ if ($id > 0 || ! empty($ref))
|
||||
else print $langs->trans("CompanyHasNoRelativeDiscount");
|
||||
$absolute_discount=$soc->getAvailableDiscounts();
|
||||
print '. ';
|
||||
if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",$absolute_discount,$langs->trans("Currency".$conf->monnaie));
|
||||
if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",$absolute_discount,$langs->trans("Currency".$conf->currency));
|
||||
else print $langs->trans("CompanyHasNoAbsoluteDiscount");
|
||||
print '.';
|
||||
print '</td></tr>';
|
||||
@ -171,7 +171,7 @@ if ($id > 0 || ! empty($ref))
|
||||
|
||||
print '<tr><td height="10">'.$langs->trans('AmountHT').'</td>';
|
||||
print '<td align="right" colspan="2"><b>'.price($object->price).'</b></td>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
print '</table>';
|
||||
}
|
||||
else
|
||||
|
||||
@ -921,6 +921,7 @@ class Propal extends CommonObject
|
||||
if (is_object($hookmanager))
|
||||
{
|
||||
$parameters=array('objFrom'=>$objFrom);
|
||||
$action='';
|
||||
$reshook=$hookmanager->executeHooks('createfrom',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) $error++;
|
||||
}
|
||||
|
||||
@ -141,7 +141,7 @@ if ($id > 0 || ! empty($ref))
|
||||
else print $langs->trans("CompanyHasNoRelativeDiscount");
|
||||
$absolute_discount=$societe->getAvailableDiscounts();
|
||||
print '. ';
|
||||
if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->trans("Currency".$conf->monnaie));
|
||||
if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->trans("Currency".$conf->currency));
|
||||
else print $langs->trans("CompanyHasNoAbsoluteDiscount");
|
||||
print '.';
|
||||
print '</td></tr>';
|
||||
|
||||
@ -258,17 +258,17 @@ if ($socid > 0)
|
||||
}
|
||||
|
||||
print '<tr><td width="38%">'.$langs->trans("CustomerAbsoluteDiscountAllUsers").'</td>';
|
||||
print '<td>'.$remise_all.' '.$langs->trans("Currency".$conf->monnaie).' '.$langs->trans("HT").'</td></tr>';
|
||||
print '<td>'.$remise_all.' '.$langs->trans("Currency".$conf->currency).' '.$langs->trans("HT").'</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("CustomerAbsoluteDiscountMy").'</td>';
|
||||
print '<td>'.$remise_user.' '.$langs->trans("Currency".$conf->monnaie).' '.$langs->trans("HT").'</td></tr>';
|
||||
print '<td>'.$remise_user.' '.$langs->trans("Currency".$conf->currency).' '.$langs->trans("HT").'</td></tr>';
|
||||
print '</table>';
|
||||
print '<br>';
|
||||
|
||||
print_fiche_titre($langs->trans("NewGlobalDiscount"),'','');
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td width="38%">'.$langs->trans("AmountHT").'</td>';
|
||||
print '<td><input type="text" size="5" name="amount_ht" value="'.$_POST["amount_ht"].'"> '.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
|
||||
print '<td><input type="text" size="5" name="amount_ht" value="'.$_POST["amount_ht"].'"> '.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
print '<tr><td width="38%">'.$langs->trans("VAT").'</td>';
|
||||
print '<td>';
|
||||
print $form->load_tva('tva_tx',GETPOST('tva_tx'),'',$mysoc,'');
|
||||
@ -392,7 +392,7 @@ if ($socid > 0)
|
||||
array('type' => 'text', 'name' => 'amount_ttc_2', 'label' => $langs->trans("AmountTTC").' 2', 'value' => $amount2, 'size' => '5')
|
||||
);
|
||||
$langs->load("dict");
|
||||
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$objsoc->id.'&remid='.$obj->rowid, $langs->trans('SplitDiscount'), $langs->trans('ConfirmSplitDiscount',price($obj->amount_ttc),$langs->transnoentities("Currency".$conf->monnaie)), 'confirm_split', $formquestion, 0, 0);
|
||||
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$objsoc->id.'&remid='.$obj->rowid, $langs->trans('SplitDiscount'), $langs->trans('ConfirmSplitDiscount',price($obj->amount_ttc),$langs->transnoentities("Currency".$conf->currency)), 'confirm_split', $formquestion, 0, 0);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
@ -191,7 +191,7 @@ if ($id > 0 || ! empty($ref))
|
||||
// partie Gauche
|
||||
print '<tr><td height="10">'.$langs->trans('AmountHT').'</td>';
|
||||
print '<td align="right" colspan="1"><b>'.price($object->total_ht).'</b></td>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
print '</table>';
|
||||
}
|
||||
else
|
||||
|
||||
@ -829,6 +829,7 @@ class Commande extends CommonObject
|
||||
if (is_object($hookmanager))
|
||||
{
|
||||
$parameters=array('objFrom'=>$objFrom);
|
||||
$action='';
|
||||
$reshook=$hookmanager->executeHooks('createfrom',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) $error++;
|
||||
}
|
||||
@ -924,6 +925,7 @@ class Commande extends CommonObject
|
||||
$hookmanager->callHooks(array('orderdao'));
|
||||
|
||||
$parameters=array('objFrom'=>$object);
|
||||
$action='';
|
||||
$reshook=$hookmanager->executeHooks('createfrom',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) $error++;
|
||||
|
||||
@ -1580,7 +1582,8 @@ class Commande extends CommonObject
|
||||
$this->stocks = array();
|
||||
|
||||
// Tableau des id de produit de la commande
|
||||
|
||||
$array_of_product=array();
|
||||
|
||||
|
||||
// Recherche total en stock pour chaque produit
|
||||
if (count($array_of_product))
|
||||
|
||||
@ -573,7 +573,7 @@ if ($action == 'addline' && $user->rights->commande->creer)
|
||||
if($price_min && (price2num($pu_ht)*(1-price2num($_POST['remise_percent'])/100) < price2num($price_min)))
|
||||
{
|
||||
//print "CantBeLessThanMinPrice ".$up_ht." - ".GETPOST('remise_percent')." - ".$product->price_min;
|
||||
$mesg = '<div class="error">'.$langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').' '.$langs->trans("Currency".$conf->monnaie)).'</div>' ;
|
||||
$mesg = '<div class="error">'.$langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').' '.$langs->trans("Currency".$conf->currency)).'</div>' ;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -676,7 +676,7 @@ if ($action == 'updateligne' && $user->rights->commande->creer && $_POST['save']
|
||||
}
|
||||
if ($price_min && GETPOST('productid') && (price2num($up_ht)*(1-price2num($_POST['remise_percent'])/100) < price2num($price_min)))
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').' '.$langs->trans("Currency".$conf->monnaie)).'</div>' ;
|
||||
$mesg = '<div class="error">'.$langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').' '.$langs->trans("Currency".$conf->currency)).'</div>' ;
|
||||
$result=-1;
|
||||
}
|
||||
|
||||
@ -1241,7 +1241,7 @@ if ($action == 'create' && $user->rights->commande->creer)
|
||||
else print $langs->trans("CompanyHasNoRelativeDiscount");
|
||||
print '. ';
|
||||
$absolute_discount=$soc->getAvailableDiscounts();
|
||||
if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->trans("Currency".$conf->monnaie));
|
||||
if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->trans("Currency".$conf->currency));
|
||||
else print $langs->trans("CompanyHasNoAbsoluteDiscount");
|
||||
print '.';
|
||||
print '</td></tr>';
|
||||
@ -1643,7 +1643,7 @@ else
|
||||
{
|
||||
if ($object->statut > 0)
|
||||
{
|
||||
print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->monnaie));
|
||||
print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->currency));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1655,7 +1655,7 @@ else
|
||||
}
|
||||
if ($absolute_creditnote)
|
||||
{
|
||||
print $langs->trans("CompanyHasCreditNote",price($absolute_creditnote),$langs->transnoentities("Currency".$conf->monnaie)).'. ';
|
||||
print $langs->trans("CompanyHasCreditNote",price($absolute_creditnote),$langs->transnoentities("Currency".$conf->currency)).'. ';
|
||||
}
|
||||
if (! $absolute_discount && ! $absolute_creditnote) print $langs->trans("CompanyHasNoAbsoluteDiscount").'.';
|
||||
print '</td></tr>';
|
||||
@ -1846,11 +1846,11 @@ else
|
||||
// Total HT
|
||||
print '<tr><td>'.$langs->trans('AmountHT').'</td>';
|
||||
print '<td align="right"><b>'.price($object->total_ht).'</b></td>';
|
||||
print '<td>'.$langs->trans('Currency'.$conf->monnaie).'</td></tr>';
|
||||
print '<td>'.$langs->trans('Currency'.$conf->currency).'</td></tr>';
|
||||
|
||||
// Total TVA
|
||||
print '<tr><td>'.$langs->trans('AmountVAT').'</td><td align="right">'.price($object->total_tva).'</td>';
|
||||
print '<td>'.$langs->trans('Currency'.$conf->monnaie).'</td></tr>';
|
||||
print '<td>'.$langs->trans('Currency'.$conf->currency).'</td></tr>';
|
||||
|
||||
// Amount Local Taxes
|
||||
if ($mysoc->pays_code=='ES')
|
||||
@ -1859,19 +1859,19 @@ else
|
||||
{
|
||||
print '<tr><td>'.$langs->transcountry("AmountLT1",$mysoc->pays_code).'</td>';
|
||||
print '<td align="right">'.price($object->total_localtax1).'</td>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
}
|
||||
if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF
|
||||
{
|
||||
print '<tr><td>'.$langs->transcountry("AmountLT2",$mysoc->pays_code).'</td>';
|
||||
print '<td align="right">'.price($object->total_localtax2).'</td>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
}
|
||||
}
|
||||
|
||||
// Total TTC
|
||||
print '<tr><td>'.$langs->trans('AmountTTC').'</td><td align="right">'.price($object->total_ttc).'</td>';
|
||||
print '<td>'.$langs->trans('Currency'.$conf->monnaie).'</td></tr>';
|
||||
print '<td>'.$langs->trans('Currency'.$conf->currency).'</td></tr>';
|
||||
|
||||
// Statut
|
||||
print '<tr><td>'.$langs->trans('Status').'</td>';
|
||||
|
||||
@ -160,7 +160,7 @@ if (($_GET["id"] || $_GET["ref"]) && $_GET["action"] != 'edit')
|
||||
print '<tr><td valign="top">'.$langs->trans("Currency").'</td>';
|
||||
print '<td colspan="3">';
|
||||
$selectedcode=$account->account_currency_code;
|
||||
if (! $selectedcode) $selectedcode=$conf->monnaie;
|
||||
if (! $selectedcode) $selectedcode=$conf->currency;
|
||||
print $langs->trans("Currency".$selectedcode);
|
||||
print '</td></tr>';
|
||||
|
||||
@ -295,7 +295,7 @@ if ($_GET["id"] && $_GET["action"] == 'edit' && $user->rights->banque->configure
|
||||
print '<tr><td valign="top">'.$langs->trans("Currency").'</td>';
|
||||
print '<td colspan="3">';
|
||||
$selectedcode=$account->account_currency_code;
|
||||
if (! $selectedcode) $selectedcode=$conf->monnaie;
|
||||
if (! $selectedcode) $selectedcode=$conf->currency;
|
||||
print $langs->trans("Currency".$selectedcode);
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
@ -244,10 +244,10 @@ if ($action == 'create')
|
||||
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("Currency").'</td>';
|
||||
print '<td colspan="3">';
|
||||
$selectedcode=$account->account_currency_code;
|
||||
if (! $selectedcode) $selectedcode=$conf->monnaie;
|
||||
if (! $selectedcode) $selectedcode=$conf->currency;
|
||||
$form->select_currency((isset($_POST["account_currency_code"])?$_POST["account_currency_code"]:$selectedcode), 'account_currency_code');
|
||||
//print $langs->trans("Currency".$conf->monnaie);
|
||||
//print '<input type="hidden" name="account_currency_code" value="'.$conf->monnaie.'">';
|
||||
//print $langs->trans("Currency".$conf->currency);
|
||||
//print '<input type="hidden" name="account_currency_code" value="'.$conf->currency.'">';
|
||||
print '</td></tr>';
|
||||
|
||||
// Status
|
||||
@ -386,7 +386,7 @@ else
|
||||
print '<tr><td valign="top">'.$langs->trans("Currency").'</td>';
|
||||
print '<td colspan="3">';
|
||||
$selectedcode=$account->account_currency_code;
|
||||
if (! $selectedcode) $selectedcode=$conf->monnaie;
|
||||
if (! $selectedcode) $selectedcode=$conf->currency;
|
||||
print $langs->trans("Currency".$selectedcode);
|
||||
print '</td></tr>';
|
||||
|
||||
@ -517,10 +517,10 @@ else
|
||||
print '</td>';
|
||||
print '<td colspan="3">';
|
||||
$selectedcode=$account->account_currency_code;
|
||||
if (! $selectedcode) $selectedcode=$conf->monnaie;
|
||||
if (! $selectedcode) $selectedcode=$conf->currency;
|
||||
$form->select_currency((isset($_POST["account_currency_code"])?$_POST["account_currency_code"]:$selectedcode), 'account_currency_code');
|
||||
//print $langs->trans("Currency".$conf->monnaie);
|
||||
//print '<input type="hidden" name="account_currency_code" value="'.$conf->monnaie.'">';
|
||||
//print $langs->trans("Currency".$conf->currency);
|
||||
//print '<input type="hidden" name="account_currency_code" value="'.$conf->currency.'">';
|
||||
print '</td></tr>';
|
||||
|
||||
// Status
|
||||
|
||||
@ -478,7 +478,7 @@ if ($result)
|
||||
if ($user->rights->banque->modifier)
|
||||
{
|
||||
print '<td colspan="3">';
|
||||
print '<input name="amount" class="flat" size="10" '.($objp->rappro?' disabled="disabled"':'').' value="'.price($objp->amount).'"> '.$langs->trans("Currency".$conf->monnaie);
|
||||
print '<input name="amount" class="flat" size="10" '.($objp->rappro?' disabled="disabled"':'').' value="'.price($objp->amount).'"> '.$langs->trans("Currency".$conf->currency);
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
|
||||
@ -33,19 +33,20 @@ require_once(DOL_DOCUMENT_ROOT."/compta/bank/class/bankcateg.class.php");
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result=restrictedArea($user,'banque');
|
||||
|
||||
$description=$_REQUEST["description"];
|
||||
$debit=$_REQUEST["debit"];
|
||||
$credit=$_REQUEST["credit"];
|
||||
$type=$_REQUEST["type"];
|
||||
$account=$_REQUEST["account"];
|
||||
$description=GETPOST("description");
|
||||
$debit=GETPOST("debit");
|
||||
$credit=GETPOST("credit");
|
||||
$type=GETPOST("type");
|
||||
$account=GETPOST("account");
|
||||
$bid=GETPOST("bid");
|
||||
|
||||
$param='';
|
||||
if (! empty($_REQUEST["description"])) $param.='&description='.$_REQUEST["description"];
|
||||
if (! empty($_REQUEST["type"])) $param.='&type='.$_REQUEST["type"];
|
||||
if (! empty($_REQUEST["debit"])) $param.='&debit='.$_REQUEST["debit"];
|
||||
if (! empty($_REQUEST["credit"])) $param.='&credit='.$_REQUEST["credit"];
|
||||
if (! empty($_REQUEST["account"])) $param.='&account='.$_REQUEST["account"];
|
||||
if (! empty($_REQUEST["bid"])) $param.='&bid='.$_REQUEST["bid"];
|
||||
if ($description) $param.='&description='.$description;
|
||||
if ($type) $param.='&type='.$type;
|
||||
if ($debit) $param.='&debit='.$debit;
|
||||
if ($credit) $param.='&credit='.$credit;
|
||||
if ($account) $param.='&account='.$account;
|
||||
if ($bid) $param.='&bid='.$bid;
|
||||
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
|
||||
@ -106,7 +106,7 @@ if ($_POST["action"] == 'add')
|
||||
if (! $error)
|
||||
{
|
||||
$mesg.="<div class=\"ok\">";
|
||||
$mesg.=$langs->trans("TransferFromToDone","<a href=\"account.php?account=".$accountfrom->id."\">".$accountfrom->label."</a>","<a href=\"account.php?account=".$accountto->id."\">".$accountto->label."</a>",$amount,$langs->transnoentities("Currency".$conf->monnaie));
|
||||
$mesg.=$langs->trans("TransferFromToDone","<a href=\"account.php?account=".$accountfrom->id."\">".$accountfrom->label."</a>","<a href=\"account.php?account=".$accountto->id."\">".$accountto->label."</a>",$amount,$langs->transnoentities("Currency".$conf->currency));
|
||||
$mesg.="</div>";
|
||||
$db->commit();
|
||||
}
|
||||
|
||||
@ -280,7 +280,7 @@ if ($_GET["action"] == 'create')
|
||||
print "</tr>";
|
||||
|
||||
// Amount
|
||||
print "<tr>".'<td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input type="text" name="amount" value="'.$_POST["amount"].'" size="10"> '.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
|
||||
print "<tr>".'<td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input type="text" name="amount" value="'.$_POST["amount"].'" size="10"> '.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("PublicDonation")."</td><td>";
|
||||
print $form->selectyesno("public",isset($_POST["public"])?$_POST["public"]:1,1);
|
||||
@ -365,7 +365,7 @@ if ($_GET["rowid"] && $_GET["action"] == 'edit')
|
||||
print "</tr>";
|
||||
|
||||
// Amount
|
||||
print "<tr>".'<td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input type="text" name="amount" size="10" value="'.$don->amount.'"> '.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
|
||||
print "<tr>".'<td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input type="text" name="amount" size="10" value="'.$don->amount.'"> '.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("PublicDonation")."</td><td>";
|
||||
print $form->selectyesno("public",1,1);
|
||||
@ -455,7 +455,7 @@ if ($_GET["rowid"] && $_GET["action"] != 'edit')
|
||||
print '<td rowspan="'.$nbrows.'" valign="top" width="50%">'.$langs->trans("Comments").' :<br>';
|
||||
print nl2br($don->note).'</td></tr>';
|
||||
|
||||
print "<tr>".'<td>'.$langs->trans("Amount").'</td><td>'.price($don->amount).' '.$langs->trans("Currency".$conf->monnaie).'</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("PublicDonation")."</td><td>";
|
||||
print yn($don->public);
|
||||
|
||||
@ -1011,7 +1011,7 @@ if (($action == 'addline' || $action == 'addline_predef') && $user->rights->fact
|
||||
{
|
||||
if($price_min && (price2num($pu_ht)*(1-price2num($_POST['remise_percent'])/100) < price2num($price_min)))
|
||||
{
|
||||
$object->error = $langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').' '.$langs->trans("Currency".$conf->monnaie));
|
||||
$object->error = $langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').' '.$langs->trans("Currency".$conf->currency));
|
||||
$result = -1 ;
|
||||
}
|
||||
else
|
||||
@ -1118,7 +1118,7 @@ if ($action == 'updateligne' && $user->rights->facture->creer && $_POST['save']
|
||||
if ($object->type!=2 && $price_min && GETPOST('productid') && (price2num($up_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min)))
|
||||
{
|
||||
//print "CantBeLessThanMinPrice ".$up_ht." - ".GETPOST('remise_percent')." - ".$product->price_min;
|
||||
$mesg = '<div class="error">'.$langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').' '.$langs->trans("Currency".$conf->monnaie)).'</div>';
|
||||
$mesg = '<div class="error">'.$langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').' '.$langs->trans("Currency".$conf->currency)).'</div>';
|
||||
$result=-1;
|
||||
}
|
||||
|
||||
@ -1726,7 +1726,7 @@ if ($action == 'create')
|
||||
print ' <a href="'.DOL_URL_ROOT.'/comm/remise.php?id='.$soc->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?socid='.$soc->id.'&action='.$action.'&origin='.GETPOST('origin').'&originid='.GETPOST('originid')).'">('.$langs->trans("EditRelativeDiscount").')</a>';
|
||||
print '. ';
|
||||
print '<br>';
|
||||
if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",'<a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$soc->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?socid='.$soc->id.'&action='.$action.'&origin='.GETPOST('origin').'&originid='.GETPOST('originid')).'">'.price($absolute_discount).'</a>',$langs->trans("Currency".$conf->monnaie));
|
||||
if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",'<a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$soc->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?socid='.$soc->id.'&action='.$action.'&origin='.GETPOST('origin').'&originid='.GETPOST('originid')).'">'.price($absolute_discount).'</a>',$langs->trans("Currency".$conf->currency));
|
||||
else print $langs->trans("CompanyHasNoAbsoluteDiscount");
|
||||
print ' <a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$soc->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?socid='.$soc->id.'&action='.$action.'&origin='.GETPOST('origin').'&originid='.GETPOST('originid')).'">('.$langs->trans("EditGlobalDiscounts").')</a>';
|
||||
print '.';
|
||||
@ -2064,8 +2064,8 @@ else
|
||||
$close[$i]['label']=$langs->trans("ConfirmClassifyPaidPartiallyReasonBadCustomerDesc");$i++;
|
||||
// Texte
|
||||
$i=0;
|
||||
$close[$i]['reason']=$form->textwithpicto($langs->transnoentities("ConfirmClassifyPaidPartiallyReasonDiscountVat",$resteapayer,$langs->trans("Currency".$conf->monnaie)),$close[$i]['label'],1);$i++;
|
||||
$close[$i]['reason']=$form->textwithpicto($langs->transnoentities("ConfirmClassifyPaidPartiallyReasonBadCustomer",$resteapayer,$langs->trans("Currency".$conf->monnaie)),$close[$i]['label'],1);$i++;
|
||||
$close[$i]['reason']=$form->textwithpicto($langs->transnoentities("ConfirmClassifyPaidPartiallyReasonDiscountVat",$resteapayer,$langs->trans("Currency".$conf->currency)),$close[$i]['label'],1);$i++;
|
||||
$close[$i]['reason']=$form->textwithpicto($langs->transnoentities("ConfirmClassifyPaidPartiallyReasonBadCustomer",$resteapayer,$langs->trans("Currency".$conf->currency)),$close[$i]['label'],1);$i++;
|
||||
// arrayreasons[code]=reason
|
||||
foreach($close as $key => $val)
|
||||
{
|
||||
@ -2249,19 +2249,19 @@ else
|
||||
{
|
||||
if ($object->statut == 0)
|
||||
{
|
||||
print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->monnaie));
|
||||
print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->currency));
|
||||
print '. ';
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($object->statut < 1 || $object->type == 2 || $object->type == 3)
|
||||
{
|
||||
$text=$langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->monnaie));
|
||||
$text=$langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->currency));
|
||||
print '<br>'.$text.'.<br>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$text=$langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->monnaie));
|
||||
$text=$langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->currency));
|
||||
$text2=$langs->trans("AbsoluteDiscountUse");
|
||||
print $form->textwithpicto($text,$text2);
|
||||
}
|
||||
@ -2290,12 +2290,12 @@ else
|
||||
{
|
||||
if ($object->statut == 0 && $object->type != 3)
|
||||
{
|
||||
$text=$langs->trans("CompanyHasCreditNote",price($absolute_creditnote),$langs->transnoentities("Currency".$conf->monnaie));
|
||||
$text=$langs->trans("CompanyHasCreditNote",price($absolute_creditnote),$langs->transnoentities("Currency".$conf->currency));
|
||||
print $form->textwithpicto($text,$langs->trans("CreditNoteDepositUse"));
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("CompanyHasCreditNote",price($absolute_creditnote),$langs->transnoentities("Currency".$conf->monnaie)).'.';
|
||||
print $langs->trans("CompanyHasCreditNote",price($absolute_creditnote),$langs->transnoentities("Currency".$conf->currency)).'.';
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -2588,9 +2588,9 @@ else
|
||||
// Amount
|
||||
print '<tr><td>'.$langs->trans('AmountHT').'</td>';
|
||||
print '<td align="right" colspan="2" nowrap>'.price($object->total_ht).'</td>';
|
||||
print '<td>'.$langs->trans('Currency'.$conf->monnaie).'</td></tr>';
|
||||
print '<td>'.$langs->trans('Currency'.$conf->currency).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans('AmountVAT').'</td><td align="right" colspan="2" nowrap>'.price($object->total_tva).'</td>';
|
||||
print '<td>'.$langs->trans('Currency'.$conf->monnaie).'</td></tr>';
|
||||
print '<td>'.$langs->trans('Currency'.$conf->currency).'</td></tr>';
|
||||
|
||||
// Amount Local Taxes
|
||||
if ($mysoc->pays_code=='ES')
|
||||
@ -2599,18 +2599,18 @@ else
|
||||
{
|
||||
print '<tr><td>'.$langs->transcountry("AmountLT1",$mysoc->pays_code).'</td>';
|
||||
print '<td align="right" colspan="2" nowrap>'.price($object->total_localtax1).'</td>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
}
|
||||
if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF
|
||||
{
|
||||
print '<tr><td>'.$langs->transcountry("AmountLT2",$mysoc->pays_code).'</td>';
|
||||
print '<td align="right" colspan="2" nowrap>'.price($object->total_localtax2).'</td>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
}
|
||||
}
|
||||
|
||||
print '<tr><td>'.$langs->trans('AmountTTC').'</td><td align="right" colspan="2" nowrap>'.price($object->total_ttc).'</td>';
|
||||
print '<td>'.$langs->trans('Currency'.$conf->monnaie).'</td></tr>';
|
||||
print '<td>'.$langs->trans('Currency'.$conf->currency).'</td></tr>';
|
||||
|
||||
// Statut
|
||||
print '<tr><td>'.$langs->trans('Status').'</td>';
|
||||
|
||||
@ -148,19 +148,19 @@ if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
if ($object->statut == 0)
|
||||
{
|
||||
print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->monnaie));
|
||||
print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->currency));
|
||||
print '. ';
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($object->statut < 1 || $object->type == 2 || $object->type == 3)
|
||||
{
|
||||
$text=$langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->monnaie));
|
||||
$text=$langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->currency));
|
||||
print '<br>'.$text.'.<br>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$text=$langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->monnaie));
|
||||
$text=$langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->currency));
|
||||
$text2=$langs->trans("AbsoluteDiscountUse");
|
||||
print $form->textwithpicto($text,$text2);
|
||||
}
|
||||
@ -190,12 +190,12 @@ if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
if ($object->statut == 0 && $object->type != 3)
|
||||
{
|
||||
$text=$langs->trans("CompanyHasCreditNote",price($absolute_creditnote),$langs->transnoentities("Currency".$conf->monnaie));
|
||||
$text=$langs->trans("CompanyHasCreditNote",price($absolute_creditnote),$langs->transnoentities("Currency".$conf->currency));
|
||||
print $form->textwithpicto($text,$langs->trans("CreditNoteDepositUse"));
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("CompanyHasCreditNote",price($absolute_creditnote),$langs->transnoentities("Currency".$conf->monnaie)).'.';
|
||||
print $langs->trans("CompanyHasCreditNote",price($absolute_creditnote),$langs->transnoentities("Currency".$conf->currency)).'.';
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -344,12 +344,12 @@ if ($id > 0 || ! empty($ref))
|
||||
|
||||
print '<tr><td>'.$langs->trans("AmountHT").'</td>';
|
||||
print '<td align="right" colspan="2"><b>'.price($object->total_ht).'</b></td>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans('AmountVAT').'</td><td align="right" colspan="2" nowrap>'.price($object->total_tva).'</td>';
|
||||
print '<td>'.$langs->trans('Currency'.$conf->monnaie).'</td></tr>';
|
||||
print '<td>'.$langs->trans('Currency'.$conf->currency).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans('AmountTTC').'</td><td align="right" colspan="2" nowrap>'.price($object->total_ttc).'</td>';
|
||||
print '<td>'.$langs->trans('Currency'.$conf->monnaie).'</td></tr>';
|
||||
print '<td>'.$langs->trans('Currency'.$conf->currency).'</td></tr>';
|
||||
|
||||
// Statut
|
||||
print '<tr><td>'.$langs->trans('Status').'</td><td align="left" colspan="3">'.($object->getLibStatut(4,$totalpaye)).'</td></tr>';
|
||||
|
||||
@ -65,8 +65,10 @@ class Facture extends CommonObject
|
||||
var $ref_int;
|
||||
//! 0=Standard invoice, 1=Replacement invoice, 2=Credit note invoice, 3=Deposit invoice, 4=Proforma invoice
|
||||
var $type;
|
||||
var $amount;
|
||||
var $remise;
|
||||
|
||||
//var $amount;
|
||||
var $remise_absolue;
|
||||
var $remise_percent;
|
||||
var $total_ht;
|
||||
var $total_tva;
|
||||
var $total_ttc;
|
||||
@ -102,27 +104,26 @@ class Facture extends CommonObject
|
||||
var $nbtodo;
|
||||
var $nbtodolate;
|
||||
var $specimen;
|
||||
//! Numero d'erreur de 512 a 1023
|
||||
var $errno = 0;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $DB Database handler
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
function Facture($DB)
|
||||
function Facture($db)
|
||||
{
|
||||
$this->db = $DB;
|
||||
$this->db = $db;
|
||||
|
||||
$this->amount = 0;
|
||||
$this->remise = 0;
|
||||
//$this->amount = 0;
|
||||
//$this->remise = 0;
|
||||
$this->remise_percent = 0;
|
||||
$this->remise_absolue = 0;
|
||||
$this->total_ht = 0;
|
||||
$this->total_tva = 0;
|
||||
$this->total_ttc = 0;
|
||||
$this->propalid = 0;
|
||||
$this->fk_project = 0;
|
||||
$this->remise_exceptionnelle = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -144,7 +145,7 @@ class Facture extends CommonObject
|
||||
$this->ref_client=trim($this->ref_client);
|
||||
$this->note=trim($this->note);
|
||||
$this->note_public=trim($this->note_public);
|
||||
if (! $this->remise) $this->remise = 0;
|
||||
//if (! $this->remise) $this->remise = 0;
|
||||
if (! $this->cond_reglement_id) $this->cond_reglement_id = 0;
|
||||
if (! $this->mode_reglement_id) $this->mode_reglement_id = 0;
|
||||
$this->brouillon = 1;
|
||||
@ -183,17 +184,17 @@ class Facture extends CommonObject
|
||||
$this->cond_reglement_id = $_facrec->cond_reglement_id;
|
||||
$this->mode_reglement = $_facrec->mode_reglement_id;
|
||||
$this->mode_reglement_id = $_facrec->mode_reglement_id;
|
||||
$this->amount = $_facrec->amount;
|
||||
//$this->amount = $_facrec->amount;
|
||||
$this->remise_absolue = $_facrec->remise_absolue;
|
||||
$this->remise_percent = $_facrec->remise_percent;
|
||||
$this->remise = $_facrec->remise;
|
||||
//$this->remise = $_facrec->remise;
|
||||
|
||||
// Clean parametres
|
||||
if (! $this->type) $this->type = 0;
|
||||
$this->ref_client=trim($this->ref_client);
|
||||
$this->note=trim($this->note);
|
||||
$this->note_public=trim($this->note_public);
|
||||
if (! $this->remise) $this->remise = 0;
|
||||
//if (! $this->remise) $this->remise = 0;
|
||||
if (! $this->mode_reglement_id) $this->mode_reglement_id = 0;
|
||||
$this->brouillon = 1;
|
||||
}
|
||||
@ -203,8 +204,8 @@ class Facture extends CommonObject
|
||||
|
||||
// Insert into database
|
||||
$socid = $this->socid;
|
||||
$amount = $this->amount;
|
||||
$remise = $this->remise;
|
||||
//$amount = $this->amount;
|
||||
//$remise = $this->remise;
|
||||
|
||||
$totalht = ($amount - $remise);
|
||||
|
||||
@ -214,7 +215,7 @@ class Facture extends CommonObject
|
||||
$sql.= ", type";
|
||||
$sql.= ", fk_soc";
|
||||
$sql.= ", datec";
|
||||
$sql.= ", amount";
|
||||
//$sql.= ", amount";
|
||||
$sql.= ", remise_absolue";
|
||||
$sql.= ", remise_percent";
|
||||
$sql.= ", datef";
|
||||
@ -230,7 +231,7 @@ class Facture extends CommonObject
|
||||
$sql.= ", '".$this->type."'";
|
||||
$sql.= ", '".$socid."'";
|
||||
$sql.= ", '".$this->db->idate($now)."'";
|
||||
$sql.= ", '".$totalht."'";
|
||||
//$sql.= ", '".$totalht."'";
|
||||
$sql.= ",".($this->remise_absolue>0?$this->remise_absolue:'NULL');
|
||||
$sql.= ",".($this->remise_percent>0?$this->remise_percent:'NULL');
|
||||
$sql.= ", '".$this->db->idate($this->date)."'";
|
||||
@ -484,7 +485,7 @@ class Facture extends CommonObject
|
||||
if ($invertdetail)
|
||||
{
|
||||
$facture->lines[$i]->subprice = -$facture->lines[$i]->subprice;
|
||||
$facture->lines[$i]->price = -$facture->lines[$i]->price;
|
||||
//$facture->lines[$i]->price = -$facture->lines[$i]->price;
|
||||
$facture->lines[$i]->total_ht = -$facture->lines[$i]->total_ht;
|
||||
$facture->lines[$i]->total_tva = -$facture->lines[$i]->total_tva;
|
||||
$facture->lines[$i]->total_localtax1 = -$facture->lines[$i]->total_localtax1;
|
||||
@ -570,6 +571,7 @@ class Facture extends CommonObject
|
||||
if (is_object($hookmanager))
|
||||
{
|
||||
$parameters=array('objFrom'=>$objFrom);
|
||||
$action='';
|
||||
$reshook=$hookmanager->executeHooks('createfrom',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) $error++;
|
||||
}
|
||||
@ -618,7 +620,7 @@ class Facture extends CommonObject
|
||||
|
||||
$line->libelle = $object->lines[$i]->libelle;
|
||||
$line->desc = $object->lines[$i]->desc;
|
||||
$line->price = $object->lines[$i]->price;
|
||||
//$line->price = $object->lines[$i]->price;
|
||||
$line->subprice = $object->lines[$i]->subprice;
|
||||
$line->total_ht = $object->lines[$i]->total_ht;
|
||||
$line->total_tva = $object->lines[$i]->total_tva;
|
||||
@ -665,6 +667,7 @@ class Facture extends CommonObject
|
||||
$hookmanager->callHooks(array('invoicedao'));
|
||||
|
||||
$parameters=array('objFrom'=>$object);
|
||||
$action='';
|
||||
$reshook=$hookmanager->executeHooks('createfrom',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) $error++;
|
||||
|
||||
@ -772,7 +775,7 @@ class Facture extends CommonObject
|
||||
$this->amount = $obj->amount;
|
||||
$this->remise_percent = $obj->remise_percent;
|
||||
$this->remise_absolue = $obj->remise_absolue;
|
||||
$this->remise = $obj->remise;
|
||||
//$this->remise = $obj->remise;
|
||||
$this->total_ht = $obj->total;
|
||||
$this->total_tva = $obj->tva;
|
||||
$this->total_localtax1 = $obj->localtax1;
|
||||
@ -895,8 +898,8 @@ class Facture extends CommonObject
|
||||
$line->fk_parent_line = $objp->fk_parent_line;
|
||||
|
||||
// Ne plus utiliser
|
||||
$line->price = $objp->price;
|
||||
$line->remise = $objp->remise;
|
||||
//$line->price = $objp->price;
|
||||
//$line->remise = $objp->remise;
|
||||
|
||||
$this->lines[$i] = $line;
|
||||
|
||||
@ -937,7 +940,7 @@ class Facture extends CommonObject
|
||||
if (isset($this->amount)) $this->amount=trim($this->amount);
|
||||
if (isset($this->remise_percent)) $this->remise_percent=trim($this->remise_percent);
|
||||
if (isset($this->remise_absolue)) $this->remise_absolue=trim($this->remise_absolue);
|
||||
if (isset($this->remise)) $this->remise=trim($this->remise);
|
||||
//if (isset($this->remise)) $this->remise=trim($this->remise);
|
||||
if (isset($this->close_code)) $this->close_code=trim($this->close_code);
|
||||
if (isset($this->close_note)) $this->close_note=trim($this->close_note);
|
||||
if (isset($this->total_tva)) $this->tva=trim($this->total_tva);
|
||||
@ -975,7 +978,7 @@ class Facture extends CommonObject
|
||||
$sql.= " amount=".(isset($this->amount)?$this->amount:"null").",";
|
||||
$sql.= " remise_percent=".(isset($this->remise_percent)?$this->remise_percent:"null").",";
|
||||
$sql.= " remise_absolue=".(isset($this->remise_absolue)?$this->remise_absolue:"null").",";
|
||||
$sql.= " remise=".(isset($this->remise)?$this->remise:"null").",";
|
||||
//$sql.= " remise=".(isset($this->remise)?$this->remise:"null").",";
|
||||
$sql.= " close_code=".(isset($this->close_code)?"'".$this->db->escape($this->close_code)."'":"null").",";
|
||||
$sql.= " close_note=".(isset($this->close_note)?"'".$this->db->escape($this->close_note)."'":"null").",";
|
||||
$sql.= " tva=".(isset($this->total_tva)?$this->total_tva:"null").",";
|
||||
@ -1076,8 +1079,8 @@ class Facture extends CommonObject
|
||||
$facligne->info_bits=2;
|
||||
|
||||
// Ne plus utiliser
|
||||
$facligne->price=-$remise->amount_ht;
|
||||
$facligne->remise=0;
|
||||
//$facligne->price=-$remise->amount_ht;
|
||||
//$facligne->remise=0;
|
||||
|
||||
$facligne->total_ht = -$remise->amount_ht;
|
||||
$facligne->total_tva = -$remise->amount_tva;
|
||||
@ -2035,8 +2038,8 @@ class Facture extends CommonObject
|
||||
$this->line->skip_update_total = $skip_update_total;
|
||||
|
||||
// A ne plus utiliser
|
||||
$this->line->price=$price;
|
||||
$this->line->remise=$remise;
|
||||
//$this->line->price=$price;
|
||||
//$this->line->remise=$remise;
|
||||
|
||||
$result=$this->line->update();
|
||||
if ($result > 0)
|
||||
@ -3110,42 +3113,61 @@ class Facture extends CommonObject
|
||||
$line->desc=$langs->trans("Description")." ".$xnbp;
|
||||
$line->qty=1;
|
||||
$line->subprice=100;
|
||||
$line->price=100;
|
||||
//$line->price=100;
|
||||
$line->tva_tx=19.6;
|
||||
$line->localtax1_tx=0;
|
||||
$line->localtax2_tx=0;
|
||||
if ($xnbp == 2)
|
||||
$line->remise_percent=0;
|
||||
if ($xnbp == 1) // Qty is negative (product line)
|
||||
{
|
||||
$prodid = rand(1, $num_prods);
|
||||
$line->fk_product=$prodids[$prodid];
|
||||
$line->qty=-1;
|
||||
$line->total_ht=-100;
|
||||
$line->total_ttc=-119.6;
|
||||
$line->total_tva=-19.6;
|
||||
}
|
||||
else if ($xnbp == 2) // UP is negative (free line)
|
||||
{
|
||||
$line->subprice=-100;
|
||||
$line->total_ht=-100;
|
||||
$line->total_ttc=-119.6;
|
||||
$line->total_tva=-19.6;
|
||||
$line->remise_percent=0;
|
||||
}
|
||||
else if ($xnbp == 3) // Discount is 50% (product line)
|
||||
{
|
||||
$prodid = rand(1, $num_prods);
|
||||
$line->fk_product=$prodids[$prodid];
|
||||
$line->total_ht=50;
|
||||
$line->total_ttc=59.8;
|
||||
$line->total_tva=9.8;
|
||||
$line->remise_percent=50;
|
||||
$line->remise_percent=50;
|
||||
}
|
||||
else
|
||||
else // (product line)
|
||||
{
|
||||
$prodid = rand(1, $num_prods);
|
||||
$line->fk_product=$prodids[$prodid];
|
||||
$line->total_ht=100;
|
||||
$line->total_ttc=119.6;
|
||||
$line->total_tva=19.6;
|
||||
$line->remise_percent=00;
|
||||
}
|
||||
$prodid = rand(1, $num_prods);
|
||||
$line->fk_product=$prodids[$prodid];
|
||||
|
||||
$this->lines[$xnbp]=$line;
|
||||
$xnbp++;
|
||||
|
||||
$this->total_ht += $line->total_ht;
|
||||
$this->total_ht += $line->total_ht;
|
||||
$this->total_tva += $line->total_tva;
|
||||
$this->total_ttc += $line->total_ttc;
|
||||
|
||||
$xnbp++;
|
||||
}
|
||||
|
||||
// Add a line "offered"
|
||||
$line=new FactureLigne($this->db);
|
||||
$line->desc=$langs->trans("Description")." ".$xnbp;
|
||||
$line->desc=$langs->trans("Description")." (offered line)";
|
||||
$line->qty=1;
|
||||
$line->subprice=100;
|
||||
$line->price=100;
|
||||
//$line->price=100;
|
||||
$line->tva_tx=19.6;
|
||||
$line->localtax1_tx=0;
|
||||
$line->localtax2_tx=0;
|
||||
@ -3157,8 +3179,7 @@ class Facture extends CommonObject
|
||||
$line->fk_product=$prodids[$prodid];
|
||||
|
||||
$this->lines[$xnbp]=$line;
|
||||
|
||||
$xnbp++;
|
||||
$xnbp++;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -3275,7 +3296,7 @@ class Facture extends CommonObject
|
||||
/**
|
||||
* \class FactureLigne
|
||||
* \brief Classe permettant la gestion des lignes de factures
|
||||
* \remarks Gere des lignes de la table llx_facturedet
|
||||
* Gere des lignes de la table llx_facturedet
|
||||
*/
|
||||
class FactureLigne
|
||||
{
|
||||
@ -3332,8 +3353,8 @@ class FactureLigne
|
||||
var $date_end;
|
||||
|
||||
// Ne plus utiliser
|
||||
var $price; // P.U. HT apres remise % de ligne (exemple 80)
|
||||
var $remise; // Montant calcule de la remise % sur PU HT (exemple 20)
|
||||
//var $price; // P.U. HT apres remise % de ligne (exemple 80)
|
||||
//var $remise; // Montant calcule de la remise % sur PU HT (exemple 20)
|
||||
|
||||
// From llx_product
|
||||
var $ref; // Product ref (deprecated)
|
||||
@ -3346,17 +3367,19 @@ class FactureLigne
|
||||
|
||||
|
||||
/**
|
||||
* \brief Constructeur d'objets ligne de facture
|
||||
* \param DB handler d'acces base de donnee
|
||||
* Constructeur d'objets ligne de facture
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
function FactureLigne($DB)
|
||||
function FactureLigne($db)
|
||||
{
|
||||
$this->db= $DB ;
|
||||
$this->db = $db;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Recupere l'objet ligne de facture
|
||||
* \param rowid id de la ligne de facture
|
||||
* Recupere l'objet ligne de facture
|
||||
*
|
||||
* @param int $rowid id de la ligne de facture
|
||||
*/
|
||||
function fetch($rowid)
|
||||
{
|
||||
@ -3401,8 +3424,8 @@ class FactureLigne
|
||||
$this->rang = $objp->rang;
|
||||
|
||||
// Ne plus utiliser
|
||||
$this->price = $objp->price;
|
||||
$this->remise = $objp->remise;
|
||||
//$this->price = $objp->price;
|
||||
//$this->remise = $objp->remise;
|
||||
|
||||
$this->ref = $objp->product_ref; // deprecated
|
||||
$this->product_ref = $objp->product_ref;
|
||||
@ -3419,15 +3442,16 @@ class FactureLigne
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Insert line in database
|
||||
* \param notrigger 1 no triggers
|
||||
* \return int <0 if KO, >0 if OK
|
||||
* Insert line in database
|
||||
*
|
||||
* @param int $notrigger 1 no triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function insert($notrigger=0)
|
||||
{
|
||||
global $langs,$user,$conf;
|
||||
|
||||
dol_syslog("FactureLigne::Insert rang=".$this->rang, LOG_DEBUG);
|
||||
dol_syslog(get_class($this)."::Insert rang=".$this->rang, LOG_DEBUG);
|
||||
|
||||
// Clean parameters
|
||||
$this->desc=trim($this->desc);
|
||||
@ -3437,11 +3461,11 @@ class FactureLigne
|
||||
if (empty($this->total_localtax1)) $this->total_localtax1=0;
|
||||
if (empty($this->total_localtax2)) $this->total_localtax2=0;
|
||||
if (empty($this->rang)) $this->rang=0;
|
||||
if (empty($this->remise)) $this->remise=0;
|
||||
//if (empty($this->remise)) $this->remise=0;
|
||||
if (empty($this->remise_percent)) $this->remise_percent=0;
|
||||
if (empty($this->info_bits)) $this->info_bits=0;
|
||||
if (empty($this->subprice)) $this->subprice=0;
|
||||
if (empty($this->price)) $this->price=0;
|
||||
//if (empty($this->price)) $this->price=0;
|
||||
if (empty($this->special_code)) $this->special_code=0;
|
||||
if (empty($this->fk_parent_line)) $this->fk_parent_line=0;
|
||||
|
||||
@ -3453,7 +3477,7 @@ class FactureLigne
|
||||
// Insertion dans base de la ligne
|
||||
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'facturedet';
|
||||
$sql.= ' (fk_facture, fk_parent_line, description, qty, tva_tx, localtax1_tx, localtax2_tx,';
|
||||
$sql.= ' fk_product, product_type, remise_percent, subprice, price, remise, fk_remise_except,';
|
||||
$sql.= ' fk_product, product_type, remise_percent, subprice, fk_remise_except,';
|
||||
$sql.= ' date_start, date_end, fk_code_ventilation, fk_export_compta, ';
|
||||
$sql.= ' rang, special_code,';
|
||||
$sql.= ' info_bits, total_ht, total_tva, total_ttc, total_localtax1, total_localtax2)';
|
||||
@ -3469,8 +3493,8 @@ class FactureLigne
|
||||
$sql.= " ".$this->product_type.",";
|
||||
$sql.= " ".price2num($this->remise_percent).",";
|
||||
$sql.= " ".price2num($this->subprice).",";
|
||||
$sql.= " ".price2num($this->price).",";
|
||||
$sql.= " ".($this->remise?price2num($this->remise):'0').","; // Deprecated
|
||||
//$sql.= " ".price2num($this->price).",";
|
||||
//$sql.= " ".($this->remise?price2num($this->remise):'0').","; // Deprecated
|
||||
if ($this->fk_remise_except) $sql.= $this->fk_remise_except.",";
|
||||
else $sql.= 'null,';
|
||||
if ($this->date_start) { $sql.= "'".$this->db->idate($this->date_start)."',"; }
|
||||
@ -3489,7 +3513,7 @@ class FactureLigne
|
||||
$sql.= " ".price2num($this->total_localtax2);
|
||||
$sql.= ')';
|
||||
|
||||
dol_syslog("FactureLigne::insert sql=".$sql);
|
||||
dol_syslog(get_class($this)."::insert sql=".$sql);
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
@ -3510,7 +3534,7 @@ class FactureLigne
|
||||
if ($discount->fk_facture)
|
||||
{
|
||||
$this->error=$langs->trans("ErrorDiscountAlreadyUsed",$discount->id);
|
||||
dol_syslog("FactureLigne::insert Error ".$this->error, LOG_ERR);
|
||||
dol_syslog(get_class($this)."::insert Error ".$this->error, LOG_ERR);
|
||||
$this->db->rollback();
|
||||
return -3;
|
||||
}
|
||||
@ -3520,7 +3544,7 @@ class FactureLigne
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->error=$discount->error;
|
||||
dol_syslog("FactureLigne::insert Error ".$this->error, LOG_ERR);
|
||||
dol_syslog(get_class($this)."::insert Error ".$this->error, LOG_ERR);
|
||||
$this->db->rollback();
|
||||
return -3;
|
||||
}
|
||||
@ -3529,7 +3553,7 @@ class FactureLigne
|
||||
else
|
||||
{
|
||||
$this->error=$langs->trans("ErrorADiscountThatHasBeenRemovedIsIncluded");
|
||||
dol_syslog("FactureLigne::insert Error ".$this->error, LOG_ERR);
|
||||
dol_syslog(get_class($this)."::insert Error ".$this->error, LOG_ERR);
|
||||
$this->db->rollback();
|
||||
return -3;
|
||||
}
|
||||
@ -3537,7 +3561,7 @@ class FactureLigne
|
||||
else
|
||||
{
|
||||
$this->error=$discount->error;
|
||||
dol_syslog("FactureLigne::insert Error ".$this->error, LOG_ERR);
|
||||
dol_syslog(get_class($this)."::insert Error ".$this->error, LOG_ERR);
|
||||
$this->db->rollback();
|
||||
return -3;
|
||||
}
|
||||
@ -3560,7 +3584,7 @@ class FactureLigne
|
||||
else
|
||||
{
|
||||
$this->error=$this->db->error();
|
||||
dol_syslog("FactureLigne::insert Error ".$this->error, LOG_ERR);
|
||||
dol_syslog(get_class($this)."::insert Error ".$this->error, LOG_ERR);
|
||||
$this->db->rollback();
|
||||
return -2;
|
||||
}
|
||||
@ -3582,7 +3606,7 @@ class FactureLigne
|
||||
if (empty($this->localtax2_tx)) $this->localtax2_tx=0;
|
||||
if (empty($this->total_localtax1)) $this->total_localtax1=0;
|
||||
if (empty($this->total_localtax2)) $this->total_localtax2=0;
|
||||
if (empty($this->remise)) $this->remise=0;
|
||||
//if (empty($this->remise)) $this->remise=0;
|
||||
if (empty($this->remise_percent)) $this->remise_percent=0;
|
||||
if (empty($this->info_bits)) $this->info_bits=0;
|
||||
if (empty($this->product_type)) $this->product_type=0;
|
||||
@ -3597,8 +3621,8 @@ class FactureLigne
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."facturedet SET";
|
||||
$sql.= " description='".$this->db->escape($this->desc)."'";
|
||||
$sql.= ",subprice=".price2num($this->subprice)."";
|
||||
$sql.= ",price=".price2num($this->price)."";
|
||||
$sql.= ",remise=".price2num($this->remise)."";
|
||||
//$sql.= ",price=".price2num($this->price)."";
|
||||
//$sql.= ",remise=".price2num($this->remise)."";
|
||||
$sql.= ",remise_percent=".price2num($this->remise_percent)."";
|
||||
if ($this->fk_remise_except) $sql.= ",fk_remise_except=".$this->fk_remise_except;
|
||||
else $sql.= ",fk_remise_except=null";
|
||||
@ -3651,7 +3675,8 @@ class FactureLigne
|
||||
|
||||
/**
|
||||
* Delete line in database
|
||||
* @return int <0 si ko, >0 si ok
|
||||
*
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function delete()
|
||||
{
|
||||
@ -3660,7 +3685,7 @@ class FactureLigne
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."facturedet WHERE rowid = ".$this->rowid;
|
||||
dol_syslog("FactureLigne::delete sql=".$sql, LOG_DEBUG);
|
||||
dol_syslog(get_class($this)."::delete sql=".$sql, LOG_DEBUG);
|
||||
if ($this->db->query($sql) )
|
||||
{
|
||||
// Appel des triggers
|
||||
@ -3677,20 +3702,21 @@ class FactureLigne
|
||||
else
|
||||
{
|
||||
$this->error=$this->db->error()." sql=".$sql;
|
||||
dol_syslog("FactureLigne::delete Error ".$this->error, LOG_ERR);
|
||||
dol_syslog(get_class($this)."::delete Error ".$this->error, LOG_ERR);
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Mise a jour en base des champs total_xxx de ligne de facture
|
||||
* \return int <0 si ko, >0 si ok
|
||||
* Mise a jour en base des champs total_xxx de ligne de facture
|
||||
*
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function update_total()
|
||||
{
|
||||
$this->db->begin();
|
||||
dol_syslog("FactureLigne::update_total", LOG_DEBUG);
|
||||
dol_syslog(get_class($this)."::update_total", LOG_DEBUG);
|
||||
|
||||
// Clean parameters
|
||||
if (empty($this->total_localtax1)) $this->total_localtax1=0;
|
||||
@ -3716,7 +3742,7 @@ class FactureLigne
|
||||
else
|
||||
{
|
||||
$this->error=$this->db->error();
|
||||
dol_syslog("FactureLigne::update_total Error ".$this->error, LOG_ERR);
|
||||
dol_syslog(get_class($this)."::update_total Error ".$this->error, LOG_ERR);
|
||||
$this->db->rollback();
|
||||
return -2;
|
||||
}
|
||||
|
||||
@ -373,12 +373,12 @@ else
|
||||
|
||||
print '<tr><td>'.$langs->trans("AmountHT").'</td>';
|
||||
print '<td align="right" colspan="2"><b>'.price($fac->total_ht).'</b></td>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("AmountVAT").'</td><td align="right" colspan="2">'.price($fac->total_tva).'</td>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("AmountTTC").'</td><td align="right" colspan="2">'.price($fac->total_ttc).'</td>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
if ($fac->note)
|
||||
{
|
||||
print '<tr><td colspan="5">'.$langs->trans("Note").' : '.nl2br($fac->note)."</td></tr>";
|
||||
|
||||
@ -214,18 +214,18 @@ if ($_REQUEST["facid"] > 0 || $_REQUEST["ref"])
|
||||
{
|
||||
if ($fac->statut == 0)
|
||||
{
|
||||
print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->monnaie)).'. ';
|
||||
print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->currency)).'. ';
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($fac->statut < 1 || $fac->type == 2 || $fac->type == 3)
|
||||
{
|
||||
$text=$langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->monnaie));
|
||||
$text=$langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->currency));
|
||||
print '<br>'.$text.'.<br>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$text=$langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->monnaie));
|
||||
$text=$langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->currency));
|
||||
$text2=$langs->trans("AbsoluteDiscountUse");
|
||||
print $form->textwithpicto($text,$text2);
|
||||
}
|
||||
@ -246,10 +246,10 @@ if ($_REQUEST["facid"] > 0 || $_REQUEST["ref"])
|
||||
{
|
||||
if ($fac->statut == 0 && $fac->type != 3)
|
||||
{
|
||||
$text=$langs->trans("CompanyHasCreditNote",price($absolute_creditnote),$langs->transnoentities("Currency".$conf->monnaie));
|
||||
$text=$langs->trans("CompanyHasCreditNote",price($absolute_creditnote),$langs->transnoentities("Currency".$conf->currency));
|
||||
print $form->textwithpicto($text,$langs->trans("CreditNoteDepositUse"));
|
||||
}
|
||||
else print $langs->trans("CompanyHasCreditNote",price($absolute_creditnote),$langs->transnoentities("Currency".$conf->monnaie)).'.';
|
||||
else print $langs->trans("CompanyHasCreditNote",price($absolute_creditnote),$langs->transnoentities("Currency".$conf->currency)).'.';
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -361,9 +361,9 @@ if ($_REQUEST["facid"] > 0 || $_REQUEST["ref"])
|
||||
// Montants
|
||||
print '<tr><td>'.$langs->trans('AmountHT').'</td>';
|
||||
print '<td align="right" colspan="2" nowrap>'.price($fac->total_ht).'</td>';
|
||||
print '<td>'.$langs->trans('Currency'.$conf->monnaie).'</td></tr>';
|
||||
print '<td>'.$langs->trans('Currency'.$conf->currency).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans('AmountVAT').'</td><td align="right" colspan="2" nowrap>'.price($fac->total_tva).'</td>';
|
||||
print '<td>'.$langs->trans('Currency'.$conf->monnaie).'</td></tr>';
|
||||
print '<td>'.$langs->trans('Currency'.$conf->currency).'</td></tr>';
|
||||
|
||||
// Amount Local Taxes
|
||||
if ($mysoc->pays_code=='ES')
|
||||
@ -372,18 +372,18 @@ if ($_REQUEST["facid"] > 0 || $_REQUEST["ref"])
|
||||
{
|
||||
print '<tr><td>'.$langs->transcountry("AmountLT1",$mysoc->pays_code).'</td>';
|
||||
print '<td align="right" colspan="2" nowrap>'.price($fac->total_localtax1).'</td>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
}
|
||||
if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF
|
||||
{
|
||||
print '<tr><td>'.$langs->transcountry("AmountLT2",$mysoc->pays_code).'</td>';
|
||||
print '<td align="right" colspan="2" nowrap>'.price($fac->total_localtax2).'</td>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
}
|
||||
}
|
||||
|
||||
print '<tr><td>'.$langs->trans('AmountTTC').'</td><td align="right" colspan="2" nowrap>'.price($fac->total_ttc).'</td>';
|
||||
print '<td>'.$langs->trans('Currency'.$conf->monnaie).'</td></tr>';
|
||||
print '<td>'.$langs->trans('Currency'.$conf->currency).'</td></tr>';
|
||||
|
||||
// Statut
|
||||
print '<tr><td>'.$langs->trans('Status').'</td>';
|
||||
|
||||
@ -551,7 +551,7 @@ class localtax extends CommonObject
|
||||
*/
|
||||
function update_fk_bank($id)
|
||||
{
|
||||
$sql = 'UPDATE llx_localtax set fk_bank = '.$id;
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.'localtax SET fk_bank = '.$id;
|
||||
$sql.= ' WHERE rowid = '.$this->id;
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
|
||||
@ -598,7 +598,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
$preselectedchoice=$addwarning?'no':'yes';
|
||||
|
||||
print '<br>';
|
||||
$text=$langs->trans('ConfirmCustomerPayment',$totalpaiement,$langs->trans("Currency".$conf->monnaie));
|
||||
$text=$langs->trans('ConfirmCustomerPayment',$totalpaiement,$langs->trans("Currency".$conf->currency));
|
||||
if (GETPOST('closepaidinvoices'))
|
||||
{
|
||||
$text.='<br>'.$langs->trans("AllCompletelyPayedInvoiceWillBeClosed");
|
||||
|
||||
@ -233,7 +233,7 @@ print $form->editfieldval("Numero",'num',$paiement->numero,$paiement,$paiement->
|
||||
print '</td></tr>';
|
||||
|
||||
// Amount
|
||||
print '<tr><td valign="top">'.$langs->trans('Amount').'</td><td colspan="3">'.price($paiement->montant).' '.$langs->trans('Currency'.$conf->monnaie).'</td></tr>';
|
||||
print '<tr><td valign="top">'.$langs->trans('Amount').'</td><td colspan="3">'.price($paiement->montant).' '.$langs->trans('Currency'.$conf->currency).'</td></tr>';
|
||||
|
||||
// Note
|
||||
print '<tr><td valign="top">'.$form->editfieldkey("Note",'note',$paiement->note,$paiement,$user->rights->facture->paiement).'</td><td colspan="3">';
|
||||
|
||||
@ -185,7 +185,7 @@ if ($_GET["action"] == 'create')
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td colspan="2">'.$charge->lib."</td></tr>\n";
|
||||
print '<tr><td>'.$langs->trans("DateDue")."</td><td colspan=\"2\">".dol_print_date($charge->date_ech,'day')."</td></tr>\n";
|
||||
|
||||
print '<tr><td>'.$langs->trans("AmountTTC")."</td><td colspan=\"2\"><b>".price($charge->amount).'</b> '.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("AmountTTC")."</td><td colspan=\"2\"><b>".price($charge->amount).'</b> '.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
|
||||
$sql = "SELECT sum(p.amount) as total";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."paiementcharge as p";
|
||||
@ -197,8 +197,8 @@ if ($_GET["action"] == 'create')
|
||||
$sumpaid = $obj->total;
|
||||
$db->free();
|
||||
}
|
||||
print '<tr><td>'.$langs->trans("AlreadyPaid").'</td><td colspan="2"><b>'.price($sumpaid).'</b> '.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
|
||||
print "<tr><td valign=\"top\">".$langs->trans("RemainderToPay")."</td><td colspan=\"3\"><b>".price($total - $sumpaid).'</b> '.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("AlreadyPaid").'</td><td colspan="2"><b>'.price($sumpaid).'</b> '.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
print "<tr><td valign=\"top\">".$langs->trans("RemainderToPay")."</td><td colspan=\"3\"><b>".price($total - $sumpaid).'</b> '.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
|
||||
print "<tr class=\"liste_titre\"><td colspan=\"3\">".$langs->trans("Payment").'</td>';
|
||||
|
||||
|
||||
@ -182,7 +182,7 @@ print '<tr><td valign="top">'.$langs->trans('Mode').'</td><td colspan="3">'.$lan
|
||||
print '<tr><td valign="top">'.$langs->trans('Numero').'</td><td colspan="3">'.$paiement->num_paiement.'</td></tr>';
|
||||
|
||||
// Montant
|
||||
print '<tr><td valign="top">'.$langs->trans('Amount').'</td><td colspan="3">'.price($paiement->amount).' '.$langs->trans('Currency'.$conf->monnaie).'</td></tr>';
|
||||
print '<tr><td valign="top">'.$langs->trans('Amount').'</td><td colspan="3">'.price($paiement->amount).' '.$langs->trans('Currency'.$conf->currency).'</td></tr>';
|
||||
|
||||
|
||||
// Note
|
||||
|
||||
@ -715,15 +715,15 @@ class BonPrelevement extends CommonObject
|
||||
* Create a withdraw
|
||||
*
|
||||
* @param int $banque code of bank
|
||||
* @param int $guichet code of banck office
|
||||
* @param int $agence code of bank office (guichet)
|
||||
* @param string $mode real=do action, simu=test only
|
||||
* @return int <0 if KO, nbre of invoice withdrawed if OK
|
||||
*/
|
||||
function Create($banque=0, $guichet=0, $mode='real')
|
||||
function Create($banque=0, $agence=0, $mode='real')
|
||||
{
|
||||
global $conf,$langs;
|
||||
|
||||
dol_syslog("BonPrelevement::Create banque=$banque guichet=$guichet");
|
||||
dol_syslog("BonPrelevement::Create banque=$banque agence=$agence");
|
||||
|
||||
require_once (DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php");
|
||||
require_once (DOL_DOCUMENT_ROOT."/societe/class/societe.class.php");
|
||||
|
||||
@ -198,7 +198,7 @@ if ($resql)
|
||||
print $thirdpartystatic->getNomUrl(1,'customer');
|
||||
print '</td>';
|
||||
print '<td align="right">';
|
||||
print price($obj->total_ttc).' '.$langs->trans("Currency".$conf->monnaie);
|
||||
print price($obj->total_ttc).' '.$langs->trans("Currency".$conf->currency);
|
||||
print '</td>';
|
||||
// Date
|
||||
print '<td align="right">';
|
||||
@ -258,7 +258,7 @@ if ($result)
|
||||
print "</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->monnaie)."</td>\n";
|
||||
print '<td align="right">'.price($obj->amount).' '.$langs->trans("Currency".$conf->currency)."</td>\n";
|
||||
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
|
||||
@ -168,7 +168,7 @@ if ($id > 0 || ! empty($ref))
|
||||
else print $langs->trans("CompanyHasNoRelativeDiscount");
|
||||
$absolute_discount=$societe->getAvailableDiscounts();
|
||||
print '. ';
|
||||
if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->trans("Currency".$conf->monnaie));
|
||||
if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->trans("Currency".$conf->currency));
|
||||
else print $langs->trans("CompanyHasNoAbsoluteDiscount");
|
||||
print '.';
|
||||
print '</td></tr>';
|
||||
@ -289,10 +289,10 @@ if ($id > 0 || ! empty($ref))
|
||||
// Amount
|
||||
print '<tr><td height="10">'.$langs->trans('AmountHT').'</td>';
|
||||
print '<td align="right" colspan="2"><b>'.price($object->total_ht).'</b></td>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
|
||||
print '<tr><td height="10">'.$langs->trans('AmountVAT').'</td><td align="right" colspan="2">'.price($object->total_tva).'</td>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
|
||||
// Amount Local Taxes
|
||||
if ($mysoc->pays_code=='ES')
|
||||
@ -301,19 +301,19 @@ if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
print '<tr><td>'.$langs->transcountry("AmountLT1",$mysoc->pays_code).'</td>';
|
||||
print '<td align="right" colspan="2">'.price($object->total_localtax1).'</td>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
}
|
||||
if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF
|
||||
{
|
||||
print '<tr><td>'.$langs->transcountry("AmountLT2",$mysoc->pays_code).'</td>';
|
||||
print '<td align="right" colspan="2">'.price($object->total_localtax2).'</td>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
print '<tr><td height="10">'.$langs->trans('AmountTTC').'</td><td align="right" colspan="2">'.price($object->total_ttc).'</td>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
|
||||
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
|
||||
|
||||
// Statut
|
||||
|
||||
@ -351,7 +351,7 @@ if ($chid > 0)
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/payment_sc/fiche.php?id='.$objp->rowid.'">'.img_object($langs->trans("Payment"),"payment").'</a> ';
|
||||
print dol_print_date($db->jdate($objp->dp),'day')."</td>\n";
|
||||
print "<td>".$objp->paiement_type.' '.$objp->num_paiement."</td>\n";
|
||||
print '<td align="right">'.price($objp->amount)."</td><td> ".$langs->trans("Currency".$conf->monnaie)."</td>\n";
|
||||
print '<td align="right">'.price($objp->amount)."</td><td> ".$langs->trans("Currency".$conf->currency)."</td>\n";
|
||||
print "</tr>";
|
||||
$totalpaye += $objp->amount;
|
||||
$i++;
|
||||
@ -359,13 +359,13 @@ if ($chid > 0)
|
||||
|
||||
if ($cha->paye == 0)
|
||||
{
|
||||
print "<tr><td colspan=\"2\" align=\"right\">".$langs->trans("AlreadyPaid")." :</td><td align=\"right\"><b>".price($totalpaye)."</b></td><td> ".$langs->trans("Currency".$conf->monnaie)."</td></tr>\n";
|
||||
print "<tr><td colspan=\"2\" align=\"right\">".$langs->trans("AmountExpected")." :</td><td align=\"right\" bgcolor=\"#d0d0d0\">".price($cha->amount)."</td><td bgcolor=\"#d0d0d0\"> ".$langs->trans("Currency".$conf->monnaie)."</td></tr>\n";
|
||||
print "<tr><td colspan=\"2\" align=\"right\">".$langs->trans("AlreadyPaid")." :</td><td align=\"right\"><b>".price($totalpaye)."</b></td><td> ".$langs->trans("Currency".$conf->currency)."</td></tr>\n";
|
||||
print "<tr><td colspan=\"2\" align=\"right\">".$langs->trans("AmountExpected")." :</td><td align=\"right\" bgcolor=\"#d0d0d0\">".price($cha->amount)."</td><td bgcolor=\"#d0d0d0\"> ".$langs->trans("Currency".$conf->currency)."</td></tr>\n";
|
||||
|
||||
$resteapayer = $cha->amount - $totalpaye;
|
||||
|
||||
print "<tr><td colspan=\"2\" align=\"right\">".$langs->trans("RemainderToPay")." :</td>";
|
||||
print "<td align=\"right\" bgcolor=\"#f0f0f0\"><b>".price($resteapayer)."</b></td><td bgcolor=\"#f0f0f0\"> ".$langs->trans("Currency".$conf->monnaie)."</td></tr>\n";
|
||||
print "<td align=\"right\" bgcolor=\"#f0f0f0\"><b>".price($resteapayer)."</b></td><td bgcolor=\"#f0f0f0\"> ".$langs->trans("Currency".$conf->currency)."</td></tr>\n";
|
||||
}
|
||||
print "</table>";
|
||||
$db->free($resql);
|
||||
|
||||
@ -78,7 +78,7 @@ class PaymentSocialContribution extends CommonObject
|
||||
// Validate parametres
|
||||
if (! $this->datepaye)
|
||||
{
|
||||
$this->error='ErrorBadValueForParameters';
|
||||
$this->error='ErrorBadValueForParameter';
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -552,7 +552,7 @@ class PaymentSocialContribution extends CommonObject
|
||||
*/
|
||||
function update_fk_bank($id_bank)
|
||||
{
|
||||
$sql = "UPDATE llx_paiementcharge set fk_bank = ".$id_bank." where rowid = ".$this->id;
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."paiementcharge SET fk_bank = ".$id_bank." WHERE rowid = ".$this->id;
|
||||
|
||||
dol_syslog(get_class($this)."::update_fk_bank sql=".$sql);
|
||||
$result = $this->db->query($sql);
|
||||
|
||||
@ -451,7 +451,7 @@ print "</table>";
|
||||
En attendant correction.
|
||||
|
||||
$sql = "SELECT sum(f.total) as tot_fht,sum(f.total_ttc) as tot_fttc, p.rowid, p.ref, s.nom, s.rowid as socid, p.total_ht, p.total_ttc
|
||||
FROM ".MAIN_DB_PREFIX."commande AS p, llx_societe AS s
|
||||
FROM ".MAIN_DB_PREFIX."commande AS p, ".MAIN_DB_PREFIX."societe AS s
|
||||
LEFT JOIN ".MAIN_DB_PREFIX."co_fa AS co_fa ON co_fa.fk_commande = p.rowid
|
||||
LEFT JOIN ".MAIN_DB_PREFIX."facture AS f ON co_fa.fk_facture = f.rowid
|
||||
WHERE p.fk_soc = s.rowid
|
||||
|
||||
@ -56,7 +56,7 @@ function pt ($db, $sql, $title) {
|
||||
$total = $total + $obj->amount;
|
||||
$i++;
|
||||
}
|
||||
print "<tr class=\"total\"><td colspan=\"2\" align=\"right\"><b>".$langs->trans("TotalHT").": ".price($total)."</b> ".$langs->trans("Currency".$conf->monnaie)."</td></tr>";
|
||||
print "<tr class=\"total\"><td colspan=\"2\" align=\"right\"><b>".$langs->trans("TotalHT").": ".price($total)."</b> ".$langs->trans("Currency".$conf->currency)."</td></tr>";
|
||||
|
||||
$db->free();
|
||||
}
|
||||
|
||||
@ -579,7 +579,7 @@ class Tva extends CommonObject
|
||||
*/
|
||||
function update_fk_bank($id_bank)
|
||||
{
|
||||
$sql = 'UPDATE llx_tva set fk_bank = '.$id_bank;
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.'tva SET fk_bank = '.$id_bank;
|
||||
$sql.= ' WHERE rowid = '.$this->id;
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
|
||||
@ -96,6 +96,14 @@ $dolibarr_main_db_port='';
|
||||
$dolibarr_main_db_name='';
|
||||
|
||||
|
||||
# dolibarr_main_db_prefix
|
||||
# This parameter contains prefix of Dolibarr database.
|
||||
# Examples:
|
||||
# $dolibarr_main_db_prefix='llx_';
|
||||
#
|
||||
$dolibarr_main_db_prefix='';
|
||||
|
||||
|
||||
# dolibarr_main_db_user
|
||||
# This parameter contains user name used to read and write into
|
||||
# Dolibarr database.
|
||||
|
||||
@ -157,7 +157,7 @@ if ($id > 0)
|
||||
else print $langs->trans("CompanyHasNoRelativeDiscount");
|
||||
$absolute_discount=$contrat->societe->getAvailableDiscounts();
|
||||
print '. ';
|
||||
if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",$absolute_discount,$langs->trans("Currency".$conf->monnaie));
|
||||
if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",$absolute_discount,$langs->trans("Currency".$conf->currency));
|
||||
else print $langs->trans("CompanyHasNoAbsoluteDiscount");
|
||||
print '.';
|
||||
print '</td></tr>';
|
||||
|
||||
@ -290,7 +290,7 @@ if ($action == 'addline' && $user->rights->contrat->creer)
|
||||
|
||||
if($price_min && (price2num($pu_ht)*(1-price2num($_POST['remise_percent'])/100) < price2num($price_min)))
|
||||
{
|
||||
$object->error = $langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').' '.$langs->trans("Currency".$conf->monnaie));
|
||||
$object->error = $langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').' '.$langs->trans("Currency".$conf->currency));
|
||||
$result = -1 ;
|
||||
}
|
||||
else
|
||||
@ -510,7 +510,7 @@ if ($action == 'create')
|
||||
else print $langs->trans("CompanyHasNoRelativeDiscount");
|
||||
$absolute_discount=$soc->getAvailableDiscounts();
|
||||
print '. ';
|
||||
if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->trans("Currency".$conf->monnaie));
|
||||
if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->trans("Currency".$conf->currency));
|
||||
else print $langs->trans("CompanyHasNoAbsoluteDiscount");
|
||||
print '.';
|
||||
print '</td></tr>';
|
||||
@ -657,7 +657,7 @@ else
|
||||
else print $langs->trans("CompanyHasNoRelativeDiscount");
|
||||
$absolute_discount=$object->societe->getAvailableDiscounts();
|
||||
print '. ';
|
||||
if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->trans("Currency".$conf->monnaie));
|
||||
if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->trans("Currency".$conf->currency));
|
||||
else print $langs->trans("CompanyHasNoAbsoluteDiscount");
|
||||
print '.';
|
||||
print '</td></tr>';
|
||||
|
||||
@ -119,7 +119,7 @@ if ($_GET["id"])
|
||||
else print $langs->trans("CompanyHasNoRelativeDiscount");
|
||||
$absolute_discount=$contrat->societe->getAvailableDiscounts();
|
||||
print '. ';
|
||||
if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",$absolute_discount,$langs->trans("Currency".$conf->monnaie));
|
||||
if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",$absolute_discount,$langs->trans("Currency".$conf->currency));
|
||||
else print $langs->trans("CompanyHasNoAbsoluteDiscount");
|
||||
print '.';
|
||||
print '</td></tr>';
|
||||
|
||||
@ -32,10 +32,10 @@ $langs->load("products");
|
||||
$langs->load("contracts");
|
||||
$langs->load("companies");
|
||||
|
||||
$mode = isset($_GET["mode"])?$_GET["mode"]:$_POST["mode"];
|
||||
$sortfield = isset($_GET["sortfield"])?$_GET["sortfield"]:$_POST["sortfield"];
|
||||
$sortorder = isset($_GET["sortorder"])?$_GET["sortorder"]:$_POST["sortorder"];
|
||||
$page = isset($_GET["page"])?$_GET["page"]:$_POST["page"];
|
||||
$mode = GETPOST("mode");
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$page = GETPOST("page");
|
||||
if ($page == -1) { $page = 0 ; }
|
||||
$limit = $conf->liste_limit;
|
||||
$offset = $limit * $page ;
|
||||
@ -43,15 +43,15 @@ $offset = $limit * $page ;
|
||||
if (! $sortfield) $sortfield="c.rowid";
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
|
||||
$filter=isset($_GET["filter"])?$_GET["filter"]:$_POST["filter"];
|
||||
$search_nom=isset($_GET["search_nom"])?$_GET["search_nom"]:$_POST["search_nom"];
|
||||
$search_contract=isset($_GET["search_contract"])?$_GET["search_contract"]:$_POST["search_contract"];
|
||||
$search_service=isset($_GET["search_service"])?$_GET["search_service"]:$_POST["search_service"];
|
||||
$filter=GETPOST("filter");
|
||||
$search_nom=GETPOST("search_nom");
|
||||
$search_contract=GETPOST("search_contract");
|
||||
$search_service=GETPOST("search_service");
|
||||
$statut=isset($_GET["statut"])?$_GET["statut"]:1;
|
||||
$socid=$_GET["socid"];
|
||||
$socid=GETPOST("socid");
|
||||
|
||||
// Security check
|
||||
$contratid = isset($_GET["id"])?$_GET["id"]:'';
|
||||
$contratid = GETPOST("id");
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result = restrictedArea($user, 'contrat',$contratid,'');
|
||||
|
||||
@ -152,15 +152,15 @@ if ($resql)
|
||||
print '<td class="liste_titre">';
|
||||
print '<input type="hidden" name="filter" value="'.$filter.'">';
|
||||
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||
print '<input type="text" class="flat" size="3" name="search_contract" value="'.$search_contract.'">';
|
||||
print '<input type="text" class="flat" size="3" name="search_contract" value="'.dol_escape_htmltag($search_contract).'">';
|
||||
print '</td>';
|
||||
// Service label
|
||||
print '<td class="liste_titre">';
|
||||
print '<input type="text" class="flat" size="18" name="search_service" value="'.$search_service.'">';
|
||||
print '<input type="text" class="flat" size="18" name="search_service" value="'.dol_escape_htmltag($search_service).'">';
|
||||
print '</td>';
|
||||
// Third party
|
||||
print '<td class="liste_titre">';
|
||||
print '<input type="text" class="flat" size="24" name="search_nom" value="'.$search_nom.'">';
|
||||
print '<input type="text" class="flat" size="24" name="search_nom" value="'.dol_escape_htmltag($search_nom).'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre" align="center">';
|
||||
$arrayofoperators=array('<'=>'<','>'=>'>');
|
||||
|
||||
@ -52,8 +52,10 @@ class box_actions extends ModeleBoxes {
|
||||
}
|
||||
|
||||
/**
|
||||
* Charge les donnees en memoire pour affichage ulterieur
|
||||
* @param $max Nombre maximum d'enregistrements a charger
|
||||
* Load data for box to show them later
|
||||
*
|
||||
* @param int $max Maximum number of records to load
|
||||
* @return void
|
||||
*/
|
||||
function loadBox($max=5)
|
||||
{
|
||||
@ -146,6 +148,13 @@ class box_actions extends ModeleBoxes {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @return void
|
||||
*/
|
||||
function showBox($head = null, $contents = null)
|
||||
{
|
||||
parent::showBox($this->info_box_head, $this->info_box_contents);
|
||||
|
||||
@ -37,7 +37,7 @@ class box_bookmarks extends ModeleBoxes {
|
||||
var $info_box_contents = array();
|
||||
|
||||
/**
|
||||
* \brief Constructeur de la classe
|
||||
* Constructor
|
||||
*/
|
||||
function box_bookmarks()
|
||||
{
|
||||
@ -48,8 +48,10 @@ class box_bookmarks extends ModeleBoxes {
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Charge les donnees en memoire pour affichage ulterieur
|
||||
* \param $max Nombre maximum d'enregistrements a charger
|
||||
* Load data for box to show them later
|
||||
*
|
||||
* @param int $max Maximum number of records to load
|
||||
* @return void
|
||||
*/
|
||||
function loadBox($max=5)
|
||||
{
|
||||
@ -121,6 +123,13 @@ class box_bookmarks extends ModeleBoxes {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @return void
|
||||
*/
|
||||
function showBox($head = null, $contents = null)
|
||||
{
|
||||
parent::showBox($this->info_box_head, $this->info_box_contents);
|
||||
|
||||
@ -40,7 +40,7 @@ class box_clients extends ModeleBoxes {
|
||||
var $info_box_contents = array();
|
||||
|
||||
/**
|
||||
* \brief Constructeur de la classe
|
||||
* Constructor
|
||||
*/
|
||||
function box_clients()
|
||||
{
|
||||
@ -51,8 +51,10 @@ class box_clients extends ModeleBoxes {
|
||||
}
|
||||
|
||||
/**
|
||||
* Load data of box into memory for a future usage
|
||||
* @param $max Maximum number of records to show
|
||||
* Load data for box to show them later
|
||||
*
|
||||
* @param int $max Maximum number of records to load
|
||||
* @return void
|
||||
*/
|
||||
function loadBox($max=5)
|
||||
{
|
||||
@ -125,6 +127,13 @@ class box_clients extends ModeleBoxes {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @return void
|
||||
*/
|
||||
function showBox($head = null, $contents = null)
|
||||
{
|
||||
parent::showBox($this->info_box_head, $this->info_box_contents);
|
||||
|
||||
@ -40,7 +40,7 @@ class box_commandes extends ModeleBoxes {
|
||||
var $info_box_contents = array();
|
||||
|
||||
/**
|
||||
* \brief Constructeur de la classe
|
||||
* Constructor
|
||||
*/
|
||||
function box_commandes()
|
||||
{
|
||||
@ -51,8 +51,10 @@ class box_commandes extends ModeleBoxes {
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Charge les donnees en memoire pour affichage ulterieur
|
||||
* \param $max Nombre maximum d'enregistrements a charger
|
||||
* Load data for box to show them later
|
||||
*
|
||||
* @param int $max Maximum number of records to load
|
||||
* @return void
|
||||
*/
|
||||
function loadBox($max=5)
|
||||
{
|
||||
@ -134,6 +136,13 @@ class box_commandes extends ModeleBoxes {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @return void
|
||||
*/
|
||||
function showBox($head = null, $contents = null)
|
||||
{
|
||||
parent::showBox($this->info_box_head, $this->info_box_contents);
|
||||
|
||||
@ -54,7 +54,8 @@ class box_comptes extends ModeleBoxes {
|
||||
/**
|
||||
* Load data into info_box_contents array to show array later.
|
||||
*
|
||||
* @param $max Maximum number of records to load
|
||||
* @param int $max Maximum number of records to load
|
||||
* @return void
|
||||
*/
|
||||
function loadBox($max=5)
|
||||
{
|
||||
@ -130,7 +131,7 @@ class box_comptes extends ModeleBoxes {
|
||||
$this->info_box_contents[$i][2] = array('td' => 'align="right" class="liste_total"',
|
||||
'text' => ' '
|
||||
);
|
||||
$totalamount=price($solde_total).' '.$langs->trans("Currency".$conf->monnaie);
|
||||
$totalamount=price($solde_total).' '.$langs->trans("Currency".$conf->currency);
|
||||
$this->info_box_contents[$i][3] = array('td' => 'align="right" class="liste_total"',
|
||||
'text' => $totalamount
|
||||
);
|
||||
@ -147,6 +148,13 @@ class box_comptes extends ModeleBoxes {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @return void
|
||||
*/
|
||||
function showBox($head = null, $contents = null)
|
||||
{
|
||||
parent::showBox($this->info_box_head, $this->info_box_contents);
|
||||
|
||||
@ -41,7 +41,7 @@ class box_contacts extends ModeleBoxes {
|
||||
var $info_box_contents = array();
|
||||
|
||||
/**
|
||||
* \brief Constructeur de la classe
|
||||
* Constructor
|
||||
*/
|
||||
function box_contacts()
|
||||
{
|
||||
@ -52,8 +52,10 @@ class box_contacts extends ModeleBoxes {
|
||||
}
|
||||
|
||||
/**
|
||||
* Load data of box into memory for a future usage
|
||||
* @param $max Maximum number of records to show
|
||||
* Load data into info_box_contents array to show array later.
|
||||
*
|
||||
* @param int $max Maximum number of records to load
|
||||
* @return void
|
||||
*/
|
||||
function loadBox($max=5)
|
||||
{
|
||||
@ -123,6 +125,13 @@ class box_contacts extends ModeleBoxes {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @return void
|
||||
*/
|
||||
function showBox($head = null, $contents = null)
|
||||
{
|
||||
parent::showBox($this->info_box_head, $this->info_box_contents);
|
||||
|
||||
@ -39,7 +39,7 @@ class box_contracts extends ModeleBoxes {
|
||||
|
||||
|
||||
/**
|
||||
* \brief Constructeur de la classe
|
||||
* Constructor
|
||||
*/
|
||||
function box_contracts()
|
||||
{
|
||||
@ -51,8 +51,10 @@ class box_contracts extends ModeleBoxes {
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Charge les donnees en memoire pour affichage ulterieur
|
||||
* \param $max Nombre maximum d'enregistrements a charger
|
||||
* Load data for box to show them later
|
||||
*
|
||||
* @param int $max Maximum number of records to load
|
||||
* @return void
|
||||
*/
|
||||
function loadBox($max=5)
|
||||
{
|
||||
@ -143,6 +145,13 @@ class box_contracts extends ModeleBoxes {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @return void
|
||||
*/
|
||||
function showBox($head = null, $contents = null)
|
||||
{
|
||||
parent::showBox($this->info_box_head, $this->info_box_contents);
|
||||
|
||||
@ -42,7 +42,7 @@ class box_external_rss extends ModeleBoxes {
|
||||
var $info_box_contents = array();
|
||||
|
||||
/**
|
||||
* Constructeur de la classe
|
||||
* Constructor
|
||||
*/
|
||||
function box_external_rss($DB,$param)
|
||||
{
|
||||
@ -56,10 +56,11 @@ class box_external_rss extends ModeleBoxes {
|
||||
}
|
||||
|
||||
/**
|
||||
* Load information for box into memory to show them later with this->showBox method.
|
||||
*
|
||||
* @param int $max Max numbe rof records to load
|
||||
* @param int $cachedelay Delay we accept for cache file
|
||||
* Load data into info_box_contents array to show array later.
|
||||
*
|
||||
* @param int $max Maximum number of records to load
|
||||
* @param int $cachedelay Delay we accept for cache file
|
||||
* @return void
|
||||
*/
|
||||
function loadBox($max=5, $cachedelay=3600)
|
||||
{
|
||||
@ -152,6 +153,13 @@ class box_external_rss extends ModeleBoxes {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @return void
|
||||
*/
|
||||
function showBox($head = null, $contents = null)
|
||||
{
|
||||
parent::showBox($this->info_box_head, $this->info_box_contents);
|
||||
|
||||
@ -39,7 +39,7 @@ class box_factures extends ModeleBoxes {
|
||||
var $info_box_contents = array();
|
||||
|
||||
/**
|
||||
* \brief Constructeur de la classe
|
||||
* Constructor
|
||||
*/
|
||||
function box_factures()
|
||||
{
|
||||
@ -50,8 +50,10 @@ class box_factures extends ModeleBoxes {
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Charge les donnees en memoire pour affichage ulterieur
|
||||
* \param $max Nombre maximum d'enregistrements a charger
|
||||
* Load data into info_box_contents array to show array later.
|
||||
*
|
||||
* @param int $max Maximum number of records to load
|
||||
* @return void
|
||||
*/
|
||||
function loadBox($max=5)
|
||||
{
|
||||
@ -149,6 +151,13 @@ class box_factures extends ModeleBoxes {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @return void
|
||||
*/
|
||||
function showBox($head = null, $contents = null)
|
||||
{
|
||||
parent::showBox($this->info_box_head, $this->info_box_contents);
|
||||
|
||||
@ -39,7 +39,7 @@ class box_factures_fourn extends ModeleBoxes {
|
||||
var $info_box_contents = array();
|
||||
|
||||
/**
|
||||
* \brief Constructeur de la classe
|
||||
* Constructor
|
||||
*/
|
||||
function box_factures_fourn()
|
||||
{
|
||||
@ -50,8 +50,10 @@ class box_factures_fourn extends ModeleBoxes {
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Charge les donnees en memoire pour affichage ulterieur
|
||||
* \param $max Nombre maximum d'enregistrements a charger
|
||||
* Load data into info_box_contents array to show array later.
|
||||
*
|
||||
* @param int $max Maximum number of records to load
|
||||
* @return void
|
||||
*/
|
||||
function loadBox($max=5)
|
||||
{
|
||||
@ -143,6 +145,13 @@ class box_factures_fourn extends ModeleBoxes {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @return void
|
||||
*/
|
||||
function showBox($head = null, $contents = null)
|
||||
{
|
||||
parent::showBox($this->info_box_head, $this->info_box_contents);
|
||||
|
||||
@ -39,7 +39,7 @@ class box_factures_fourn_imp extends ModeleBoxes {
|
||||
|
||||
|
||||
/**
|
||||
* \brief Constructeur de la classe
|
||||
* Constructor
|
||||
*/
|
||||
function box_factures_fourn_imp()
|
||||
{
|
||||
@ -50,8 +50,10 @@ class box_factures_fourn_imp extends ModeleBoxes {
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Charge les donnees en memoire pour affichage ulterieur
|
||||
* \param $max Nombre maximum d'enregistrements a charger
|
||||
* Load data into info_box_contents array to show array later.
|
||||
*
|
||||
* @param int $max Maximum number of records to load
|
||||
* @return void
|
||||
*/
|
||||
function loadBox($max=5)
|
||||
{
|
||||
@ -143,6 +145,13 @@ class box_factures_fourn_imp extends ModeleBoxes {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @return void
|
||||
*/
|
||||
function showBox($head = null, $contents = null)
|
||||
{
|
||||
parent::showBox($this->info_box_head, $this->info_box_contents);
|
||||
|
||||
@ -42,7 +42,7 @@ class box_factures_imp extends ModeleBoxes {
|
||||
|
||||
|
||||
/**
|
||||
* \brief Constructeur de la classe
|
||||
* Constructor
|
||||
*/
|
||||
function box_factures_imp()
|
||||
{
|
||||
@ -53,8 +53,10 @@ class box_factures_imp extends ModeleBoxes {
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Charge les donnees en memoire pour affichage ulterieur
|
||||
* \param $max Nombre maximum d'enregistrements a charger
|
||||
* Load data into info_box_contents array to show array later.
|
||||
*
|
||||
* @param int $max Maximum number of records to load
|
||||
* @return void
|
||||
*/
|
||||
function loadBox($max=5)
|
||||
{
|
||||
@ -145,6 +147,13 @@ class box_factures_imp extends ModeleBoxes {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @return void
|
||||
*/
|
||||
function showBox($head = null, $contents = null)
|
||||
{
|
||||
parent::showBox($this->info_box_head, $this->info_box_contents);
|
||||
|
||||
@ -39,7 +39,7 @@ class box_fournisseurs extends ModeleBoxes {
|
||||
var $info_box_contents = array();
|
||||
|
||||
/**
|
||||
* \brief Constructeur de la classe
|
||||
* Constructor
|
||||
*/
|
||||
function box_fournisseurs()
|
||||
{
|
||||
@ -50,8 +50,10 @@ class box_fournisseurs extends ModeleBoxes {
|
||||
}
|
||||
|
||||
/**
|
||||
* Load data of box into memory for a future usage
|
||||
* @param $max Maximum number of records to show
|
||||
* Load data into info_box_contents array to show array later.
|
||||
*
|
||||
* @param int $max Maximum number of records to load
|
||||
* @return void
|
||||
*/
|
||||
function loadBox($max=5)
|
||||
{
|
||||
@ -119,6 +121,13 @@ class box_fournisseurs extends ModeleBoxes {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @return void
|
||||
*/
|
||||
function showBox($head = null, $contents = null)
|
||||
{
|
||||
parent::showBox($this->info_box_head, $this->info_box_contents);
|
||||
|
||||
@ -40,7 +40,7 @@ class box_members extends ModeleBoxes {
|
||||
var $info_box_contents = array();
|
||||
|
||||
/**
|
||||
* \brief Constructeur de la classe
|
||||
* Constructor
|
||||
*/
|
||||
function box_members()
|
||||
{
|
||||
@ -51,8 +51,10 @@ class box_members extends ModeleBoxes {
|
||||
}
|
||||
|
||||
/**
|
||||
* Load data of box into memory for a future usage
|
||||
* @param $max Maximum number of records to show
|
||||
* Load data into info_box_contents array to show array later.
|
||||
*
|
||||
* @param int $max Maximum number of records to load
|
||||
* @return void
|
||||
*/
|
||||
function loadBox($max=5)
|
||||
{
|
||||
@ -121,6 +123,13 @@ class box_members extends ModeleBoxes {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @return void
|
||||
*/
|
||||
function showBox($head = null, $contents = null)
|
||||
{
|
||||
parent::showBox($this->info_box_head, $this->info_box_contents);
|
||||
|
||||
@ -39,7 +39,7 @@ class box_osc_clients extends ModeleBoxes {
|
||||
var $info_box_contents = array();
|
||||
|
||||
/**
|
||||
* \brief Constructeur de la classe
|
||||
* Constructor
|
||||
*/
|
||||
function box_osc_clients()
|
||||
{
|
||||
@ -50,8 +50,10 @@ class box_osc_clients extends ModeleBoxes {
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Charge les donn<EFBFBD>es en m<EFBFBD>moire pour affichage ult<EFBFBD>rieur
|
||||
* \param $max Nombre maximum d'enregistrements <EFBFBD> charger
|
||||
* Load data into info_box_contents array to show array later.
|
||||
*
|
||||
* @param int $max Maximum number of records to load
|
||||
* @return void
|
||||
*/
|
||||
function loadBox($max=5)
|
||||
{
|
||||
@ -97,6 +99,13 @@ class box_osc_clients extends ModeleBoxes {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @return void
|
||||
*/
|
||||
function showBox($head = null, $contents = null)
|
||||
{
|
||||
parent::showBox($this->info_box_head, $this->info_box_contents);
|
||||
|
||||
@ -42,7 +42,7 @@ class box_produits extends ModeleBoxes {
|
||||
|
||||
|
||||
/**
|
||||
* \brief Constructeur de la classe
|
||||
* Constructor
|
||||
*/
|
||||
function box_produits()
|
||||
{
|
||||
@ -53,8 +53,10 @@ class box_produits extends ModeleBoxes {
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Charge les donnees en memoire pour affichage ulterieur
|
||||
* \param $max Nombre maximum d'enregistrements a charger
|
||||
* Load data into info_box_contents array to show array later.
|
||||
*
|
||||
* @param int $max Maximum number of records to load
|
||||
* @return void
|
||||
*/
|
||||
function loadBox($max=5)
|
||||
{
|
||||
@ -154,6 +156,13 @@ class box_produits extends ModeleBoxes {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @return void
|
||||
*/
|
||||
function showBox($head = null, $contents = null)
|
||||
{
|
||||
parent::showBox($this->info_box_head, $this->info_box_contents);
|
||||
|
||||
@ -41,7 +41,7 @@ class box_propales extends ModeleBoxes {
|
||||
|
||||
|
||||
/**
|
||||
* \brief Constructeur de la classe
|
||||
* Constructor
|
||||
*/
|
||||
function box_propales()
|
||||
{
|
||||
@ -52,8 +52,10 @@ class box_propales extends ModeleBoxes {
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Charge les donnees en memoire pour affichage ulterieur
|
||||
* \param $max Nombre maximum d'enregistrements a charger
|
||||
* Load data into info_box_contents array to show array later.
|
||||
*
|
||||
* @param int $max Maximum number of records to load
|
||||
* @return void
|
||||
*/
|
||||
function loadBox($max=5)
|
||||
{
|
||||
@ -139,6 +141,13 @@ class box_propales extends ModeleBoxes {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @return void
|
||||
*/
|
||||
function showBox($head = null, $contents = null)
|
||||
{
|
||||
parent::showBox($this->info_box_head, $this->info_box_contents);
|
||||
|
||||
@ -42,7 +42,7 @@ class box_prospect extends ModeleBoxes {
|
||||
var $info_box_contents = array();
|
||||
|
||||
/**
|
||||
* \brief Constructeur de la classe
|
||||
* Constructor
|
||||
*/
|
||||
function box_prospect($DB,$param)
|
||||
{
|
||||
@ -56,8 +56,10 @@ class box_prospect extends ModeleBoxes {
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Charge les donnees en memoire pour affichage ulterieur
|
||||
* \param $max Nombre maximum d'enregistrements a charger
|
||||
* Load data into info_box_contents array to show array later.
|
||||
*
|
||||
* @param int $max Maximum number of records to load
|
||||
* @return void
|
||||
*/
|
||||
function loadBox($max=5)
|
||||
{
|
||||
@ -132,6 +134,13 @@ class box_prospect extends ModeleBoxes {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @return void
|
||||
*/
|
||||
function showBox($head = null, $contents = null)
|
||||
{
|
||||
parent::showBox($this->info_box_head, $this->info_box_contents);
|
||||
|
||||
159
htdocs/core/boxes/box_services_expired.php
Normal file
159
htdocs/core/boxes/box_services_expired.php
Normal file
@ -0,0 +1,159 @@
|
||||
<?php
|
||||
/* Copyright (C) 2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/core/boxes/box_services_expired.php
|
||||
* \ingroup contracts
|
||||
* \brief Module to show the box of last expired services
|
||||
*/
|
||||
|
||||
include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php");
|
||||
|
||||
|
||||
class box_services_expired extends ModeleBoxes {
|
||||
|
||||
var $boxcode="expiredservices";
|
||||
var $boximg="object_contract";
|
||||
var $boxlabel;
|
||||
var $depends = array("contrat"); // conf->propal->enabled
|
||||
|
||||
var $db;
|
||||
var $param;
|
||||
|
||||
var $info_box_head = array();
|
||||
var $info_box_contents = array();
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
function box_services_expired()
|
||||
{
|
||||
global $langs;
|
||||
|
||||
$langs->load("contracts");
|
||||
|
||||
$this->boxlabel=$langs->trans("BoxOldestExpiredServices");
|
||||
}
|
||||
|
||||
/**
|
||||
* Load data for box to show them later
|
||||
*
|
||||
* @param int $max Maximum number of records to load
|
||||
* @return void
|
||||
*/
|
||||
function loadBox($max=5)
|
||||
{
|
||||
global $user, $langs, $db, $conf;
|
||||
|
||||
$this->max=$max;
|
||||
|
||||
$now=dol_now('tzref');
|
||||
|
||||
$this->info_box_head = array('text' => $langs->trans("BoxLastExpiredServices",$max));
|
||||
|
||||
if ($user->rights->contrat->lire)
|
||||
{
|
||||
// Select contracts with at least one expired service
|
||||
$sql = "SELECT ";
|
||||
$sql.= " c.rowid, c.ref, c.statut as fk_statut, c.date_contrat,";
|
||||
$sql.= " s.nom, s.rowid as socid,";
|
||||
$sql.= " MIN(cd.date_fin_validite) as date_line, COUNT(cd.rowid) as nb_services";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."contrat as c, ".MAIN_DB_PREFIX."societe s, ".MAIN_DB_PREFIX."contratdet as cd";
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE cd.statut = 4 AND cd.date_fin_validite <= '".$db->idate($now)."'";
|
||||
$sql.= " AND c.fk_soc=s.rowid AND cd.fk_contrat=c.rowid AND c.statut > 0";
|
||||
if ($user->societe_id) $sql.=' AND c.fk_soc = '.$user->societe_id;
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
$sql.= " GROUP BY c.rowid, c.ref, c.statut, c.date_contrat, s.nom, s.rowid";
|
||||
$sql.= " ORDER BY date_line ASC";
|
||||
$sql.= $db->plimit($max, 0);
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
$i = 0;
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$late='';
|
||||
|
||||
$objp = $db->fetch_object($resql);
|
||||
|
||||
$dateline=$db->jdate($objp->date_line);
|
||||
if (($dateline + $conf->contrat->services->expires->warning_delay) < $now) $late=img_warning($langs->trans("Late"));
|
||||
|
||||
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',
|
||||
'logo' => $this->boximg,
|
||||
'url' => DOL_URL_ROOT."/contrat/fiche.php?id=".$objp->rowid);
|
||||
|
||||
$this->info_box_contents[$i][1] = array('td' => 'align="left"',
|
||||
'text' => ($objp->ref?$objp->ref:$objp->rowid), // Some contracts have no ref
|
||||
'url' => DOL_URL_ROOT."/contrat/fiche.php?id=".$objp->rowid);
|
||||
|
||||
$this->info_box_contents[$i][2] = array('td' => 'align="left" width="16"',
|
||||
'logo' => 'company',
|
||||
'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->socid);
|
||||
|
||||
$this->info_box_contents[$i][3] = array('td' => 'align="left"',
|
||||
'text' => dol_trunc($objp->nom,40),
|
||||
'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->socid);
|
||||
|
||||
$this->info_box_contents[$i][4] = array('td' => 'align="center"',
|
||||
'text' => dol_print_date($dateline,'day'),
|
||||
'text2'=> $late);
|
||||
|
||||
$this->info_box_contents[$i][5] = array('td' => 'align="right"',
|
||||
'text' => $objp->nb_services);
|
||||
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoExpiredServices"));
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->info_box_contents[0][0] = array('td' => 'align="left"',
|
||||
'text' => $langs->trans("ReadPermissionNotAllowed"));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @return void
|
||||
*/
|
||||
function showBox($head = null, $contents = null)
|
||||
{
|
||||
parent::showBox($this->info_box_head, $this->info_box_contents);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@ -40,7 +40,7 @@ class box_services_vendus extends ModeleBoxes {
|
||||
var $info_box_contents = array();
|
||||
|
||||
/**
|
||||
* \brief Constructeur de la classe
|
||||
* Constructor
|
||||
*/
|
||||
function box_services_vendus()
|
||||
{
|
||||
@ -51,8 +51,10 @@ class box_services_vendus extends ModeleBoxes {
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Charge les donnees en memoire pour affichage ulterieur
|
||||
* \param $max Nombre maximum d'enregistrements a charger
|
||||
* Load data into info_box_contents array to show array later.
|
||||
*
|
||||
* @param int $max Maximum number of records to load
|
||||
* @return void
|
||||
*/
|
||||
function loadBox($max=5)
|
||||
{
|
||||
@ -159,6 +161,13 @@ class box_services_vendus extends ModeleBoxes {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @return void
|
||||
*/
|
||||
function showBox($head = null, $contents = null)
|
||||
{
|
||||
parent::showBox($this->info_box_head, $this->info_box_contents);
|
||||
|
||||
@ -88,9 +88,11 @@ class ModeleBoxes // Can't be abtract as it is instanciated to build "empty"
|
||||
|
||||
|
||||
/**
|
||||
* \brief Standard method to show a box (usage by boxes not mandatory, a box can still use its own function)
|
||||
* \param $head tableau des caracteristiques du titre
|
||||
* \param $contents tableau des lignes de contenu
|
||||
* Standard method to show a box (usage by boxes not mandatory, a box can still use its own function)
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @return void
|
||||
*/
|
||||
function showBox($head, $contents)
|
||||
{
|
||||
|
||||
@ -2127,6 +2127,7 @@ abstract class CommonObject
|
||||
if (empty($line->fk_parent_line))
|
||||
{
|
||||
$parameters=array('line'=>$line,'var'=>$var,'i'=>$i);
|
||||
$action='';
|
||||
$reshook=$hookmanager->executeHooks('printOriginObjectLine',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
||||
}
|
||||
}
|
||||
|
||||
@ -326,9 +326,8 @@ class Conf
|
||||
$this->global->PRODUIT_USE_SEARCH_TO_SELECT=0;
|
||||
}
|
||||
|
||||
// conf->monnaie
|
||||
// conf->currency
|
||||
if (empty($this->global->MAIN_MONNAIE)) $this->global->MAIN_MONNAIE='EUR';
|
||||
$this->monnaie=$this->global->MAIN_MONNAIE; // TODO deprecated
|
||||
$this->currency=$this->global->MAIN_MONNAIE;
|
||||
|
||||
// $this->global->COMPTA_MODE = Option des modules Comptabilites (simple ou expert). Defini le mode de calcul des etats comptables (CA,...)
|
||||
|
||||
@ -1249,10 +1249,10 @@ class Form
|
||||
$outval.=$objRef.' - '.dol_trunc($label,32).' - ';
|
||||
|
||||
$found=0;
|
||||
$currencytext=$langs->trans("Currency".$conf->monnaie);
|
||||
$currencytextnoent=$langs->transnoentities("Currency".$conf->monnaie);
|
||||
if (dol_strlen($currencytext) > 10) $currencytext=$conf->monnaie; // If text is too long, we use the short code
|
||||
if (dol_strlen($currencytextnoent) > 10) $currencytextnoent=$conf->monnaie; // If text is too long, we use the short code
|
||||
$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
|
||||
if ($price_level >= 1) // If we need a particular price level (from 1 to 6)
|
||||
@ -1464,10 +1464,10 @@ class Form
|
||||
|
||||
if ($objp->fprice != '') // Keep != ''
|
||||
{
|
||||
$currencytext=$langs->trans("Currency".$conf->monnaie);
|
||||
$currencytextnoent=$langs->transnoentities("Currency".$conf->monnaie);
|
||||
if (dol_strlen($currencytext) > 10) $currencytext=$conf->monnaie; // If text is too long, we use the short code
|
||||
if (dol_strlen($currencytextnoent) > 10) $currencytextnoent=$conf->monnaie; // If text is too long, we use the short code
|
||||
$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
|
||||
|
||||
$opt.= price($objp->fprice).' '.$currencytext."/".$objp->quantity;
|
||||
$outval.= price($objp->fprice).' '.$currencytextnoent."/".$objp->quantity;
|
||||
@ -1578,7 +1578,7 @@ class Form
|
||||
if ($objp->quantity == 1)
|
||||
{
|
||||
$opt.= price($objp->fprice);
|
||||
$opt.= $langs->trans("Currency".$conf->monnaie)."/";
|
||||
$opt.= $langs->trans("Currency".$conf->currency)."/";
|
||||
}
|
||||
|
||||
$opt.= $objp->quantity.' ';
|
||||
@ -1594,7 +1594,7 @@ class Form
|
||||
if ($objp->quantity > 1)
|
||||
{
|
||||
$opt.=" - ";
|
||||
$opt.= price($objp->unitprice).$langs->trans("Currency".$conf->monnaie)."/".strtolower($langs->trans("Unit"));
|
||||
$opt.= price($objp->unitprice).$langs->trans("Currency".$conf->currency)."/".strtolower($langs->trans("Unit"));
|
||||
}
|
||||
if ($objp->duration) $opt .= " - ".$objp->duration;
|
||||
$opt .= "</option>\n";
|
||||
@ -1810,7 +1810,7 @@ class Form
|
||||
$tmparray[$obj->rowid]['label']=$label;
|
||||
$i++;
|
||||
}
|
||||
$this->cache_demand_reason=dol_sort_array($tmparray,'label', $order='asc', $natsort, $case_sensitive);
|
||||
$this->cache_demand_reason=dol_sort_array($tmparray,'label', $order='asc');
|
||||
|
||||
unset($tmparray);
|
||||
return 1;
|
||||
@ -2723,9 +2723,9 @@ class Form
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
|
||||
print '<tr><td nowrap="nowrap">';
|
||||
//if (! $filter || $filter=="fk_facture_source IS NULL") print $langs->trans("CompanyHasAbsoluteDiscount",price($amount),$langs->transnoentities("Currency".$conf->monnaie)).': '; // 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 OR (fk_facture_source IS NOT NULL AND description='(DEPOSIT)')") print $langs->trans("CompanyHasAbsoluteDiscount",price($amount),$langs->transnoentities("Currency".$conf->monnaie)).': ';
|
||||
else print $langs->trans("CompanyHasCreditNote",price($amount),$langs->transnoentities("Currency".$conf->monnaie)).': ';
|
||||
//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 OR (fk_facture_source IS NOT NULL AND description='(DEPOSIT)')") print $langs->trans("CompanyHasAbsoluteDiscount",price($amount),$langs->transnoentities("Currency".$conf->currency)).': ';
|
||||
else print $langs->trans("CompanyHasCreditNote",price($amount),$langs->transnoentities("Currency".$conf->currency)).': ';
|
||||
$newfilter='fk_facture IS NULL AND fk_facture_line IS NULL'; // Remises disponibles
|
||||
if ($filter) $newfilter.=' AND ('.$filter.')';
|
||||
$nbqualifiedlines=$this->select_remises($selected,$htmlname,$newfilter,$socid,$maxvalue);
|
||||
|
||||
@ -420,7 +420,7 @@ class FormCompany
|
||||
|
||||
// On recherche les formes juridiques actives des pays actifs
|
||||
$sql = "SELECT f.rowid, f.code as code , f.libelle as nom, f.active, p.libelle as libelle_pays, p.code as code_pays";
|
||||
$sql .= " FROM llx_c_forme_juridique as f, llx_c_pays as p";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."c_forme_juridique as f, ".MAIN_DB_PREFIX."c_pays as p";
|
||||
$sql .= " WHERE f.fk_pays=p.rowid";
|
||||
$sql .= " AND f.active = 1 AND p.active = 1";
|
||||
if ($pays_code) $sql .= " AND p.code = '".$pays_code."'";
|
||||
|
||||
@ -1189,7 +1189,6 @@ class SMTPs
|
||||
//$content = 'Content-Type: multipart/related; boundary="' . $this->_getBoundary() . '"' . "\r\n";
|
||||
$content = 'Content-Type: multipart/mixed; boundary="' . $this->_getBoundary() . '"' . "\r\n";
|
||||
|
||||
// TODO Restore
|
||||
// . "\r\n"
|
||||
// . 'This is a multi-part message in MIME format.' . "\r\n";
|
||||
$content .= "Content-Transfer-Encoding: 8bit" . "\r\n";
|
||||
@ -1203,8 +1202,6 @@ class SMTPs
|
||||
// loop through all attachments
|
||||
foreach ( $_content as $_file => $_data )
|
||||
{
|
||||
|
||||
// TODO Restore "\r\n"
|
||||
$content .= "--" . $this->_getBoundary() . "\r\n"
|
||||
. 'Content-Disposition: attachment; filename="' . $_data['fileName'] . '"' . "\r\n"
|
||||
. 'Content-Type: ' . $_data['mimeType'] . '; name="' . $_data['fileName'] . '"' . "\r\n"
|
||||
@ -1225,7 +1222,6 @@ class SMTPs
|
||||
// loop through all images
|
||||
foreach ( $_content as $_image => $_data )
|
||||
{
|
||||
// TODO Restore "\r\n"
|
||||
$content .= "--" . $this->_getBoundary() . "\r\n";
|
||||
|
||||
$content .= 'Content-Type: ' . $_data['mimeType'] . '; name="' . $_data['imageName'] . '"' . "\r\n"
|
||||
@ -1242,13 +1238,11 @@ class SMTPs
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO Restore "\r\n"
|
||||
$content .= "--" . $this->_getBoundary() . "\r\n"
|
||||
. 'Content-Type: ' . $_content['mimeType'] . '; '
|
||||
// . 'charset="' . $this->getCharSet() . '"';
|
||||
. 'charset=' . $this->getCharSet() . '';
|
||||
|
||||
// TODO Restore
|
||||
// $content .= ( $type == 'html') ? '; name="HTML Part"' : '';
|
||||
$content .= "\r\n";
|
||||
// $content .= 'Content-Transfer-Encoding: ';
|
||||
|
||||
@ -220,6 +220,12 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='')
|
||||
{
|
||||
if ($sql)
|
||||
{
|
||||
// Replace the prefix tables
|
||||
if (MAIN_DB_PREFIX != 'llx_')
|
||||
{
|
||||
$sql=preg_replace('/llx_/i',MAIN_DB_PREFIX,$sql);
|
||||
}
|
||||
|
||||
if (!empty($handler)) $sql=preg_replace('/__HANDLER__/i',"'".$handler."'",$sql);
|
||||
|
||||
$newsql=preg_replace('/__ENTITY__/i',(!empty($entity)?$entity:$conf->entity),$sql);
|
||||
@ -448,7 +454,7 @@ function dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $not
|
||||
|
||||
if (strcmp($value,'')) // true if different. Must work for $value='0' or $value=0
|
||||
{
|
||||
$sql = "INSERT INTO llx_const(name,value,type,visible,note,entity)";
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."const(name,value,type,visible,note,entity)";
|
||||
$sql.= " VALUES (";
|
||||
$sql.= $db->encrypt($name,1);
|
||||
$sql.= ", ".$db->encrypt($value,1);
|
||||
|
||||
@ -480,11 +480,12 @@ function show_projects($conf,$langs,$db,$object,$backtopage='')
|
||||
|
||||
/**
|
||||
* Show html area for list of contacts
|
||||
* @param conf Object conf
|
||||
* @param langs Object langs
|
||||
* @param db Database handler
|
||||
* @param object Third party object
|
||||
* @param backtopage Url to go once contact is created
|
||||
*
|
||||
* @param Conf $conf Object conf
|
||||
* @param Translate $langs Object langs
|
||||
* @param DoliDB $db Database handler
|
||||
* @param Object $object Third party object
|
||||
* @param string $backtopage Url to go once contact is created
|
||||
*/
|
||||
function show_contacts($conf,$langs,$db,$object,$backtopage='')
|
||||
{
|
||||
@ -564,7 +565,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
|
||||
|
||||
if ($conf->agenda->enabled && $user->rights->agenda->myactions->create)
|
||||
{
|
||||
print '<td align="center"><a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&actioncode=AC_RDV&contactid='.$obj->rowid.'&socid='.$object->id.'&backtopage='.urlencode($backtourl).'">';
|
||||
print '<td align="center"><a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&actioncode=AC_RDV&contactid='.$obj->rowid.'&socid='.$object->id.'&backtopage='.urlencode($backtopage).'">';
|
||||
print img_object($langs->trans("Rendez-Vous"),"action");
|
||||
print '</a></td>';
|
||||
}
|
||||
@ -743,6 +744,7 @@ function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0)
|
||||
|
||||
/**
|
||||
* Show html area with actions done
|
||||
*
|
||||
* @param conf Object conf
|
||||
* @param langs Object langs
|
||||
* @param db Object db
|
||||
@ -837,6 +839,7 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0)
|
||||
$numaction++;
|
||||
$i++;
|
||||
}
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -967,8 +970,6 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0)
|
||||
}
|
||||
$out.="</table>\n";
|
||||
$out.="<br>\n";
|
||||
|
||||
$db->free($result);
|
||||
}
|
||||
|
||||
if ($noprint) return $out;
|
||||
|
||||
@ -557,7 +557,7 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass
|
||||
// Capital
|
||||
if ($fromcompany->capital)
|
||||
{
|
||||
$line3.=($line3?" - ":"").$outputlangs->transnoentities("CapitalOf",$fromcompany->capital)." ".$outputlangs->transnoentities("Currency".$conf->monnaie);
|
||||
$line3.=($line3?" - ":"").$outputlangs->transnoentities("CapitalOf",$fromcompany->capital)." ".$outputlangs->transnoentities("Currency".$conf->currency);
|
||||
}
|
||||
// Prof Id 1
|
||||
if ($fromcompany->idprof1 && ($fromcompany->pays_code != 'FR' || ! $fromcompany->idprof2))
|
||||
@ -685,6 +685,7 @@ function pdf_writelinedesc(&$pdf,$object,$i,$outputlangs,$w,$h,$posx,$posy,$hide
|
||||
$special_code = $object->lines[$i]->special_code;
|
||||
if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
|
||||
$parameters = array('pdf'=>$pdf,'i'=>$i,'outputlangs'=>$outputlangs,'w'=>$w,'h'=>$h,'posx'=>$posx,'posy'=>$posy,'hideref'=>$hideref,'hidedesc'=>$hidedesc,'issupplierline'=>$issupplierline,'special_code'=>$special_code);
|
||||
$action='';
|
||||
$reshook=$hookmanager->executeHooks('pdf_writelinedesc',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
}
|
||||
else
|
||||
@ -929,6 +930,7 @@ function pdf_getlinevatrate($object,$i,$outputlangs,$hidedetails=0,$hookmanager=
|
||||
$special_code = $object->lines[$i]->special_code;
|
||||
if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
|
||||
$parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code);
|
||||
$action='';
|
||||
return $hookmanager->executeHooks('pdf_getlinevatrate',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
}
|
||||
else
|
||||
@ -959,6 +961,7 @@ function pdf_getlineupexcltax($object,$i,$outputlangs,$hidedetails=0,$hookmanage
|
||||
$special_code = $object->lines[$i]->special_code;
|
||||
if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
|
||||
$parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code);
|
||||
$action='';
|
||||
return $hookmanager->executeHooks('pdf_getlineupexcltax',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
}
|
||||
else
|
||||
@ -985,6 +988,7 @@ function pdf_getlineqty($object,$i,$outputlangs,$hidedetails=0,$hookmanager=fals
|
||||
$special_code = $object->lines[$i]->special_code;
|
||||
if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
|
||||
$parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code);
|
||||
$action='';
|
||||
return $hookmanager->executeHooks('pdf_getlineqty',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
}
|
||||
else
|
||||
@ -1013,6 +1017,7 @@ function pdf_getlineqty_asked($object,$i,$outputlangs,$hidedetails=0,$hookmanage
|
||||
$special_code = $object->lines[$i]->special_code;
|
||||
if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
|
||||
$parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code);
|
||||
$action='';
|
||||
return $hookmanager->executeHooks('pdf_getlineqty_asked',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
}
|
||||
else
|
||||
@ -1041,6 +1046,7 @@ function pdf_getlineqty_shipped($object,$i,$outputlangs,$hidedetails=0,$hookmana
|
||||
$special_code = $object->lines[$i]->special_code;
|
||||
if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
|
||||
$parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code);
|
||||
$action='';
|
||||
return $hookmanager->executeHooks('pdf_getlineqty_shipped',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
}
|
||||
else
|
||||
@ -1069,6 +1075,7 @@ function pdf_getlineqty_keeptoship($object,$i,$outputlangs,$hidedetails=0,$hookm
|
||||
$special_code = $object->lines[$i]->special_code;
|
||||
if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
|
||||
$parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code);
|
||||
$action='';
|
||||
return $hookmanager->executeHooks('pdf_getlineqty_keeptoship',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
}
|
||||
else
|
||||
@ -1099,6 +1106,7 @@ function pdf_getlineremisepercent($object,$i,$outputlangs,$hidedetails=0,$hookma
|
||||
$special_code = $object->lines[$i]->special_code;
|
||||
if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
|
||||
$parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code);
|
||||
$action='';
|
||||
return $hookmanager->executeHooks('pdf_getlineremisepercent',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
}
|
||||
else
|
||||
@ -1136,6 +1144,7 @@ function pdf_getlinetotalexcltax($object,$i,$outputlangs,$hidedetails=0,$hookman
|
||||
$special_code = $object->lines[$i]->special_code;
|
||||
if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
|
||||
$parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code);
|
||||
$action='';
|
||||
return $hookmanager->executeHooks('pdf_getlinetotalexcltax',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
}
|
||||
else
|
||||
|
||||
@ -142,9 +142,10 @@ function group_prepare_head($object)
|
||||
|
||||
/**
|
||||
* Show list of themes. Show all thumbs of themes
|
||||
* @param fuser User concerned or '' for global theme
|
||||
* @param edit 1 to add edit form
|
||||
* @param foruserprofile Show for user profile view
|
||||
*
|
||||
* @param User $fuser User concerned or '' for global theme
|
||||
* @param int $edit 1 to add edit form
|
||||
* @param boolean $foruserprofile Show for user profile view
|
||||
*/
|
||||
function show_theme($fuser,$edit=0,$foruserprofile=false)
|
||||
{
|
||||
@ -166,21 +167,21 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
|
||||
// Title
|
||||
if ($foruserprofile)
|
||||
{
|
||||
print '<tr class="liste_titre"><td width="25%">'.$langs->trans("Parameter").'</td><td width="25%">'.$langs->trans("DefaultValue").'</td>';
|
||||
print '<td colspan="2"> </td>';
|
||||
print '<tr class="liste_titre"><th width="25%">'.$langs->trans("Parameter").'</th><th width="25%">'.$langs->trans("DefaultValue").'</th>';
|
||||
print '<th colspan="2"> </th>';
|
||||
print '</tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<tr class="liste_titre"><td width="35%">'.$langs->trans("DefaultSkin").'</td>';
|
||||
print '<td align="right">';
|
||||
print '<tr class="liste_titre"><th width="35%">'.$langs->trans("DefaultSkin").'</th>';
|
||||
print '<th align="right">';
|
||||
$url='http://www.dolistore.com/lang-en/4-skins';
|
||||
if (preg_match('/fr/i',$langs->defaultlang)) $url='http://www.dolistore.com/lang-fr/4-themes';
|
||||
//if (preg_match('/es/i',$langs->defaultlang)) $url='http://www.dolistore.com/lang-es/4-themes';
|
||||
print '<a href="'.$url.'" target="_blank">';
|
||||
print $langs->trans('DownloadMoreSkins');
|
||||
print '</a>';
|
||||
print '</td></tr>';
|
||||
print '</th></tr>';
|
||||
}
|
||||
|
||||
$var=false;
|
||||
@ -190,8 +191,8 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td>'.$langs->trans("DefaultSkin").'</td>';
|
||||
print '<td>'.$conf->global->MAIN_THEME.'</td>';
|
||||
print '<td '.$bc[$var].' align="left" nowrap="nowrap" width="20%"><input '.$bc[$var].' name="check_MAIN_THEME"'.($edit?'':' disabled').' type="checkbox" '.($selected_theme?" checked":"").'> '.$langs->trans("UsePersonalValue").'</td>';
|
||||
print '<td '.$bc[$var].'> </td>';
|
||||
print '<td align="left" nowrap="nowrap" width="20%"><input '.$bc[$var].' name="check_MAIN_THEME"'.($edit?'':' disabled').' type="checkbox" '.($selected_theme?" checked":"").'> '.$langs->trans("UsePersonalValue").'</td>';
|
||||
print '<td> </td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
@ -203,12 +204,6 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
if ($edit)
|
||||
{
|
||||
if ($subdir == $conf->global->MAIN_THEME) $title=$langs->trans("ThemeCurrentlyActive");
|
||||
else $title=$langs->trans("ShowPreview");
|
||||
}
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td colspan="'.$colspan.'">';
|
||||
|
||||
|
||||
@ -56,10 +56,10 @@ class MenuTop {
|
||||
$classname='class="tmenu"';
|
||||
|
||||
print_start_menu_entry_empty($idsel);
|
||||
print '<a class="tmenuimage" href="'.dol_buildpath('/index.php',1).'?mainmenu=home&leftmenu="'.($atarget?" target=$atarget":"").'>';
|
||||
print '<a class="tmenuimage" href="'.dol_buildpath('/index.php',1).'?mainmenu=home&leftmenu="'.($this->atarget?' target="'.$this->atarget.'"':'').'>';
|
||||
print '<div class="mainmenu '.$idsel.'"><span class="mainmenu_'.$idsel.' tmenuimage" id="mainmenuspan_'.$idsel.'"></span></div>';
|
||||
print '</a>';
|
||||
print '<a '.$classname.' id="mainmenua_'.$idsel.'" href="'.$url.'"'.($tabMenu[$i]['atarget']?" target='".$tabMenu[$i]['atarget']."'":($atarget?" target=$atarget":"")).'>';
|
||||
print '<a '.$classname.' id="mainmenua_'.$idsel.'" href="'.DOL_URL_ROOT.'"'.($this->atarget?' target="'.$this->atarget.'"':'').'>';
|
||||
print_text_menu_entry_empty($langs->trans("Home"));
|
||||
print '</a>';
|
||||
print_end_menu_entry_empty();
|
||||
|
||||
@ -408,7 +408,7 @@ abstract class DolibarrModules
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."dolibarr_modules";
|
||||
$sql.= " WHERE numero = ".$this->numero;
|
||||
$sql.= " AND entity in (0, ".$conf->entity.")";
|
||||
$sql.= " AND entity IN (0, ".$conf->entity.")";
|
||||
|
||||
dol_syslog(get_class($this)."::_dbunactive sql=".$sql, LOG_DEBUG);
|
||||
$this->db->query($sql);
|
||||
|
||||
@ -487,7 +487,7 @@ class pdf_edison extends ModelePDFCommandes
|
||||
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->SetFont('','', $default_font_size-1);
|
||||
$titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$conf->monnaie));
|
||||
$titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$conf->currency));
|
||||
$pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top-4);
|
||||
$pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
|
||||
}
|
||||
|
||||
@ -774,7 +774,7 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->SetFont('','', $default_font_size - 2);
|
||||
$titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$conf->monnaie));
|
||||
$titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$conf->currency));
|
||||
$pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top-4);
|
||||
$pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
|
||||
|
||||
|
||||
@ -119,8 +119,8 @@ class html_cerfafr extends ModeleDon
|
||||
$form = str_replace('__DATE__',dol_print_date($don->date,'day',false,$outputlangs),$form);
|
||||
$form = str_replace('__IP__',$user->ip,$form);
|
||||
$form = str_replace('__AMOUNT__',$don->amount,$form);
|
||||
$form = str_replace('__CURRENCY__',$outputlangs->transnoentitiesnoconv("Currency".$conf->monnaie),$form);
|
||||
$form = str_replace('__CURRENCYCODE__',$conf->monnaie,$form);
|
||||
$form = str_replace('__CURRENCY__',$outputlangs->transnoentitiesnoconv("Currency".$conf->currency),$form);
|
||||
$form = str_replace('__CURRENCYCODE__',$conf->currency,$form);
|
||||
$form = str_replace('__MAIN_INFO_SOCIETE_NOM__',$mysoc->name,$form);
|
||||
$form = str_replace('__MAIN_INFO_SOCIETE_ADRESSE__',$mysoc->address,$form);
|
||||
$form = str_replace('__MAIN_INFO_SOCIETE_CP__',$mysoc->zip,$form);
|
||||
|
||||
@ -933,7 +933,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
// Amount in (at tab_top - 1)
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->SetFont('','', $default_font_size - 2);
|
||||
$titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$conf->monnaie));
|
||||
$titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$conf->currency));
|
||||
$pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top-4);
|
||||
$pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
|
||||
|
||||
|
||||
@ -1013,7 +1013,7 @@ class pdf_oursin extends ModelePDFFactures
|
||||
// Amount in (at tab_top - 1)
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->SetFont('','', $default_font_size-1);
|
||||
$titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$conf->monnaie));
|
||||
$titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$conf->currency));
|
||||
$pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), 90);
|
||||
$pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
|
||||
}
|
||||
|
||||
@ -63,14 +63,17 @@ class mailing_framboise extends MailingTargets
|
||||
// CHANGE THIS
|
||||
// Select the members from category
|
||||
$sql = "SELECT s.rowid as id, s.email as email, s.nom as name, null as fk_contact, null as firstname,";
|
||||
if ($_POST['filter']) $sql.= " llx_categorie.label as label";
|
||||
if ($_POST['filter']) $sql.= " c.label";
|
||||
else $sql.=" null as label";
|
||||
$sql.= " FROM llx_adherent as s";
|
||||
if ($_POST['filter']) $sql.= " LEFT JOIN llx_categorie_member ON llx_categorie_member.fk_member=s.rowid";
|
||||
if ($_POST['filter']) $sql.= " LEFT JOIN llx_categorie ON llx_categorie.rowid = llx_categorie_member.fk_categorie";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as s";
|
||||
if ($_POST['filter'])
|
||||
{
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_member as cm ON cm.fk_member = s.rowid";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON c.rowid = cm.fk_categorie";
|
||||
}
|
||||
$sql.= " WHERE s.email != ''";
|
||||
$sql.= " AND s.entity = ".$conf->entity;
|
||||
if ($_POST['filter']) $sql.= " AND llx_categorie.rowid='".$_POST['filter']."'";
|
||||
if ($_POST['filter']) $sql.= " AND ".MAIN_DB_PREFIX."categorie.rowid='".$_POST['filter']."'";
|
||||
$sql.= " ORDER BY s.email";
|
||||
|
||||
// Stocke destinataires dans cibles
|
||||
|
||||
@ -63,14 +63,17 @@ class mailing_thirdparties extends MailingTargets
|
||||
// CHANGE THIS
|
||||
// Select the third parties from category
|
||||
$sql = "SELECT s.rowid as id, s.email as email, s.nom as name, null as fk_contact, null as firstname,";
|
||||
if ($_POST['filter']) $sql.= " llx_categorie.label as label";
|
||||
if ($_POST['filter']) $sql.= " c.label";
|
||||
else $sql.=" null as label";
|
||||
$sql.= " FROM llx_societe as s";
|
||||
if ($_POST['filter']) $sql.= " LEFT JOIN llx_categorie_societe ON llx_categorie_societe.fk_societe=s.rowid";
|
||||
if ($_POST['filter']) $sql.= " LEFT JOIN llx_categorie ON llx_categorie.rowid = llx_categorie_societe.fk_categorie";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
if ($_POST['filter'])
|
||||
{
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_societe as cs ON cs.fk_societe = s.rowid";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON c.rowid = cs.fk_categorie";
|
||||
}
|
||||
$sql.= " WHERE s.email != ''";
|
||||
$sql.= " AND s.entity = ".$conf->entity;
|
||||
if ($_POST['filter']) $sql.= " AND llx_categorie.rowid='".$_POST['filter']."'";
|
||||
if ($_POST['filter']) $sql.= " AND c.rowid='".$_POST['filter']."'";
|
||||
$sql.= " ORDER BY s.email";
|
||||
|
||||
// Stocke destinataires dans cibles
|
||||
|
||||
@ -79,6 +79,7 @@ class modContrat extends DolibarrModules
|
||||
// Boxes
|
||||
$this->boxes = array();
|
||||
$this->boxes[0][1] = "box_contracts.php";
|
||||
$this->boxes[1][1] = "box_services_expired.php";
|
||||
|
||||
// Permissions
|
||||
$this->rights = array();
|
||||
|
||||
@ -804,7 +804,7 @@ class pdf_propale_azur extends ModelePDFPropales
|
||||
// Montants exprimes en (en tab_top - 1)
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->SetFont('','',$default_font_size - 2);
|
||||
$titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$conf->monnaie));
|
||||
$titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$conf->currency));
|
||||
$pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top-4);
|
||||
$pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
|
||||
|
||||
|
||||
@ -804,7 +804,7 @@ class pdf_propale_jaune extends ModelePDFPropales
|
||||
// Montants exprimes en (en tab_top - 1)
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->SetFont('','',$default_font_size - 2);
|
||||
$titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$conf->monnaie));
|
||||
$titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$conf->currency));
|
||||
$pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top-4);
|
||||
$pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
|
||||
|
||||
|
||||
@ -587,7 +587,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
// Amount in (at tab_top - 1)
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->SetFont('','',$default_font_size - 2);
|
||||
$titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$conf->monnaie));
|
||||
$titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$conf->currency));
|
||||
$pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top-4);
|
||||
$pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
|
||||
|
||||
|
||||
@ -358,7 +358,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
|
||||
if ($deja_regle || $amount_credit_notes_included || $amount_deposits_included)
|
||||
{
|
||||
$this->_tableau_versements($pdf, $fac, $posy);
|
||||
$this->_tableau_versements($pdf, $object, $posy);
|
||||
}
|
||||
|
||||
// Pied de page
|
||||
@ -591,7 +591,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
// Amount in (at tab_top - 1)
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->SetFont('','', $default_font_size - 2);
|
||||
$titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$conf->monnaie));
|
||||
$titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$conf->currency));
|
||||
$pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top-4);
|
||||
$pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
|
||||
|
||||
|
||||
@ -51,11 +51,11 @@ class EcmDirectory // extends CommonObject
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $DB Database handler
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
function EcmDirectory($DB)
|
||||
function EcmDirectory($db)
|
||||
{
|
||||
$this->db = $DB;
|
||||
$this->db = $db;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -86,14 +86,14 @@ class EcmDirectory // extends CommonObject
|
||||
$relativepath=$this->label;
|
||||
if ($this->fk_parent)
|
||||
{
|
||||
$parent = new ECMDirectory($this->db);
|
||||
$parent = new EcmDirectory($this->db);
|
||||
$parent->fetch($this->fk_parent);
|
||||
$relativepath=$parent->getRelativePath().$relativepath;
|
||||
}
|
||||
$relativepath=preg_replace('/([\/])+/i','/',$relativepath); // Avoid duplicate / or \
|
||||
//print $relativepath.'<br>';
|
||||
|
||||
$cat = new ECMDirectory($this->db);
|
||||
$cat = new EcmDirectory($this->db);
|
||||
$cate_arbo = $cat->get_full_arbo(1);
|
||||
$pathfound=0;
|
||||
foreach ($cate_arbo as $key => $categ)
|
||||
@ -174,10 +174,11 @@ class EcmDirectory // extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Update database
|
||||
* \param user User that modify
|
||||
* \param notrigger 0=no, 1=yes (no update trigger)
|
||||
* \return int <0 if KO, >0 if OK
|
||||
* Update database
|
||||
*
|
||||
* @param User $user User that modify
|
||||
* @param int $notrigger 0=no, 1=yes (no update trigger)
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function update($user=0, $notrigger=0)
|
||||
{
|
||||
@ -235,9 +236,10 @@ class EcmDirectory // extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* Update cache of nb of documents into database
|
||||
* @param sign '+' or '-'
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* Update cache of nb of documents into database
|
||||
*
|
||||
* @param string $sign '+' or '-'
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function changeNbOfFiles($sign)
|
||||
{
|
||||
@ -262,9 +264,10 @@ class EcmDirectory // extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* \brief Load object in memory from database
|
||||
* \param id id object
|
||||
* \return int <0 if KO, 0 if not found, >0 if OK
|
||||
* Load object in memory from database
|
||||
*
|
||||
* @param int $id Id of object
|
||||
* @return int <0 if KO, 0 if not found, >0 if OK
|
||||
*/
|
||||
function fetch($id)
|
||||
{
|
||||
@ -315,9 +318,10 @@ class EcmDirectory // extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* \brief Delete object on database and on disk
|
||||
* \param user User that delete
|
||||
* \return int <0 if KO, >0 if OK
|
||||
* Delete object on database and on disk
|
||||
*
|
||||
* @param User $user User that delete
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function delete($user)
|
||||
{
|
||||
@ -391,10 +395,12 @@ class EcmDirectory // extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* \brief Return directory name you can click (and picto)
|
||||
* \param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
|
||||
* \param option Sur quoi pointe le lien
|
||||
* \return string Chaine avec URL
|
||||
* Return directory name you can click (and picto)
|
||||
*
|
||||
* @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
|
||||
* @param string $option Sur quoi pointe le lien
|
||||
* @param int $max Max length
|
||||
* @return string Chaine avec URL
|
||||
*/
|
||||
function getNomUrl($withpicto=0,$option='',$max=0)
|
||||
{
|
||||
@ -423,8 +429,9 @@ class EcmDirectory // extends CommonObject
|
||||
|
||||
/**
|
||||
* Return relative path of a directory on disk
|
||||
* @param force Force reload of full arbo even if already loaded
|
||||
* @return string Relative physical path
|
||||
*
|
||||
* @param int $force Force reload of full arbo even if already loaded
|
||||
* @return string Relative physical path
|
||||
*/
|
||||
function getRelativePath($force=0)
|
||||
{
|
||||
@ -461,8 +468,9 @@ class EcmDirectory // extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Load this->motherof that is array(id_son=>id_parent, ...)
|
||||
* \return int <0 if KO, >0 if OK
|
||||
* Load this->motherof that is array(id_son=>id_parent, ...)
|
||||
*
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function load_motherof()
|
||||
{
|
||||
@ -488,7 +496,7 @@ class EcmDirectory // extends CommonObject
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error ($this->db);
|
||||
dol_print_error($this->db);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@ -509,8 +517,9 @@ class EcmDirectory // extends CommonObject
|
||||
* fullrelativename Full path name (Added by build_path_from_id_categ call)
|
||||
* fulllabel Full label (Added by build_path_from_id_categ call)
|
||||
* level Level of line (Added by build_path_from_id_categ call)
|
||||
* @param force Force reload of full arbo even if already loaded in cache $this->cats
|
||||
* @return array Tableau de array
|
||||
*
|
||||
* @param int $force Force reload of full arbo even if already loaded in cache $this->cats
|
||||
* @return array Tableau de array
|
||||
*/
|
||||
function get_full_arbo($force=0)
|
||||
{
|
||||
@ -576,7 +585,7 @@ class EcmDirectory // extends CommonObject
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error ($this->db);
|
||||
dol_print_error($this->db);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -594,10 +603,12 @@ class EcmDirectory // extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Calcule les proprietes fullpath, fullrelativename, fulllabel d'un repertoire
|
||||
* du tableau this->cats et de toutes ces enfants
|
||||
* \param id_categ id_categ entry to update
|
||||
* \param protection Deep counter to avoid infinite loop
|
||||
* Calcule les proprietes fullpath, fullrelativename, fulllabel d'un repertoire
|
||||
* du tableau this->cats et de toutes ces enfants.
|
||||
*
|
||||
* @param int $id_categ id_categ entry to update
|
||||
* @param int $protection Deep counter to avoid infinite loop
|
||||
* @return void
|
||||
*/
|
||||
function build_path_from_id_categ($id_categ,$protection=0)
|
||||
{
|
||||
@ -635,10 +646,10 @@ class EcmDirectory // extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Refresh value for cachenboffile
|
||||
* \param directory Directory to scan
|
||||
* \param all 0=refresh this id , 1=refresh this entity
|
||||
* \return int <0 if KO, Nb of files in directory if OK
|
||||
* Refresh value for cachenboffile
|
||||
*
|
||||
* @param int $all 0=refresh this id , 1=refresh this entity
|
||||
* @return int <0 if KO, Nb of files in directory if OK
|
||||
*/
|
||||
function refreshcachenboffile($all=0)
|
||||
{
|
||||
|
||||
@ -34,21 +34,22 @@ class FormEcm
|
||||
|
||||
|
||||
/**
|
||||
* \brief Constructeur
|
||||
* \param DB handler d'acces base de donnee
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
function FormEcm($DB)
|
||||
function FormEcm($db)
|
||||
{
|
||||
$this->db = $DB;
|
||||
|
||||
return 1;
|
||||
$this->db = $db;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Retourne la liste des categories du type choisi
|
||||
* \param selected Id categorie preselectionnee
|
||||
* \param select_name Nom formulaire HTML
|
||||
* Retourne la liste des categories du type choisi
|
||||
*
|
||||
* @param int $selected Id categorie preselectionnee
|
||||
* @param string $select_name Nom formulaire HTML
|
||||
* @return string String with HTML select
|
||||
*/
|
||||
function select_all_sections($selected='',$select_name='')
|
||||
{
|
||||
@ -57,7 +58,7 @@ class FormEcm
|
||||
|
||||
if ($select_name=="") $select_name="catParent";
|
||||
|
||||
$cat = new ECMDirectory($this->db);
|
||||
$cat = new EcmDirectory($this->db);
|
||||
$cate_arbo = $cat->get_full_arbo();
|
||||
|
||||
$output = '<select class="flat" name="'.$select_name.'">';
|
||||
|
||||
@ -61,7 +61,7 @@ $pagenext = $page + 1;
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
if (! $sortfield) $sortfield="label";
|
||||
|
||||
$ecmdir = new ECMDirectory($db);
|
||||
$ecmdir = new EcmDirectory($db);
|
||||
if (! empty($_GET["section"]))
|
||||
{
|
||||
$result=$ecmdir->fetch($_GET["section"]);
|
||||
|
||||
@ -72,7 +72,7 @@ if (! $urlfile)
|
||||
}
|
||||
|
||||
// Load ecm object
|
||||
$ecmdir = new ECMDirectory($db);
|
||||
$ecmdir = new EcmDirectory($db);
|
||||
$result=$ecmdir->fetch(GETPOST("section"));
|
||||
if (! $result > 0)
|
||||
{
|
||||
@ -176,7 +176,7 @@ if ($_GET["action"] == 'edit')
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td width="30%">'.$langs->trans("Ref").'</td><td>';
|
||||
$s='';
|
||||
$tmpecmdir=new ECMDirectory($db); // Need to create a new one
|
||||
$tmpecmdir=new EcmDirectory($db); // Need to create a new one
|
||||
$tmpecmdir->fetch($ecmdir->id);
|
||||
$result = 1;
|
||||
$i=0;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user