Merge branch 'develop' of https://github.com/dolibarr/dolibarr into develop

This commit is contained in:
Laurent Destailleur 2019-10-31 02:36:31 +01:00
commit b296f62671
306 changed files with 6246 additions and 6161 deletions

View File

@ -65,21 +65,33 @@ $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."product"; $productsid = array();
$resql=$db->query($sql); $resql=$db->query($sql);
if ($resql) { if ($resql) {
$num = $db->num_rows($resql); $i = 0; $num = $db->num_rows($resql); $i = 0;
while ($i < $num) { $row = $db->fetch_row($resql); $productsid[$i] = $row[0]; $i++; } while ($i < $num) {
$row = $db->fetch_row($resql);
$productsid[$i] = $row[0];
$i++;
}
} }
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe"; $societesid = array(); $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe"; $societesid = array();
$resql=$db->query($sql); $resql=$db->query($sql);
if ($resql) { if ($resql) {
$num = $db->num_rows($resql); $i = 0; $num = $db->num_rows($resql); $i = 0;
while ($i < $num) { $row = $db->fetch_row($resql); $societesid[$i] = $row[0]; $i++; } while ($i < $num) {
$row = $db->fetch_row($resql);
$societesid[$i] = $row[0];
$i++;
}
} else { print "err"; } } else { print "err"; }
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."commande"; $commandesid = array(); $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."commande"; $commandesid = array();
$resql=$db->query($sql); $resql=$db->query($sql);
if ($resql) { if ($resql) {
$num = $db->num_rows($resql); $i = 0; $num = $db->num_rows($resql); $i = 0;
while ($i < $num) { $row = $db->fetch_row($resql); $commandesid[$i] = $row[0]; $i++; } while ($i < $num) {
$row = $db->fetch_row($resql);
$commandesid[$i] = $row[0];
$i++;
}
} else { print "err"; } } else { print "err"; }

View File

@ -186,7 +186,7 @@
<!-- Check indent are done with spaces and with correct number --> <!-- Check indent are done with spaces and with correct number -->
<!-- Disabled as this does not support tab --> <!-- Disabled as this does not support tab -->
<!-- <rule ref="Generic.WhiteSpace.ScopeIndent" /> --> <!-- <rule ref="Generic.WhiteSpace.ScopeIndent" /> -->
<!-- TODO Enable this
<arg name="tab-width" value="4"/> <arg name="tab-width" value="4"/>
<rule ref="Generic.WhiteSpace.ScopeIndent"> <rule ref="Generic.WhiteSpace.ScopeIndent">
<properties> <properties>
@ -194,7 +194,7 @@
<property name="tabIndent" value="true"/> <property name="tabIndent" value="true"/>
</properties> </properties>
</rule> </rule>
-->
<rule ref="Squiz.WhiteSpace.ScopeClosingBrace.Indent" /> <rule ref="Squiz.WhiteSpace.ScopeClosingBrace.Indent" />

View File

@ -178,7 +178,7 @@ if (! empty($conf->global->MEMBER_ENABLE_PUBLIC))
$listofval = array(-1 => $langs->trans("Undefined")); $listofval = array(-1 => $langs->trans("Undefined"));
$listofval += $adht->liste_array(); $listofval += $adht->liste_array();
$forcetype = $conf->global->MEMBER_NEWFORM_FORCETYPE ?: -1; $forcetype = $conf->global->MEMBER_NEWFORM_FORCETYPE ?: -1;
print $form->selectarray("MEMBER_NEWFORM_FORCETYPE", $listofval, $forcetype, count($listetype)>1?1:0); print $form->selectarray("MEMBER_NEWFORM_FORCETYPE", $listofval, $forcetype, count($listofval)>1?1:0);
print "</td></tr>\n"; print "</td></tr>\n";
// Amount // Amount

View File

@ -2180,6 +2180,10 @@ class Adherent extends CommonObject
global $langs; global $langs;
$langs->load("members"); $langs->load("members");
$statusType = '';
$labelstatut = '';
$labelstatutShort = '';
if ($statut == -1) if ($statut == -1)
{ {
$statusType = 'status0'; $statusType = 'status0';

View File

@ -140,6 +140,7 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele
{ {
print '<form method="post" action="'.DOL_URL_ROOT.'/core/search.php">'; print '<form method="post" action="'.DOL_URL_ROOT.'/core/search.php">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder nohover centpercent">'; print '<table class="noborder nohover centpercent">';
$i=0; $i=0;
foreach($listofsearchfields as $key => $value) foreach($listofsearchfields as $key => $value)
@ -152,6 +153,7 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele
$i++; $i++;
} }
print '</table>'; print '</table>';
print '</div>';
print '</form>'; print '</form>';
print '<br>'; print '<br>';
} }

View File

@ -70,7 +70,7 @@ function printBookmarksList()
$ret.= '<select name="bookmark" id="boxbookmark" class="flat boxcombo vmenusearchselectcombo" alt="Bookmarks">'; $ret.= '<select name="bookmark" id="boxbookmark" class="flat boxcombo vmenusearchselectcombo" alt="Bookmarks">';
$ret.= '<option hidden value="listbookmarks" class="optiongrey" selected rel="'.DOL_URL_ROOT.'/bookmarks/list.php">'.$langs->trans('Bookmarks').'</option>'; $ret.= '<option hidden value="listbookmarks" class="optiongrey" selected rel="'.DOL_URL_ROOT.'/bookmarks/list.php">'.$langs->trans('Bookmarks').'</option>';
$ret.= '<option value="listbookmark" class="optionblue" rel="'.dol_escape_htmltag(DOL_URL_ROOT.'/bookmarks/list.php').'" '; $ret.= '<option value="listbookmark" class="optionblue" rel="'.dol_escape_htmltag(DOL_URL_ROOT.'/bookmarks/list.php').'" ';
$ret.= ' data-html="'.dol_escape_htmltag('<span class="fa fa-star-o"></span> '.dol_escape_htmltag($user->rights->bookmark->creer ? $langs->trans('EditBookmarks') : $langs->trans('ListOfBookmarks')).'...').'">'; $ret.= ' data-html="'.dol_escape_htmltag('<span class="fas fa-star"></span> '.dol_escape_htmltag($user->rights->bookmark->creer ? $langs->trans('EditBookmarks') : $langs->trans('ListOfBookmarks')).'...').'">';
$ret.= dol_escape_htmltag($user->rights->bookmark->creer ? $langs->trans('EditBookmarks') : $langs->trans('ListOfBookmarks')).'...</option>'; $ret.= dol_escape_htmltag($user->rights->bookmark->creer ? $langs->trans('EditBookmarks') : $langs->trans('ListOfBookmarks')).'...</option>';
// Url to go on create new bookmark page // Url to go on create new bookmark page
if (! empty($user->rights->bookmark->creer)) if (! empty($user->rights->bookmark->creer))
@ -78,7 +78,7 @@ function printBookmarksList()
//$urltoadd=DOL_URL_ROOT.'/bookmarks/card.php?action=create&amp;urlsource='.urlencode($url).'&amp;url='.urlencode($url); //$urltoadd=DOL_URL_ROOT.'/bookmarks/card.php?action=create&amp;urlsource='.urlencode($url).'&amp;url='.urlencode($url);
$urltoadd=DOL_URL_ROOT.'/bookmarks/card.php?action=create&amp;url='.urlencode($url); $urltoadd=DOL_URL_ROOT.'/bookmarks/card.php?action=create&amp;url='.urlencode($url);
$ret.= '<option value="newbookmark" class="optionblue" rel="'.dol_escape_htmltag($urltoadd).'"'; $ret.= '<option value="newbookmark" class="optionblue" rel="'.dol_escape_htmltag($urltoadd).'"';
$ret.= ' data-html="'.dol_escape_htmltag('<span class="fa fa-star-o"></span> '.$langs->trans('AddThisPageToBookmarks').'...').'">'.dol_escape_htmltag($langs->trans('AddThisPageToBookmarks').'...').'</option>'; $ret.= ' data-html="'.dol_escape_htmltag('<span class="fas fa-star"></span> '.$langs->trans('AddThisPageToBookmarks').'...').'">'.dol_escape_htmltag($langs->trans('AddThisPageToBookmarks').'...').'</option>';
} }
// Menu with all bookmarks // Menu with all bookmarks
if (! empty($conf->global->BOOKMARKS_SHOW_IN_MENU)) if (! empty($conf->global->BOOKMARKS_SHOW_IN_MENU))
@ -201,7 +201,7 @@ function printDropdownBookmarksList()
//$urltoadd=DOL_URL_ROOT.'/bookmarks/card.php?action=create&amp;urlsource='.urlencode($url).'&amp;url='.urlencode($url); //$urltoadd=DOL_URL_ROOT.'/bookmarks/card.php?action=create&amp;urlsource='.urlencode($url).'&amp;url='.urlencode($url);
$urltoadd=DOL_URL_ROOT.'/bookmarks/card.php?action=create&amp;url='.urlencode($url); $urltoadd=DOL_URL_ROOT.'/bookmarks/card.php?action=create&amp;url='.urlencode($url);
$newbtn.= '<a class="top-menu-dropdown-link" title="'.$langs->trans('AddThisPageToBookmarks').'" href="'.dol_escape_htmltag($urltoadd).'" >'; $newbtn.= '<a class="top-menu-dropdown-link" title="'.$langs->trans('AddThisPageToBookmarks').'" href="'.dol_escape_htmltag($urltoadd).'" >';
$newbtn.= '<span class="fa fa-star-o"></span> '.dol_escape_htmltag($langs->trans('AddThisPageToBookmarks')).'</a>'; $newbtn.= '<span class="fas fa-star"></span> '.dol_escape_htmltag($langs->trans('AddThisPageToBookmarks')).'</a>';
} }

View File

@ -56,30 +56,33 @@ $langs->loadLangs(array("main","bills","cashdesk"));
</td> </td>
<td class="select_design maxwidthonsmartphone"> <td class="select_design maxwidthonsmartphone">
<select id="selProduit" class="maxwidthonsmartphone" name="selProduit" onchange="javascript: setSource('LISTE');"> <select id="selProduit" class="maxwidthonsmartphone" name="selProduit" onchange="javascript: setSource('LISTE');">
<?php <?php
print '<option value="0">'.$top_liste_produits.'</option>'."\n"; print '<option value="0">'.$top_liste_produits.'</option>'."\n";
$id = $obj_facturation->id(); $id = $obj_facturation->id();
// Si trop d'articles ont ete trouves, on n'affiche que les X premiers (defini dans le fichier de configuration) ... // Si trop d'articles ont ete trouves, on n'affiche que les X premiers (defini dans le fichier de configuration) ...
$nbtoshow = $nbr_enreg; $nbtoshow = $nbr_enreg;
if (! empty($conf_taille_listes) && $nbtoshow > $conf_taille_listes) $nbtoshow = $conf_taille_listes; if (! empty($conf_taille_listes) && $nbtoshow > $conf_taille_listes) $nbtoshow = $conf_taille_listes;
for ($i = 0; $i < $nbtoshow; $i++) for ($i = 0; $i < $nbtoshow; $i++)
{ {
if ( $id == $tab_designations[$i]['rowid'] ) if ($id == $tab_designations[$i]['rowid']) {
$selected = 'selected'; $selected = 'selected';
else } else {
$selected = ''; $selected = '';
}
$label = $tab_designations[$i]['label']; $label = $tab_designations[$i]['label'];
print '<option '.$selected.' value="'.$tab_designations[$i]['rowid'].'">'.dol_trunc($tab_designations[$i]['ref'], 16).' - '.dol_trunc($label, 35, 'middle'); print '<option '.$selected.' value="'.$tab_designations[$i]['rowid'].'">'.dol_trunc($tab_designations[$i]['ref'], 16).' - '.dol_trunc($label, 35, 'middle');
if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot) && $tab_designations[$i]['fk_product_type']==0) print ' ('.$langs->trans("CashDeskStock").': '.(empty($tab_designations[$i]['reel'])?0:$tab_designations[$i]['reel']).')'; if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot) && $tab_designations[$i]['fk_product_type']==0) {
print '</option>'."\n"; print ' ('.$langs->trans("CashDeskStock").': '.(empty($tab_designations[$i]['reel'])?0:$tab_designations[$i]['reel']).')';
} }
?> print '</option>'."\n";
}
?>
</select> </select>
</td> </td>
</tr> </tr>

View File

@ -36,16 +36,16 @@ $langs->loadLangs(array("main","bills","banks"));
<tr><td class="resume_label"><?php echo $langs->trans("Invoice"); ?></td><td><?php echo $obj_facturation->numInvoice(); ?></td></tr> <tr><td class="resume_label"><?php echo $langs->trans("Invoice"); ?></td><td><?php echo $obj_facturation->numInvoice(); ?></td></tr>
<tr><td class="resume_label"><?php echo $langs->trans("TotalHT"); ?></td><td><?php echo price(price2num($obj_facturation->prixTotalHt(), 'MT'), 0, $langs, 0, 0, -1, $conf->currency); ?></td></tr> <tr><td class="resume_label"><?php echo $langs->trans("TotalHT"); ?></td><td><?php echo price(price2num($obj_facturation->prixTotalHt(), 'MT'), 0, $langs, 0, 0, -1, $conf->currency); ?></td></tr>
<?php <?php
// Affichage de la tva par taux // Affichage de la tva par taux
if ( $obj_facturation->montantTva() ) { if ( $obj_facturation->montantTva() ) {
echo ('<tr><td class="resume_label">'.$langs->trans("VAT").'</td><td>'.price(price2num($obj_facturation->montantTva(), 'MT'), 0, $langs, 0, 0, -1, $conf->currency).'</td></tr>'); echo ('<tr><td class="resume_label">'.$langs->trans("VAT").'</td><td>'.price(price2num($obj_facturation->montantTva(), 'MT'), 0, $langs, 0, 0, -1, $conf->currency).'</td></tr>');
} }
else else
{ {
echo ('<tr><td class="resume_label">'.$langs->trans("VAT").'</td><td>'.$langs->trans("NoVAT").'</td></tr>'); echo ('<tr><td class="resume_label">'.$langs->trans("VAT").'</td><td>'.$langs->trans("NoVAT").'</td></tr>');
} }
?> ?>
<tr><td class="resume_label"><?php echo $langs->trans("TotalTTC"); ?> </td><td><?php echo price(price2num($obj_facturation->prixTotalTtc(), 'MT'), 0, $langs, 0, 0, -1, $conf->currency); ?></td></tr> <tr><td class="resume_label"><?php echo $langs->trans("TotalTTC"); ?> </td><td><?php echo price(price2num($obj_facturation->prixTotalTtc(), 'MT'), 0, $langs, 0, 0, -1, $conf->currency); ?></td></tr>
<tr><td class="resume_label"><?php echo $langs->trans("PaymentMode"); ?> </td><td> <tr><td class="resume_label"><?php echo $langs->trans("PaymentMode"); ?> </td><td>
<?php <?php
@ -82,20 +82,20 @@ $langs->loadLangs(array("main","bills","banks"));
?> ?>
</td></tr> </td></tr>
<?php <?php
// Affichage des infos en fonction du mode de paiement // Affichage des infos en fonction du mode de paiement
if ( $obj_facturation->getsetPaymentMode() == 'DIF' ) { if ( $obj_facturation->getsetPaymentMode() == 'DIF' ) {
echo ('<tr><td class="resume_label">'.$langs->trans("DateDue").'</td><td>'.$obj_facturation->paiementLe().'</td></tr>'); echo ('<tr><td class="resume_label">'.$langs->trans("DateDue").'</td><td>'.$obj_facturation->paiementLe().'</td></tr>');
} else { } else {
echo ('<tr><td class="resume_label">'.$langs->trans("Received").'</td><td>'.price(price2num($obj_facturation->montantEncaisse(), 'MT'), 0, $langs, 0, 0, -1, $conf->currency).'</td></tr>'); echo ('<tr><td class="resume_label">'.$langs->trans("Received").'</td><td>'.price(price2num($obj_facturation->montantEncaisse(), 'MT'), 0, $langs, 0, 0, -1, $conf->currency).'</td></tr>');
} }
// Affichage du montant rendu (reglement en especes) // Affichage du montant rendu (reglement en especes)
if ( $obj_facturation->montantRendu() ) { if ( $obj_facturation->montantRendu() ) {
echo ('<tr><td class="resume_label">'.$langs->trans("Change").'</td><td>'.price(price2num($obj_facturation->montantRendu(), 'MT'), 0, $langs, 0, 0, -1, $conf->currency).'</td></tr>'); echo ('<tr><td class="resume_label">'.$langs->trans("Change").'</td><td>'.price(price2num($obj_facturation->montantRendu(), 'MT'), 0, $langs, 0, 0, -1, $conf->currency).'</td></tr>');
} }
?> ?>
</table> </table>

View File

@ -1582,8 +1582,9 @@ if ($id > 0)
if ($user->rights->agenda->allactions->create || if ($user->rights->agenda->allactions->create ||
(($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create)) (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create))
{ {
if ($action != 'classify') if ($action != 'classify') {
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; $morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
}
if ($action == 'classify') { if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';

View File

@ -1735,5 +1735,18 @@ function sort_events_by_date($a, $b)
} }
// If both events have the same start time, longest first // If both events have the same start time, longest first
if(! is_numeric($b->datef))
{
// when event B have no end timestamp, event B should sort be before event A (All day events on top)
return 1;
}
if(! is_numeric($a->datef))
{
// when event A have no end timestamp , event A should sort be before event B (All day events on top)
return -1;
}
return $b->datef - $a->datef; return $b->datef - $a->datef;
} }

View File

@ -12,7 +12,7 @@
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es> * Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2016 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2016 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -1325,17 +1325,17 @@ if (empty($reshook))
$object->setProject(GETPOST('projectid', 'int')); $object->setProject(GETPOST('projectid', 'int'));
} }
// Delai de livraison // Delivery time
elseif ($action == 'setavailability' && $usercancreate) { elseif ($action == 'setavailability' && $usercancreate) {
$result = $object->set_availability($user, GETPOST('availability_id', 'int')); $result = $object->set_availability($user, GETPOST('availability_id', 'int'));
} }
// Origine de la propale // Origin of the commercial proposal
elseif ($action == 'setdemandreason' && $usercancreate) { elseif ($action == 'setdemandreason' && $usercancreate) {
$result = $object->set_demand_reason($user, GETPOST('demand_reason_id', 'int')); $result = $object->set_demand_reason($user, GETPOST('demand_reason_id', 'int'));
} }
// Conditions de reglement // Terms of payment
elseif ($action == 'setconditions' && $usercancreate) { elseif ($action == 'setconditions' && $usercancreate) {
$result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int')); $result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int'));
} }
@ -1348,7 +1348,7 @@ if (empty($reshook))
$result = $object->set_remise_absolue($user, $_POST['remise_absolue']); $result = $object->set_remise_absolue($user, $_POST['remise_absolue']);
} }
// Mode de reglement // Payment choice
elseif ($action == 'setmode' && $usercancreate) { elseif ($action == 'setmode' && $usercancreate) {
$result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int')); $result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int'));
} }
@ -1413,7 +1413,7 @@ if (empty($reshook))
} }
} }
// Bascule du statut d'un contact // Toggle the status of a contact
elseif ($action == 'swapstatut') { elseif ($action == 'swapstatut') {
if ($object->fetch($id) > 0) { if ($object->fetch($id) > 0) {
$result = $object->swapContactStatus(GETPOST('ligne')); $result = $object->swapContactStatus(GETPOST('ligne'));
@ -1422,7 +1422,7 @@ if (empty($reshook))
} }
} }
// Efface un contact // Delete a contact
elseif ($action == 'deletecontact') { elseif ($action == 'deletecontact') {
$object->fetch($id); $object->fetch($id);
$result = $object->delete_contact($lineid); $result = $object->delete_contact($lineid);
@ -1600,7 +1600,7 @@ if ($action == 'create')
$form->select_contacts($soc->id, $contactid, 'contactid', 1, $srccontactslist); $form->select_contacts($soc->id, $contactid, 'contactid', 1, $srccontactslist);
print '</td></tr>'; print '</td></tr>';
// Ligne info remises tiers // Third party discounts info line
print '<tr><td>' . $langs->trans('Discounts') . '</td><td>'; print '<tr><td>' . $langs->trans('Discounts') . '</td><td>';
$absolute_discount = $soc->getAvailableDiscounts(); $absolute_discount = $soc->getAvailableDiscounts();
@ -1787,7 +1787,7 @@ if ($action == 'create')
/* /*
* Combobox pour la fonction de copie * Combobox for copy function
*/ */
if (empty($conf->global->PROPAL_CLONE_ON_CREATE_PAGE)) print '<input type="hidden" name="createmode" value="empty">'; if (empty($conf->global->PROPAL_CLONE_ON_CREATE_PAGE)) print '<input type="hidden" name="createmode" value="empty">';
@ -1884,7 +1884,7 @@ if ($action == 'create')
if (!empty($conf->global->PROPAL_CLONE_DATE_DELIVERY) && !empty($object->date_livraison)) { if (!empty($conf->global->PROPAL_CLONE_DATE_DELIVERY) && !empty($object->date_livraison)) {
$formquestion[] = array('type' => 'date','name' => 'date_delivery','label' => $langs->trans("DeliveryDate"),'value' => $object->date_livraison); $formquestion[] = array('type' => 'date','name' => 'date_delivery','label' => $langs->trans("DeliveryDate"),'value' => $object->date_livraison);
} }
// Paiement incomplet. On demande si motif = escompte ou autre // Incomplete payment. We ask if reason = discount or other
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ToClone'), $langs->trans('ConfirmClonePropal', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ToClone'), $langs->trans('ConfirmClonePropal', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
} }
@ -1927,7 +1927,7 @@ if ($action == 'create')
elseif ($action == 'validate') { elseif ($action == 'validate') {
$error = 0; $error = 0;
// We verifie whether the object is provisionally numbering // We verify whether the object is provisionally numbering
$ref = substr($object->ref, 1, 4); $ref = substr($object->ref, 1, 4);
if ($ref == 'PROV') { if ($ref == 'PROV') {
$numref = $object->getNextNumRef($soc); $numref = $object->getNextNumRef($soc);

View File

@ -170,9 +170,10 @@ if ($object->id > 0)
$morehtmlref.='<br>'.$langs->trans('Project') . ' '; $morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->propal->creer) if ($user->rights->propal->creer)
{ {
if ($action != 'classify') if ($action != 'classify') {
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>'; //$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>';
$morehtmlref.=' : '; $morehtmlref.=' : ';
}
if ($action == 'classify') { if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';

View File

@ -125,9 +125,10 @@ if ($object->id > 0)
$morehtmlref.='<br>'.$langs->trans('Project') . ' '; $morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->propal->creer) if ($user->rights->propal->creer)
{ {
if ($action != 'classify') if ($action != 'classify') {
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>'; //$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>';
$morehtmlref.=' : '; $morehtmlref.=' : ';
}
if ($action == 'classify') { if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';

View File

@ -86,9 +86,10 @@ if (! empty($conf->projet->enabled))
$morehtmlref.='<br>'.$langs->trans('Project') . ' '; $morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->propal->creer) if ($user->rights->propal->creer)
{ {
if ($action != 'classify') if ($action != 'classify') {
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>'; //$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>';
$morehtmlref.=' : '; $morehtmlref.=' : ';
}
if ($action == 'classify') { if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';

View File

@ -280,8 +280,9 @@ $sql.= ' u.login';
if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user"; if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user";
if ($search_categ_cus) $sql .= ", cc.fk_categorie, cc.fk_soc"; if ($search_categ_cus) $sql .= ", cc.fk_categorie, cc.fk_soc";
// Add fields from extrafields // Add fields from extrafields
if (! empty($extrafields->attributes[$object->table_element]['label'])) if (! empty($extrafields->attributes[$object->table_element]['label'])) {
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key : ''); foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key : '');
}
// Add fields from hooks // Add fields from hooks
$parameters=array(); $parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook

View File

@ -101,9 +101,10 @@ if ($id > 0 || ! empty($ref))
$morehtmlref.='<br>'.$langs->trans('Project') . ' '; $morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->propal->creer) if ($user->rights->propal->creer)
{ {
if ($action != 'classify') if ($action != 'classify') {
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>'; //$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>';
$morehtmlref.=' : '; $morehtmlref.=' : ';
}
if ($action == 'classify') { if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';

View File

@ -29,11 +29,8 @@ if (empty($conf) || ! is_object($conf)) {
exit; exit;
} }
?>
<!-- BEGIN PHP TEMPLATE --> print "<!-- BEGIN PHP TEMPLATE -->\n";
<?php
global $user; global $user;
@ -45,51 +42,46 @@ $langs->load("propal");
$linkedObjectBlock = dol_sort_array($linkedObjectBlock, 'date', 'desc', 0, 0, 1); $linkedObjectBlock = dol_sort_array($linkedObjectBlock, 'date', 'desc', 0, 0, 1);
$total=0; $ilink=0; $total=0;
$ilink=0;
foreach($linkedObjectBlock as $key => $objectlink) foreach($linkedObjectBlock as $key => $objectlink)
{ {
$ilink++; $ilink++;
$trclass='oddeven'; $trclass='oddeven';
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total'; if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total';
?> print '<tr class="'.$trclass.'" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" >';
<tr class="<?php echo $trclass; ?>" data-element="<?php echo $objectlink->element; ?>" data-id="<?php echo $objectlink->id; ?>" > print '<td class="linkedcol-element" >'.$langs->trans("Proposal");
<td class="linkedcol-element" ><?php echo $langs->trans("Proposal"); ?> if (!empty($showImportButton) && $conf->global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES)
<?php
if(!empty($showImportButton) && $conf->global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES)
{ {
$url = DOL_URL_ROOT.'/comm/propal/card.php?id='.$objectlink->id; $url = DOL_URL_ROOT.'/comm/propal/card.php?id='.$objectlink->id;
print '<a class="objectlinked_importbtn" href="'.$url.'&amp;action=selectlines" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" > <i class="fa fa-indent"></i> </a>'; print '<a class="objectlinked_importbtn" href="'.$url.'&amp;action=selectlines" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" > <i class="fa fa-indent"></i> </a>';
} }
?> print '</td>';
</td> print '<td class="linkedcol-name nowraponall" >'.$objectlink->getNomUrl(1).'</td>';
<td class="linkedcol-name nowraponall" ><?php echo $objectlink->getNomUrl(1); ?></td> print '<td class="linkedcol-ref" >'.$objectlink->ref_client.'</td>';
<td class="linkedcol-ref" ><?php echo $objectlink->ref_client; ?></td> print '<td class="linkedcol-date center">'.dol_print_date($objectlink->date, 'day').'</td>';
<td class="linkedcol-date center"><?php echo dol_print_date($objectlink->date, 'day'); ?></td> print '<td class="linkedcol-amount right">';
<td class="linkedcol-amount right"><?php
if ($user->rights->propale->lire) { if ($user->rights->propale->lire) {
$total = $total + $objectlink->total_ht; $total = $total + $objectlink->total_ht;
echo price($objectlink->total_ht); echo price($objectlink->total_ht);
} ?></td> }
<td class="linkedcol-statut right"><?php echo $objectlink->getLibStatut(3); ?></td> print '</td>';
<td class="linkedcol-action right"><a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key; ?>"><?php echo img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink'); ?></a></td> print '<td class="linkedcol-statut right">'.$objectlink->getLibStatut(3).'</td>';
</tr> print '<td class="linkedcol-action right"><a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key.'">'.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').'</a></td>';
<?php print "</tr>\n";
} }
if (count($linkedObjectBlock) > 1) if (count($linkedObjectBlock) > 1)
{ {
?> print '<tr class="liste_total '.(empty($noMoreLinkedObjectBlockAfter)?'liste_sub_total':'').'">';
<tr class="liste_total <?php echo (empty($noMoreLinkedObjectBlockAfter)?'liste_sub_total':''); ?>"> print '<td>'.$langs->trans("Total").'</td>';
<td><?php echo $langs->trans("Total"); ?></td> print '<td></td>';
<td></td> print '<td class="center"></td>';
<td class="center"></td> print '<td class="center"></td>';
<td class="center"></td> print '<td class="right">'.price($total).'</td>';
<td class="right"><?php echo price($total); ?></td> print '<td class="right"></td>';
<td class="right"></td> print '<td class="right"></td>';
<td class="right"></td> print "</tr>\n";
</tr>
<?php
} }
?>
<!-- END PHP TEMPLATE --> print "<!-- END PHP TEMPLATE -->\n";

View File

@ -306,7 +306,7 @@ else
$log="graph.php: min=".$min." max=".$max; $log="graph.php: min=".$min." max=".$max;
dol_syslog($log); dol_syslog($log);
// CRED PART // CRED PART
// Chargement du tableau des années // Chargement du tableau des années
$tblyear[0] = array(); $tblyear[0] = array();
$tblyear[1] = array(); $tblyear[1] = array();
@ -393,7 +393,7 @@ else
unset($tblyear[1]); unset($tblyear[1]);
unset($tblyear[2]); unset($tblyear[2]);
// DEDBT PART // DEDBT PART
// Chargement du tableau des années // Chargement du tableau des années
$tblyear[0] = array(); $tblyear[0] = array();
$tblyear[1] = array(); $tblyear[1] = array();

View File

@ -427,8 +427,9 @@ if ($id)
$morehtmlref.=$langs->trans('Project') . ' '; $morehtmlref.=$langs->trans('Project') . ' ';
if ($user->rights->banque->modifier) if ($user->rights->banque->modifier)
{ {
if ($action != 'classify') if ($action != 'classify') {
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; $morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
}
if ($action == 'classify') { if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';

View File

@ -92,8 +92,9 @@ if ($object->id)
$morehtmlref.=$langs->trans('Project') . ' : '; $morehtmlref.=$langs->trans('Project') . ' : ';
if ($user->rights->banque->modifier && 0) if ($user->rights->banque->modifier && 0)
{ {
if ($action != 'classify') if ($action != 'classify') {
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; $morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
}
if ($action == 'classify') { if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';

View File

@ -61,8 +61,9 @@ if (! empty($conf->projet->enabled))
$morehtmlref.=$langs->trans('Project') . ' : '; $morehtmlref.=$langs->trans('Project') . ' : ';
if ($user->rights->banque->modifier && 0) if ($user->rights->banque->modifier && 0)
{ {
if ($action != 'classify') if ($action != 'classify') {
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; $morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
}
if ($action == 'classify') { if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';

View File

@ -14,7 +14,7 @@
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr> * Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2014-2019 Ferran Marcet <fmarcet@2byte.es> * Copyright (C) 2014-2019 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2015-2016 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2015-2016 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -815,7 +815,9 @@ if (empty($reshook))
$sql .= " WHERE fk_facture = " . $object->id; $sql .= " WHERE fk_facture = " . $object->id;
$resql = $db->query($sql); $resql = $db->query($sql);
if (!empty($resql)) { if (!empty($resql)) {
while ($obj = $db->fetch_object($resql)) $total_creditnote_and_deposit += $obj->amount_ttc; while ($obj = $db->fetch_object($resql)) {
$total_creditnote_and_deposit += $obj->amount_ttc;
}
} else dol_print_error($db); } else dol_print_error($db);
$discount->amount_ht = $discount->amount_ttc = $total_paiements + $total_creditnote_and_deposit - $object->total_ttc; $discount->amount_ht = $discount->amount_ttc = $total_paiements + $total_creditnote_and_deposit - $object->total_ttc;
@ -3274,11 +3276,11 @@ if ($action == 'create')
print '<td colspan="2">'; print '<td colspan="2">';
include_once DOL_DOCUMENT_ROOT . '/core/modules/facture/modules_facture.php'; include_once DOL_DOCUMENT_ROOT . '/core/modules/facture/modules_facture.php';
$liste = ModelePDFFactures::liste_modeles($db); $liste = ModelePDFFactures::liste_modeles($db);
if(!empty($conf->global->INVOICE_USE_DEFAULT_DOCUMENT)){ // Hidden conf if(!empty($conf->global->INVOICE_USE_DEFAULT_DOCUMENT)){
// Hidden conf
$paramkey='FACTURE_ADDON_PDF_'.$object->type; $paramkey='FACTURE_ADDON_PDF_'.$object->type;
$curent = !empty($conf->global->$paramkey)?$conf->global->$paramkey:$conf->global->FACTURE_ADDON_PDF; $curent = !empty($conf->global->$paramkey)?$conf->global->$paramkey:$conf->global->FACTURE_ADDON_PDF;
} } else {
else{
$curent = $conf->global->FACTURE_ADDON_PDF; $curent = $conf->global->FACTURE_ADDON_PDF;
} }
print $form->selectarray('model', $liste, $curent); print $form->selectarray('model', $liste, $curent);
@ -3803,8 +3805,9 @@ elseif ($id > 0 || ! empty($ref))
$morehtmlref.='<br>'.$langs->trans('Project') . ' '; $morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($usercancreate) if ($usercancreate)
{ {
if ($action != 'classify') if ($action != 'classify') {
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; $morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
}
if ($action == 'classify') { if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';

View File

@ -529,8 +529,7 @@ class Invoices extends DolibarrApi
// update bank account // update bank account
if (!empty($this->invoice->fk_account)) if (!empty($this->invoice->fk_account))
{ {
if($this->invoice->setBankAccount($this->invoice->fk_account) == 0) if ($this->invoice->setBankAccount($this->invoice->fk_account) == 0) {
{
throw new RestException(400, $this->invoice->error); throw new RestException(400, $this->invoice->error);
} }
} }
@ -909,11 +908,11 @@ class Invoices extends DolibarrApi
$result = $this->invoice->fetch($id); $result = $this->invoice->fetch($id);
if( ! $result ) { if (! $result) {
throw new RestException(404, 'Invoice not found'); throw new RestException(404, 'Invoice not found');
} }
if( ! DolibarrApi::_checkAccessToResource('facture', $this->invoice->id)) { if (! DolibarrApi::_checkAccessToResource('facture', $this->invoice->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
} }

View File

@ -2587,10 +2587,12 @@ class Facture extends CommonInvoice
$next_invoice->brouillon = 1; $next_invoice->brouillon = 1;
foreach ($next_invoice->lines as $line) foreach ($next_invoice->lines as $line)
{ {
$result = $next_invoice->updateline($line->id, $line->desc, $line->subprice, $line->qty, $line->remise_percent, $result = $next_invoice->updateline(
$line->id, $line->desc, $line->subprice, $line->qty, $line->remise_percent,
$line->date_start, $line->date_end, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'HT', $line->info_bits, $line->product_type, $line->date_start, $line->date_end, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'HT', $line->info_bits, $line->product_type,
$line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent,
$line->fk_unit); $line->fk_unit
);
if ($result < 0) if ($result < 0)
{ {

View File

@ -163,9 +163,10 @@ if ($id > 0 || ! empty($ref))
$morehtmlref.='<br>'.$langs->trans('Project') . ' '; $morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->facture->creer) if ($user->rights->facture->creer)
{ {
if ($action != 'classify') if ($action != 'classify') {
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; //$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
$morehtmlref.=' : '; $morehtmlref.=' : ';
}
if ($action == 'classify') { if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';

View File

@ -1242,8 +1242,9 @@ else
$morehtmlref.='<br>'.$langs->trans('Project') . ' '; $morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->facture->creer) if ($user->rights->facture->creer)
{ {
if ($action != 'classify') if ($action != 'classify') {
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; $morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
}
if ($action == 'classify') { if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';

View File

@ -223,8 +223,9 @@ $sql.= " f.nb_gen_done, f.nb_gen_max, f.date_last_gen, f.date_when, f.suspended,
$sql.= " f.datec, f.tms,"; $sql.= " f.datec, f.tms,";
$sql.= " f.fk_cond_reglement, f.fk_mode_reglement"; $sql.= " f.fk_cond_reglement, f.fk_mode_reglement";
// Add fields from extrafields // Add fields from extrafields
if (! empty($extrafields->attributes[$object->table_element]['label'])) if (! empty($extrafields->attributes[$object->table_element]['label'])) {
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key : ''); foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key : '');
}
// Add fields from hooks // Add fields from hooks
$parameters=array(); $parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
@ -632,8 +633,7 @@ if ($resql)
$reshook=$hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint; print $hookmanager->resPrint;
// Status // Status
if (! empty($arrayfields['status']['checked'])) if (! empty($arrayfields['status']['checked'])) {
{
print '<td align="center">'; print '<td align="center">';
print $invoicerectmp->getLibStatut(3, 0); print $invoicerectmp->getLibStatut(3, 0);
print '</td>'; print '</td>';

View File

@ -400,8 +400,9 @@ $sql.= " p.rowid as project_id, p.ref as project_ref, p.title as project_label";
if (! $sall) $sql.= ', SUM(pf.amount) as dynamount_payed'; if (! $sall) $sql.= ', SUM(pf.amount) as dynamount_payed';
if ($search_categ_cus) $sql .= ", cc.fk_categorie, cc.fk_soc"; if ($search_categ_cus) $sql .= ", cc.fk_categorie, cc.fk_soc";
// Add fields from extrafields // Add fields from extrafields
if (! empty($extrafields->attributes[$object->table_element]['label'])) if (! empty($extrafields->attributes[$object->table_element]['label'])) {
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key : ''); foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key : '');
}
// Add fields from hooks // Add fields from hooks
$parameters=array(); $parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
@ -1352,8 +1353,7 @@ if ($resql)
|| isset($totalarray['totalttcfield']) || isset($totalarray['totalttcfield'])
|| isset($totalarray['totalamfield']) || isset($totalarray['totalamfield'])
|| isset($totalarray['totalrtpfield']) || isset($totalarray['totalrtpfield'])
) ) {
{
print '<tr class="liste_total">'; print '<tr class="liste_total">';
$i=0; $i=0;
while ($i < $totalarray['nbfield']) while ($i < $totalarray['nbfield'])

View File

@ -189,9 +189,10 @@ if ($object->id > 0)
$morehtmlref.='<br>'.$langs->trans('Project') . ' '; $morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->facture->creer) if ($user->rights->facture->creer)
{ {
if ($action != 'classify') if ($action != 'classify') {
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; //$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
$morehtmlref.=' : '; $morehtmlref.=' : ';
}
if ($action == 'classify') { if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';

View File

@ -233,48 +233,45 @@ foreach ($tmp_companies as $value) {
print '<div class="fichecenter"><div class="fichethirdleft">'; print '<div class="fichecenter"><div class="fichethirdleft">';
//if (empty($socid)) // Show filter box
//{ print '<form name="stats" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
// Show filter box print '<input type="hidden" name="mode" value="'.$mode.'">';
print '<form name="stats" method="POST" action="'.$_SERVER["PHP_SELF"].'">'; print '<table class="noborder" width="100%">';
print '<input type="hidden" name="mode" value="'.$mode.'">'; print '<tr class="liste_titre"><td class="liste_titre" colspan="2">'.$langs->trans("Filter").'</td></tr>';
print '<table class="noborder" width="100%">'; // Company
print '<tr class="liste_titre"><td class="liste_titre" colspan="2">'.$langs->trans("Filter").'</td></tr>'; print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
// Company if ($mode == 'customer') $filter='s.client in (1,2,3)';
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>'; if ($mode == 'supplier') $filter='s.fournisseur = 1';
if ($mode == 'customer') $filter='s.client in (1,2,3)'; print $form->selectarray('socid', $companies, $socid, 1, 0, 0, 'style="width: 95%"', 0, 0, 0, '', '', 1);
if ($mode == 'supplier') $filter='s.fournisseur = 1'; print '</td></tr>';
print $form->selectarray('socid', $companies, $socid, 1, 0, 0, 'style="width: 95%"', 0, 0, 0, '', '', 1); // User
print '</td></tr>'; print '<tr><td>'.$langs->trans("CreatedBy").'</td><td>';
// User print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
print '<tr><td>'.$langs->trans("CreatedBy").'</td><td>'; print '</td></tr>';
print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); // Status
print '</td></tr>'; print '<tr><td class="left">'.$langs->trans("Status").'</td><td class="left">';
// Status if ($mode == 'customer')
print '<tr><td class="left">'.$langs->trans("Status").'</td><td class="left">'; {
if ($mode == 'customer')
{
$liststatus=array('0'=>$langs->trans("BillStatusDraft"), '1'=>$langs->trans("BillStatusNotPaid"), '2'=>$langs->trans("BillStatusPaid"), '3'=>$langs->trans("BillStatusCanceled")); $liststatus=array('0'=>$langs->trans("BillStatusDraft"), '1'=>$langs->trans("BillStatusNotPaid"), '2'=>$langs->trans("BillStatusPaid"), '3'=>$langs->trans("BillStatusCanceled"));
print $form->selectarray('object_status', $liststatus, $object_status, 1); print $form->selectarray('object_status', $liststatus, $object_status, 1);
} }
if ($mode == 'supplier') if ($mode == 'supplier')
{ {
$liststatus=array('0'=>$langs->trans("BillStatusDraft"),'1'=>$langs->trans("BillStatusNotPaid"), '2'=>$langs->trans("BillStatusPaid")); $liststatus=array('0'=>$langs->trans("BillStatusDraft"),'1'=>$langs->trans("BillStatusNotPaid"), '2'=>$langs->trans("BillStatusPaid"));
print $form->selectarray('object_status', $liststatus, $object_status, 1); print $form->selectarray('object_status', $liststatus, $object_status, 1);
} }
print '</td></tr>'; print '</td></tr>';
// Year // Year
print '<tr><td>'.$langs->trans("Year").'</td><td>'; print '<tr><td>'.$langs->trans("Year").'</td><td>';
if (! in_array($year, $arrayyears)) $arrayyears[$year]=$year; if (! in_array($year, $arrayyears)) $arrayyears[$year]=$year;
if (! in_array($nowyear, $arrayyears)) $arrayyears[$nowyear]=$nowyear; if (! in_array($nowyear, $arrayyears)) $arrayyears[$nowyear]=$nowyear;
arsort($arrayyears); arsort($arrayyears);
print $form->selectarray('year', $arrayyears, $year, 0); print $form->selectarray('year', $arrayyears, $year, 0);
print '</td></tr>'; print '</td></tr>';
print '<tr><td align="center" colspan="2"><input type="submit" name="submit" class="button" value="'.$langs->trans("Refresh").'"></td></tr>'; print '<tr><td align="center" colspan="2"><input type="submit" name="submit" class="button" value="'.$langs->trans("Refresh").'"></td></tr>';
print '</table>'; print '</table>';
print '</form>'; print '</form>';
print '<br><br>'; print '<br><br>';
//}
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';

View File

@ -24,11 +24,7 @@ if (empty($conf) || ! is_object($conf))
exit; exit;
} }
?> print "<!-- BEGIN PHP TEMPLATE -->\n";
<!-- BEGIN PHP TEMPLATE -->
<?php
global $user; global $user;
global $noMoreLinkedObjectBlockAfter; global $noMoreLinkedObjectBlockAfter;
@ -40,16 +36,16 @@ $langs->load("bills");
$linkedObjectBlock = dol_sort_array($linkedObjectBlock, 'date', 'desc', 0, 0, 1); $linkedObjectBlock = dol_sort_array($linkedObjectBlock, 'date', 'desc', 0, 0, 1);
$total=0; $ilink=0; $total=0;
$ilink=0;
foreach($linkedObjectBlock as $key => $objectlink) foreach($linkedObjectBlock as $key => $objectlink)
{ {
$ilink++; $ilink++;
$trclass='oddeven'; $trclass='oddeven';
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total'; if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total';
?> print '<tr class="'.$trclass.'" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" >';
<tr class="<?php echo $trclass; ?>" data-element="<?php echo $objectlink->element; ?>" data-id="<?php echo $objectlink->id; ?>" > print '<td class="linkedcol-element">';
<td class="linkedcol-element"><?php
switch ($objectlink->type) { switch ($objectlink->type) {
case Facture::TYPE_REPLACEMENT: case Facture::TYPE_REPLACEMENT:
echo $langs->trans("InvoiceReplacement"); echo $langs->trans("InvoiceReplacement");
@ -70,16 +66,16 @@ foreach($linkedObjectBlock as $key => $objectlink)
echo $langs->trans("CustomerInvoice"); echo $langs->trans("CustomerInvoice");
break; break;
} }
?></td> print '</td>';
<td class="linkedcol-name nowraponall"><?php echo $objectlink->getNomUrl(1); ?></td> print '<td class="linkedcol-name nowraponall">'.$objectlink->getNomUrl(1).'</td>';
<td class="linkedcol-ref left"><?php echo $objectlink->ref_client; ?></td> print '<td class="linkedcol-ref left">'.$objectlink->ref_client.'</td>';
<td class="linkedcol-date center"><?php echo dol_print_date($objectlink->date, 'day'); ?></td> print '<td class="linkedcol-date center">'.dol_print_date($objectlink->date, 'day').'</td>';
<td class="linkedcol-amount right"><?php print '<td class="linkedcol-amount right">';
if ($user->rights->facture->lire) { if ($user->rights->facture->lire) {
$sign = 1; $sign = 1;
if ($object->type == Facture::TYPE_CREDIT_NOTE) $sign = -1; if ($object->type == Facture::TYPE_CREDIT_NOTE) $sign = -1;
if ($objectlink->statut != 3) // If not abandonned if ($objectlink->statut != 3) {
{ // If not abandonned
$total = $total + $sign * $objectlink->total_ht; $total = $total + $sign * $objectlink->total_ht;
echo price($objectlink->total_ht); echo price($objectlink->total_ht);
} }
@ -87,26 +83,23 @@ foreach($linkedObjectBlock as $key => $objectlink)
{ {
echo '<strike>'.price($objectlink->total_ht).'</strike>'; echo '<strike>'.price($objectlink->total_ht).'</strike>';
} }
} ?></td> }
<td class="linkedcol-statut right"><?php echo $objectlink->getLibStatut(3); ?></td> print '</td>';
<td class="linkedcol-action right"><a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key; ?>"><?php echo img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink'); ?></a></td> print '<td class="linkedcol-statut right">'.$objectlink->getLibStatut(3).'</td>';
</tr> print '<td class="linkedcol-action right"><a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key.'">'.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').'</a></td>';
<?php print "</tr>\n";
} }
if (count($linkedObjectBlock) > 1) if (count($linkedObjectBlock) > 1)
{ {
?> print '<tr class="liste_total '.(empty($noMoreLinkedObjectBlockAfter)?'liste_sub_total':'').'">';
<tr class="liste_total <?php echo (empty($noMoreLinkedObjectBlockAfter)?'liste_sub_total':''); ?>"> print '<td>'.$langs->trans("Total").'</td>';
<td><?php echo $langs->trans("Total"); ?></td> print '<td></td>';
<td></td> print '<td class="center"></td>';
<td class="center"></td> print '<td class="center"></td>';
<td class="center"></td> print '<td class="right">'.price($total).'</td>';
<td class="right"><?php echo price($total); ?></td> print '<td class="right"></td>';
<td class="right"></td> print '<td class="right"></td>';
<td class="right"></td> print '</tr>';
</tr>
<?php
} }
?>
<!-- END PHP TEMPLATE --> print "<!-- END PHP TEMPLATE -->\n";

View File

@ -24,11 +24,9 @@ if (empty($conf) || ! is_object($conf))
exit; exit;
} }
?>
<!-- BEGIN PHP TEMPLATE --> print "<!-- BEGIN PHP TEMPLATE -->\n";
<?php
global $user; global $user;
global $noMoreLinkedObjectBlockAfter; global $noMoreLinkedObjectBlockAfter;
@ -38,14 +36,15 @@ $linkedObjectBlock = $GLOBALS['linkedObjectBlock'];
$langs->load("bills"); $langs->load("bills");
$total=0; $ilink=0; $total=0;
$ilink=0;
foreach($linkedObjectBlock as $key => $objectlink) foreach($linkedObjectBlock as $key => $objectlink)
{ {
$ilink++; $ilink++;
$trclass='oddeven'; $trclass='oddeven';
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total'; if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total';
?> ?>
<tr class="<?php echo $trclass; ?>" > <tr class="<?php echo $trclass; ?>" >
<td class="linkedcol-element"><?php echo $langs->trans("RepeatableInvoice"); ?></td> <td class="linkedcol-element"><?php echo $langs->trans("RepeatableInvoice"); ?></td>
<td class="linkedcol-name"><!-- nowraponall because ref is a label --><?php echo $objectlink->getNomUrl(1); ?></td> <td class="linkedcol-name"><!-- nowraponall because ref is a label --><?php echo $objectlink->getNomUrl(1); ?></td>
@ -55,11 +54,12 @@ foreach($linkedObjectBlock as $key => $objectlink)
if ($user->rights->facture->lire) { if ($user->rights->facture->lire) {
$total = $total + $objectlink->total_ht; $total = $total + $objectlink->total_ht;
echo price($objectlink->total_ht); echo price($objectlink->total_ht);
} ?></td> }
?></td>
<td class="linkedcol-statut right"><?php echo $objectlink->getLibStatut(3); ?></td> <td class="linkedcol-statut right"><?php echo $objectlink->getLibStatut(3); ?></td>
<td class="linkedcol-action right"><a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key; ?>"><?php echo img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink'); ?></a></td> <td class="linkedcol-action right"><a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key; ?>"><?php echo img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink'); ?></a></td>
</tr> </tr>
<?php <?php
} }
if (count($linkedObjectBlock) > 1) if (count($linkedObjectBlock) > 1)
{ {
@ -75,6 +75,5 @@ if (count($linkedObjectBlock) > 1)
</tr> </tr>
<?php <?php
} }
?>
<!-- END PHP TEMPLATE --> print "<!-- END PHP TEMPLATE -->\n";

View File

@ -115,6 +115,7 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele
{ {
print '<form method="post" action="'.DOL_URL_ROOT.'/core/search.php">'; print '<form method="post" action="'.DOL_URL_ROOT.'/core/search.php">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder nohover centpercent">'; print '<table class="noborder nohover centpercent">';
$i=0; $i=0;
foreach($listofsearchfields as $key => $value) foreach($listofsearchfields as $key => $value)
@ -127,6 +128,7 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele
$i++; $i++;
} }
print '</table>'; print '</table>';
print '</div>';
print '</form>'; print '</form>';
print '<br>'; print '<br>';
} }
@ -165,6 +167,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
{ {
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<th colspan="3">'.$langs->trans("CustomersDraftInvoices").($num?' <span class="badge">'.$num.'</span>':'').'</th></tr>'; print '<th colspan="3">'.$langs->trans("CustomersDraftInvoices").($num?' <span class="badge">'.$num.'</span>':'').'</th></tr>';
@ -216,7 +219,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
{ {
print '<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans("NoInvoice").'</td></tr>'; print '<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans("NoInvoice").'</td></tr>';
} }
print "</table><br>"; print "</table></div><br>";
$db->free($resql); $db->free($resql);
} }
else else
@ -251,6 +254,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
{ {
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<th colspan="3">'.$langs->trans("SuppliersDraftInvoices").($num?' <span class="badge">'.$num.'</span>':'').'</th></tr>'; print '<th colspan="3">'.$langs->trans("SuppliersDraftInvoices").($num?' <span class="badge">'.$num.'</span>':'').'</th></tr>';
@ -303,7 +307,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
{ {
print '<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans("NoInvoice").'</td></tr>'; print '<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans("NoInvoice").'</td></tr>';
} }
print "</table><br>"; print "</table></div><br>";
$db->free($resql); $db->free($resql);
} }
else else

View File

@ -320,8 +320,6 @@ else
$span=$columns; $span=$columns;
if ($modetax != 1) $span+=2; if ($modetax != 1) $span+=2;
//if ($modetax == 0 || $modetax == 2)
//{
// Customers invoices // Customers invoices
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td class="left">'.$elementcust.'</td>'; print '<td class="left">'.$elementcust.'</td>';
@ -481,9 +479,7 @@ else
print '<tr><td colspan="'.($span+1).'">&nbsp;</td></tr>'; print '<tr><td colspan="'.($span+1).'">&nbsp;</td></tr>';
print '</table>'; print '</table>';
$diff=$x_coll_sum; $diff=$x_coll_sum;
//}
//if($conf->global->$calc ==0 || $conf->global->$calc == 1){
echo '<table class="noborder" width="100%">'; echo '<table class="noborder" width="100%">';
//print table headers for this quadri - expenses now //print table headers for this quadri - expenses now
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
@ -636,7 +632,6 @@ else
} }
print '</table>'; print '</table>';
//}
// Total to pay // Total to pay
print '<br><br>'; print '<br><br>';

View File

@ -271,7 +271,7 @@ if ($id > 0 || $ref)
print '<tr class="oddeven"><td>'.$langs->trans("TransMetod").'</td><td>'; print '<tr class="oddeven"><td>'.$langs->trans("TransMetod").'</td><td>';
print $form->selectarray("methode", $object->methodes_trans); print $form->selectarray("methode", $object->methodes_trans);
print '</td></tr>'; print '</td></tr>';
/* print '<tr><td width="20%">'.$langs->trans("File").'</td><td>'; /*print '<tr><td width="20%">'.$langs->trans("File").'</td><td>';
print '<input type="hidden" name="max_file_size" value="'.$conf->maxfilesize.'">'; print '<input type="hidden" name="max_file_size" value="'.$conf->maxfilesize.'">';
print '<input class="flat" type="file" name="userfile"><br>'; print '<input class="flat" type="file" name="userfile"><br>';
print '</td></tr>';*/ print '</td></tr>';*/

View File

@ -1887,15 +1887,15 @@ class BonPrelevement extends CommonObject
$XML_SEPA_INFO .= ' <BIC>'.$this->emetteur_bic.'</BIC>'.$CrLf; $XML_SEPA_INFO .= ' <BIC>'.$this->emetteur_bic.'</BIC>'.$CrLf;
$XML_SEPA_INFO .= ' </FinInstnId>'.$CrLf; $XML_SEPA_INFO .= ' </FinInstnId>'.$CrLf;
$XML_SEPA_INFO .= ' </CdtrAgt>'.$CrLf; $XML_SEPA_INFO .= ' </CdtrAgt>'.$CrLf;
/* $XML_SEPA_INFO .= ' <UltmtCdtr>'.$CrLf; /* $XML_SEPA_INFO .= ' <UltmtCdtr>'.$CrLf;
$XML_SEPA_INFO .= ' <Nm>'.$this->raison_sociale.'</Nm>'.$CrLf; $XML_SEPA_INFO .= ' <Nm>'.$this->raison_sociale.'</Nm>'.$CrLf;
$XML_SEPA_INFO .= ' <PstlAdr>'.$CrLf; $XML_SEPA_INFO .= ' <PstlAdr>'.$CrLf;
$XML_SEPA_INFO .= ' <Ctry>'.$country[1].'</Ctry>'.$CrLf; $XML_SEPA_INFO .= ' <Ctry>'.$country[1].'</Ctry>'.$CrLf;
$XML_SEPA_INFO .= ' <AdrLine>'.$conf->global->MAIN_INFO_SOCIETE_ADDRESS.'</AdrLine>'.$CrLf; $XML_SEPA_INFO .= ' <AdrLine>'.$conf->global->MAIN_INFO_SOCIETE_ADDRESS.'</AdrLine>'.$CrLf;
$XML_SEPA_INFO .= ' <AdrLine>'.$conf->global->MAIN_INFO_SOCIETE_ZIP.' '.$conf->global->MAIN_INFO_SOCIETE_TOWN.'</AdrLine>'.$CrLf; $XML_SEPA_INFO .= ' <AdrLine>'.$conf->global->MAIN_INFO_SOCIETE_ZIP.' '.$conf->global->MAIN_INFO_SOCIETE_TOWN.'</AdrLine>'.$CrLf;
$XML_SEPA_INFO .= ' </PstlAdr>'.$CrLf; $XML_SEPA_INFO .= ' </PstlAdr>'.$CrLf;
$XML_SEPA_INFO .= ' </UltmtCdtr>'.$CrLf; $XML_SEPA_INFO .= ' </UltmtCdtr>'.$CrLf;*/
*/ $XML_SEPA_INFO .= ' <ChrgBr>SLEV</ChrgBr>'.$CrLf; $XML_SEPA_INFO .= ' <ChrgBr>SLEV</ChrgBr>'.$CrLf;
$XML_SEPA_INFO .= ' <CdtrSchmeId>'.$CrLf; $XML_SEPA_INFO .= ' <CdtrSchmeId>'.$CrLf;
$XML_SEPA_INFO .= ' <Id>'.$CrLf; $XML_SEPA_INFO .= ' <Id>'.$CrLf;
$XML_SEPA_INFO .= ' <PrvtId>'.$CrLf; $XML_SEPA_INFO .= ' <PrvtId>'.$CrLf;

View File

@ -749,17 +749,17 @@ if (! empty($conf->don->enabled) && ($modecompta == 'CREANCES-DETTES' || $modeco
$sql.= " AND fk_statut in (1,2)"; $sql.= " AND fk_statut in (1,2)";
if (! empty($date_start) && ! empty($date_end)) if (! empty($date_start) && ! empty($date_end))
$sql.= " AND p.datedon >= '".$db->idate($date_start)."' AND p.datedon <= '".$db->idate($date_end)."'"; $sql.= " AND p.datedon >= '".$db->idate($date_start)."' AND p.datedon <= '".$db->idate($date_end)."'";
} } elseif ($modecompta == 'RECETTES-DEPENSES') {
elseif ($modecompta == 'RECETTES-DEPENSES') {
$sql = "SELECT p.societe as nom, p.firstname, p.lastname, date_format(pe.datep,'%Y-%m') as dm, sum(p.amount) as amount"; $sql = "SELECT p.societe as nom, p.firstname, p.lastname, date_format(pe.datep,'%Y-%m') as dm, sum(p.amount) as amount";
$sql.= " FROM ".MAIN_DB_PREFIX."don as p"; $sql.= " FROM ".MAIN_DB_PREFIX."don as p";
$sql.= " INNER JOIN ".MAIN_DB_PREFIX."payment_donation as pe ON pe.fk_donation = p.rowid"; $sql.= " INNER JOIN ".MAIN_DB_PREFIX."payment_donation as pe ON pe.fk_donation = p.rowid";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as c ON pe.fk_typepayment = c.id"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as c ON pe.fk_typepayment = c.id";
$sql.= " WHERE p.entity IN (".getEntity('donation').")"; $sql.= " WHERE p.entity IN (".getEntity('donation').")";
$sql.= " AND fk_statut >= 2"; $sql.= " AND fk_statut >= 2";
if (! empty($date_start) && ! empty($date_end)) if (! empty($date_start) && ! empty($date_end)) {
$sql.= " AND pe.datep >= '".$db->idate($date_start)."' AND pe.datep <= '".$db->idate($date_end)."'"; $sql.= " AND pe.datep >= '".$db->idate($date_start)."' AND pe.datep <= '".$db->idate($date_end)."'";
} }
}
$sql.= " GROUP BY p.societe, p.firstname, p.lastname, dm"; $sql.= " GROUP BY p.societe, p.firstname, p.lastname, dm";

View File

@ -454,8 +454,9 @@ if ($id > 0)
$morehtmlref.='<br>'.$langs->trans('Project') . ' '; $morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->tax->charges->creer) if ($user->rights->tax->charges->creer)
{ {
if ($action != 'classify') if ($action != 'classify') {
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; $morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
}
if ($action == 'classify') { if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';

View File

@ -241,47 +241,45 @@ if (! empty($conf->accounting->enabled) && $modecompta != 'BOOKKEEPING')
} }
if ($modecompta == 'CREANCES-DETTES') if ($modecompta == 'CREANCES-DETTES') {
{ print '<table class="noborder" width="100%">';
print '<table class="noborder" width="100%">'; print '<tr class="liste_titre"><td width="6%" class="right">' . $langs->trans("TurnoverbyVatrate") . '</td>';
print '<tr class="liste_titre"><td width="6%" class="right">' . $langs->trans("TurnoverbyVatrate") . '</td>'; print '<td class="left">' . $langs->trans("ProductOrService") . '</td>';
print '<td class="left">' . $langs->trans("ProductOrService") . '</td>'; print '<td class="left">' . $langs->trans("Country") . '</td>';
print '<td class="left">' . $langs->trans("Country") . '</td>'; $i=0;
$i=0; while($i < 12) {
while($i < 12)
{
$j = $i + (empty($conf->global->SOCIETE_FISCAL_MONTH_START)?1:$conf->global->SOCIETE_FISCAL_MONTH_START); $j = $i + (empty($conf->global->SOCIETE_FISCAL_MONTH_START)?1:$conf->global->SOCIETE_FISCAL_MONTH_START);
if ($j > 12) $j -= 12; if ($j > 12) $j -= 12;
print '<td width="60" class="right">' . $langs->trans('MonthShort' . str_pad($j, 2, '0', STR_PAD_LEFT)) . '</td>'; print '<td width="60" class="right">' . $langs->trans('MonthShort' . str_pad($j, 2, '0', STR_PAD_LEFT)) . '</td>';
$i++; $i++;
} }
print '<td width="60" class="right"><b>' . $langs->trans("TotalHT") . '</b></td></tr>'; print '<td width="60" class="right"><b>' . $langs->trans("TotalHT") . '</b></td></tr>';
$sql = "SELECT fd.tva_tx AS vatrate,"; $sql = "SELECT fd.tva_tx AS vatrate,";
$sql .= " fd.product_type AS product_type,"; $sql .= " fd.product_type AS product_type,";
$sql .= " cc.label AS country,"; $sql .= " cc.label AS country,";
for ($i = 1; $i <= 12; $i ++) { for ($i = 1; $i <= 12; $i ++) {
$sql .= " SUM(" . $db->ifsql('MONTH(f.datef)=' . $i, 'fd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ","; $sql .= " SUM(" . $db->ifsql('MONTH(f.datef)=' . $i, 'fd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
} }
$sql .= " SUM(fd.total_ht) as total"; $sql .= " SUM(fd.total_ht) as total";
$sql .= " FROM " . MAIN_DB_PREFIX . "facturedet as fd"; $sql .= " FROM " . MAIN_DB_PREFIX . "facturedet as fd";
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture"; $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture";
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "societe as soc ON soc.rowid = f.fk_soc"; $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "societe as soc ON soc.rowid = f.fk_soc";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_country as cc ON cc.rowid = soc.fk_pays"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_country as cc ON cc.rowid = soc.fk_pays";
$sql .= " WHERE f.datef >= '" . $db->idate($date_start) . "'"; $sql .= " WHERE f.datef >= '" . $db->idate($date_start) . "'";
$sql .= " AND f.datef <= '" . $db->idate($date_end) . "'"; $sql .= " AND f.datef <= '" . $db->idate($date_end) . "'";
$sql.= " AND f.fk_statut in (1,2)"; $sql.= " AND f.fk_statut in (1,2)";
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
$sql.= " AND f.type IN (0,1,2,5)"; $sql.= " AND f.type IN (0,1,2,5)";
} else { } else {
$sql.= " AND f.type IN (0,1,2,3,5)"; $sql.= " AND f.type IN (0,1,2,3,5)";
} }
$sql .= " AND f.entity IN (" . getEntity('invoice', 0) . ")"; $sql .= " AND f.entity IN (" . getEntity('invoice', 0) . ")";
$sql .= " GROUP BY fd.tva_tx,fd.product_type, cc.label "; $sql .= " GROUP BY fd.tva_tx,fd.product_type, cc.label ";
dol_syslog("htdocs/compta/tva/index.php sql=" . $sql, LOG_DEBUG); dol_syslog("htdocs/compta/tva/index.php sql=" . $sql, LOG_DEBUG);
$resql = $db->query($sql); $resql = $db->query($sql);
if ($resql) { if ($resql) {
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
$totalpermonth = array(); $totalpermonth = array();
while ( $obj = $db->fetch_object($resql)) { while ( $obj = $db->fetch_object($resql)) {
@ -317,50 +315,50 @@ if ($resql) {
} }
print '<td class="right" width="6%"><b>' . price($totalpermonth['total']) . '</b></td>'; print '<td class="right" width="6%"><b>' . price($totalpermonth['total']) . '</b></td>';
print '</tr>'; print '</tr>';
} else { } else {
print $db->lasterror(); // Show last sql error print $db->lasterror(); // Show last sql error
} }
print '<tr class="liste_titre"><td width="6%" class="right">' . $langs->trans("PurchasebyVatrate") . '</td>'; print '<tr class="liste_titre"><td width="6%" class="right">' . $langs->trans("PurchasebyVatrate") . '</td>';
print '<td class="left">' . $langs->trans("ProductOrService") . '</td>'; print '<td class="left">' . $langs->trans("ProductOrService") . '</td>';
print '<td class="left">' . $langs->trans("Country") . '</td>'; print '<td class="left">' . $langs->trans("Country") . '</td>';
$i=0; $i=0;
while($i < 12) while($i < 12)
{ {
$j = $i + (empty($conf->global->SOCIETE_FISCAL_MONTH_START)?1:$conf->global->SOCIETE_FISCAL_MONTH_START); $j = $i + (empty($conf->global->SOCIETE_FISCAL_MONTH_START)?1:$conf->global->SOCIETE_FISCAL_MONTH_START);
if ($j > 12) $j -= 12; if ($j > 12) $j -= 12;
print '<td width="60" class="right">' . $langs->trans('MonthShort' . str_pad($j, 2, '0', STR_PAD_LEFT)) . '</td>'; print '<td width="60" class="right">' . $langs->trans('MonthShort' . str_pad($j, 2, '0', STR_PAD_LEFT)) . '</td>';
$i++; $i++;
} }
print '<td width="60" class="right"><b>' . $langs->trans("TotalHT") . '</b></td></tr>'; print '<td width="60" class="right"><b>' . $langs->trans("TotalHT") . '</b></td></tr>';
$sql2 = "SELECT ffd.tva_tx AS vatrate,"; $sql2 = "SELECT ffd.tva_tx AS vatrate,";
$sql2 .= " ffd.product_type AS product_type,"; $sql2 .= " ffd.product_type AS product_type,";
$sql2 .= " cc.label AS country,"; $sql2 .= " cc.label AS country,";
for($i = 1; $i <= 12; $i ++) { for($i = 1; $i <= 12; $i ++) {
$sql2 .= " SUM(" . $db->ifsql('MONTH(ff.datef)=' . $i, 'ffd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ","; $sql2 .= " SUM(" . $db->ifsql('MONTH(ff.datef)=' . $i, 'ffd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
} }
$sql2 .= " SUM(ffd.total_ht) as total"; $sql2 .= " SUM(ffd.total_ht) as total";
$sql2 .= " FROM " . MAIN_DB_PREFIX . "facture_fourn_det as ffd"; $sql2 .= " FROM " . MAIN_DB_PREFIX . "facture_fourn_det as ffd";
$sql2 .= " INNER JOIN " . MAIN_DB_PREFIX . "facture_fourn as ff ON ff.rowid = ffd.fk_facture_fourn"; $sql2 .= " INNER JOIN " . MAIN_DB_PREFIX . "facture_fourn as ff ON ff.rowid = ffd.fk_facture_fourn";
$sql2 .= " INNER JOIN " . MAIN_DB_PREFIX . "societe as soc ON soc.rowid = ff.fk_soc"; $sql2 .= " INNER JOIN " . MAIN_DB_PREFIX . "societe as soc ON soc.rowid = ff.fk_soc";
$sql2 .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_country as cc ON cc.rowid = soc.fk_pays"; $sql2 .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_country as cc ON cc.rowid = soc.fk_pays";
$sql2 .= " WHERE ff.datef >= '" . $db->idate($date_start) . "'"; $sql2 .= " WHERE ff.datef >= '" . $db->idate($date_start) . "'";
$sql2 .= " AND ff.datef <= '" . $db->idate($date_end) . "'"; $sql2 .= " AND ff.datef <= '" . $db->idate($date_end) . "'";
$sql.= " AND ff.fk_statut in (1,2)"; $sql.= " AND ff.fk_statut in (1,2)";
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
$sql.= " AND ff.type IN (0,1,2,5)"; $sql.= " AND ff.type IN (0,1,2,5)";
} else { } else {
$sql.= " AND ff.type IN (0,1,2,3,5)"; $sql.= " AND ff.type IN (0,1,2,3,5)";
} }
$sql2 .= " AND ff.entity IN (" . getEntity("facture_fourn", 0) . ")"; $sql2 .= " AND ff.entity IN (" . getEntity("facture_fourn", 0) . ")";
$sql2 .= " GROUP BY ffd.tva_tx, ffd.product_type, cc.label"; $sql2 .= " GROUP BY ffd.tva_tx, ffd.product_type, cc.label";
//print $sql2; //print $sql2;
dol_syslog("htdocs/compta/tva/index.php sql=" . $sql, LOG_DEBUG); dol_syslog("htdocs/compta/tva/index.php sql=" . $sql, LOG_DEBUG);
$resql2 = $db->query($sql2); $resql2 = $db->query($sql2);
if ($resql2) { if ($resql2) {
$num = $db->num_rows($resql2); $num = $db->num_rows($resql2);
$totalpermonth = array(); $totalpermonth = array();
while ( $obj = $db->fetch_object($resql2)) { while ( $obj = $db->fetch_object($resql2)) {
@ -396,10 +394,10 @@ if ($resql2) {
} }
print '<td class="right" width="6%"><b>' . price($totalpermonth['total']) . '</b></td>'; print '<td class="right" width="6%"><b>' . price($totalpermonth['total']) . '</b></td>';
print '</tr>'; print '</tr>';
} else { } else {
print $db->lasterror(); // Show last sql error print $db->lasterror(); // Show last sql error
} }
print "</table>\n"; print "</table>\n";
} else { } else {
// $modecompta != 'CREANCES-DETTES' // $modecompta != 'CREANCES-DETTES'
// "Calculation of part of each product for accountancy in this mode is not possible. When a partial payment (for example 5 euros) is done on an // "Calculation of part of each product for accountancy in this mode is not possible. When a partial payment (for example 5 euros) is done on an

View File

@ -326,7 +326,7 @@ if ($modecompta == 'CREANCES-DETTES')
// Array header // Array header
print "<tr class=\"liste_titre\">"; print "<tr class=\"liste_titre\">";
print_liste_field_titre( print_liste_field_titre(
$langs->trans("Product"), $langs->trans("Product"),
$_SERVER["PHP_SELF"], $_SERVER["PHP_SELF"],
"ref", "ref",
@ -336,7 +336,7 @@ print_liste_field_titre(
$sortfield, $sortfield,
$sortorder $sortorder
); );
print_liste_field_titre( print_liste_field_titre(
$langs->trans('Quantity'), $langs->trans('Quantity'),
$_SERVER["PHP_SELF"], $_SERVER["PHP_SELF"],
"qty", "qty",
@ -346,7 +346,7 @@ print_liste_field_titre(
$sortfield, $sortfield,
$sortorder $sortorder
); );
print_liste_field_titre( print_liste_field_titre(
$langs->trans("Percentage"), $langs->trans("Percentage"),
$_SERVER["PHP_SELF"], $_SERVER["PHP_SELF"],
"qty", "qty",
@ -356,7 +356,7 @@ print_liste_field_titre(
$sortfield, $sortfield,
$sortorder $sortorder
); );
print_liste_field_titre( print_liste_field_titre(
$langs->trans('AmountHT'), $langs->trans('AmountHT'),
$_SERVER["PHP_SELF"], $_SERVER["PHP_SELF"],
"amount", "amount",
@ -366,7 +366,7 @@ print_liste_field_titre(
$sortfield, $sortfield,
$sortorder $sortorder
); );
print_liste_field_titre( print_liste_field_titre(
$langs->trans("AmountTTC"), $langs->trans("AmountTTC"),
$_SERVER["PHP_SELF"], $_SERVER["PHP_SELF"],
"amount_ttc", "amount_ttc",
@ -376,7 +376,7 @@ print_liste_field_titre(
$sortfield, $sortfield,
$sortorder $sortorder
); );
print_liste_field_titre( print_liste_field_titre(
$langs->trans("Percentage"), $langs->trans("Percentage"),
$_SERVER["PHP_SELF"], $_SERVER["PHP_SELF"],
"amount_ttc", "amount_ttc",

View File

@ -172,7 +172,7 @@ if ($modecompta == 'CREANCES-DETTES')
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2,5)"; if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2,5)";
else $sql.= " AND f.type IN (0,1,2,3,5)"; else $sql.= " AND f.type IN (0,1,2,3,5)";
$sql.= " AND f.entity IN (".getEntity('invoice').")"; $sql.= " AND f.entity IN (".getEntity('invoice').")";
if ($socid) $sql.= " AND f.fk_soc = ".$socid; if ($socid) $sql.= " AND f.fk_soc = ".$socid;
} }
elseif ($modecompta=="RECETTES-DEPENSES") elseif ($modecompta=="RECETTES-DEPENSES")
{ {
@ -187,7 +187,7 @@ elseif ($modecompta=="RECETTES-DEPENSES")
$sql.= " WHERE p.rowid = pf.fk_paiement"; $sql.= " WHERE p.rowid = pf.fk_paiement";
$sql.= " AND pf.fk_facture = f.rowid"; $sql.= " AND pf.fk_facture = f.rowid";
$sql.= " AND f.entity IN (".getEntity('invoice').")"; $sql.= " AND f.entity IN (".getEntity('invoice').")";
if ($socid) $sql.= " AND f.fk_soc = ".$socid; if ($socid) $sql.= " AND f.fk_soc = ".$socid;
} }
elseif ($modecompta=="BOOKKEEPING") elseif ($modecompta=="BOOKKEEPING")
{ {

View File

@ -135,13 +135,15 @@ echo $this->control->tpl['ajax_selectcountry'];
<td colspan="3" valign="top"><textarea name="note" cols="70" rows="<?php echo ROWS_3; ?>"><?php echo $this->control->tpl['note']; ?></textarea></td> <td colspan="3" valign="top"><textarea name="note" cols="70" rows="<?php echo ROWS_3; ?>"><?php echo $this->control->tpl['note']; ?></textarea></td>
</tr> </tr>
<?php if (! empty($this->control->tpl['contact_element'])) { ?> <?php
<?php foreach ($this->control->tpl['contact_element'] as $element) { ?> if (! empty($this->control->tpl['contact_element'])) {
<tr> foreach ($this->control->tpl['contact_element'] as $element) {
<td><?php echo $element['linked_element_label']; ?></td> print '<tr>';
<td colspan="3"><?php echo $element['linked_element_value']; ?></td> print '<td>'.$element['linked_element_label'].'</td>';
</tr> print '<td colspan="3">'.$element['linked_element_value'].'</td>';
<?php } } ?> print '</tr>';
}
} ?>
<tr> <tr>
<td><?php echo $langs->trans("DolibarrLogin"); ?></td> <td><?php echo $langs->trans("DolibarrLogin"); ?></td>

View File

@ -24,17 +24,14 @@ if (empty($conf) || ! is_object($conf))
$contact = $GLOBALS['objcanvas']->control->object; $contact = $GLOBALS['objcanvas']->control->object;
?>
<!-- BEGIN PHP TEMPLATE CONTACTCARD_VIEW.TPL.PHP DEFAULT --> print "<!-- BEGIN PHP TEMPLATE CONTACTCARD_VIEW.TPL.PHP DEFAULT -->\n";
<?php echo $this->control->tpl['showhead']; ?> echo $this->control->tpl['showhead'];
<?php
dol_htmloutput_errors($this->control->tpl['error'], $this->control->tpl['errors']); dol_htmloutput_errors($this->control->tpl['error'], $this->control->tpl['errors']);
?>
<?php if (! empty($this->control->tpl['action_create_user'])) echo $this->control->tpl['action_create_user']; ?> if (! empty($this->control->tpl['action_create_user'])) echo $this->control->tpl['action_create_user'];
<?php if (! empty($this->control->tpl['action_delete'])) echo $this->control->tpl['action_delete']; ?> if (! empty($this->control->tpl['action_delete'])) echo $this->control->tpl['action_delete']; ?>
<table class="border allwidth"> <table class="border allwidth">
@ -134,29 +131,27 @@ dol_htmloutput_errors($this->control->tpl['error'], $this->control->tpl['errors'
</table> </table>
<?php echo $this->control->tpl['showend']; ?> <?php echo $this->control->tpl['showend'];
<?php if (empty($user->societe_id)) { ?> if (empty($user->societe_id)) {
<div class="tabsAction"> print '<div class="tabsAction">';
if ($user->rights->societe->contact->creer) {
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$this->control->tpl['id'].'&amp;action=edit&amp;canvas='.$canvas.'">'.$langs->trans('Modify').'</a>';
}
<?php if ($user->rights->societe->contact->creer) { ?> if (! $this->control->tpl['user_id'] && $user->rights->user->user->creer) {
<a class="butAction" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->control->tpl['id'].'&amp;action=edit&amp;canvas='.$canvas; ?>"><?php echo $langs->trans('Modify'); ?></a> print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$this->control->tpl['id'].'&amp;action=create_user&amp;canvas='.$canvas.'">'.$langs->trans("CreateDolibarrLogin").'</a>';
<?php } ?> }
<?php if (! $this->control->tpl['user_id'] && $user->rights->user->user->creer) { ?> if ($user->rights->societe->contact->supprimer) {
<a class="butAction" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->control->tpl['id'].'&amp;action=create_user&amp;canvas='.$canvas; ?>"><?php echo $langs->trans("CreateDolibarrLogin"); ?></a> print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$this->control->tpl['id'].'&amp;action=delete&amp;canvas='.$canvas.'">'.$langs->trans('Delete').'</a>';
<?php } ?> }
<?php if ($user->rights->societe->contact->supprimer) { ?> print '</div><br>';
<a class="butActionDelete" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->control->tpl['id'].'&amp;action=delete&amp;canvas='.$canvas; ?>"><?php echo $langs->trans('Delete'); ?></a> }
<?php } ?>
</div><br>
<?php }
echo $this->control->tpl['actionstodo']; echo $this->control->tpl['actionstodo'];
echo $this->control->tpl['actionsdone']; echo $this->control->tpl['actionsdone'];
?>
<!-- END PHP TEMPLATE --> print "<!-- END PHP TEMPLATE -->\n";

View File

@ -972,7 +972,7 @@ else
print '<tr><td><label for="state_id">'.$langs->trans('State').'</label></td><td colspan="3" class="maxwidthonsmartphone">'; print '<tr><td><label for="state_id">'.$langs->trans('State').'</label></td><td colspan="3" class="maxwidthonsmartphone">';
} }
print $formcompany->select_state($object->state_id, isset($_POST["country_id"])?GETPOST("country_id"):$object->country_id, 'state_id'); print $formcompany->select_state(GETPOSTISSET('state_id')?GETPOST('state_id', 'alpha'):$object->state_id, $object->country_code, 'state_id');
print '</td></tr>'; print '</td></tr>';
} }

View File

@ -151,7 +151,7 @@ if ($object->thirdparty->fournisseur)
if ($conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire) $elementTypeArray['supplier_order']=$langs->transnoentitiesnoconv('SuppliersOrders'); if ($conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire) $elementTypeArray['supplier_order']=$langs->transnoentitiesnoconv('SuppliersOrders');
// There no contact type for supplier proposals // There no contact type for supplier proposals
// if ($conf->fournisseur->enabled && $user->rights->supplier_proposal->lire) $elementTypeArray['supplier_proposal']=$langs->transnoentitiesnoconv('SupplierProposals'); // if ($conf->fournisseur->enabled && $user->rights->supplier_proposal->lire) $elementTypeArray['supplier_proposal']=$langs->transnoentitiesnoconv('SupplierProposals');
} }
print '</table>'; print '</table>';
@ -298,7 +298,7 @@ if (!empty($sql_select))
$sql.= " "; $sql.= " ";
if ($type_element != 'fichinter') $sql.= ", p.ref as prod_ref, p.label as product_label"; if ($type_element != 'fichinter') $sql.= ", p.ref as prod_ref, p.label as product_label";
$sql.= " FROM "/*.MAIN_DB_PREFIX."societe as s, "*/.$tables_from; $sql.= " FROM "/*.MAIN_DB_PREFIX."societe as s, "*/.$tables_from;
// if ($type_element != 'fichinter') $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON d.fk_product = p.rowid '; // if ($type_element != 'fichinter') $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON d.fk_product = p.rowid ';
$sql.= $where; $sql.= $where;
$sql.= dolSqlDateFilter($dateprint, 0, $month, $year); $sql.= dolSqlDateFilter($dateprint, 0, $month, $year);
if ($sref) $sql.= " AND ".$doc_number." LIKE '%".$db->escape($sref)."%'"; if ($sref) $sql.= " AND ".$doc_number." LIKE '%".$db->escape($sref)."%'";

View File

@ -63,8 +63,8 @@ $offset = $conf->liste_limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
if (! empty($conf->global->MAIN_DOC_SORT_FIELD)) { $sortfield=$conf->global->MAIN_DOC_SORT_FIELD; } if (! empty($conf->global->MAIN_DOC_SORT_FIELD)) { $sortfield=$conf->global->MAIN_DOC_SORT_FIELD; }
if (! empty($conf->global->MAIN_DOC_SORT_ORDER)) { $sortorder=$conf->global->MAIN_DOC_SORT_ORDER; } if (! empty($conf->global->MAIN_DOC_SORT_ORDER)) { $sortorder=$conf->global->MAIN_DOC_SORT_ORDER; }
if (! $sortorder) $sortorder="ASC"; if (! $sortorder) $sortorder="ASC";
if (! $sortfield) $sortfield="name"; if (! $sortfield) $sortfield="name";

View File

@ -164,8 +164,9 @@ if ($id > 0)
$morehtmlref.='<br>'.$langs->trans('Project') . ' '; $morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->contrat->creer) if ($user->rights->contrat->creer)
{ {
if ($action != 'classify') if ($action != 'classify') {
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; $morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
}
if ($action == 'classify') { if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';

View File

@ -331,9 +331,8 @@ if (empty($reshook))
// Extrafields // Extrafields
$array_options = array(); $array_options = array();
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) // For avoid conflicts if // For avoid conflicts if trigger used
// trigger used if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) {
{
$lines[$i]->fetch_optionals($lines[$i]->rowid); $lines[$i]->fetch_optionals($lines[$i]->rowid);
$array_options = $lines[$i]->array_options; $array_options = $lines[$i]->array_options;
} }
@ -1419,8 +1418,9 @@ else
$morehtmlref.='<br>'.$langs->trans('Project') . ' '; $morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->contrat->creer) if ($user->rights->contrat->creer)
{ {
if ($action != 'classify') if ($action != 'classify') {
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; $morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
}
if ($action == 'classify') { if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
@ -2254,7 +2254,7 @@ $db->close();
if (! empty($conf->margin->enabled) && $action == 'editline') if (! empty($conf->margin->enabled) && $action == 'editline')
{ {
// TODO Why this ? To manage margin on contracts ? // TODO Why this ? To manage margin on contracts ?
?> ?>
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() { $(document).ready(function() {
var idprod = $("input[name='idprod']").val(); var idprod = $("input[name='idprod']").val();
@ -2309,5 +2309,5 @@ $(document).ready(function() {
} }
}); });
</script> </script>
<?php <?php
} }

View File

@ -9,7 +9,7 @@
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com> * Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2015-2018 Ferran Marcet <fmarcet@2byte.es> * Copyright (C) 2015-2018 Ferran Marcet <fmarcet@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -706,8 +706,9 @@ while ($i < min($num, $limit))
if (! empty($arrayfields['status']['checked'])) if (! empty($arrayfields['status']['checked']))
{ {
print '<td class="right">'; print '<td class="right">';
if ($obj->cstatut == 0) // If contract is draft, we say line is also draft if ($obj->cstatut == 0)
{ {
// If contract is draft, we say line is also draft
print $contractstatic->LibStatut(0, 5); print $contractstatic->LibStatut(0, 5);
} }
else else

View File

@ -23,11 +23,9 @@ if (empty($conf) || ! is_object($conf))
exit; exit;
} }
?>
<!-- BEGIN PHP TEMPLATE --> print "<!-- BEGIN PHP TEMPLATE -->\n";
<?php
global $user; global $user;
global $noMoreLinkedObjectBlockAfter; global $noMoreLinkedObjectBlockAfter;
@ -45,7 +43,7 @@ foreach($linkedObjectBlock as $key => $objectlink)
$trclass='oddeven'; $trclass='oddeven';
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total'; if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total';
?> ?>
<tr class="<?php echo $trclass; ?>"> <tr class="<?php echo $trclass; ?>">
<td><?php echo $langs->trans("Contract"); ?></td> <td><?php echo $langs->trans("Contract"); ?></td>
<td><?php echo $objectlink->getNomUrl(1); ?></td> <td><?php echo $objectlink->getNomUrl(1); ?></td>
@ -65,8 +63,9 @@ foreach($linkedObjectBlock as $key => $objectlink)
echo price($totalcontrat); echo price($totalcontrat);
} ?></td> } ?></td>
<td class="right"><?php echo $objectlink->getLibStatut(7); ?></td> <td class="right"><?php echo $objectlink->getLibStatut(7); ?></td>
<td class="right"><a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key; ?>"><?php echo img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink'); ?></a></td> <td class="right"><a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key.'">'.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink'); ?></a></td>
</tr> </tr>
<?php } ?> <?php
}
<!-- END PHP TEMPLATE --> print "<!-- END PHP TEMPLATE -->\n";

View File

@ -82,8 +82,8 @@ elseif (GETPOST('linkit', 'none') && ! empty($conf->global->MAIN_UPLOAD_DOC))
if ($action == 'confirm_deletefile' && $confirm == 'yes') if ($action == 'confirm_deletefile' && $confirm == 'yes')
{ {
$urlfile = GETPOST('urlfile', 'alpha', 0, null, null, 1); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). $urlfile = GETPOST('urlfile', 'alpha', 0, null, null, 1); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
if (GETPOST('section', 'alpha')) // For a delete from the ECM module, upload_dir is ECM root dir and urlfile contains relative path from upload_dir if (GETPOST('section', 'alpha')) {
{ // For a delete from the ECM module, upload_dir is ECM root dir and urlfile contains relative path from upload_dir
$file = $upload_dir . (preg_match('/\/$/', $upload_dir) ? '' : '/') . $urlfile; $file = $upload_dir . (preg_match('/\/$/', $upload_dir) ? '' : '/') . $urlfile;
} }
else // For a delete from the file manager into another module, or from documents pages, upload_dir contains already path to file from module dir, so we clean path into urlfile. else // For a delete from the file manager into another module, or from documents pages, upload_dir contains already path to file from module dir, so we clean path into urlfile.
@ -94,8 +94,8 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes')
} }
$linkid = GETPOST('linkid', 'int'); $linkid = GETPOST('linkid', 'int');
if ($urlfile) // delete of a file if ($urlfile) {
{ // delete of a file
$dir = dirname($file).'/'; // Chemin du dossier contenant l'image d'origine $dir = dirname($file).'/'; // Chemin du dossier contenant l'image d'origine
$dirthumb = $dir.'/thumbs/'; // Chemin du dossier contenant la vignette (if file is an image) $dirthumb = $dir.'/thumbs/'; // Chemin du dossier contenant la vignette (if file is an image)
@ -118,8 +118,11 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes')
} }
} }
if ($ret) setEventMessages($langs->trans("FileWasRemoved", $urlfile), null, 'mesgs'); if ($ret) {
else setEventMessages($langs->trans("ErrorFailToDeleteFile", $urlfile), null, 'errors'); setEventMessages($langs->trans("FileWasRemoved", $urlfile), null, 'mesgs');
} else {
setEventMessages($langs->trans("ErrorFailToDeleteFile", $urlfile), null, 'errors');
}
} }
elseif ($linkid) // delete of external link elseif ($linkid) // delete of external link
{ {
@ -140,10 +143,8 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes')
} }
} }
if (is_object($object) && $object->id > 0) if (is_object($object) && $object->id > 0) {
{ if ($backtopage) {
if ($backtopage)
{
header('Location: ' . $backtopage); header('Location: ' . $backtopage);
exit; exit;
} }

View File

@ -12,7 +12,7 @@
* Copyright (C) 2017 ATM Consulting <support@atm-consulting.fr> * Copyright (C) 2017 ATM Consulting <support@atm-consulting.fr>
* Copyright (C) 2017-2019 Nicolas ZABOURI <info@inovea-conseil.com> * Copyright (C) 2017-2019 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2017 Rui Strecht <rui.strecht@aliartalentos.com> * Copyright (C) 2017 Rui Strecht <rui.strecht@aliartalentos.com>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018 Josep Lluís Amador <joseplluis@lliuretic.cat> * Copyright (C) 2018 Josep Lluís Amador <joseplluis@lliuretic.cat>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -4612,7 +4612,7 @@ abstract class CommonObject
$parameters = array('modelspath'=>$modelspath,'modele'=>$modele,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'hidedesc'=>$hidedesc,'hideref'=>$hideref, 'moreparams'=>$moreparams); $parameters = array('modelspath'=>$modelspath,'modele'=>$modele,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'hidedesc'=>$hidedesc,'hideref'=>$hideref, 'moreparams'=>$moreparams);
$reshook = $hookmanager->executeHooks('commonGenerateDocument', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks $reshook = $hookmanager->executeHooks('commonGenerateDocument', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
if(empty($reshook)) if (empty($reshook))
{ {
dol_syslog("commonGenerateDocument modele=".$modele." outputlangs->defaultlang=".(is_object($outputlangs)?$outputlangs->defaultlang:'null')); dol_syslog("commonGenerateDocument modele=".$modele." outputlangs->defaultlang=".(is_object($outputlangs)?$outputlangs->defaultlang:'null'));
@ -4631,7 +4631,9 @@ abstract class CommonObject
} }
// Search template files // Search template files
$file=''; $classname=''; $filefound=0; $file='';
$classname='';
$filefound=0;
$dirmodels=array('/'); $dirmodels=array('/');
if (is_array($conf->modules_parts['models'])) $dirmodels=array_merge($dirmodels, $conf->modules_parts['models']); if (is_array($conf->modules_parts['models'])) $dirmodels=array_merge($dirmodels, $conf->modules_parts['models']);
foreach($dirmodels as $reldir) foreach($dirmodels as $reldir)
@ -4771,8 +4773,7 @@ abstract class CommonObject
$setsharekey=true; $setsharekey=true;
} }
if ($setsharekey) if ($setsharekey) {
{
if (empty($ecmfile->share)) // Because object not found or share not set yet if (empty($ecmfile->share)) // Because object not found or share not set yet
{ {
require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
@ -4788,8 +4789,7 @@ abstract class CommonObject
$ecmfile->description = ''; // indexed content $ecmfile->description = ''; // indexed content
$ecmfile->keyword = ''; // keyword content $ecmfile->keyword = ''; // keyword content
$result = $ecmfile->update($user); $result = $ecmfile->update($user);
if ($result < 0) if ($result < 0) {
{
setEventMessages($ecmfile->error, $ecmfile->errors, 'warnings'); setEventMessages($ecmfile->error, $ecmfile->errors, 'warnings');
} }
} }
@ -4807,8 +4807,7 @@ abstract class CommonObject
$ecmfile->src_object_id = $this->id; $ecmfile->src_object_id = $this->id;
$result = $ecmfile->create($user); $result = $ecmfile->create($user);
if ($result < 0) if ($result < 0) {
{
setEventMessages($ecmfile->error, $ecmfile->errors, 'warnings'); setEventMessages($ecmfile->error, $ecmfile->errors, 'warnings');
} }
} }
@ -4827,9 +4826,9 @@ abstract class CommonObject
$sql.= ' WHERE rowid = '.$this->id; $sql.= ' WHERE rowid = '.$this->id;
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if (! $resql) dol_print_error($this->db); if (! $resql) {
else dol_print_error($this->db);
{ } else {
$this->last_main_doc = $ecmfile->filepath.'/'.$ecmfile->filename; $this->last_main_doc = $ecmfile->filepath.'/'.$ecmfile->filename;
} }
} }
@ -6063,8 +6062,9 @@ abstract class CommonObject
$labeltoshow = dol_trunc($obj->{$InfoFieldList[1]}, 18); $labeltoshow = dol_trunc($obj->{$InfoFieldList[1]}, 18);
} }
} }
if (empty($labeltoshow)) if (empty($labeltoshow)) {
$labeltoshow = '(not defined)'; $labeltoshow = '(not defined)';
}
if (is_array($value_arr) && in_array($obj->rowid, $value_arr)) { if (is_array($value_arr) && in_array($obj->rowid, $value_arr)) {
$data[$obj->rowid]=$labeltoshow; $data[$obj->rowid]=$labeltoshow;

View File

@ -76,10 +76,9 @@ class FormContract
if ($socid > 0) if ($socid > 0)
{ {
// CONTRACT_ALLOW_TO_LINK_FROM_OTHER_COMPANY is 'all' or a list of ids separated by coma. // CONTRACT_ALLOW_TO_LINK_FROM_OTHER_COMPANY is 'all' or a list of ids separated by coma.
if (empty($conf->global->CONTRACT_ALLOW_TO_LINK_FROM_OTHER_COMPANY)) if (empty($conf->global->CONTRACT_ALLOW_TO_LINK_FROM_OTHER_COMPANY)) {
$sql.= " AND (c.fk_soc=".$socid." OR c.fk_soc IS NULL)"; $sql.= " AND (c.fk_soc=".$socid." OR c.fk_soc IS NULL)";
elseif ($conf->global->CONTRACT_ALLOW_TO_LINK_FROM_OTHER_COMPANY != 'all') } elseif ($conf->global->CONTRACT_ALLOW_TO_LINK_FROM_OTHER_COMPANY != 'all') {
{
$sql.= " AND (c.fk_soc IN (".$socid.", ".$conf->global->CONTRACT_ALLOW_TO_LINK_FROM_OTHER_COMPANY.") "; $sql.= " AND (c.fk_soc IN (".$socid.", ".$conf->global->CONTRACT_ALLOW_TO_LINK_FROM_OTHER_COMPANY.") ";
$sql.= " OR c.fk_soc IS NULL)"; $sql.= " OR c.fk_soc IS NULL)";
} }

View File

@ -41,9 +41,21 @@ class FormMail extends Form
*/ */
public $db; public $db;
public $withform; // 1=Include HTML form tag and show submit button, 0=Do not include form tag and submit button, -1=Do not include form tag but include submit button /**
* @var int 1 = Include HTML form tag and show submit button
* 0 = Do not include form tag and submit button
* -1 = Do not include form tag but include submit button
*/
public $withform;
/**
* @var string name from
*/
public $fromname; public $fromname;
/**
* @var string email from
*/
public $frommail; public $frommail;
/** /**
@ -52,10 +64,15 @@ class FormMail extends Form
public $fromtype; public $fromtype;
/** /**
* @var int ID * @var int from ID
*/ */
public $fromid; public $fromid;
/**
* @var int also from robot
*/
public $fromalsorobot;
/** /**
* @var string thirdparty etc * @var string thirdparty etc
*/ */
@ -66,10 +83,29 @@ class FormMail extends Form
*/ */
public $toid; public $toid;
/**
* @var string replyto name
*/
public $replytoname; public $replytoname;
/**
* @var string replyto email
*/
public $replytomail; public $replytomail;
/**
* @var string to name
*/
public $toname; public $toname;
/**
* @var string to email
*/
public $tomail; public $tomail;
/**
* @var string trackid
*/
public $trackid; public $trackid;
public $withsubstit; // Show substitution array public $withsubstit; // Show substitution array

View File

@ -139,8 +139,7 @@ class Menubase
{ {
$sql = "SELECT MAX(rowid) as maxrowid FROM ".MAIN_DB_PREFIX."menu"; $sql = "SELECT MAX(rowid) as maxrowid FROM ".MAIN_DB_PREFIX."menu";
$resqlrowid=$this->db->query($sql); $resqlrowid=$this->db->query($sql);
if ($resqlrowid) if ($resqlrowid) {
{
$obj=$this->db->fetch_object($resqlrowid); $obj=$this->db->fetch_object($resqlrowid);
$maxrowid=$obj->maxrowid; $maxrowid=$obj->maxrowid;

View File

@ -220,8 +220,7 @@ class DoliDBMssql extends DoliDB
*/ */
public function close() public function close()
{ {
if ($this->db) if ($this->db) {
{
if ($this->transaction_opened > 0) dol_syslog(get_class($this)."::close Closing a connection with an opened transaction depth=".$this->transaction_opened, LOG_ERR); if ($this->transaction_opened > 0) dol_syslog(get_class($this)."::close Closing a connection with an opened transaction depth=".$this->transaction_opened, LOG_ERR);
$this->connected=false; $this->connected=false;
return mssql_close($this->db); return mssql_close($this->db);

View File

@ -1135,13 +1135,16 @@ class DoliDBPgsql extends DoliDB
$sql .= " ".$field_desc['attribute']; $sql .= " ".$field_desc['attribute'];
if (preg_match("/^[^\s]/i", $field_desc['null'])) if (preg_match("/^[^\s]/i", $field_desc['null']))
$sql .= " ".$field_desc['null']; $sql .= " ".$field_desc['null'];
if (preg_match("/^[^\s]/i", $field_desc['default'])) if (preg_match("/^[^\s]/i", $field_desc['default'])) {
if (preg_match("/null/i", $field_desc['default'])) if (preg_match("/null/i", $field_desc['default'])) {
$sql .= " default ".$field_desc['default']; $sql .= " default ".$field_desc['default'];
else } else {
$sql .= " default '".$field_desc['default']."'"; $sql .= " default '".$field_desc['default']."'";
if (preg_match("/^[^\s]/i", $field_desc['extra'])) }
}
if (preg_match("/^[^\s]/i", $field_desc['extra'])) {
$sql .= " ".$field_desc['extra']; $sql .= " ".$field_desc['extra'];
}
$sql .= " ".$field_position; $sql .= " ".$field_position;
dol_syslog($sql, LOG_DEBUG); dol_syslog($sql, LOG_DEBUG);

View File

@ -1081,7 +1081,7 @@ function price2numjs(amount) {
<?php <?php
if (empty($conf->global->MAIN_DISABLE_JQUERY_JNOTIFY) && ! defined('DISABLE_JQUERY_JNOTIFY')) { if (empty($conf->global->MAIN_DISABLE_JQUERY_JNOTIFY) && ! defined('DISABLE_JQUERY_JNOTIFY')) {
?> ?>
// Defined properties for JNotify // Defined properties for JNotify
$(document).ready(function() { $(document).ready(function() {
if (typeof $.jnotify == 'function') if (typeof $.jnotify == 'function')

View File

@ -237,6 +237,7 @@ function show_array_actions_to_do($max = 5)
{ {
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("LastActionsToDo", $max).'</th>'; print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("LastActionsToDo", $max).'</th>';
print '<th colspan="2" class="right"><a class="commonlink" href="'.DOL_URL_ROOT.'/comm/action/list.php?status=todo">'.$langs->trans("FullList").'</a></th>'; print '<th colspan="2" class="right"><a class="commonlink" href="'.DOL_URL_ROOT.'/comm/action/list.php?status=todo">'.$langs->trans("FullList").'</a></th>';
@ -292,7 +293,7 @@ function show_array_actions_to_do($max = 5)
$i++; $i++;
} }
print "</table><br>"; print "</table></div><br>";
$db->free($resql); $db->free($resql);
} }
@ -334,6 +335,7 @@ function show_array_last_actions_done($max = 5)
{ {
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("LastDoneTasks", $max).'</th>'; print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("LastDoneTasks", $max).'</th>';
print '<th colspan="2" class="right"><a class="commonlink" href="'.DOL_URL_ROOT.'/comm/action/list.php?status=done">'.$langs->trans("FullList").'</a></th>'; print '<th colspan="2" class="right"><a class="commonlink" href="'.DOL_URL_ROOT.'/comm/action/list.php?status=done">'.$langs->trans("FullList").'</a></th>';
@ -380,7 +382,7 @@ function show_array_last_actions_done($max = 5)
} }
// TODO Ajouter rappel pour "il y a des contrats a mettre en service" // TODO Ajouter rappel pour "il y a des contrats a mettre en service"
// TODO Ajouter rappel pour "il y a des contrats qui arrivent a expiration" // TODO Ajouter rappel pour "il y a des contrats qui arrivent a expiration"
print "</table><br>"; print "</table></div><br>";
$db->free($resql); $db->free($resql);
} }

View File

@ -835,7 +835,7 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $
$start = "{user_extra_"; $start = "{user_extra_";
$end = "\}"; $end = "\}";
$extra= get_string_between($mask, "user_extra_", "}"); $extra= get_string_between($mask, "user_extra_", "}");
if(!empty($user->array_options['options_'.$extra])){ if (!empty($user->array_options['options_'.$extra])) {
$mask = preg_replace('#('.$start.')(.*?)('.$end.')#si', $user->array_options['options_'.$extra], $mask); $mask = preg_replace('#('.$start.')(.*?)('.$end.')#si', $user->array_options['options_'.$extra], $mask);
} }
} }

View File

@ -137,7 +137,7 @@ function invoice_admin_prepare_head()
$head[$h][2] = 'payment'; $head[$h][2] = 'payment';
$h++; $h++;
if($conf->global->INVOICE_USE_SITUATION){ if ($conf->global->INVOICE_USE_SITUATION) {
$head[$h][0] = DOL_URL_ROOT.'/admin/facture_situation.php'; $head[$h][0] = DOL_URL_ROOT.'/admin/facture_situation.php';
$head[$h][1] = $langs->trans("InvoiceSituation"); $head[$h][1] = $langs->trans("InvoiceSituation");
$head[$h][2] = 'situation'; $head[$h][2] = 'situation';

View File

@ -1417,7 +1417,7 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0,
//print '>'.$outputlangs->charset_output.','.$period; //print '>'.$outputlangs->charset_output.','.$period;
if(!empty($conf->global->ADD_HTML_FORMATING_INTO_DESC_DOC)){ if(!empty($conf->global->ADD_HTML_FORMATING_INTO_DESC_DOC)){
$libelleproduitservice.= '<b style="color:#333666;" ><em>'."__N__</b> ".$period.'</em>'; $libelleproduitservice.= '<b style="color:#333666;" ><em>'."__N__</b> ".$period.'</em>';
}else{ } else {
$libelleproduitservice.="__N__".$period; $libelleproduitservice.="__N__".$period;
} }
//print $libelleproduitservice; //print $libelleproduitservice;

View File

@ -313,8 +313,14 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
{ {
if (empty($user->rights->$feature->$subfeature->creer) if (empty($user->rights->$feature->$subfeature->creer)
&& empty($user->rights->$feature->$subfeature->write) && empty($user->rights->$feature->$subfeature->write)
&& empty($user->rights->$feature->$subfeature->create)) { $createok=0; $nbko++; } && empty($user->rights->$feature->$subfeature->create)) {
else { $createok=1; break; } // Break to bypass second test if the first is ok $createok=0;
$nbko++;
} else {
$createok=1;
// Break to bypass second test if the first is ok
break;
}
} }
} }
elseif (! empty($feature)) // This is for permissions on 2 levels ('creer' or 'write') elseif (! empty($feature)) // This is for permissions on 2 levels ('creer' or 'write')
@ -322,7 +328,10 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
//print '<br>feature='.$feature.' creer='.$user->rights->$feature->creer.' write='.$user->rights->$feature->write; //print '<br>feature='.$feature.' creer='.$user->rights->$feature->creer.' write='.$user->rights->$feature->write;
if (empty($user->rights->$feature->creer) if (empty($user->rights->$feature->creer)
&& empty($user->rights->$feature->write) && empty($user->rights->$feature->write)
&& empty($user->rights->$feature->create)) { $createok=0; $nbko++; } && empty($user->rights->$feature->create)) {
$createok=0;
$nbko++;
}
} }
} }

View File

@ -690,10 +690,10 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no
$out.=$actionstatic->getNomUrl(1, -1).' '; $out.=$actionstatic->getNomUrl(1, -1).' ';
} }
// if ($user->rights->agenda->allactions->read || $actionstatic->authorid == $user->id) //if ($user->rights->agenda->allactions->read || $actionstatic->authorid == $user->id)
// { //{
// $out.='<a href="'.$url.'" class="timeline-btn" title="'.$langs->trans('Show').'" ><i class="fa fa-calendar" ></i>'.$langs->trans('Show').'</a>'; // $out.='<a href="'.$url.'" class="timeline-btn" title="'.$langs->trans('Show').'" ><i class="fa fa-calendar" ></i>'.$langs->trans('Show').'</a>';
// } //}
if ($user->rights->agenda->allactions->create || if ($user->rights->agenda->allactions->create ||
@ -723,10 +723,8 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no
$out.="</span>\n"; $out.="</span>\n";
// Ref // Ref
$out.='<h3 class="timeline-header">'; $out.='<h3 class="timeline-header">';
// Author of event // Author of event
$out.='<span class="messaging-author">'; $out.='<span class="messaging-author">';
if ($histo[$key]['userid'] > 0) if ($histo[$key]['userid'] > 0)
@ -739,11 +737,9 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no
} }
$out.='</span>'; $out.='</span>';
// Title // Title
$out .= ' <span class="messaging-title">'; $out .= ' <span class="messaging-title">';
if($actionstatic->code == 'TICKET_MSG') { if($actionstatic->code == 'TICKET_MSG') {
$out .= $langs->trans('TicketNewMessage'); $out .= $langs->trans('TicketNewMessage');
} }

View File

@ -240,7 +240,6 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest)
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array('main', 'other', 'errors')); $langs->loadLangs(array('main', 'other', 'errors'));
;
$_SESSION["dol_loginmesg"]=($ldap->error?$ldap->error:$langs->trans("ErrorBadLoginPassword")); $_SESSION["dol_loginmesg"]=($ldap->error?$ldap->error:$langs->trans("ErrorBadLoginPassword"));
} }

View File

@ -307,10 +307,12 @@ class MenuManager
print $val2['titre']; print $val2['titre'];
if ($relurl2) if ($relurl2)
{ {
if ($val2['enabled']) // Allowed if ($val2['enabled']) {
// Allowed
print '</a>'; print '</a>';
else } else {
print '</a>'; print '</a>';
}
} }
print '</li>'."\n"; print '</li>'."\n";
} }
@ -448,7 +450,7 @@ class MenuManager
unset($this->menu->liste); unset($this->menu->liste);
} }
} }
/* /*
if ($mode == 'jmobile') if ($mode == 'jmobile')
{ {
foreach($this->menu->liste as $key => $val) // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu' foreach($this->menu->liste as $key => $val) // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu'
@ -506,7 +508,7 @@ class MenuManager
break; // Only first menu entry (so home) break; // Only first menu entry (so home)
} }
} }
*/ */
unset($this->menu); unset($this->menu);
return $res; return $res;

View File

@ -49,7 +49,10 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
*/ */
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr' public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
public $code_auto; // Automatic Numbering /**
* @var int Automatic numbering
*/
public $code_auto;
public $searchcode; // Search string public $searchcode; // Search string

View File

@ -952,8 +952,6 @@ class pdf_einstein extends ModelePDFCommandes
{ {
//$this->atleastoneratenotnull++; //$this->atleastoneratenotnull++;
$index++; $index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);

View File

@ -7,7 +7,7 @@
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr> * Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es> * Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -1107,7 +1107,6 @@ class pdf_eratosthene extends ModelePDFCommandes
if ($tvakey!=0) // On affiche pas taux 0 if ($tvakey!=0) // On affiche pas taux 0
{ {
//$this->atleastoneratenotnull++; //$this->atleastoneratenotnull++;
$index++; $index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
@ -1139,8 +1138,6 @@ class pdf_eratosthene extends ModelePDFCommandes
{ {
//$this->atleastoneratenotnull++; //$this->atleastoneratenotnull++;
$index++; $index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);

View File

@ -53,6 +53,9 @@ class mod_contract_magre extends ModelNumRefContracts
*/ */
public $name='Magre'; public $name='Magre';
/**
* @var int Automatic numbering
*/
public $code_auto=1; public $code_auto=1;
/** /**

View File

@ -58,7 +58,10 @@ class mod_contract_olive extends ModelNumRefContracts
*/ */
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr' public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
public $code_auto = 0; // Numerotation automatique /**
* @var int Automatic numbering
*/
public $code_auto = 0;
/** /**

View File

@ -53,6 +53,9 @@ class mod_contract_serpis extends ModelNumRefContracts
*/ */
public $name='Serpis'; public $name='Serpis';
/**
* @var int Automatic numbering
*/
public $code_auto=1; public $code_auto=1;

View File

@ -324,8 +324,7 @@ class html_cerfafr extends ModeleDon
if ($unite[$i]==1) { if ($unite[$i]==1) {
$secon[$i]='vingt et'; $secon[$i]='vingt et';
$prim[$i]=$chif[$unite[$i]]; $prim[$i]=$chif[$unite[$i]];
} } else {
else {
$secon[$i]='vingt'; $secon[$i]='vingt';
$prim[$i]=$chif[$unite[$i]]; $prim[$i]=$chif[$unite[$i]];
} }
@ -334,8 +333,7 @@ class html_cerfafr extends ModeleDon
if ($unite[$i]==1) { if ($unite[$i]==1) {
$secon[$i]='trente et'; $secon[$i]='trente et';
$prim[$i]=$chif[$unite[$i]]; $prim[$i]=$chif[$unite[$i]];
} } else {
else {
$secon[$i]='trente'; $secon[$i]='trente';
$prim[$i]=$chif[$unite[$i]]; $prim[$i]=$chif[$unite[$i]];
} }

View File

@ -218,10 +218,9 @@ class pdf_rouget extends ModelePdfExpedition
$realpath=''; $realpath='';
foreach ($objphoto->liste_photos($dir, 1) as $key => $obj) foreach ($objphoto->liste_photos($dir, 1) as $key => $obj) {
{ if (empty($conf->global->CAT_HIGH_QUALITY_IMAGES)) {
if (empty($conf->global->CAT_HIGH_QUALITY_IMAGES)) // If CAT_HIGH_QUALITY_IMAGES not defined, we use thumb if defined and then original photo // If CAT_HIGH_QUALITY_IMAGES not defined, we use thumb if defined and then original photo
{
if ($obj['photo_vignette']) if ($obj['photo_vignette'])
{ {
$filename= $obj['photo_vignette']; $filename= $obj['photo_vignette'];

View File

@ -139,19 +139,19 @@ class mod_expensereport_jade extends ModeleNumRefExpenseReport
$result = $db->query($sql); $result = $db->query($sql);
if($db->num_rows($result) > 0): if ($db->num_rows($result) > 0) {
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
$newref = $objp->max; $newref = $objp->max;
$newref++; $newref++;
while(strlen($newref) < $num_car): while (strlen($newref) < $num_car) {
$newref = "0".$newref; $newref = "0".$newref;
endwhile; }
else: } else {
$newref = 1; $newref = 1;
while(strlen($newref) < $num_car): while (strlen($newref) < $num_car) {
$newref = "0".$newref; $newref = "0".$newref;
endwhile; }
endif; }
$ref_number_int = ($newref+1)-1; $ref_number_int = ($newref+1)-1;

View File

@ -1271,8 +1271,7 @@ class pdf_crabe extends ModelePDFFactures
//Local tax 1 after VAT //Local tax 1 after VAT
//if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
//{ //{
foreach($this->localtax1 as $localtax_type => $localtax_rate) foreach ($this->localtax1 as $localtax_type => $localtax_rate) {
{
if (in_array((string) $localtax_type, array('2','4','6'))) continue; if (in_array((string) $localtax_type, array('2','4','6'))) continue;
foreach($localtax_rate as $tvakey => $tvaval) foreach($localtax_rate as $tvakey => $tvaval)

View File

@ -371,7 +371,7 @@ class pdf_sponge extends ModelePDFFactures
// Does we have at least one line with discount $this->atleastonediscount // Does we have at least one line with discount $this->atleastonediscount
foreach ($object->lines as $line) { foreach ($object->lines as $line) {
if ($line->remise_percent){ if ($line->remise_percent) {
$this->atleastonediscount = true; $this->atleastonediscount = true;
break; break;
} }
@ -769,10 +769,12 @@ class pdf_sponge extends ModelePDFFactures
} }
// retrieve global local tax // retrieve global local tax
if ($localtax1_type && $localtax1ligne != 0) if ($localtax1_type && $localtax1ligne != 0) {
$this->localtax1[$localtax1_type][$localtax1_rate]+=$localtax1ligne; $this->localtax1[$localtax1_type][$localtax1_rate]+=$localtax1ligne;
if ($localtax2_type && $localtax2ligne != 0) }
if ($localtax2_type && $localtax2ligne != 0) {
$this->localtax2[$localtax2_type][$localtax2_rate]+=$localtax2ligne; $this->localtax2[$localtax2_type][$localtax2_rate]+=$localtax2ligne;
}
if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate.='*'; if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate.='*';
if (! isset($this->tva[$vatrate])) $this->tva[$vatrate]=0; if (! isset($this->tva[$vatrate])) $this->tva[$vatrate]=0;
@ -781,8 +783,7 @@ class pdf_sponge extends ModelePDFFactures
$nexY = max($nexY, $posYAfterImage); $nexY = max($nexY, $posYAfterImage);
// Add line // Add line
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblines - 1)) if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblines - 1)) {
{
$pdf->setPage($pageposafter); $pdf->setPage($pageposafter);
$pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(80,80,80))); $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(80,80,80)));
//$pdf->SetDrawColor(190,190,200); //$pdf->SetDrawColor(190,190,200);
@ -793,11 +794,9 @@ class pdf_sponge extends ModelePDFFactures
$nexY+=2; // Add space between lines $nexY+=2; // Add space between lines
// Detect if some page were added automatically and output _tableau for past pages // Detect if some page were added automatically and output _tableau for past pages
while ($pagenb < $pageposafter) while ($pagenb < $pageposafter) {
{
$pdf->setPage($pagenb); $pdf->setPage($pagenb);
if ($pagenb == $pageposbeforeprintlines) if ($pagenb == $pageposbeforeprintlines) {
{
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, $hidetop, 1, $object->multicurrency_code); $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, $hidetop, 1, $object->multicurrency_code);
} }
else else
@ -811,10 +810,8 @@ class pdf_sponge extends ModelePDFFactures
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
} }
if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak) if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak) {
{ if ($pagenb == $pageposafter) {
if ($pagenb == $pageposafter)
{
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, $hidetop, 1, $object->multicurrency_code); $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, $hidetop, 1, $object->multicurrency_code);
} }
else else
@ -1266,14 +1263,11 @@ class pdf_sponge extends ModelePDFFactures
$deja_paye = 0; $deja_paye = 0;
$i = 1; $i = 1;
if(!empty($TPreviousIncoice)){ if (!empty($TPreviousIncoice)) {
$pdf->setY($tab2_top); $pdf->setY($tab2_top);
$posy = $pdf->GetY(); $posy = $pdf->GetY();
foreach ($TPreviousIncoice as &$fac) {
foreach ($TPreviousIncoice as &$fac){
if($posy > $this->page_hauteur - 4 ) { if($posy > $this->page_hauteur - 4 ) {
$this->_pagefoot($pdf, $object, $outputlangs, 1); $this->_pagefoot($pdf, $object, $outputlangs, 1);
$pdf->addPage(); $pdf->addPage();
@ -1290,7 +1284,7 @@ class pdf_sponge extends ModelePDFFactures
$pdf->SetXY($col2x, $posy); $pdf->SetXY($col2x, $posy);
$facSign = ''; $facSign = '';
if($i>1){ if ($i>1) {
$facSign = $fac->total_ht>=0?'+':''; $facSign = $fac->total_ht>=0?'+':'';
} }
@ -1312,11 +1306,11 @@ class pdf_sponge extends ModelePDFFactures
$pdf->SetXY($col2x, $posy); $pdf->SetXY($col2x, $posy);
$facSign = ''; $facSign = '';
if($i>1){ if ($i>1) {
$facSign = $object->total_ht>=0?'+':''; // management of a particular customer case $facSign = $object->total_ht>=0?'+':''; // management of a particular customer case
} }
if($fac->type === facture::TYPE_CREDIT_NOTE){ if ($fac->type === facture::TYPE_CREDIT_NOTE) {
$facSign = '-'; // les avoirs $facSign = '-'; // les avoirs
} }
@ -1453,8 +1447,6 @@ class pdf_sponge extends ModelePDFFactures
{ {
//$this->atleastoneratenotnull++; //$this->atleastoneratenotnull++;
$index++; $index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
@ -1473,7 +1465,6 @@ class pdf_sponge extends ModelePDFFactures
} }
} }
} }
//} //}
// VAT // VAT

View File

@ -502,7 +502,7 @@ class pdf_soleil extends ModelePDFFicheinter
$default_font_size = pdf_getPDFFontSize($outputlangs); $default_font_size = pdf_getPDFFontSize($outputlangs);
/* /*
$pdf->SetXY($this->marge_gauche, $tab_top); $pdf->SetXY($this->marge_gauche, $tab_top);
$pdf->MultiCell(190,8,$outputlangs->transnoentities("Description"),0,'L',0); $pdf->MultiCell(190,8,$outputlangs->transnoentities("Description"),0,'L',0);
$pdf->line($this->marge_gauche, $tab_top + 8, $this->page_largeur-$this->marge_droite, $tab_top + 8); $pdf->line($this->marge_gauche, $tab_top + 8, $this->page_largeur-$this->marge_droite, $tab_top + 8);
@ -526,7 +526,7 @@ class pdf_soleil extends ModelePDFFicheinter
$pdf->line($this->marge_gauche, $nexY, $this->page_largeur-$this->marge_droite, $nexY); $pdf->line($this->marge_gauche, $nexY, $this->page_largeur-$this->marge_droite, $nexY);
$pdf->MultiCell(0, 3, ''); // Set interline to 3. Then writeMultiCell must use 3 also. $pdf->MultiCell(0, 3, ''); // Set interline to 3. Then writeMultiCell must use 3 also.
*/ */
// Output Rect // Output Rect
$this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height+1, 0, 0); // Rect takes a length in 3rd parameter and 4th parameter $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height+1, 0, 0); // Rect takes a length in 3rd parameter and 4th parameter

View File

@ -53,6 +53,9 @@ class mod_holiday_immaculate extends ModelNumRefHolidays
*/ */
public $name='Immaculate'; public $name='Immaculate';
/**
* @var int Automatic numbering
*/
public $code_auto=1; public $code_auto=1;
/** /**

View File

@ -54,6 +54,9 @@ class mod_holiday_madonna extends ModelNumRefHolidays
*/ */
public $name='Madonna'; public $name='Madonna';
/**
* @var int Automatic numbering
*/
public $code_auto=1; public $code_auto=1;

View File

@ -255,7 +255,9 @@ class mailing_fraise extends MailingTargets
$sql.= " WHERE a.entity IN (".getEntity('member').") AND a.email <> ''"; // Note that null != '' is false $sql.= " WHERE a.entity IN (".getEntity('member').") AND a.email <> ''"; // Note that null != '' is false
$sql.= " AND a.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$this->db->escape($mailing_id).")"; $sql.= " AND a.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$this->db->escape($mailing_id).")";
// Filter on status // Filter on status
if (isset($_POST["filter"]) && $_POST["filter"] == '-1') $sql.= " AND a.statut=-1"; if (isset($_POST["filter"]) && $_POST["filter"] == '-1') {
$sql.= " AND a.statut=-1";
}
if (isset($_POST["filter"]) && $_POST["filter"] == '1a') $sql.= " AND a.statut=1 AND (a.datefin >= '".$this->db->idate($now)."' OR ta.subscription = 0)"; if (isset($_POST["filter"]) && $_POST["filter"] == '1a') $sql.= " AND a.statut=1 AND (a.datefin >= '".$this->db->idate($now)."' OR ta.subscription = 0)";
if (isset($_POST["filter"]) && $_POST["filter"] == '1b') $sql.= " AND a.statut=1 AND ((a.datefin IS NULL or a.datefin < '".$this->db->idate($now)."') AND ta.subscription = 1)"; if (isset($_POST["filter"]) && $_POST["filter"] == '1b') $sql.= " AND a.statut=1 AND ((a.datefin IS NULL or a.datefin < '".$this->db->idate($now)."') AND ta.subscription = 1)";
if (isset($_POST["filter"]) && $_POST["filter"] == '0') $sql.= " AND a.statut=0"; if (isset($_POST["filter"]) && $_POST["filter"] == '0') $sql.= " AND a.statut=0";

View File

@ -291,8 +291,7 @@ class mailing_thirdparties extends MailingTargets
$s.= $langs->trans('ProspectCustomer'); $s.= $langs->trans('ProspectCustomer');
$s.=': <select name="filter_client" class="flat">'; $s.=': <select name="filter_client" class="flat">';
$s.= '<option value="-1">&nbsp;</option>'; $s.= '<option value="-1">&nbsp;</option>';
if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) {
{
$s.= '<option value="2">'.$langs->trans('Prospect').'</option>'; $s.= '<option value="2">'.$langs->trans('Prospect').'</option>';
} }
if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTSCUSTOMERS)) { if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTSCUSTOMERS)) {
@ -303,14 +302,14 @@ class mailing_thirdparties extends MailingTargets
} }
$s.= '<option value="0">'.$langs->trans('NorProspectNorCustomer').'</option>'; $s.= '<option value="0">'.$langs->trans('NorProspectNorCustomer').'</option>';
$s.='</select> '; $s.= '</select> ';
$s.=$langs->trans("Status"); $s.= $langs->trans("Status");
$s.=': <select name="filter_status" class="flat">'; $s.= ': <select name="filter_status" class="flat">';
$s.='<option value="-1">&nbsp;</option>'; $s.= '<option value="-1">&nbsp;</option>';
$s.='<option value="1" selected>'.$langs->trans("Enabled").'</option>'; $s.= '<option value="1" selected>'.$langs->trans("Enabled").'</option>';
$s.='<option value="0">'.$langs->trans("Disabled").'</option>'; $s.= '<option value="0">'.$langs->trans("Disabled").'</option>';
$s.='</select>'; $s.= '</select>';
return $s; return $s;
} }

View File

@ -72,7 +72,8 @@ class modComptabilite extends DolibarrModules
$this->const = array(); $this->const = array();
// Data directories to create when module is enabled // Data directories to create when module is enabled
$this->dirs = array("/comptabilite/temp", $this->dirs = array(
"/comptabilite/temp",
"/comptabilite/rapport", "/comptabilite/rapport",
"/comptabilite/export", "/comptabilite/export",
"/comptabilite/bordereau" "/comptabilite/bordereau"

View File

@ -298,8 +298,7 @@ class modExpedition extends DolibarrModules
$this->export_sql_end[$r] .=' , '.MAIN_DB_PREFIX.'commandedet as cd'; $this->export_sql_end[$r] .=' , '.MAIN_DB_PREFIX.'commandedet as cd';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on cd.fk_product = p.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on cd.fk_product = p.rowid';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product_extrafields as extraprod ON p.rowid = extraprod.fk_object'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product_extrafields as extraprod ON p.rowid = extraprod.fk_object';
if ($idcontacts && ! empty($conf->global->SHIPMENT_ADD_CONTACTS_IN_EXPORT)) if ($idcontacts && ! empty($conf->global->SHIPMENT_ADD_CONTACTS_IN_EXPORT)) {
{
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'element_contact as ee ON ee.element_id = cd.fk_commande AND ee.fk_c_type_contact IN ('.$idcontacts.')'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'element_contact as ee ON ee.element_id = cd.fk_commande AND ee.fk_c_type_contact IN ('.$idcontacts.')';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'socpeople as sp ON sp.rowid = ee.fk_socpeople'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'socpeople as sp ON sp.rowid = ee.fk_socpeople';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'socpeople_extrafields as extra3 ON sp.rowid = extra3.fk_object'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'socpeople_extrafields as extra3 ON sp.rowid = extra3.fk_object';

View File

@ -223,8 +223,7 @@ class modReception extends DolibarrModules
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'commande_fournisseur_dispatch_extrafields as extra2 ON ed.rowid = extra2.fk_object'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'commande_fournisseur_dispatch_extrafields as extra2 ON ed.rowid = extra2.fk_object';
$this->export_sql_end[$r] .=' , '.MAIN_DB_PREFIX.'commande_fournisseurdet as cd'; $this->export_sql_end[$r] .=' , '.MAIN_DB_PREFIX.'commande_fournisseurdet as cd';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on cd.fk_product = p.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on cd.fk_product = p.rowid';
if ($idcontacts && ! empty($conf->global->RECEPTION_ADD_CONTACTS_IN_EXPORT)) if ($idcontacts && ! empty($conf->global->RECEPTION_ADD_CONTACTS_IN_EXPORT)) {
{
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'element_contact as ee ON ee.element_id = cd.fk_commande AND ee.fk_c_type_contact IN ('.$idcontacts.')'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'element_contact as ee ON ee.element_id = cd.fk_commande AND ee.fk_c_type_contact IN ('.$idcontacts.')';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'socpeople as sp ON sp.rowid = ee.fk_socpeople'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'socpeople as sp ON sp.rowid = ee.fk_socpeople';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'socpeople_extrafields as extra3 ON sp.rowid = extra3.fk_object'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'socpeople_extrafields as extra3 ON sp.rowid = extra3.fk_object';

View File

@ -148,7 +148,7 @@ class modSociete extends DolibarrModules
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
$this->rights[$r][4] = 'lire'; $this->rights[$r][4] = 'lire';
/* $r++; /*$r++;
$this->rights[$r][0] = 241; $this->rights[$r][0] = 241;
$this->rights[$r][1] = 'Read thirdparties customers'; $this->rights[$r][1] = 'Read thirdparties customers';
$this->rights[$r][2] = 'r'; $this->rights[$r][2] = 'r';
@ -163,7 +163,7 @@ class modSociete extends DolibarrModules
$this->rights[$r][3] = 0; $this->rights[$r][3] = 0;
$this->rights[$r][4] = 'thirdparty_supplier_advance'; // Visible if option MAIN_USE_ADVANCED_PERMS is on $this->rights[$r][4] = 'thirdparty_supplier_advance'; // Visible if option MAIN_USE_ADVANCED_PERMS is on
$this->rights[$r][5] = 'read'; $this->rights[$r][5] = 'read';
*/ */
$r++; $r++;
$this->rights[$r][0] = 122; // id de la permission $this->rights[$r][0] = 122; // id de la permission
@ -172,7 +172,7 @@ class modSociete extends DolibarrModules
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
$this->rights[$r][4] = 'creer'; $this->rights[$r][4] = 'creer';
/* $r++; /* $r++;
$this->rights[$r][0] = 251; $this->rights[$r][0] = 251;
$this->rights[$r][1] = 'Create thirdparties customers'; $this->rights[$r][1] = 'Create thirdparties customers';
$this->rights[$r][2] = 'r'; $this->rights[$r][2] = 'r';
@ -187,7 +187,7 @@ class modSociete extends DolibarrModules
$this->rights[$r][3] = 0; $this->rights[$r][3] = 0;
$this->rights[$r][4] = 'thirdparty_supplier_advance'; // Visible if option MAIN_USE_ADVANCED_PERMS is on $this->rights[$r][4] = 'thirdparty_supplier_advance'; // Visible if option MAIN_USE_ADVANCED_PERMS is on
$this->rights[$r][5] = 'read'; $this->rights[$r][5] = 'read';
*/ */
$r++; $r++;
$this->rights[$r][0] = 125; // id de la permission $this->rights[$r][0] = 125; // id de la permission

View File

@ -82,8 +82,8 @@ class modStripe extends DolibarrModules
// New pages on tabs // New pages on tabs
$this->tabs = array(); $this->tabs = array();
// Boxes // List of boxes
$this->boxes = array(); // List of boxes $this->boxes = array();
$r=0; $r=0;
// Permissions // Permissions

View File

@ -92,7 +92,7 @@ class modVariants extends DolibarrModules
// Array to add new pages in new tabs // Array to add new pages in new tabs
$this->tabs = array( $this->tabs = array(
// 'product:+combinations:Combinaciones:products:1:/variants/combinations.php?id=__ID__' // 'product:+combinations:Combinaciones:products:1:/variants/combinations.php?id=__ID__'
); );
// Dictionaries // Dictionaries

View File

@ -185,14 +185,12 @@ class modWebsite extends DolibarrModules
dol_mkdir($destroot); dol_mkdir($destroot);
$docs=dol_dir_list($srcroot, 'files', 0, 'website_.*(\.zip|\.jpg)$'); $docs=dol_dir_list($srcroot, 'files', 0, 'website_.*(\.zip|\.jpg)$');
foreach($docs as $cursorfile) foreach($docs as $cursorfile) {
{
$src=$srcroot.'/'.$cursorfile['name']; $src=$srcroot.'/'.$cursorfile['name'];
$dest=$destroot.'/'.$cursorfile['name']; $dest=$destroot.'/'.$cursorfile['name'];
$result=dol_copy($src, $dest, 0, 0); $result=dol_copy($src, $dest, 0, 0);
if ($result < 0) if ($result < 0) {
{
$langs->load("errors"); $langs->load("errors");
$this->error=$langs->trans('ErrorFailToCopyFile', $src, $dest); $this->error=$langs->trans('ErrorFailToCopyFile', $src, $dest);
} }

View File

@ -668,8 +668,7 @@ class pdf_standard extends ModelePDFProduct
$pdf->line($this->posxunit - 1, $tab_top, $this->posxunit - 1, $tab_top + $tab_height); $pdf->line($this->posxunit - 1, $tab_top, $this->posxunit - 1, $tab_top + $tab_height);
if (empty($hidetop)) { if (empty($hidetop)) {
$pdf->SetXY($this->posxunit - 1, $tab_top + 1); $pdf->SetXY($this->posxunit - 1, $tab_top + 1);
$pdf->MultiCell($this->posxdiscount - $this->posxunit - 1, 2, $outputlangs->transnoentities("Unit"), '', $pdf->MultiCell($this->posxdiscount - $this->posxunit - 1, 2, $outputlangs->transnoentities("Unit"), '', 'C');
'C');
} }
} }

View File

@ -60,7 +60,10 @@ class mod_codeproduct_elephant extends ModeleProductCode
*/ */
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr' public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
public $code_auto; // Numerotation automatique /**
* @var int Automatic numbering
*/
public $code_auto;
public $searchcode; // String de recherche public $searchcode; // String de recherche

View File

@ -65,7 +65,10 @@ class mod_codeproduct_leopard extends ModeleProductCode
*/ */
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr' public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
public $code_auto; // Numerotation automatique /**
* @var int Automatic numbering
*/
public $code_auto;
/** /**

View File

@ -142,10 +142,9 @@ class pdf_squille extends ModelePdfReception
$realpath=''; $realpath='';
foreach ($objphoto->liste_photos($dir, 1) as $key => $obj) foreach ($objphoto->liste_photos($dir, 1) as $key => $obj) {
{ if (empty($conf->global->CAT_HIGH_QUALITY_IMAGES)) {
if (empty($conf->global->CAT_HIGH_QUALITY_IMAGES)) // If CAT_HIGH_QUALITY_IMAGES not defined, we use thumb if defined and then original photo // If CAT_HIGH_QUALITY_IMAGES not defined, we use thumb if defined and then original photo
{
if ($obj['photo_vignette']) if ($obj['photo_vignette'])
{ {
$filename= $obj['photo_vignette']; $filename= $obj['photo_vignette'];
@ -461,8 +460,7 @@ class pdf_squille extends ModelePdfReception
$pdf->writeHTMLCell($this->posxqtyordered - $this->posxweightvol + 2, 3, $this->posxweightvol - 1, $curY, $weighttxt.(($weighttxt && $voltxt)?'<br>':'').$voltxt, 0, 0, false, true, 'C'); $pdf->writeHTMLCell($this->posxqtyordered - $this->posxweightvol + 2, 3, $this->posxweightvol - 1, $curY, $weighttxt.(($weighttxt && $voltxt)?'<br>':'').$voltxt, 0, 0, false, true, 'C');
//$pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), 3, $weighttxt.(($weighttxt && $voltxt)?'<br>':'').$voltxt,'','C'); //$pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), 3, $weighttxt.(($weighttxt && $voltxt)?'<br>':'').$voltxt,'','C');
if (empty($conf->global->RECEPTION_PDF_HIDE_ORDERED)) if (empty($conf->global->RECEPTION_PDF_HIDE_ORDERED)) {
{
$pdf->SetXY($this->posxqtyordered, $curY); $pdf->SetXY($this->posxqtyordered, $curY);
if($object->lines[$i]->fk_commandefourndet!=$fk_commandefourndet){ if($object->lines[$i]->fk_commandefourndet!=$fk_commandefourndet){
$pdf->MultiCell(($this->posxqtytoship - $this->posxqtyordered), 3, $object->lines[$i]->qty_asked, '', 'C'); $pdf->MultiCell(($this->posxqtytoship - $this->posxqtyordered), 3, $object->lines[$i]->qty_asked, '', 'C');

View File

@ -198,8 +198,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc
} }
// Add odtgeneration hook // Add odtgeneration hook
if (! is_object($hookmanager)) if (! is_object($hookmanager)) {
{
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
$hookmanager=new HookManager($this->db); $hookmanager=new HookManager($this->db);
} }
@ -412,8 +411,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc
$odfHandler->title = $object->builddoc_filename; $odfHandler->title = $object->builddoc_filename;
$odfHandler->subject = $object->builddoc_filename; $odfHandler->subject = $object->builddoc_filename;
if (! empty($conf->global->ODT_ADD_DOLIBARR_ID)) if (! empty($conf->global->ODT_ADD_DOLIBARR_ID)) {
{
$odfHandler->userdefined['dol_id'] = $object->id; $odfHandler->userdefined['dol_id'] = $object->id;
$odfHandler->userdefined['dol_element'] = $object->element; $odfHandler->userdefined['dol_element'] = $object->element;
} }

View File

@ -53,7 +53,10 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode
*/ */
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr' public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
public $code_auto; // Numerotation automatique /**
* @var int Automatic numbering
*/
public $code_auto;
public $searchcode; // String de recherche public $searchcode; // String de recherche

View File

@ -57,7 +57,10 @@ class mod_codeclient_leopard extends ModeleThirdPartyCode
*/ */
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr' public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
public $code_auto; // Numerotation automatique /**
* @var int Automatic numbering
*/
public $code_auto;
/** /**

View File

@ -51,7 +51,10 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode
*/ */
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr' public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
public $code_auto; // Numerotation automatique /**
* @var int Automatic numbering
*/
public $code_auto;
public $prefixcustomer='CU'; public $prefixcustomer='CU';

View File

@ -715,8 +715,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
//if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
//{ //{
//Local tax 1 //Local tax 1
foreach($this->localtax1 as $tvakey => $tvaval) foreach ($this->localtax1 as $tvakey => $tvaval) {
{
if ($tvakey != 0) // On affiche pas taux 0 if ($tvakey != 0) // On affiche pas taux 0
{ {
//$this->atleastoneratenotnull++; //$this->atleastoneratenotnull++;
@ -743,8 +742,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
//if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
//{ //{
//Local tax 2 //Local tax 2
foreach($this->localtax2 as $tvakey => $tvaval) foreach($this->localtax2 as $tvakey => $tvaval) {
{
if ($tvakey != 0) // On affiche pas taux 0 if ($tvakey != 0) // On affiche pas taux 0
{ {
//$this->atleastoneratenotnull++; //$this->atleastoneratenotnull++;

View File

@ -4,7 +4,7 @@
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com> * Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
* Copyright (C) 2018-2019 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2018-2019 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2019 Tim Otte <otte@meuser.it> * Copyright (C) 2019 Tim Otte <otte@meuser.it>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

Some files were not shown because too many files have changed in this diff Show More