Merge branch 'develop' of https://github.com/Dolibarr/dolibarr into develop
This commit is contained in:
commit
4fe1843800
@ -119,6 +119,7 @@ Fix: [ bug #1043 ] Bad interventions ref numbering
|
||||
Fix: Mailing module : if an email is already in destinaires list all other email from selector was not inserted
|
||||
Fix: Localtaxes balance not showing
|
||||
Fix: Intervention box links to contracts id
|
||||
Fix: Compatiblity with multicompany module
|
||||
|
||||
***** ChangeLog for 3.4 compared to 3.3.* *****
|
||||
For users:
|
||||
|
||||
BIN
doc/images/dolibarr_screenshot1_640x400.png
Normal file
BIN
doc/images/dolibarr_screenshot1_640x400.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 111 KiB |
@ -107,8 +107,7 @@ if ((! empty($foruserid) || ! empty($foruserlogin) || ! empty($mode)) && ! $mesg
|
||||
'%MONTH%'=>$month,
|
||||
'%DAY%'=>$day,
|
||||
'%DOL_MAIN_URL_ROOT%'=>DOL_MAIN_URL_ROOT,
|
||||
'%SERVER%'=>"http://".$_SERVER["SERVER_NAME"]."/",
|
||||
'%SOCIETE%'=>$objp->company
|
||||
'%SERVER%'=>"http://".$_SERVER["SERVER_NAME"]."/"
|
||||
);
|
||||
complete_substitutions_array($substitutionarray, $langs);
|
||||
|
||||
@ -204,7 +203,7 @@ if ((! empty($foruserid) || ! empty($foruserlogin) || ! empty($mode)) && ! $mesg
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
if (! $mesg)
|
||||
if (! $mesg)
|
||||
{
|
||||
$db->close();
|
||||
exit;
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
* Copyright (C) 2006-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2006-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* 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
|
||||
@ -610,8 +611,8 @@ class Categorie
|
||||
$sql = "SELECT fk_parent as id_parent, rowid as id_son";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."categorie";
|
||||
$sql.= " WHERE fk_parent != 0";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
|
||||
$sql.= " AND entity IN (".getEntity('category',1).")";
|
||||
|
||||
dol_syslog(get_class($this)."::load_motherof sql=".$sql);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
|
||||
@ -1521,6 +1521,10 @@ if ($action == 'create' && $user->rights->commande->creer)
|
||||
$objectsrc->fetch($originid);
|
||||
if (empty($objectsrc->lines) && method_exists($objectsrc,'fetch_lines')) $objectsrc->fetch_lines();
|
||||
$objectsrc->fetch_thirdparty();
|
||||
|
||||
//Replicate extrafields
|
||||
$objectsrc->fetch_optionals($originid);
|
||||
$object->array_options=$objectsrc->array_options;
|
||||
|
||||
$projectid = (!empty($objectsrc->fk_project)?$objectsrc->fk_project:'');
|
||||
$ref_client = (!empty($objectsrc->ref_client)?$objectsrc->ref_client:'');
|
||||
|
||||
@ -2022,6 +2022,10 @@ if ($action == 'create')
|
||||
$remise_percent = (! empty($objectsrc->remise_percent)?$objectsrc->remise_percent:(! empty($soc->remise_percent)?$soc->remise_percent:0));
|
||||
$remise_absolue = (! empty($objectsrc->remise_absolue)?$objectsrc->remise_absolue:(! empty($soc->remise_absolue)?$soc->remise_absolue:0));
|
||||
$dateinvoice = empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0;
|
||||
|
||||
//Replicate extrafields
|
||||
$objectsrc->fetch_optionals($originid);
|
||||
$object->array_options=$objectsrc->array_options;
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -2174,7 +2178,7 @@ if ($action == 'create')
|
||||
print '</td></tr>'."\n";
|
||||
}
|
||||
|
||||
if ((empty($origin)) || (($origin=='propal') && (!empty($originid))))
|
||||
if ((empty($origin)) || ((($origin=='propal') || ($origin=='commande')) && (!empty($originid))))
|
||||
{
|
||||
// Deposit
|
||||
print '<tr height="18"><td width="16px" valign="middle">';
|
||||
@ -2182,7 +2186,7 @@ if ($action == 'create')
|
||||
print '</td><td valign="middle" class="nowrap">';
|
||||
$desc=$form->textwithpicto($langs->trans("InvoiceDeposit"),$langs->transnoentities("InvoiceDepositDesc"),1);
|
||||
print '<table class="nobordernopadding"><tr><td>'.$desc.'</td>';
|
||||
if (($origin=='propal') ) {
|
||||
if (($origin=='propal') || ($origin=='commande')) {
|
||||
print '<td><select name="typedeposit"><option value="amount">'.$langs->trans('FixAmount').'</option>';
|
||||
print '<option value="variable">'.$langs->trans('VarAmount').'</option></select></td>';
|
||||
print '<td>'.$langs->trans('Value').':<input type="text" name="valuedeposit" size="3" value="'.GETPOST('valuedeposit','int').'"/>';
|
||||
|
||||
@ -71,7 +71,7 @@ class DolGraph
|
||||
var $showlegend=1;
|
||||
var $showpointvalue=1;
|
||||
var $showpercent=0;
|
||||
|
||||
|
||||
var $graph; // Objet Graph (Artichow, Phplot...)
|
||||
var $error;
|
||||
|
||||
@ -244,17 +244,17 @@ class DolGraph
|
||||
$this->data = $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set data
|
||||
*
|
||||
* @param array $datacolor Data color array(array(R,G,B),array(R,G,B)...)
|
||||
* @return void
|
||||
*/
|
||||
function SetDataColor($datacolor)
|
||||
{
|
||||
$this->datacolor = $datacolor;
|
||||
/**
|
||||
* Set data
|
||||
*
|
||||
* @param array $datacolor Data color array(array(R,G,B),array(R,G,B)...)
|
||||
* @return void
|
||||
*/
|
||||
function SetDataColor($datacolor)
|
||||
{
|
||||
$this->datacolor = $datacolor;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set type
|
||||
*
|
||||
@ -395,7 +395,7 @@ class DolGraph
|
||||
|
||||
/**
|
||||
* Show legend or not
|
||||
*
|
||||
*
|
||||
* @param int $showlegend 1=Show legend (default), 0=Hide legend
|
||||
* @return void
|
||||
*/
|
||||
@ -406,7 +406,7 @@ class DolGraph
|
||||
|
||||
/**
|
||||
* Show pointvalue or not
|
||||
*
|
||||
*
|
||||
* @param int $showpointvalue 1=Show value for each point, as tooltip or inline (default), 0=Hide value
|
||||
* @return void
|
||||
*/
|
||||
@ -414,10 +414,10 @@ class DolGraph
|
||||
{
|
||||
$this->showpointvalue=$showpointvalue;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Show percent or not
|
||||
*
|
||||
*
|
||||
* @param int $showpercent 1=Show percent for each point, as tooltip or inline, 0=Hide percent (default)
|
||||
* @return void
|
||||
*/
|
||||
@ -425,9 +425,9 @@ class DolGraph
|
||||
{
|
||||
$this->showpercent=$showpercent;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Define background color of complete image
|
||||
*
|
||||
@ -590,12 +590,18 @@ class DolGraph
|
||||
/**
|
||||
* Build a graph onto disk using correct library
|
||||
*
|
||||
* @param string $file Image file name to use if we save onto disk
|
||||
* @param string $file Image file name to use to save onto disk (also used as javascript unique id)
|
||||
* @param string $fileurl Url path to show image if saved onto disk
|
||||
* @return void
|
||||
*/
|
||||
function draw($file,$fileurl='')
|
||||
{
|
||||
if (empty($file))
|
||||
{
|
||||
$this->error="Call to draw method was made with empty value for parameter file.";
|
||||
dol_syslog(get_class($this)."::draw ".$this->error, LOG_ERR);
|
||||
return -2;
|
||||
}
|
||||
if (! is_array($this->data) || count($this->data) < 1)
|
||||
{
|
||||
$this->error="Call to draw method was made but SetData was not called or called with an empty dataset for parameters";
|
||||
@ -796,8 +802,8 @@ class DolGraph
|
||||
* $this->mode = 'depth' ???
|
||||
* $this->bgcolorgrid
|
||||
* $this->datacolor
|
||||
*
|
||||
* @param string $file Image file name to use if we save onto disk
|
||||
*
|
||||
* @param string $file Image file name to use to save onto disk (also used as javascript unique id)
|
||||
* @param string $fileurl Url path to show image if saved onto disk
|
||||
* @return void
|
||||
*/
|
||||
@ -807,6 +813,12 @@ class DolGraph
|
||||
|
||||
dol_syslog(get_class($this)."::draw_jflot this->type=".join(',',$this->type));
|
||||
|
||||
if (empty($this->width) && empty($this->height))
|
||||
{
|
||||
print 'Error width or height not set';
|
||||
return;
|
||||
}
|
||||
|
||||
$legends=array();
|
||||
$nblot=count($this->data[0])-1; // -1 to remove legend
|
||||
if ($nblot < 0) dol_print_error('Bad value for property ->data. Must be set by mydolgraph->SetData before callinf mydolgrapgh->draw');
|
||||
@ -823,7 +835,7 @@ class DolGraph
|
||||
|
||||
// Fill array $values
|
||||
$x=0;
|
||||
foreach($this->data as $valarray) // Loop on each x
|
||||
foreach($this->data as $valarray) // Loop on each x
|
||||
{
|
||||
$legends[$x] = $valarray[0];
|
||||
$values[$x] = (is_numeric($valarray[$i+1]) ? $valarray[$i+1] : null);
|
||||
@ -839,12 +851,12 @@ class DolGraph
|
||||
{
|
||||
foreach($values as $x => $y) { if (isset($y)) $serie[$i].='d'.$i.'.push(['.$x.', '.$y.']);'."\n"; }
|
||||
}
|
||||
|
||||
|
||||
unset($values);
|
||||
$i++;
|
||||
}
|
||||
$tag=dol_escape_htmltag(dol_string_unaccent(dol_string_nospecial(basename($file),'_',array('-','.'))));
|
||||
|
||||
|
||||
$this->_stringtoshow ='<!-- Build using '.$this->_library.' -->'."\n";
|
||||
if (! empty($this->title)) $this->_stringtoshow.='<div align="center" class="dolgraphtitle'.(empty($this->cssprefix)?'':' dolgraphtitle'.$this->cssprefix).'">'.$this->title.'</div>';
|
||||
$this->_stringtoshow.='<div id="placeholder_'.$tag.'" style="width:'.$this->width.'px;height:'.$this->height.'px;" class="dolgraph'.(empty($this->cssprefix)?'':' dolgraph'.$this->cssprefix).'"></div>'."\n";
|
||||
@ -868,7 +880,7 @@ class DolGraph
|
||||
$showlegend=$this->showlegend;
|
||||
$showpointvalue=$this->showpointvalue;
|
||||
$showpercent=$this->showpercent;
|
||||
|
||||
|
||||
$this->_stringtoshow.= '
|
||||
function plotWithOptions_'.$tag.'() {
|
||||
$.plot($("#placeholder_'.$tag.'"), d0,
|
||||
@ -933,16 +945,16 @@ class DolGraph
|
||||
opacity: 0.80
|
||||
}).appendTo("body").fadeIn(20);
|
||||
}
|
||||
|
||||
|
||||
var previousPoint = null;
|
||||
$("#placeholder_'.$tag.'").bind("plothover", function (event, pos, item) {
|
||||
$("#x").text(pos.x.toFixed(2));
|
||||
$("#y").text(pos.y.toFixed(2));
|
||||
|
||||
|
||||
if (item) {
|
||||
if (previousPoint != item.dataIndex) {
|
||||
previousPoint = item.dataIndex;
|
||||
|
||||
|
||||
$("#tooltip").remove();
|
||||
/* console.log(item); */
|
||||
var x = item.datapoint[0].toFixed(2);
|
||||
@ -962,9 +974,9 @@ class DolGraph
|
||||
}
|
||||
});
|
||||
';
|
||||
|
||||
|
||||
$this->_stringtoshow.='var stack = null, steps = false;'."\n";
|
||||
|
||||
|
||||
$this->_stringtoshow.='function plotWithOptions_'.$tag.'() {'."\n";
|
||||
$this->_stringtoshow.='$.plot($("#placeholder_'.$tag.'"), [ '."\n";
|
||||
$i=$firstlot;
|
||||
@ -979,7 +991,7 @@ class DolGraph
|
||||
$i++;
|
||||
}
|
||||
$this->_stringtoshow.="\n".' ], { series: { stack: stack, lines: { fill: false, steps: steps }, bars: { barWidth: 0.6 } }'."\n";
|
||||
|
||||
|
||||
// Xaxis
|
||||
$this->_stringtoshow.=', xaxis: { ticks: ['."\n";
|
||||
$x=0;
|
||||
@ -990,10 +1002,10 @@ class DolGraph
|
||||
$x++;
|
||||
}
|
||||
$this->_stringtoshow.='] }'."\n";
|
||||
|
||||
|
||||
// Yaxis
|
||||
$this->_stringtoshow.=', yaxis: { min: '.$this->MinValue.', max: '.($this->MaxValue).' }'."\n";
|
||||
|
||||
|
||||
// Background color
|
||||
$color1=sprintf("%02x%02x%02x",$this->bgcolorgrid[0],$this->bgcolorgrid[0],$this->bgcolorgrid[2]);
|
||||
$color2=sprintf("%02x%02x%02x",$this->bgcolorgrid[0],$this->bgcolorgrid[1],$this->bgcolorgrid[2]);
|
||||
@ -1001,7 +1013,7 @@ class DolGraph
|
||||
//$this->_stringtoshow.=', shadowSize: 20'."\n"; TODO Uncommet this
|
||||
$this->_stringtoshow.='});'."\n";
|
||||
$this->_stringtoshow.='}'."\n";
|
||||
|
||||
|
||||
}
|
||||
|
||||
$this->_stringtoshow.='plotWithOptions_'.$tag.'();'."\n";
|
||||
|
||||
@ -683,9 +683,9 @@ class ExtraFields
|
||||
}
|
||||
elseif ($type == 'sellist')
|
||||
{
|
||||
|
||||
$out='<select class="flat" name="options_'.$key.'">';
|
||||
if (is_array($param['options'])) {
|
||||
if (is_array($param['options']))
|
||||
{
|
||||
$param_list=array_keys($param['options']);
|
||||
$InfoFieldList = explode(":", $param_list[0]);
|
||||
|
||||
@ -696,38 +696,38 @@ class ExtraFields
|
||||
|
||||
$keyList='rowid';
|
||||
|
||||
if (count($InfoFieldList)>=3)
|
||||
$keyList=$InfoFieldList[2].' as rowid';
|
||||
if (count($InfoFieldList)>=4) {
|
||||
list($parentName, $parentField) = explode('|', $InfoFieldList[3]);
|
||||
$keyList.= ', '.$parentField;
|
||||
}
|
||||
if (count($InfoFieldList)>=3)
|
||||
$keyList=$InfoFieldList[2].' as rowid';
|
||||
if (count($InfoFieldList)>=4) {
|
||||
list($parentName, $parentField) = explode('|', $InfoFieldList[3]);
|
||||
$keyList.= ', '.$parentField;
|
||||
}
|
||||
|
||||
$fields_label = explode('|',$InfoFieldList[1]);
|
||||
if(is_array($fields_label)) {
|
||||
$keyList .=', ';
|
||||
$keyList .= implode(', ', $fields_label);
|
||||
}
|
||||
$fields_label = explode('|',$InfoFieldList[1]);
|
||||
if(is_array($fields_label)) {
|
||||
$keyList .=', ';
|
||||
$keyList .= implode(', ', $fields_label);
|
||||
}
|
||||
|
||||
$fields_label = explode('|',$InfoFieldList[1]);
|
||||
if(is_array($fields_label)) {
|
||||
$keyList .=', ';
|
||||
$keyList .= implode(', ', $fields_label);
|
||||
}
|
||||
$fields_label = explode('|',$InfoFieldList[1]);
|
||||
if(is_array($fields_label)) {
|
||||
$keyList .=', ';
|
||||
$keyList .= implode(', ', $fields_label);
|
||||
}
|
||||
|
||||
$sql = 'SELECT '.$keyList;
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX .$InfoFieldList[0];
|
||||
//$sql.= ' WHERE entity = '.$conf->entity;
|
||||
$sql = 'SELECT '.$keyList;
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX .$InfoFieldList[0];
|
||||
//$sql.= ' WHERE entity = '.$conf->entity;
|
||||
//print $sql;
|
||||
|
||||
dol_syslog(get_class($this).'::showInputField type=sellist sql='.$sql);
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
if ($resql)
|
||||
{
|
||||
$out.='<option value="0"> </option>';
|
||||
$num = $this->db->num_rows($resql);
|
||||
$i = 0;
|
||||
if ($num)
|
||||
while ($i < $num)
|
||||
{
|
||||
$labeltoshow='';
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
@ -764,16 +764,18 @@ class ExtraFields
|
||||
$translabel=$langs->trans($obj->$InfoFieldList[1]);
|
||||
if ($translabel!=$obj->$InfoFieldList[1]) {
|
||||
$labeltoshow=dol_trunc($translabel,18);
|
||||
}else {
|
||||
}
|
||||
else {
|
||||
$labeltoshow=dol_trunc($obj->$InfoFieldList[1],18);
|
||||
}
|
||||
|
||||
if (empty($labeltoshow)) $labeltoshow='(not defined)';
|
||||
if ($value==$obj->rowid)
|
||||
{
|
||||
$out.='<option value="'.$obj->rowid.'" selected="selected">'.$labeltoshow.'</option>';
|
||||
}
|
||||
|
||||
if(!empty($InfoFieldList[3])) {
|
||||
if (!empty($InfoFieldList[3]))
|
||||
{
|
||||
$parent = $parentName.':'.$obj->{$parentField};
|
||||
}
|
||||
|
||||
@ -781,9 +783,9 @@ class ExtraFields
|
||||
$out.= ($value==$obj->rowid?' selected="selected"':'');
|
||||
$out.= (!empty($parent)?' parent="'.$parent.'"':'');
|
||||
$out.='>'.$labeltoshow.'</option>';
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
$i++;
|
||||
}
|
||||
$this->db->free();
|
||||
}
|
||||
|
||||
@ -800,7 +800,21 @@ class Form
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
$label=$obj->nom;
|
||||
|
||||
if ($conf->global->SOCIETE_ADD_REF_IN_LIST) {
|
||||
if (($obj->client) && (!empty($obj->code_client))) {
|
||||
$label = $obj->code_client. ' - ';
|
||||
}
|
||||
if (($obj->fournisseur) && (!empty($obj->code_fournisseur))) {
|
||||
$label .= $obj->code_fournisseur. ' - ';
|
||||
}
|
||||
$label.=' '.$obj->nom;
|
||||
}
|
||||
else
|
||||
{
|
||||
$label=$obj->nom;
|
||||
}
|
||||
|
||||
if ($showtype)
|
||||
{
|
||||
if ($obj->client || $obj->fournisseur) $label.=' (';
|
||||
|
||||
@ -122,10 +122,10 @@ class pdf_standard
|
||||
* @param Translate $outputlangs Output langs
|
||||
* @param string $textright Text right
|
||||
* @param int $idmember Id member
|
||||
* @param string $photomember Photo member
|
||||
* @param string $photo Photo member
|
||||
* @return void
|
||||
*/
|
||||
function Add_PDF_card(&$pdf,$textleft,$header,$footer,$outputlangs,$textright='',$idmember=0,$photomember='')
|
||||
function Add_PDF_card(&$pdf,$textleft,$header,$footer,$outputlangs,$textright='',$idmember=0,$photo='')
|
||||
{
|
||||
global $mysoc,$conf,$langs;
|
||||
|
||||
@ -154,9 +154,9 @@ class pdf_standard
|
||||
|
||||
// Define photo
|
||||
$dir=$conf->adherent->dir_output;
|
||||
$file=get_exdir($idmember,2).'photos/'.$photomember;
|
||||
$file=get_exdir($idmember,2).'photos/'.$photo;
|
||||
$photo=$dir.'/'.$file;
|
||||
if (empty($photomember) || ! is_readable($photo)) $photo='';
|
||||
if (empty($photo) || ! is_readable($photo)) $photo='';
|
||||
|
||||
// Define background image
|
||||
$backgroundimage='';
|
||||
@ -408,12 +408,13 @@ class pdf_standard
|
||||
/**
|
||||
* Function to build PDF on disk, then output on HTTP strem.
|
||||
*
|
||||
* @param array $arrayofmembers Array of members informations
|
||||
* @param array $arrayofrecords Array of record informations (array('textleft'=>,'textheader'=>, ...'id'=>,'photo'=>)
|
||||
* @param Translate $outputlangs Lang object for output language
|
||||
* @param string $srctemplatepath Full path of source filename for generator using a template file
|
||||
* @param string $mode Tell if doc module is called for 'member, ...
|
||||
* @return int 1=OK, 0=KO
|
||||
*/
|
||||
function write_file($arrayofmembers,$outputlangs,$srctemplatepath)
|
||||
function write_file($arrayofrecords,$outputlangs,$srctemplatepath,$mode='member')
|
||||
{
|
||||
global $user,$conf,$langs,$mysoc,$_Avery_Labels;
|
||||
|
||||
@ -433,9 +434,20 @@ class pdf_standard
|
||||
$outputlangs->load("members");
|
||||
$outputlangs->load("admin");
|
||||
|
||||
if (empty($mode) || $mode == 'member')
|
||||
{
|
||||
$title=$outputlangs->transnoentities('MembersCards');
|
||||
$keywords=$outputlangs->transnoentities('MembersCards')." ".$outputlangs->transnoentities("Foundation")." ".$outputlangs->convToOutputCharset($mysoc->name);
|
||||
$outputdir=$conf->adherent->dir_temp;
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error('','Bad value for $mode');
|
||||
return -1;
|
||||
}
|
||||
|
||||
$dir = (empty($outputdir)?$conf->adherent->dir_temp:$outputdir);
|
||||
$filename='tmp_cards.pdf';
|
||||
$dir = $outputdir;
|
||||
$filename = 'tmp_cards.pdf';
|
||||
$file = $dir."/".$filename;
|
||||
|
||||
if (! file_exists($dir))
|
||||
@ -456,11 +468,11 @@ class pdf_standard
|
||||
}
|
||||
$pdf->SetFont(pdf_getPDFFont($outputlangs));
|
||||
|
||||
$pdf->SetTitle($outputlangs->transnoentities('MembersCards'));
|
||||
$pdf->SetSubject($outputlangs->transnoentities("MembersCards"));
|
||||
$pdf->SetTitle($title);
|
||||
$pdf->SetSubject($title);
|
||||
$pdf->SetCreator("Dolibarr ".DOL_VERSION);
|
||||
$pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
|
||||
$pdf->SetKeyWords($outputlangs->transnoentities('MembersCards')." ".$outputlangs->transnoentities("Foundation")." ".$outputlangs->convToOutputCharset($mysoc->name));
|
||||
$pdf->SetKeyWords($keywords);
|
||||
if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false);
|
||||
|
||||
$pdf->SetMargins(0,0);
|
||||
@ -482,7 +494,7 @@ class pdf_standard
|
||||
|
||||
|
||||
// Add each record
|
||||
foreach($arrayofmembers as $val)
|
||||
foreach($arrayofrecords as $val)
|
||||
{
|
||||
// imprime le texte specifique sur la carte
|
||||
$this->Add_PDF_card($pdf,$val['textleft'],$val['textheader'],$val['textfooter'],$langs,$val['textright'],$val['id'],$val['photo']);
|
||||
@ -499,7 +511,6 @@ class pdf_standard
|
||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
||||
|
||||
|
||||
|
||||
// Output to http stream
|
||||
clearstatcache();
|
||||
|
||||
|
||||
@ -175,9 +175,9 @@ class modAdherent extends DolibarrModules
|
||||
$this->export_code[$r]=$this->rights_class.'_'.$r;
|
||||
$this->export_label[$r]='MembersAndSubscriptions';
|
||||
$this->export_permission[$r]=array(array("adherent","export"));
|
||||
$this->export_fields_array[$r]=array('a.rowid'=>'Id','a.civilite'=>"UserTitle",'a.lastname'=>"Lastname",'a.firstname'=>"Firstname",'a.login'=>"Login",'a.morphy'=>'Nature','a.societe'=>'Company','a.address'=>"Address",'a.zip'=>"Zip",'a.town'=>"Town",'a.country'=>"Country",'a.phone'=>"PhonePro",'a.phone_perso'=>"PhonePerso",'a.phone_mobile'=>"PhoneMobile",'a.email'=>"Email",'a.birth'=>"Birthday",'a.statut'=>"Status",'a.photo'=>"Photo",'a.note'=>"Note",'a.datec'=>'DateCreation','a.datevalid'=>'DateValidation','a.tms'=>'DateLastModification','a.datefin'=>'DateEndSubscription','ta.rowid'=>'MemberTypeId','ta.libelle'=>'MemberTypeLabel','c.rowid'=>'SubscriptionId','c.dateadh'=>'DateSubscription','c.cotisation'=>'Amount');
|
||||
$this->export_TypeFields_array[$r]=array('a.civilite'=>"Text",'a.lastname'=>"Text",'a.firstname'=>"Text",'a.login'=>"Text",'a.morphy'=>'Text','a.societe'=>'Text','a.address'=>"Text",'a.zip'=>"Text",'a.town'=>"Text",'a.country'=>"Text",'a.phone'=>"Text",'a.phone_perso'=>"Text",'a.phone_mobile'=>"Text",'a.email'=>"Text",'a.birth'=>"Date",'a.statut'=>"Status",'a.note'=>"Text",'a.datec'=>'Date','a.datevalid'=>'Date','a.tms'=>'Date','a.datefin'=>'Date','ta.rowid'=>'List:fk_adherent_type:libelle','ta.libelle'=>'Text','c.dateadh'=>'Date','c.cotisation'=>'Number');
|
||||
$this->export_entities_array[$r]=array('a.rowid'=>'member','a.civilite'=>"member",'a.lastname'=>"member",'a.firstname'=>"member",'a.login'=>"member",'a.morphy'=>'member','a.societe'=>'member','a.address'=>"member",'a.zip'=>"member",'a.town'=>"member",'a.country'=>"member",'a.phone'=>"member",'a.phone_perso'=>"member",'a.phone_mobile'=>"member",'a.email'=>"member",'a.birth'=>"member",'a.statut'=>"member",'a.photo'=>"member",'a.note'=>"member",'a.datec'=>'member','a.datevalid'=>'member','a.tms'=>'member','a.datefin'=>'member','ta.rowid'=>'member_type','ta.libelle'=>'member_type','c.rowid'=>'subscription','c.dateadh'=>'subscription','c.cotisation'=>'subscription');
|
||||
$this->export_fields_array[$r]=array('a.rowid'=>'Id','a.civilite'=>"UserTitle",'a.lastname'=>"Lastname",'a.firstname'=>"Firstname",'a.login'=>"Login",'a.morphy'=>'Nature','a.societe'=>'Company','a.address'=>"Address",'a.zip'=>"Zip",'a.town'=>"Town",'d.nom'=>"State",'p.code'=>"CountryCode",'p.libelle'=>"Country",'a.phone'=>"PhonePro",'a.phone_perso'=>"PhonePerso",'a.phone_mobile'=>"PhoneMobile",'a.email'=>"Email",'a.birth'=>"Birthday",'a.statut'=>"Status",'a.photo'=>"Photo",'a.note'=>"Note",'a.datec'=>'DateCreation','a.datevalid'=>'DateValidation','a.tms'=>'DateLastModification','a.datefin'=>'DateEndSubscription','ta.rowid'=>'MemberTypeId','ta.libelle'=>'MemberTypeLabel','c.rowid'=>'SubscriptionId','c.dateadh'=>'DateSubscription','c.cotisation'=>'Amount');
|
||||
$this->export_TypeFields_array[$r]=array('a.civilite'=>"Text",'a.lastname'=>"Text",'a.firstname'=>"Text",'a.login'=>"Text",'a.morphy'=>'Text','a.societe'=>'Text','a.address'=>"Text",'a.zip'=>"Text",'a.town'=>"Text",'d.nom'=>"Text",'p.code'=>'Text','p.libelle'=>"Text",'a.phone'=>"Text",'a.phone_perso'=>"Text",'a.phone_mobile'=>"Text",'a.email'=>"Text",'a.birth'=>"Date",'a.statut'=>"Status",'a.note'=>"Text",'a.datec'=>'Date','a.datevalid'=>'Date','a.tms'=>'Date','a.datefin'=>'Date','ta.rowid'=>'List:fk_adherent_type:libelle','ta.libelle'=>'Text','c.dateadh'=>'Date','c.cotisation'=>'Number');
|
||||
$this->export_entities_array[$r]=array('a.rowid'=>'member','a.civilite'=>"member",'a.lastname'=>"member",'a.firstname'=>"member",'a.login'=>"member",'a.morphy'=>'member','a.societe'=>'member','a.address'=>"member",'a.zip'=>"member",'a.town'=>"member",'d.nom'=>"member",'p.code'=>"member",'p.libelle'=>"member",'a.phone'=>"member",'a.phone_perso'=>"member",'a.phone_mobile'=>"member",'a.email'=>"member",'a.birth'=>"member",'a.statut'=>"member",'a.photo'=>"member",'a.note'=>"member",'a.datec'=>'member','a.datevalid'=>'member','a.tms'=>'member','a.datefin'=>'member','ta.rowid'=>'member_type','ta.libelle'=>'member_type','c.rowid'=>'subscription','c.dateadh'=>'subscription','c.cotisation'=>'subscription');
|
||||
// Add extra fields
|
||||
$sql="SELECT name, label FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'adherent' AND entity = ".$conf->entity;
|
||||
$resql=$this->db->query($sql);
|
||||
@ -193,6 +193,8 @@ class modAdherent extends DolibarrModules
|
||||
$this->export_sql_end[$r] =' FROM ('.MAIN_DB_PREFIX.'adherent_type as ta, '.MAIN_DB_PREFIX.'adherent as a)';
|
||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'adherent_extrafields as extra ON a.rowid = extra.fk_object';
|
||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'cotisation as c ON c.fk_adherent = a.rowid';
|
||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON a.state_id = d.rowid';
|
||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as p ON a.country = p.rowid';
|
||||
$this->export_sql_end[$r] .=' WHERE a.fk_adherent_type = ta.rowid';
|
||||
$this->export_dependencies_array[$r]=array('subscription'=>'c.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them
|
||||
|
||||
@ -210,7 +212,7 @@ class modAdherent extends DolibarrModules
|
||||
$this->import_entities_array[$r]=array(); // We define here only fields that use another icon that the one defined into import_icon
|
||||
$this->import_tables_array[$r]=array('a'=>MAIN_DB_PREFIX.'adherent','extra'=>MAIN_DB_PREFIX.'adherent_extrafields');
|
||||
$this->import_tables_creator_array[$r]=array('a'=>'fk_user_author'); // Fields to store import user id
|
||||
$this->import_fields_array[$r]=array('a.civilite'=>"UserTitle",'a.lastname'=>"Lastname*",'a.firstname'=>"Firstname",'a.login'=>"Login*","a.pass"=>"Password","a.fk_adherent_type"=>"MemberType*",'a.morphy'=>'Nature*','a.societe'=>'Company','a.address'=>"Address",'a.zip'=>"Zip",'a.town'=>"Town",'a.country'=>"Country",'a.phone'=>"PhonePro",'a.phone_perso'=>"PhonePerso",'a.phone_mobile'=>"PhoneMobile",'a.email'=>"Email",'a.birth'=>"Birthday",'a.statut'=>"Status*",'a.photo'=>"Photo",'a.note'=>"Note",'a.datec'=>'DateCreation','a.datefin'=>'DateEndSubscription');
|
||||
$this->import_fields_array[$r]=array('a.civilite'=>"UserTitle",'a.lastname'=>"Lastname*",'a.firstname'=>"Firstname",'a.login'=>"Login*","a.pass"=>"Password","a.fk_adherent_type"=>"MemberType*",'a.morphy'=>'Nature*','a.societe'=>'Company','a.address'=>"Address",'a.zip'=>"Zip",'a.town'=>"Town",'a.state_id'=>'StateId','a.country'=>"CountryId",'a.phone'=>"PhonePro",'a.phone_perso'=>"PhonePerso",'a.phone_mobile'=>"PhoneMobile",'a.email'=>"Email",'a.birth'=>"Birthday",'a.statut'=>"Status*",'a.photo'=>"Photo",'a.note'=>"Note",'a.datec'=>'DateCreation','a.datefin'=>'DateEndSubscription');
|
||||
// Add extra fields
|
||||
$sql="SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'adherent' AND entity = ".$conf->entity;
|
||||
$resql=$this->db->query($sql);
|
||||
|
||||
@ -124,6 +124,13 @@ class modSociete extends DolibarrModules
|
||||
$this->const[$r][4] = 1;
|
||||
$r++;
|
||||
*/
|
||||
|
||||
$this->const[$r][0] = "SOCIETE_ADD_REF_IN_LIST";
|
||||
$this->const[$r][1] = "yesno";
|
||||
$this->const[$r][2] = "0";
|
||||
$this->const[$r][3] = "Display customer ref into select list";
|
||||
$this->const[$r][4] = 0;
|
||||
$r++;
|
||||
|
||||
// Boxes
|
||||
$this->boxes = array();
|
||||
@ -313,8 +320,8 @@ class modSociete extends DolibarrModules
|
||||
$this->export_label[$r]='ExportDataset_company_2';
|
||||
$this->export_icon[$r]='contact';
|
||||
$this->export_permission[$r]=array(array("societe","contact","export"));
|
||||
$this->export_fields_array[$r]=array('c.rowid'=>"IdContact",'c.civilite'=>"CivilityCode",'c.lastname'=>'Lastname','c.firstname'=>'Firstname','c.poste'=>'PostOrFunction','c.datec'=>"DateCreation",'c.tms'=>"DateLastModification",'c.priv'=>"ContactPrivate",'c.address'=>"Address",'c.zip'=>"Zip",'c.town'=>"Town",'c.phone'=>"Phone",'c.fax'=>"Fax",'c.phone_mobile'=>"Mobile",'c.email'=>"EMail",'p.libelle'=>"Country",'p.code'=>"CountryCode",'s.rowid'=>"IdCompany",'s.nom'=>"CompanyName",'s.status'=>"Status",'s.code_client'=>"CustomerCode",'s.code_fournisseur'=>"SupplierCode");
|
||||
$this->export_TypeFields_array[$r]=array('c.civilite'=>"List:c_civilite:civilite:code",'c.name'=>'Text','c.firstname'=>'Text','c.poste'=>'Text','c.datec'=>"Date",'c.priv'=>"Boolean",'c.address'=>"Text",'c.cp'=>"Text",'c.ville'=>"Text",'c.phone'=>"Text",'c.fax'=>"Text",'c.email'=>"Text",'p.libelle'=>"List:c_pays:libelle:rowid",'p.code'=>"Text",'s.rowid'=>"List:societe:nom",'s.nom'=>"Text",'s.status'=>"Status",'s.code_client'=>"Text",'s.code_fournisseur'=>"Text");
|
||||
$this->export_fields_array[$r]=array('c.rowid'=>"IdContact",'c.civilite'=>"CivilityCode",'c.lastname'=>'Lastname','c.firstname'=>'Firstname','c.poste'=>'PostOrFunction','c.datec'=>"DateCreation",'c.tms'=>"DateLastModification",'c.priv'=>"ContactPrivate",'c.address'=>"Address",'c.zip'=>"Zip",'c.town'=>"Town",'d.nom'=>'State','p.libelle'=>"Country",'p.code'=>"CountryCode",'c.phone'=>"Phone",'c.fax'=>"Fax",'c.phone_mobile'=>"Mobile",'c.email'=>"EMail",'s.rowid'=>"IdCompany",'s.nom'=>"CompanyName",'s.status'=>"Status",'s.code_client'=>"CustomerCode",'s.code_fournisseur'=>"SupplierCode");
|
||||
$this->export_TypeFields_array[$r]=array('c.civilite'=>"List:c_civilite:civilite:code",'c.lastname'=>'Text','c.firstname'=>'Text','c.poste'=>'Text','c.datec'=>"Date",'c.priv'=>"Boolean",'c.address'=>"Text",'c.cp'=>"Text",'c.ville'=>"Text",'d.nom'=>'Text','p.libelle'=>"List:c_pays:libelle:rowid",'p.code'=>"Text",'c.phone'=>"Text",'c.fax'=>"Text",'c.email'=>"Text",'s.rowid'=>"List:societe:nom",'s.nom'=>"Text",'s.status'=>"Status",'s.code_client'=>"Text",'s.code_fournisseur'=>"Text");
|
||||
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>"company",'s.code_client'=>"company",'s.code_fournisseur'=>"company"); // We define here only fields that use another picto
|
||||
if (empty($conf->fournisseur->enabled))
|
||||
{
|
||||
@ -358,6 +365,7 @@ class modSociete extends DolibarrModules
|
||||
$this->export_sql_start[$r]='SELECT DISTINCT ';
|
||||
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'socpeople as c';
|
||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON c.fk_soc = s.rowid';
|
||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON c.fk_departement = d.rowid';
|
||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as p ON c.fk_pays = p.rowid';
|
||||
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'socpeople_extrafields as extra ON extra.fk_object = c.rowid';
|
||||
$this->export_sql_end[$r] .=' WHERE c.entity IN ('.getEntity("societe", 1).')';
|
||||
@ -374,7 +382,7 @@ class modSociete extends DolibarrModules
|
||||
$this->import_icon[$r]='company';
|
||||
$this->import_entities_array[$r]=array(); // We define here only fields that use another icon that the one defined into import_icon
|
||||
$this->import_tables_array[$r]=array('s'=>MAIN_DB_PREFIX.'societe','extra'=>MAIN_DB_PREFIX.'societe_extrafields'); // List of tables to insert into (insert done in same order)
|
||||
$this->import_fields_array[$r]=array('s.nom'=>"Name*",'s.status'=>"Status",'s.client'=>"Customer*",'s.fournisseur'=>"Supplier*",'s.code_client'=>"CustomerCode",'s.code_fournisseur'=>"SupplierCode",'s.code_compta'=>"CustomerAccountancyCode",'s.code_compta_fournisseur'=>"SupplierAccountancyCode",'s.address'=>"Address",'s.zip'=>"Zip",'s.town'=>"Town",'s.fk_pays'=>"CountryCode",'s.phone'=>"Phone",'s.fax'=>"Fax",'s.url'=>"Url",'s.email'=>"Email",'s.siret'=>"ProfId1",'s.siren'=>"ProfId2",'s.ape'=>"ProfId3",'s.idprof4'=>"ProfId4",'s.tva_intra'=>"VATIntraShort",'s.capital'=>"Capital",'s.note_private'=>"NotePrivate",'s.note_public'=>"NotePublic",'s.fk_typent'=>"ThirdPartyType",'s.fk_effectif'=>"Staff","s.fk_forme_juridique"=>"JuridicalStatus",'s.fk_prospectlevel'=>'ProspectLevel','s.fk_stcomm'=>'ProspectStatus','s.default_lang'=>'DefaultLanguage','s.barcode'=>'BarCode','s.datec'=>"DateCreation");
|
||||
$this->import_fields_array[$r]=array('s.nom'=>"Name*",'s.status'=>"Status",'s.client'=>"Customer*",'s.fournisseur'=>"Supplier*",'s.code_client'=>"CustomerCode",'s.code_fournisseur'=>"SupplierCode",'s.code_compta'=>"CustomerAccountancyCode",'s.code_compta_fournisseur'=>"SupplierAccountancyCode",'s.address'=>"Address",'s.zip'=>"Zip",'s.town'=>"Town",'s.fk_departement'=>"StateId",'s.fk_pays'=>"CountryCode",'s.phone'=>"Phone",'s.fax'=>"Fax",'s.url'=>"Url",'s.email'=>"Email",'s.siret'=>"ProfId1",'s.siren'=>"ProfId2",'s.ape'=>"ProfId3",'s.idprof4'=>"ProfId4",'s.tva_intra'=>"VATIntraShort",'s.capital'=>"Capital",'s.note_private'=>"NotePrivate",'s.note_public'=>"NotePublic",'s.fk_typent'=>"ThirdPartyType",'s.fk_effectif'=>"Staff","s.fk_forme_juridique"=>"JuridicalStatus",'s.fk_prospectlevel'=>'ProspectLevel','s.fk_stcomm'=>'ProspectStatus','s.default_lang'=>'DefaultLanguage','s.barcode'=>'BarCode','s.datec'=>"DateCreation");
|
||||
// Add extra fields
|
||||
$sql="SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'societe' AND entity = ".$conf->entity;
|
||||
$resql=$this->db->query($sql);
|
||||
|
||||
@ -72,10 +72,11 @@ class mod_task_simple extends ModeleNumRefTask
|
||||
$coyymm=''; $max='';
|
||||
|
||||
$posindice=8;
|
||||
$sql = "SELECT MAX(SUBSTRING(ref FROM ".$posindice.")) as max";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."projet_task";
|
||||
$sql.= " WHERE ref LIKE '".$this->prefix."____-%'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
$sql = "SELECT MAX(SUBSTRING(task.ref FROM " . $posindice . ")) as max";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "projet_task AS task, ";
|
||||
$sql .= MAIN_DB_PREFIX . "projet AS project WHERE task.fk_projet=project.rowid";
|
||||
$sql .= " AND task.ref LIKE '" . $this->prefix . "____-%'";
|
||||
$sql .= " AND project.entity = " . $conf->entity;
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
|
||||
@ -220,7 +220,12 @@ class Export
|
||||
|
||||
if ($i > 0) $sql.=', ';
|
||||
else $i++;
|
||||
$newfield=$key.' as '.str_replace(array('.', '-'),'_',$key);;
|
||||
|
||||
if (strpos($key, ' as ')===false) {
|
||||
$newfield=$key.' as '.str_replace(array('.', '-'),'_',$key);
|
||||
} else {
|
||||
$newfield=$key;
|
||||
}
|
||||
|
||||
$sql.=$newfield;
|
||||
}
|
||||
|
||||
@ -1002,6 +1002,7 @@ BrowserIsOK=You are using the web browser %s. This browser is ok for security an
|
||||
BrowserIsKO=You are using the web browser %s. This browser is known to be a bad choice for security, performance and reliability. We recommand you to use Firefox, Chrome, Opera or Safari.
|
||||
XDebugInstalled=XDebug est chargé.
|
||||
XCacheInstalled=XCache is loaded.
|
||||
AddRefInList=Display customer/supplier ref into list (select list or combobox) and most of hyperlink
|
||||
##### Module password generation
|
||||
PasswordGenerationStandard=Return a password generated according to internal Dolibarr algorithm: 8 characters containing shared numbers and characters in lowercase.
|
||||
PasswordGenerationNone=Do not suggest any generated password. Password must be type in manually.
|
||||
|
||||
@ -1002,6 +1002,7 @@ BrowserIsOK=Vous utilisez le navigateur %s. Ce navigateur est réputé optimisé
|
||||
BrowserIsKO=Vous utilisez le navigateur %s. Ce navigateur est déconseillé pour des raisons de sécurité, performance et qualité des pages restituées. Nous vous recommandons d'utiliser Firefox, Chrome, Opera ou Safari.
|
||||
XDebugInstalled=XDebug est chargé.
|
||||
XCacheInstalled=XCache est chargé.
|
||||
AddRefInList=Affiché le code client/fournisseur dans les liste (déroulante ou autocomplétion) et dans la pluspart des hyperliens
|
||||
##### Module password generation
|
||||
PasswordGenerationStandard=Renvoie un mot de passe généré selon l'algorithme interne de Dolibarr : 8 caractères, chiffres et caractères en minuscules mélangés.
|
||||
PasswordGenerationNone=Ne propose pas de mots de passe générés. Le mot de passe est à saisir manuellement.
|
||||
|
||||
@ -199,3 +199,5 @@ CostPmpHT=Cout à l'achat HT
|
||||
ProductUsedForBuild=Consommé automatiquement par la fabrication
|
||||
ProductBuilded=Fabrication terminée
|
||||
ProductsMultiPrice=Produits multi-prix
|
||||
ProductSellByQuarterHT=Chiffre d'affaire trimestrielle HT des produits
|
||||
ServiceSellByQuarterHT=Chiffre d'affaire trimestrielle HT des services
|
||||
|
||||
@ -395,6 +395,8 @@ class MailmanSpip
|
||||
if ($listes=='' && ! empty($conf->global->ADHERENT_MAILMAN_LISTS)) $lists=explode(',',$conf->global->ADHERENT_MAILMAN_LISTS);
|
||||
else $lists=explode(',',$listes);
|
||||
|
||||
$categstatic=new Categorie($this->db);
|
||||
|
||||
foreach ($lists as $list)
|
||||
{
|
||||
// Filter on type something (ADHERENT_MAILMAN_LISTS = "mailinglist0,TYPE:typevalue:mailinglist1,CATEG:categvalue:mailinglist2")
|
||||
|
||||
@ -258,10 +258,121 @@ else
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
// ici le récap des ventes par trimestre de service et de produit
|
||||
if (! empty($conf->product->enabled))
|
||||
activitytrim(0);
|
||||
|
||||
if (! empty($conf->service->enabled))
|
||||
activitytrim(1);
|
||||
|
||||
//print '</td></tr></table>';
|
||||
print '</div></div></div>';
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
function activitytrim($product_type)
|
||||
{
|
||||
global $conf,$langs,$db;
|
||||
|
||||
// on affiche les 3 dernières années
|
||||
$yearofbegindate=date('Y',dol_time_plus_duree(time(), -3, "y"));
|
||||
|
||||
// ventilation par trimestre
|
||||
$sql = "SELECT DATE_FORMAT(p.datep,'%Y') as annee, DATE_FORMAT(p.datep,'%m') as mois, sum(fd.total_ht) as Mnttot";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."facturedet as fd";
|
||||
$sql.= " , ".MAIN_DB_PREFIX."paiement as p,".MAIN_DB_PREFIX."paiement_facture as pf";
|
||||
$sql.= " WHERE f.fk_soc = s.rowid";
|
||||
$sql.= " AND f.rowid = fd.fk_facture";
|
||||
$sql.= " AND pf.fk_facture = f.rowid";
|
||||
$sql.= " AND pf.fk_paiement= p.rowid";
|
||||
$sql.= " AND fd.product_type=".$product_type;
|
||||
$sql.= " AND s.entity = ".$conf->entity;
|
||||
$sql.= " AND p.datep >= '".$db->idate(dol_get_first_day($yearofbegindate),1)."'";
|
||||
$sql.= " GROUP BY annee, mois ";
|
||||
$sql.= " ORDER BY annee, mois ";
|
||||
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$tmpyear=$beginyear;
|
||||
$trim1=0;
|
||||
$trim2=0;
|
||||
$trim3=0;
|
||||
$trim4=0;
|
||||
$lgn = 0;
|
||||
$num = $db->num_rows($result);
|
||||
|
||||
if ($num > 0 )
|
||||
{
|
||||
print '<br>';
|
||||
print '<table class="noborder" width="75%">';
|
||||
|
||||
if ($product_type==0)
|
||||
print '<tr class="liste_titre"><td align=left>'.$langs->trans("ProductSellByQuarterHT").'</td>';
|
||||
else
|
||||
print '<tr class="liste_titre"><td align=left>'.$langs->trans("ServiceSellByQuarterHT").'</td>';
|
||||
print '<td align=right>'.$langs->trans("Quarter1").'</td>';
|
||||
print '<td align=right>'.$langs->trans("Quarter2").'</td>';
|
||||
print '<td align=right>'.$langs->trans("Quarter3").'</td>';
|
||||
print '<td align=right>'.$langs->trans("Quarter4").'</td>';
|
||||
print '<td align=right>'.$langs->trans("Total").'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
$i = 0;
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($result);
|
||||
if ($tmpyear != $objp->annee)
|
||||
{
|
||||
if ($trim1+$trim2+$trim3+$trim4 > 0)
|
||||
{
|
||||
print '<tr ><td align=left>'.$tmpyear.'</td>';
|
||||
print '<td align=right>'.price($trim1).'</td>';
|
||||
print '<td align=right>'.price($trim2).'</td>';
|
||||
print '<td align=right>'.price($trim3).'</td>';
|
||||
print '<td align=right>'.price($trim4).'</td>';
|
||||
print '<td align=right>'.price($trim1+$trim2+$trim3+$trim4).'</td>';
|
||||
print '</tr>';
|
||||
$lgn++;
|
||||
}
|
||||
// on passe à l'année suivante
|
||||
$tmpyear = $objp->annee;
|
||||
$trim1=0;
|
||||
$trim2=0;
|
||||
$trim3=0;
|
||||
$trim4=0;
|
||||
}
|
||||
|
||||
if ($objp->mois == "01" || $objp->mois == "02" || $objp->mois == "03")
|
||||
$trim1 += $objp->Mnttot;
|
||||
|
||||
if ($objp->mois == "04" || $objp->mois == "05" || $objp->mois == "06")
|
||||
$trim2 += $objp->Mnttot;
|
||||
|
||||
if ($objp->mois == "07" || $objp->mois == "08" || $objp->mois == "09")
|
||||
$trim3 += $objp->Mnttot;
|
||||
|
||||
if ($objp->mois == "10" || $objp->mois == "11" || $objp->mois == "12")
|
||||
$trim4 += $objp->Mnttot;
|
||||
|
||||
$i++;
|
||||
}
|
||||
if ($trim1+$trim2+$trim3+$trim4 > 0)
|
||||
{
|
||||
print '<tr ><td align=left>'.$tmpyear.'</td>';
|
||||
print '<td align=right>'.price($trim1).'</td>';
|
||||
print '<td align=right>'.price($trim2).'</td>';
|
||||
print '<td align=right>'.price($trim3).'</td>';
|
||||
print '<td align=right>'.price($trim4).'</td>';
|
||||
print '<td align=right>'.price($trim1+$trim2+$trim3+$trim4).'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
if ($num > 0 )
|
||||
print '</table>';
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@ -211,6 +211,22 @@ if ($action == 'setprofid')
|
||||
}
|
||||
}
|
||||
|
||||
//Activate Set ref in list
|
||||
if ($action=="setaddrefinlist") {
|
||||
$setaddrefinlist = GETPOST('value','int');
|
||||
$res = dolibarr_set_const($db, "SOCIETE_ADD_REF_IN_LIST", $setaddrefinlist,'yesno',0,'',$conf->entity);
|
||||
if (! $res > 0) $error++;
|
||||
if (! $error)
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Activate ProfId mandatory
|
||||
if ($action == 'setprofidmandatory')
|
||||
{
|
||||
@ -717,6 +733,23 @@ else
|
||||
print '</tr>';
|
||||
print '</form>';
|
||||
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var].">";
|
||||
print '<td width="80%">'.$langs->trans("AddRefInList").'</td>';
|
||||
if (!empty($conf->global->SOCIETE_ADD_REF_IN_LIST))
|
||||
{
|
||||
print '<td align="center" colspan="2"><a href="'.$_SERVER['PHP_SELF'].'?action=setaddrefinlist&value=0">';
|
||||
print img_picto($langs->trans("Activated"),'switch_on');
|
||||
print '</a></td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td align="center" colspan="2"><a href="'.$_SERVER['PHP_SELF'].'?action=setaddrefinlist&value=1">';
|
||||
print img_picto($langs->trans("Disabled"),'switch_off');
|
||||
print '</a></td>';
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
|
||||
$var=!$var;
|
||||
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
|
||||
|
||||
@ -1433,6 +1433,16 @@ class Societe extends CommonObject
|
||||
|
||||
$name=$this->name?$this->name:$this->nom;
|
||||
|
||||
if ($conf->global->SOCIETE_ADD_REF_IN_LIST) {
|
||||
if (($this->client) && (! empty ( $this->code_client ))) {
|
||||
$code = $this->code_client . ' - ';
|
||||
}
|
||||
if (($this->fournisseur) && (! empty ( $this->code_fournisseur ))) {
|
||||
$code .= $this->code_fournisseur . ' - ';
|
||||
}
|
||||
$name =$code.' '.$name;
|
||||
}
|
||||
|
||||
$result='';
|
||||
$lien=$lienfin='';
|
||||
|
||||
@ -1571,18 +1581,18 @@ class Societe extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* Return list of contacts emails or mobile existing for third party
|
||||
* Return list of contacts emails or mobile existing for third party
|
||||
*
|
||||
* @param string $mode 'email' or 'mobile'
|
||||
* @return array Array of contacts emails or mobile
|
||||
* @param string $mode 'email' or 'mobile'
|
||||
* @param int $hidedisabled 1=Hide contact if disabled
|
||||
* @return array Array of contacts emails or mobile
|
||||
*/
|
||||
function contact_property_array($mode='email')
|
||||
function contact_property_array($mode='email', $hidedisabled=0)
|
||||
{
|
||||
$contact_property = array();
|
||||
|
||||
|
||||
|
||||
$sql = "SELECT rowid, email, statut, phone_mobile, lastname, firstname";
|
||||
$sql = "SELECT rowid, email, statut, phone_mobile, lastname, poste, firstname";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople";
|
||||
$sql.= " WHERE fk_soc = '".$this->id."'";
|
||||
|
||||
@ -1599,12 +1609,18 @@ class Societe extends CommonObject
|
||||
if ($mode == 'email') $property=$obj->email;
|
||||
else if ($mode == 'mobile') $property=$obj->phone_mobile;
|
||||
|
||||
|
||||
if ($obj->statut == 1)
|
||||
// Show all contact. If hidedisabled is 1, showonly contacts with status = 1
|
||||
if ($obj->statut == 1 || empty($hidedisabled))
|
||||
{
|
||||
$contact_property[$obj->rowid] = trim(dolGetFirstLastname($obj->firstname,$obj->lastname))." <".$property.">";
|
||||
|
||||
}
|
||||
if (!empty($obj->poste))
|
||||
{
|
||||
$contact_property[$obj->rowid] = trim(dolGetFirstLastname($obj->firstname,$obj->lastname))."(".$obj->poste.")"." <".$property.">";
|
||||
}
|
||||
else
|
||||
{
|
||||
$contact_property[$obj->rowid] = trim(dolGetFirstLastname($obj->firstname,$obj->lastname))." <".$property.">";
|
||||
}
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user