Skip to content

Commit

Permalink
Merge branch '7.0' of github.com:ATM-Consulting/dolibarr into FIX_7.0…
Browse files Browse the repository at this point in the history
…_contact_change
  • Loading branch information
ATM-Marc committed Dec 18, 2018
2 parents 7e2eca6 + e150d85 commit 8964b86
Show file tree
Hide file tree
Showing 35 changed files with 201 additions and 142 deletions.
4 changes: 2 additions & 2 deletions htdocs/accountancy/bookkeeping/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -651,8 +651,8 @@
print "</tr>\n";
}

$total_debit = price2num($total_debit);
$total_credit = price2num($total_credit);
$total_debit = price2num($total_debit, 2);
$total_credit = price2num($total_credit, 2);

if ($total_debit != $total_credit)
{
Expand Down
10 changes: 10 additions & 0 deletions htdocs/admin/delais.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,16 @@
'img' => 'bill'
)
),
'supplier_proposal' => array(
array(
'code' => 'MAIN_DELAY_SUPPLIER_PROPOSALS_TO_CLOSE',
'img' => 'supplier_proposal'
),
array(
'code' => 'MAIN_DELAY_SUPPLIER_PROPOSALS_TO_BILL',
'img' => 'supplier_proposal'
)
),
'service' => array(
array(
'code' => 'MAIN_DELAY_NOT_ACTIVATED_SERVICES',
Expand Down
2 changes: 1 addition & 1 deletion htdocs/comm/action/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@

$canedit=1;
if (! $user->rights->agenda->myactions->read) accessforbidden();
if (! $user->rights->agenda->allactions->read) $canedit=0;
if (! $user->rights->agenda->myactions->read) $canedit=0;
if (! $user->rights->agenda->allactions->read || $filter =='mine') // If no permission to see all, we show only affected to me
{
$filtert=$user->id;
Expand Down
2 changes: 1 addition & 1 deletion htdocs/comm/action/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@

$canedit=1;
if (! $user->rights->agenda->myactions->read) accessforbidden();
if (! $user->rights->agenda->allactions->read) $canedit=0;
if (! $user->rights->agenda->myactions->read) $canedit=0;
if (! $user->rights->agenda->allactions->read || $filter=='mine') // If no permission to see all, we show only affected to me
{
$filtert=$user->id;
Expand Down
8 changes: 4 additions & 4 deletions htdocs/comm/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@
$link=DOL_URL_ROOT.'/comm/propal/list.php?socid='.$object->id;
$icon='bill';
if ($link) $boxstat.='<a href="'.$link.'" class="boxstatsindicator thumbstat nobold nounderline">';
$boxstat.='<div class="boxstats">';
$boxstat.='<div class="boxstats" title="'.dol_escape_htmltag($text).'">';
$boxstat.='<span class="boxstatstext">'.img_object("",$icon).' '.$text.'</span><br>';
$boxstat.='<span class="boxstatsindicator">'.price($outstandingTotal, 1, $langs, 1, -1, -1, $conf->currency).'</span>';
$boxstat.='</div>';
Expand All @@ -570,7 +570,7 @@
$link=DOL_URL_ROOT.'/commande/list.php?socid='.$object->id;
$icon='bill';
if ($link) $boxstat.='<a href="'.$link.'" class="boxstatsindicator thumbstat nobold nounderline">';
$boxstat.='<div class="boxstats">';
$boxstat.='<div class="boxstats" title="'.dol_escape_htmltag($text).'">';
$boxstat.='<span class="boxstatstext">'.img_object("",$icon).' '.$text.'</span><br>';
$boxstat.='<span class="boxstatsindicator">'.price($outstandingTotal, 1, $langs, 1, -1, -1, $conf->currency).'</span>';
$boxstat.='</div>';
Expand All @@ -588,7 +588,7 @@
$link=DOL_URL_ROOT.'/compta/facture/list.php?socid='.$object->id;
$icon='bill';
if ($link) $boxstat.='<a href="'.$link.'" class="boxstatsindicator thumbstat nobold nounderline">';
$boxstat.='<div class="boxstats">';
$boxstat.='<div class="boxstats" title="'.dol_escape_htmltag($text).'">';
$boxstat.='<span class="boxstatstext">'.img_object("",$icon).' '.$text.'</span><br>';
$boxstat.='<span class="boxstatsindicator">'.price($outstandingTotal, 1, $langs, 1, -1, -1, $conf->currency).'</span>';
$boxstat.='</div>';
Expand All @@ -604,7 +604,7 @@
$link=DOL_URL_ROOT.'/compta/recap-compta.php?socid='.$object->id;
$icon='bill';
if ($link) $boxstat.='<a href="'.$link.'" class="boxstatsindicator thumbstat nobold nounderline">';
$boxstat.='<div class="boxstats">';
$boxstat.='<div class="boxstats" title="'.dol_escape_htmltag($text).'">';
$boxstat.='<span class="boxstatstext">'.img_object("",$icon).' '.$text.'</span><br>';
$boxstat.='<span class="boxstatsindicator'.($outstandingOpened>0?' amountremaintopay':'').'">'.price($outstandingOpened, 1, $langs, 1, -1, -1, $conf->currency).$warn.'</span>';
$boxstat.='</div>';
Expand Down
1 change: 1 addition & 0 deletions htdocs/commande/class/commande.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -3879,6 +3879,7 @@ function fetch($rowid)
{
$objp = $this->db->fetch_object($result);
$this->rowid = $objp->rowid;
$this->id = $objp->rowid;
$this->fk_commande = $objp->fk_commande;
$this->fk_parent_line = $objp->fk_parent_line;
$this->label = $objp->custom_label;
Expand Down
1 change: 1 addition & 0 deletions htdocs/compta/facture/class/facture.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -4307,6 +4307,7 @@ function fetch($rowid)
$objp = $this->db->fetch_object($result);

$this->rowid = $objp->rowid;
$this->id = $objp->rowid;
$this->fk_facture = $objp->fk_facture;
$this->fk_parent_line = $objp->fk_parent_line;
$this->label = $objp->custom_label;
Expand Down
1 change: 1 addition & 0 deletions htdocs/compta/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -1078,3 +1078,4 @@
llxFooter();

$db->close();

6 changes: 6 additions & 0 deletions htdocs/compta/stats/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@
$userid=GETPOST('userid','int');
$socid = GETPOST('socid','int');

$tmps=dol_getdate($date_start);
$year_start = $tmps['year'];
$tmpe=dol_getdate($date_end);
$year_end = $tmpe['year'];
$nbofyear = ($year_end - $year_start) + 1;

// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES' or 'BOOKKEEPING')
$modecompta = $conf->global->ACCOUNTING_MODE;
if (! empty($conf->accounting->enabled)) $modecompta='BOOKKEEPING';
Expand Down
1 change: 1 addition & 0 deletions htdocs/core/actions_massactions.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
$resaction = '';
$nbsent = 0;
$nbignored = 0;
$langs->load("main");
$langs->load("mails");
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';

Expand Down
7 changes: 5 additions & 2 deletions htdocs/core/class/commonobject.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -2375,7 +2375,7 @@ function update_note_public($note)
*/
function update_price($exclspec=0,$roundingadjust='none',$nodatabaseupdate=0,$seller=null)
{
global $conf;
global $conf, $hookmanager, $action;

// Some external module want no update price after a trigger because they have another method to calculate the total (ex: with an extrafield)
$MODULE = "";
Expand Down Expand Up @@ -2466,7 +2466,10 @@ function update_price($exclspec=0,$roundingadjust='none',$nodatabaseupdate=0,$se
$obj = $this->db->fetch_object($resql);

// Note: There is no check on detail line and no check on total, if $forcedroundingmode = 'none'
if ($forcedroundingmode == '0') // Check if data on line are consistent. This may solve lines that were not consistent because set with $forcedroundingmode='auto'
$parameters=array('fk_element' => $obj->rowid);
$reshook = $hookmanager->executeHooks('changeRoundingMode', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks

if (empty($reshook) && $forcedroundingmode == '0') // Check if data on line are consistent. This may solve lines that were not consistent because set with $forcedroundingmode='auto'
{
$localtax_array=array($obj->localtax1_type,$obj->localtax1_tx,$obj->localtax2_type,$obj->localtax2_tx);
$tmpcal=calcul_price_total($obj->qty, $obj->up, $obj->remise_percent, $obj->vatrate, $obj->localtax1_tx, $obj->localtax2_tx, 0, 'HT', $obj->info_bits, $obj->product_type, $seller, $localtax_array, (isset($obj->situation_percent) ? $obj->situation_percent : 100), $multicurrency_tx);
Expand Down
12 changes: 6 additions & 6 deletions htdocs/core/class/conf.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,6 @@ function setValues($db)
$this->fournisseur->facture=new stdClass();
$this->fournisseur->facture->dir_output =$rootfordata."/fournisseur/facture";
$this->fournisseur->facture->dir_temp =$rootfordata."/fournisseur/facture/temp";
$this->supplierproposal=new stdClass();
$this->supplierproposal->dir_output=$rootfordata."/supplier_proposal";
$this->supplierproposal->dir_temp=$rootfordata."/supplier_proposal/temp";
$this->fournisseur->payment=new stdClass();
$this->fournisseur->payment->dir_output =$rootfordata."/fournisseur/payment";
$this->fournisseur->payment->dir_temp =$rootfordata."/fournisseur/payment/temp";
Expand All @@ -361,9 +358,6 @@ function setValues($db)
$this->supplier_invoice->enabled=1;
$this->supplier_invoice->dir_output=$rootfordata."/fournisseur/facture";
$this->supplier_invoice->dir_temp=$rootfordata."/fournisseur/facture/temp";
$this->supplierproposal=new stdClass();
$this->supplierproposal->dir_output=$rootfordata."/supplier_proposal";
$this->supplierproposal->dir_temp=$rootfordata."/supplier_proposal/temp";
}
}

Expand Down Expand Up @@ -572,6 +566,12 @@ function setValues($db)
$this->expensereport->payment = new stdClass();
$this->expensereport->payment->warning_delay=(isset($this->global->MAIN_DELAY_EXPENSEREPORTS_TO_PAY)?$this->global->MAIN_DELAY_EXPENSEREPORTS_TO_PAY:0)*24*60*60;
}
if (isset($this->supplier_proposal)) {
$this->supplier_proposal->cloture = new stdClass();
$this->supplier_proposal->cloture->warning_delay=(isset($this->global->MAIN_DELAY_SUPPLIER_PROPOSALS_TO_CLOSE)?$this->global->MAIN_DELAY_SUPPLIER_PROPOSALS_TO_CLOSE:0)*24*60*60;
$this->supplier_proposal->facturation = new stdClass();
$this->supplier_proposal->facturation->warning_delay=(isset($this->global->MAIN_DELAY_SUPPLIER_PROPOSALS_TO_BILL)?$this->global->MAIN_DELAY_SUPPLIER_PROPOSALS_TO_BILL:0)*24*60*60;
}

if (! empty($this->global->PRODUIT_MULTIPRICES) && empty($this->global->PRODUIT_MULTIPRICES_LIMIT))
{
Expand Down
11 changes: 11 additions & 0 deletions htdocs/core/class/discount.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,8 @@ function link_to_invoice($rowidline,$rowidinvoice)
*/
function unlink_invoice()
{
global $user, $langs, $conf;

$sql ="UPDATE ".MAIN_DB_PREFIX."societe_remise_except";
$sql.=" SET fk_facture_line = NULL, fk_facture = NULL";
$sql.=" WHERE rowid = ".$this->id;
Expand All @@ -342,6 +344,15 @@ function unlink_invoice()
$resql = $this->db->query($sql);
if ($resql)
{
require_once DOL_DOCUMENT_ROOT.'/core/class/interfaces.class.php';
$interface = new Interfaces($this->db);
$result = $interface->run_triggers('DISCOUNT_UNLINK_INVOICE', $this, $user, $langs, $conf);
if ($result < 0)
{
$this->errors=$interface->errors;
return -1;
}

return 1;
}
else
Expand Down
5 changes: 3 additions & 2 deletions htdocs/core/class/html.formprojet.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -462,9 +462,10 @@ function selectTasks($socid=-1, $selected='', $htmlname='taskid', $maxlength=24,
* @param string $socid If of thirdparty to use as filter or 'id1,id2,...'
* @param string $morecss More CSS
* @param int $limitonstatus Add filters to limit length of list to opened status (for example to avoid ERR_RESPONSE_HEADERS_TOO_BIG on project/element.php page). TODO To implement
* @param string $projectkey Equivalent key to fk_projet for actual table_element
* @return int|string The HTML select list of element or '' if nothing or -1 if KO
*/
function select_element($table_element, $socid=0, $morecss='', $limitonstatus=-2)
function select_element($table_element, $socid=0, $morecss='', $limitonstatus=-2,$projectkey="fk_projet")
{
global $conf, $langs;

Expand All @@ -474,7 +475,7 @@ function select_element($table_element, $socid=0, $morecss='', $limitonstatus=-2
if (! in_array($table_element, array('don','expensereport_det','expensereport','loan','stock_mouvement','chargesociales'))) $linkedtothirdparty=true;

$sqlfilter='';
$projectkey="fk_projet";

//print $table_element;
switch ($table_element)
{
Expand Down
11 changes: 6 additions & 5 deletions htdocs/core/lib/company.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,6 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
$user->fetch_clicktodial(); // lecture des infos de clicktodial du user
}


$contactstatic = new Contact($db);

$extralabels=$extrafields->fetch_name_optionals_label($contactstatic->table_element);
Expand All @@ -802,7 +801,6 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
'address' =>array('type'=>'varchar(128)', 'label'=>'Address', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>30),
'statut' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'default'=>0, 'index'=>1, 'position'=>40, 'arrayofkeyval'=>array(0=>$contactstatic->LibStatut(0,1), 1=>$contactstatic->LibStatut(1,1))),
);

// Definition of fields for list
$arrayfields=array(
't.rowid'=>array('label'=>"TechnicalID", 'checked'=>($conf->global->MAIN_SHOW_TECHNICAL_ID?1:0), 'enabled'=>($conf->global->MAIN_SHOW_TECHNICAL_ID?1:0), 'position'=>1),
Expand Down Expand Up @@ -868,7 +866,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')

$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
//if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1);
$selectedfields.=$form->showCheckAddButtons('checkforselect', 1);

print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
print "\n".'<table class="tagtable liste">'."\n";
Expand Down Expand Up @@ -948,6 +946,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
$reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"],'','','','align="center"',$sortfield,$sortorder,'maxwidthsearch ')."\n";

print '</tr>'."\n";

$i = -1;
Expand Down Expand Up @@ -1049,14 +1048,16 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
print '</a> &nbsp; ';
}

// Edit
// Edit & massaction checkbox
if ($user->rights->societe->contact->creer)
{
print '<a href="'.DOL_URL_ROOT.'/contact/card.php?action=edit&id='.$obj->rowid.'&backtopage='.urlencode($backtopage).'">';
print img_edit();
print '</a>';

print '<input id="'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected?' checked="checked"':'').' style="margin-left:13px;margin-right:9px;"></td>';
}

print '</td>';

print "</tr>\n";
Expand Down
16 changes: 3 additions & 13 deletions htdocs/core/modules/commande/doc/pdf_einstein.modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -308,18 +308,14 @@ function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hid

$tab_top = 90+$top_shift;
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42+$top_shift:10);
$tab_height = 130-$top_shift;
$tab_height_newpage = 150;
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $tab_height_newpage -= $top_shift;

// Incoterm
$height_incoterms = 0;
if ($conf->incoterm->enabled)
{
$desc_incoterms = $object->getIncotermsForPDF();
if ($desc_incoterms)
{
$tab_top = 88+$top_shift;
$tab_top -= 2;

$pdf->SetFont('','', $default_font_size - 1);
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($desc_incoterms), 0, 1);
Expand All @@ -331,7 +327,6 @@ function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hid
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1);

$tab_top = $nexY+6;
$height_incoterms += 4;
}
}

Expand All @@ -354,24 +349,19 @@ function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hid
complete_substitutions_array($substitutionarray, $outputlangs, $object);
$notetoshow = make_substitutions($notetoshow, $substitutionarray, $outputlangs);

$tab_top = 88 + $top_shift + $height_incoterms;
$tab_top -= 2;

$pdf->SetFont('','', $default_font_size - 1);
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1);
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($notetoshow), 0, 1);
$nexY = $pdf->GetY();
$height_note=$nexY-$tab_top;

// Rect prend une longueur en 3eme param
$pdf->SetDrawColor(192,192,192);
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1);

$tab_height = $tab_height - $height_note;
$tab_top = $nexY+6;
}
else
{
$height_note=0;
}

$iniY = $tab_top + 7;
$curY = $tab_top + 7;
Expand Down
11 changes: 2 additions & 9 deletions htdocs/core/modules/contract/doc/pdf_strato.modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,30 +215,23 @@ function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hid

$tab_top = 90;
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10);
$tab_height = 130;
$tab_height_newpage = 150;

// Affiche notes
if (! empty($object->note_public))
{
$tab_top = 88;
$tab_top -= 2;

$pdf->SetFont('','', $default_font_size - 1);
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($object->note_public), 0, 1);
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($object->note_public), 0, 1);
$nexY = $pdf->GetY();
$height_note=$nexY-$tab_top;

// Rect prend une longueur en 3eme param
$pdf->SetDrawColor(192,192,192);
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1);

$tab_height = $tab_height - $height_note;
$tab_top = $nexY+6;
}
else
{
$height_note=0;
}

$iniY = $tab_top + 7;
$curY = $tab_top + 7;
Expand Down
Loading

0 comments on commit 8964b86

Please sign in to comment.