Skip to content

Commit

Permalink
Merge branch '4.0' of git@github.com:Dolibarr/dolibarr.git into 5.0
Browse files Browse the repository at this point in the history
Conflicts:
	htdocs/compta/facture/list.php
	htdocs/holiday/card.php
  • Loading branch information
eldy committed Jul 7, 2017
2 parents c6fc731 + fd5f992 commit b7af0cc
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 68 deletions.
71 changes: 36 additions & 35 deletions htdocs/compta/facture/list.php
Expand Up @@ -206,7 +206,7 @@
$search_state="";
$search_type='';
$search_country='';
$search_type_thirdparty='';
$search_type_thirdparty='';
$day='';
$year='';
$month='';
Expand All @@ -229,7 +229,7 @@
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
}



/*
* View
Expand All @@ -255,7 +255,7 @@
$sql.= " state.code_departement as state_code, state.nom as state_name";
// We need dynamount_payed to be able to sort on status (value is surely wrong because we can count several lines several times due to other left join or link with contacts. But what we need is just 0 or > 0)
// TODO Better solution to be able to sort on already payed or remain to pay is to store amount_payed in a denormalized field.
if (! $sall) $sql.= ', SUM(pf.amount) as dynamount_payed';
if (! $sall) $sql.= ', SUM(pf.amount) as dynamount_payed';
// Add fields from extrafields
foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : '');
// Add fields from hooks
Expand Down Expand Up @@ -462,7 +462,7 @@
'presend'=>$langs->trans("SendByMail"),
'builddoc'=>$langs->trans("PDFMerge")
);
if ($user->rights->facture->supprimer)
if ($user->rights->facture->supprimer)
{
//if (! empty($conf->global->STOCK_CALCULATE_ON_BILL) || empty($conf->global->INVOICE_CAN_ALWAYS_BE_REMOVED))
if (empty($conf->global->INVOICE_CAN_ALWAYS_BE_REMOVED))
Expand All @@ -479,6 +479,7 @@

$i = 0;
print '<form method="POST" name="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";

if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
Expand All @@ -492,8 +493,8 @@
if ($massaction == 'presend')
{
$langs->load("mails");
if (! GETPOST('cancel'))

if (! GETPOST('cancel'))
{
$objecttmp=new Facture($db);
$listofselectedid=array();
Expand All @@ -502,7 +503,7 @@
foreach($arrayofselected as $toselectid)
{
$result=$objecttmp->fetch($toselectid);
if ($result > 0)
if ($result > 0)
{
$listofselectedid[$toselectid]=$toselectid;
$thirdpartyid=$objecttmp->fk_soc?$objecttmp->fk_soc:$objecttmp->socid;
Expand All @@ -513,10 +514,10 @@
}

print '<input type="hidden" name="massaction" value="confirm_presend">';

include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$formmail = new FormMail($db);

dol_fiche_head(null, '', '');

$topicmail="SendBillRef";
Expand Down Expand Up @@ -584,16 +585,16 @@
//$formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id;

print $formmail->get_form();

dol_fiche_end();
}

if ($sall)
{
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall);
}

// If the user can view prospects other than his'
$moreforfilter='';
if ($user->rights->societe->client->voir || $socid)
Expand Down Expand Up @@ -683,14 +684,14 @@
// Filters lines
print '<tr class="liste_titre">';
// Ref
if (! empty($arrayfields['f.facnumber']['checked']))
if (! empty($arrayfields['f.facnumber']['checked']))
{
print '<td class="liste_titre" align="left">';
print '<input class="flat" size="6" type="text" name="search_ref" value="'.$search_ref.'">';
print '</td>';
}
// Ref customer
if (! empty($arrayfields['f.ref_client']['checked']))
if (! empty($arrayfields['f.ref_client']['checked']))
{
print '<td class="liste_titre">';
print '<input class="flat" size="6" type="text" name="search_refcustomer" value="'.$search_refcustomer.'">';
Expand All @@ -711,7 +712,7 @@
print '</td>';
}
// Date invoice
if (! empty($arrayfields['f.date']['checked']))
if (! empty($arrayfields['f.date']['checked']))
{
print '<td class="liste_titre" align="center">';
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="day" value="'.$day.'">';
Expand All @@ -720,7 +721,7 @@
print '</td>';
}
// Date due
if (! empty($arrayfields['f.date_lim_reglement']['checked']))
if (! empty($arrayfields['f.date_lim_reglement']['checked']))
{
print '<td class="liste_titre" align="center">';
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="day_lim" value="'.$day_lim.'">';
Expand All @@ -730,7 +731,7 @@
print '</td>';
}
// Thirpdarty
if (! empty($arrayfields['s.nom']['checked']))
if (! empty($arrayfields['s.nom']['checked']))
{
print '<td class="liste_titre" align="left"><input class="flat" type="text" size="6" name="search_societe" value="'.$search_societe.'"></td>';
}
Expand Down Expand Up @@ -760,7 +761,7 @@
print '</td>';
}
// Payment mode
if (! empty($arrayfields['f.fk_mode_reglement']['checked']))
if (! empty($arrayfields['f.fk_mode_reglement']['checked']))
{
print '<td class="liste_titre" align="left">';
$form->select_types_paiements($search_paymentmode, 'search_paymentmode', '', 0, 0, 1, 10);
Expand Down Expand Up @@ -875,19 +876,19 @@
$totaldeposits = $facturestatic->getSumDepositsUsed();
$totalpay = $paiement + $totalcreditnotes + $totaldeposits;
$remaintopay = $obj->total_ttc - $totalpay;

print '<tr '.$bc[$var].'>';
if (! empty($arrayfields['f.facnumber']['checked']))
{
print '<td class="nowrap">';

print '<table class="nobordernopadding"><tr class="nocellnopadd">';

print '<td class="nobordernopadding nowrap">';
print $facturestatic->getNomUrl(1,'',200,0,'',0,1);
print $obj->increment;
print '</td>';

print '<td style="min-width: 20px" class="nobordernopadding nowrap">';
$filename=dol_sanitizeFileName($obj->facnumber);
$filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($obj->facnumber);
Expand All @@ -896,7 +897,7 @@
print '</td>';
print '</tr>';
print '</table>';

print "</td>\n";
if (! $i) $totalarray['nbfield']++;
}
Expand Down Expand Up @@ -1085,12 +1086,12 @@
// Status
if (! empty($arrayfields['f.fk_statut']['checked']))
{
print '<td align="right" class="nowrap">';
print $facturestatic->LibStatut($obj->paye,$obj->fk_statut,5,$paiement,$obj->type);
print "</td>";
if (! $i) $totalarray['nbfield']++;
print '<td align="right" class="nowrap">';
print $facturestatic->LibStatut($obj->paye,$obj->fk_statut,5,$paiement,$obj->type);
print "</td>";
if (! $i) $totalarray['nbfield']++;
}

// Action column
print '<td class="nowrap" align="center">';
if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
Expand All @@ -1101,7 +1102,7 @@
}
print '</td>' ;
if (! $i) $totalarray['nbfield']++;

print "</tr>\n";

$i++;
Expand All @@ -1128,33 +1129,33 @@
else print '<td></td>';
}
print '</tr>';

}
}

$db->free($resql);

$parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql);
$reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;

print "</table>\n";
print "</div>";

print "</form>\n";

if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files)
{
/*
* Show list of available documents
*/
$urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
$urlsource.=str_replace('&amp;','&',$param);

$filedir=$diroutputmassaction;
$genallowed=$user->rights->facture->lire;
$delallowed=$user->rights->facture->lire;

print $formfile->showdocuments('massfilesarea_invoices','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'');
}
else
Expand Down

0 comments on commit b7af0cc

Please sign in to comment.