Merge remote-tracking branch 'origin/3.8' into develop
This commit is contained in:
commit
b7cb98e873
@ -240,6 +240,11 @@ FIX [ bug #3288 ] Tasks box is not properly drawn
|
|||||||
FIX [ bug #3211 ] Outstading bill amount of a client showed wrong amounts
|
FIX [ bug #3211 ] Outstading bill amount of a client showed wrong amounts
|
||||||
FIX [ bug #3321 ] Users with certain permissions were shown a "forbidden access" page even if they had the rights
|
FIX [ bug #3321 ] Users with certain permissions were shown a "forbidden access" page even if they had the rights
|
||||||
FIX [ bug #3426 ] Unable to create an invoice from a contract with extrafields
|
FIX [ bug #3426 ] Unable to create an invoice from a contract with extrafields
|
||||||
|
FIX [ bug #3431 ] Invoice bank account is not respected
|
||||||
|
FIX [ bug #3432 ] Spaces should be removed from IBAN when formatting it
|
||||||
|
FIX [ bug #3358 ] Tasks box does not work with PostgreSQL
|
||||||
|
FIX [ bug #3383 ] Company name is overlapped with company direction in PDF models
|
||||||
|
FIX [ bug #3460 ] Bank account is not saved when creating a customer invoice and facing an error message
|
||||||
|
|
||||||
NEW: Created new ContratLigne::insert function
|
NEW: Created new ContratLigne::insert function
|
||||||
|
|
||||||
|
|||||||
@ -173,11 +173,12 @@ if ($result) {
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
$var = true;
|
$var = false;
|
||||||
|
|
||||||
$accountstatic=new AccountingAccount($db);
|
$accountstatic=new AccountingAccount($db);
|
||||||
|
|
||||||
while ( $i < min($num, $limit) ) {
|
while ( $i < min($num, $limit) )
|
||||||
|
{
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
$accountstatic->id=$obj->rowid;
|
$accountstatic->id=$obj->rowid;
|
||||||
|
|||||||
@ -99,12 +99,13 @@ print_fiche_titre($langs->trans('ConfigAccountingExpert'),$linkback,'title_setup
|
|||||||
|
|
||||||
$head = admin_accounting_prepare_head();
|
$head = admin_accounting_prepare_head();
|
||||||
|
|
||||||
dol_fiche_head($head, 'export', $langs->trans("Configuration"), 0, 'cron');
|
|
||||||
|
|
||||||
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">';
|
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">';
|
||||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||||
print '<input type="hidden" name="action" value="update">';
|
print '<input type="hidden" name="action" value="update">';
|
||||||
|
|
||||||
|
dol_fiche_head($head, 'export', $langs->trans("Configuration"), 0, 'cron');
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
$var = true;
|
$var = true;
|
||||||
|
|
||||||
@ -169,7 +170,9 @@ if ($num)
|
|||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<br><div style="text-align:center"><input type="submit" class="button" value="' . dol_escape_htmltag($langs->trans('Modify')) . '" name="button"></div>';
|
dol_fiche_end();
|
||||||
|
|
||||||
|
print '<div class="center"><input type="submit" class="button" value="' . dol_escape_htmltag($langs->trans('Modify')) . '" name="button"></div>';
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
|
|||||||
@ -157,12 +157,13 @@ print_fiche_titre($langs->trans('ConfigAccountingExpert'),$linkback,'title_setup
|
|||||||
|
|
||||||
$head = admin_accounting_prepare_head($accounting);
|
$head = admin_accounting_prepare_head($accounting);
|
||||||
|
|
||||||
dol_fiche_head($head, 'general', $langs->trans("Configuration"), 0, 'cron');
|
|
||||||
|
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<input type="hidden" name="action" value="update">';
|
print '<input type="hidden" name="action" value="update">';
|
||||||
|
|
||||||
|
dol_fiche_head($head, 'general', $langs->trans("Configuration"), 0, 'cron');
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
|
|
||||||
// Cas du parametre ACCOUNTING_MODE
|
// Cas du parametre ACCOUNTING_MODE
|
||||||
@ -291,7 +292,11 @@ print '</tr>';
|
|||||||
|
|
||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
|
|
||||||
print '<br /><br /><div style="text-align:center"><input type="submit" class="button" value="'.$langs->trans('Modify').'" name="button"></div>';
|
dol_fiche_end();
|
||||||
|
|
||||||
|
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans('Modify').'" name="button"></div>';
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -22,7 +22,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/accountancy/admin/journaux.php
|
* \file htdocs/accountancy/admin/journal.php
|
||||||
* \ingroup Accounting Expert
|
* \ingroup Accounting Expert
|
||||||
* \brief Setup page to configure accounting expert module
|
* \brief Setup page to configure accounting expert module
|
||||||
*/
|
*/
|
||||||
@ -87,12 +87,12 @@ print_fiche_titre($langs->trans('ConfigAccountingExpert'),$linkback,'title_setup
|
|||||||
|
|
||||||
$head = admin_accounting_prepare_head(null);
|
$head = admin_accounting_prepare_head(null);
|
||||||
|
|
||||||
dol_fiche_head($head, 'journal', $langs->trans("Configuration"), 0, 'cron');
|
|
||||||
|
|
||||||
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">';
|
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">';
|
||||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||||
print '<input type="hidden" name="action" value="update">';
|
print '<input type="hidden" name="action" value="update">';
|
||||||
|
|
||||||
|
dol_fiche_head($head, 'journal', $langs->trans("Configuration"), 0, 'cron');
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td colspan="3">' . $langs->trans('Journaux') . '</td>';
|
print '<td colspan="3">' . $langs->trans('Journaux') . '</td>';
|
||||||
@ -115,10 +115,9 @@ foreach ( $list as $key ) {
|
|||||||
|
|
||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
|
|
||||||
print '<br /><div style="text-align:center"><input type="submit" class="button" value="' . $langs->trans('Modify') . '" name="button"></div>';
|
|
||||||
print '</form>';
|
|
||||||
|
|
||||||
print '<br />';
|
print '<br>';
|
||||||
|
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
@ -164,9 +163,12 @@ $db->free($resql);
|
|||||||
|
|
||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
|
|
||||||
print '</div>';
|
dol_fiche_end();
|
||||||
|
|
||||||
|
print '<div class="center"><input type="submit" class="button" value="' . $langs->trans('Modify') . '" name="button"></div>';
|
||||||
|
|
||||||
|
print '</form>';
|
||||||
|
|
||||||
print '<br>';
|
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
@ -287,8 +287,9 @@ if ($result) {
|
|||||||
print '<th align="left">' . $langs->trans("Accountancy_code_sell_suggest") . '</td>';
|
print '<th align="left">' . $langs->trans("Accountancy_code_sell_suggest") . '</td>';
|
||||||
}
|
}
|
||||||
// print_liste_field_titre('');
|
// print_liste_field_titre('');
|
||||||
print '<td align="center">' . $langs->trans("Ventilate") . '<br><label id="select-all">' . $langs->trans('All') . '</label>/<label id="unselect-all">' . $langs->trans('None') . '</label>' . '</td>';
|
print_liste_field_titre($langs->trans("Ventilate") . '<br><label id="select-all">' . $langs->trans('All') . '</label> / <label id="unselect-all">' . $langs->trans('None') . '</label>');
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_ref" value="' . $search_ref . '"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_ref" value="' . $search_ref . '"></td>';
|
||||||
print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_label" value="' . $search_label . '"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_label" value="' . $search_label . '"></td>';
|
||||||
@ -359,7 +360,7 @@ if ($result) {
|
|||||||
// print '<td align="left">' . $compta_prodbuy . '</td>';
|
// print '<td align="left">' . $compta_prodbuy . '</td>';
|
||||||
// TODO: we shoul set a user defined value to adjust user square / wide screen size
|
// TODO: we shoul set a user defined value to adjust user square / wide screen size
|
||||||
// $trunclenghform = defined('ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT') ? ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT : 50;
|
// $trunclenghform = defined('ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT') ? ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT : 50;
|
||||||
print '<td align="center">';
|
print '<td align="left">';
|
||||||
print $form->select_account($compta_prodbuy_id, 'codeventil_'.$product_static->id, 1);
|
print $form->select_account($compta_prodbuy_id, 'codeventil_'.$product_static->id, 1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
} else {
|
} else {
|
||||||
@ -369,7 +370,7 @@ if ($result) {
|
|||||||
// TODO: replace by select
|
// TODO: replace by select
|
||||||
// TODO: we shoul set a user defined value to adjust user square / wide screen size
|
// TODO: we shoul set a user defined value to adjust user square / wide screen size
|
||||||
// $trunclenghform = defined('ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT') ? ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT : 50;
|
// $trunclenghform = defined('ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT') ? ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT : 50;
|
||||||
print '<td align="center">';
|
print '<td align="left">';
|
||||||
print $form->select_account($compta_prodsell_id, 'codeventil_'.$product_static->id, 1);
|
print $form->select_account($compta_prodsell_id, 'codeventil_'.$product_static->id, 1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -571,7 +571,7 @@ else
|
|||||||
|
|
||||||
// Title
|
// Title
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td valign="top" width="110">'.$langs->trans("ReportName").'</td>';
|
print '<td width="110">'.$langs->trans("ReportName").'</td>';
|
||||||
print '<td colspan="3">'.$namereport.'</td>';
|
print '<td colspan="3">'.$namereport.'</td>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
@ -588,7 +588,7 @@ else
|
|||||||
|
|
||||||
// Description
|
// Description
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td valign="top">'.$langs->trans("ReportDescription").'</td>';
|
print '<td>'.$langs->trans("ReportDescription").'</td>';
|
||||||
print '<td colspan="3">'.$description.'</td>';
|
print '<td colspan="3">'.$description.'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
|||||||
@ -394,6 +394,9 @@ if ($action == 'create' && !$error)
|
|||||||
print '<input type="hidden" name="origin" value="'.GETPOST('origin').'">';
|
print '<input type="hidden" name="origin" value="'.GETPOST('origin').'">';
|
||||||
print '<input type="hidden" name="originid" value="'.GETPOST('originid').'">';
|
print '<input type="hidden" name="originid" value="'.GETPOST('originid').'">';
|
||||||
print '<input type="hidden" name="autocloseorders" value="'.GETPOST('autocloseorders').'">';
|
print '<input type="hidden" name="autocloseorders" value="'.GETPOST('autocloseorders').'">';
|
||||||
|
|
||||||
|
dol_fiche_head();
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
@ -495,16 +498,20 @@ if ($action == 'create' && !$error)
|
|||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dol_fiche_end();
|
||||||
|
|
||||||
// Button "Create Draft"
|
// Button "Create Draft"
|
||||||
print '<br><div class="center"><input type="submit" class="button" name="bouton" value="'.$langs->trans('CreateDraft').'" /></div>';
|
print '<div class="center"><input type="submit" class="button" name="bouton" value="'.$langs->trans('CreateDraft').'" /></div>';
|
||||||
print "</form>\n";
|
print "</form>\n";
|
||||||
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Mode liste
|
// Mode liste
|
||||||
if (($action != 'create' && $action != 'add') && !$error)
|
if (($action != 'create' && $action != 'add') || ($action == 'create' && $error))
|
||||||
{
|
{
|
||||||
llxHeader();
|
llxHeader();
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -2242,6 +2242,10 @@ if ($action == 'create')
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Bank Account
|
// Bank Account
|
||||||
|
if (isset($_POST['fk_account'])) {
|
||||||
|
$fk_account = $_POST['fk_account'];
|
||||||
|
}
|
||||||
|
|
||||||
print '<tr><td>' . $langs->trans('BankAccount') . '</td><td colspan="2">';
|
print '<tr><td>' . $langs->trans('BankAccount') . '</td><td colspan="2">';
|
||||||
$form->select_comptes($fk_account, 'fk_account', 0, '', 1);
|
$form->select_comptes($fk_account, 'fk_account', 0, '', 1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|||||||
@ -82,7 +82,7 @@ class box_task extends ModeleBoxes
|
|||||||
|
|
||||||
$sql = "SELECT pt.fk_statut, count(pt.rowid) as nb, sum(ptt.task_duration) as durationtot, sum(pt.planned_workload) as plannedtot";
|
$sql = "SELECT pt.fk_statut, count(pt.rowid) as nb, sum(ptt.task_duration) as durationtot, sum(pt.planned_workload) as plannedtot";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."projet_task as pt, ".MAIN_DB_PREFIX."projet_task_time as ptt";
|
$sql.= " FROM ".MAIN_DB_PREFIX."projet_task as pt, ".MAIN_DB_PREFIX."projet_task_time as ptt";
|
||||||
$sql.= " WHERE DATE_FORMAT(pt.datec,'%Y') = ".date("Y")." ";
|
$sql.= " WHERE DATE_FORMAT(pt.datec,'%Y') = '".date("Y")."' ";
|
||||||
$sql.= " AND pt.rowid = ptt.fk_task";
|
$sql.= " AND pt.rowid = ptt.fk_task";
|
||||||
$sql.= " GROUP BY pt.fk_statut ";
|
$sql.= " GROUP BY pt.fk_statut ";
|
||||||
$sql.= " ORDER BY pt.fk_statut DESC";
|
$sql.= " ORDER BY pt.fk_statut DESC";
|
||||||
|
|||||||
@ -47,12 +47,12 @@ function admin_accounting_prepare_head(AccountingAccount $object=null)
|
|||||||
// $this->tabs = array('entity:-tabname); to remove a tab
|
// $this->tabs = array('entity:-tabname); to remove a tab
|
||||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'accounting_admin');
|
complete_head_from_modules($conf, $langs, $object, $head, $h, 'accounting_admin');
|
||||||
|
|
||||||
$head[$h][0] = dol_buildpath('/accountancy/admin/journaux.php', 1);
|
$head[$h][0] = DOL_URL_ROOT.'/accountancy/admin/journal.php';
|
||||||
$head[$h][1] = $langs->trans("Journaux");
|
$head[$h][1] = $langs->trans("Journaux");
|
||||||
$head[$h][2] = 'journal';
|
$head[$h][2] = 'journal';
|
||||||
$h ++;
|
$h ++;
|
||||||
|
|
||||||
$head[$h][0] = dol_buildpath('/accountancy/admin/export.php', 1);
|
$head[$h][0] = DOL_URL_ROOT.'/accountancy/admin/export.php';
|
||||||
$head[$h][1] = $langs->trans("Export");
|
$head[$h][1] = $langs->trans("Export");
|
||||||
$head[$h][2] = 'export';
|
$head[$h][2] = 'export';
|
||||||
$h ++;
|
$h ++;
|
||||||
@ -75,7 +75,7 @@ function accounting_prepare_head(AccountingAccount $object)
|
|||||||
$h = 0;
|
$h = 0;
|
||||||
$head = array ();
|
$head = array ();
|
||||||
|
|
||||||
$head[$h][0] = dol_buildpath('/accountancy/admin/card.php', 1) . '?id=' . $object->id;
|
$head[$h][0] = DOL_URL_ROOT.'/accountancy/admin/card.php?id=' . $object->id;
|
||||||
$head[$h][1] = $langs->trans("Card");
|
$head[$h][1] = $langs->trans("Card");
|
||||||
$head[$h][2] = 'card';
|
$head[$h][2] = 'card';
|
||||||
$h ++;
|
$h ++;
|
||||||
|
|||||||
@ -676,7 +676,8 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default
|
|||||||
if ($account->getCountryCode() == 'IN') $ibankey="IFSC";
|
if ($account->getCountryCode() == 'IN') $ibankey="IFSC";
|
||||||
if (! empty($account->iban))
|
if (! empty($account->iban))
|
||||||
{
|
{
|
||||||
$ibanDisplay_temp = $outputlangs->convToOutputCharset($account->iban);
|
//Remove whitespaces to ensure we are dealing with the format we expect
|
||||||
|
$ibanDisplay_temp = str_replace(' ', '', $outputlangs->convToOutputCharset($account->iban));
|
||||||
$ibanDisplay = "";
|
$ibanDisplay = "";
|
||||||
|
|
||||||
for($i = 0; $i < dol_strlen($ibanDisplay_temp); $i++)
|
for($i = 0; $i < dol_strlen($ibanDisplay_temp); $i++)
|
||||||
|
|||||||
@ -61,7 +61,7 @@ function report_header($nom,$variante,$period,$periodlink,$description,$builddat
|
|||||||
|
|
||||||
// Ligne de titre
|
// Ligne de titre
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td valign="top" width="110">'.$langs->trans("ReportName").'</td>';
|
print '<td width="110">'.$langs->trans("ReportName").'</td>';
|
||||||
if (! $variantexxx) print '<td colspan="3">';
|
if (! $variantexxx) print '<td colspan="3">';
|
||||||
else print '<td>';
|
else print '<td>';
|
||||||
print $nom;
|
print $nom;
|
||||||
@ -73,7 +73,7 @@ function report_header($nom,$variante,$period,$periodlink,$description,$builddat
|
|||||||
if ($calcmode)
|
if ($calcmode)
|
||||||
{
|
{
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td valign="top" width="110">'.$langs->trans("CalculationMode").'</td>';
|
print '<td width="110">'.$langs->trans("CalculationMode").'</td>';
|
||||||
if (! $variante) print '<td colspan="3">';
|
if (! $variante) print '<td colspan="3">';
|
||||||
else print '<td>';
|
else print '<td>';
|
||||||
print $calcmode;
|
print $calcmode;
|
||||||
@ -94,7 +94,7 @@ function report_header($nom,$variante,$period,$periodlink,$description,$builddat
|
|||||||
|
|
||||||
// Ligne de description
|
// Ligne de description
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td valign="top">'.$langs->trans("ReportDescription").'</td>';
|
print '<td>'.$langs->trans("ReportDescription").'</td>';
|
||||||
print '<td colspan="3">'.$description.'</td>';
|
print '<td colspan="3">'.$description.'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
|||||||
@ -1325,9 +1325,11 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
$pdf->SetFont('','B', $default_font_size);
|
$pdf->SetFont('','B', $default_font_size);
|
||||||
$pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L');
|
$pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L');
|
||||||
|
|
||||||
|
$posy = $pdf->getY();
|
||||||
|
|
||||||
// Show recipient information
|
// Show recipient information
|
||||||
$pdf->SetFont('','', $default_font_size - 1);
|
$pdf->SetFont('','', $default_font_size - 1);
|
||||||
$pdf->SetXY($posx+2,$posy+4+(dol_nboflines_bis($carac_client_name,50)*4));
|
$pdf->SetXY($posx+2,$posy);
|
||||||
$pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
|
$pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1217,9 +1217,11 @@ class pdf_proforma extends ModelePDFCommandes
|
|||||||
$pdf->SetFont('','B', $default_font_size);
|
$pdf->SetFont('','B', $default_font_size);
|
||||||
$pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L');
|
$pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L');
|
||||||
|
|
||||||
|
$posy = $pdf->getY();
|
||||||
|
|
||||||
// Show recipient information
|
// Show recipient information
|
||||||
$pdf->SetFont('','', $default_font_size - 1);
|
$pdf->SetFont('','', $default_font_size - 1);
|
||||||
$pdf->SetXY($posx+2,$posy+4+(dol_nboflines_bis($carac_client_name,50)*4));
|
$pdf->SetXY($posx+2,$posy);
|
||||||
$pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
|
$pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -647,9 +647,11 @@ class pdf_strato extends ModelePDFContract
|
|||||||
$pdf->SetFont('','B', $default_font_size);
|
$pdf->SetFont('','B', $default_font_size);
|
||||||
$pdf->MultiCell($widthrecbox, 4, $this->recipient->name, 0, 'L');
|
$pdf->MultiCell($widthrecbox, 4, $this->recipient->name, 0, 'L');
|
||||||
|
|
||||||
|
$posy = $pdf->getY();
|
||||||
|
|
||||||
// Show recipient information
|
// Show recipient information
|
||||||
$pdf->SetFont('','', $default_font_size - 1);
|
$pdf->SetFont('','', $default_font_size - 1);
|
||||||
$pdf->SetXY($posx+2,$posy+4+(dol_nboflines_bis($this->recipient->name,50)*4));
|
$pdf->SetXY($posx+2,$posy);
|
||||||
$pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
|
$pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -650,9 +650,11 @@ class pdf_merou extends ModelePdfExpedition
|
|||||||
$pdf->SetXY($blDestX,$Yoff);
|
$pdf->SetXY($blDestX,$Yoff);
|
||||||
$pdf->MultiCell($blW,3, $carac_client_name, 0, 'L');
|
$pdf->MultiCell($blW,3, $carac_client_name, 0, 'L');
|
||||||
|
|
||||||
|
$posy = $pdf->getY();
|
||||||
|
|
||||||
// Show recipient information
|
// Show recipient information
|
||||||
$pdf->SetFont('','', $default_font_size - 3);
|
$pdf->SetFont('','', $default_font_size - 1);
|
||||||
$pdf->SetXY($blDestX,$Yoff+(dol_nboflines_bis($carac_client_name,50)*4));
|
$pdf->SetXY($posx+2,$posy);
|
||||||
$pdf->MultiCell($blW,2, $carac_client, 0, 'L');
|
$pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -694,9 +694,11 @@ class pdf_rouget extends ModelePdfExpedition
|
|||||||
$pdf->SetFont('','B', $default_font_size);
|
$pdf->SetFont('','B', $default_font_size);
|
||||||
$pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L');
|
$pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L');
|
||||||
|
|
||||||
|
$posy = $pdf->getY();
|
||||||
|
|
||||||
// Show recipient information
|
// Show recipient information
|
||||||
$pdf->SetFont('','', $default_font_size - 1);
|
$pdf->SetFont('','', $default_font_size - 1);
|
||||||
$pdf->SetXY($posx+2,$posy+4+(dol_nboflines_bis($carac_client_name,50)*4));
|
$pdf->SetXY($posx+2,$posy);
|
||||||
$pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
|
$pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -958,9 +958,9 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
// If payment mode not forced or forced to VIR, show payment with BAN
|
// If payment mode not forced or forced to VIR, show payment with BAN
|
||||||
if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'VIR')
|
if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'VIR')
|
||||||
{
|
{
|
||||||
if (! empty($object->fk_bank) || ! empty($conf->global->FACTURE_RIB_NUMBER))
|
if (! empty($object->fk_account) || ! empty($conf->global->FACTURE_RIB_NUMBER))
|
||||||
{
|
{
|
||||||
$bankid=(empty($object->fk_bank)?$conf->global->FACTURE_RIB_NUMBER:$object->fk_bank);
|
$bankid=(empty($object->fk_account)?$conf->global->FACTURE_RIB_NUMBER:$object->fk_account);
|
||||||
$account = new Account($this->db);
|
$account = new Account($this->db);
|
||||||
$account->fetch($bankid);
|
$account->fetch($bankid);
|
||||||
|
|
||||||
@ -1611,11 +1611,13 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
// Show recipient name
|
// Show recipient name
|
||||||
$pdf->SetXY($posx+2,$posy+3);
|
$pdf->SetXY($posx+2,$posy+3);
|
||||||
$pdf->SetFont('','B', $default_font_size);
|
$pdf->SetFont('','B', $default_font_size);
|
||||||
$pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L');
|
$pdf->MultiCell($widthrecbox, 2, $carac_client_name, 0, 'L');
|
||||||
|
|
||||||
|
$posy = $pdf->getY();
|
||||||
|
|
||||||
// Show recipient information
|
// Show recipient information
|
||||||
$pdf->SetFont('','', $default_font_size - 1);
|
$pdf->SetFont('','', $default_font_size - 1);
|
||||||
$pdf->SetXY($posx+2,$posy+4+(dol_nboflines_bis($carac_client_name,50)*4));
|
$pdf->SetXY($posx+2,$posy);
|
||||||
$pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
|
$pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -641,9 +641,11 @@ class pdf_soleil extends ModelePDFFicheinter
|
|||||||
$pdf->SetFont('','B', $default_font_size);
|
$pdf->SetFont('','B', $default_font_size);
|
||||||
$pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L');
|
$pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L');
|
||||||
|
|
||||||
|
$posy = $pdf->getY();
|
||||||
|
|
||||||
// Show recipient information
|
// Show recipient information
|
||||||
$pdf->SetFont('','', $default_font_size - 1);
|
$pdf->SetFont('','', $default_font_size - 1);
|
||||||
$pdf->SetXY($posx+2,$posy+4+(dol_nboflines_bis($carac_client_name,50)*4));
|
$pdf->SetXY($posx+2,$posy);
|
||||||
$pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
|
$pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -875,9 +875,11 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
|||||||
$pdf->SetFont('','B', $default_font_size);
|
$pdf->SetFont('','B', $default_font_size);
|
||||||
$pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L');
|
$pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L');
|
||||||
|
|
||||||
|
$posy = $pdf->getY();
|
||||||
|
|
||||||
// Show recipient information
|
// Show recipient information
|
||||||
$pdf->SetFont('','', $default_font_size - 1);
|
$pdf->SetFont('','', $default_font_size - 1);
|
||||||
$pdf->SetXY($posx+2,$posy+4+(dol_nboflines_bis($carac_client_name,50)*4));
|
$pdf->SetXY($posx+2,$posy);
|
||||||
$pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
|
$pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1517,9 +1517,11 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
$pdf->SetFont('','B', $default_font_size);
|
$pdf->SetFont('','B', $default_font_size);
|
||||||
$pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L');
|
$pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L');
|
||||||
|
|
||||||
|
$posy = $pdf->getY();
|
||||||
|
|
||||||
// Show recipient information
|
// Show recipient information
|
||||||
$pdf->SetFont('','', $default_font_size - 1);
|
$pdf->SetFont('','', $default_font_size - 1);
|
||||||
$pdf->SetXY($posx+2,$posy+4+(dol_nboflines_bis($carac_client_name,50)*4));
|
$pdf->SetXY($posx+2,$posy);
|
||||||
$pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
|
$pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1132,9 +1132,11 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
|||||||
$pdf->SetFont('','B', $default_font_size);
|
$pdf->SetFont('','B', $default_font_size);
|
||||||
$pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L');
|
$pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L');
|
||||||
|
|
||||||
|
$posy = $pdf->getY();
|
||||||
|
|
||||||
// Show recipient information
|
// Show recipient information
|
||||||
$pdf->SetFont('','', $default_font_size - 1);
|
$pdf->SetFont('','', $default_font_size - 1);
|
||||||
$pdf->SetXY($posx+2,$posy+4+(dol_nboflines_bis($carac_client_name,50)*4));
|
$pdf->SetXY($posx+2,$posy);
|
||||||
$pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
|
$pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1184,9 +1184,11 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
$pdf->SetFont('','B', $default_font_size);
|
$pdf->SetFont('','B', $default_font_size);
|
||||||
$pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L');
|
$pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L');
|
||||||
|
|
||||||
|
$posy = $pdf->getY();
|
||||||
|
|
||||||
// Show recipient information
|
// Show recipient information
|
||||||
$pdf->SetFont('','', $default_font_size - 1);
|
$pdf->SetFont('','', $default_font_size - 1);
|
||||||
$pdf->SetXY($posx+2,$posy+4+(dol_nboflines_bis($carac_client_name,50)*4));
|
$pdf->SetXY($posx+2,$posy);
|
||||||
$pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
|
$pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -51,11 +51,12 @@ $now=dol_now();
|
|||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// If create a request
|
||||||
if ($action == 'create')
|
if ($action == 'create')
|
||||||
{
|
{
|
||||||
$cp = new Holiday($db);
|
$cp = new Holiday($db);
|
||||||
|
|
||||||
// Si pas le droit de créer une demande
|
// If no right to create a request
|
||||||
if (($userid == $user->id && empty($user->rights->holiday->write)) || ($userid != $user->id && empty($user->rights->holiday->write_all)))
|
if (($userid == $user->id && empty($user->rights->holiday->write)) || ($userid != $user->id && empty($user->rights->holiday->write_all)))
|
||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
@ -83,21 +84,21 @@ if ($action == 'create')
|
|||||||
$description = trim(GETPOST('description'));
|
$description = trim(GETPOST('description'));
|
||||||
$userID = GETPOST('userID');
|
$userID = GETPOST('userID');
|
||||||
|
|
||||||
// Si pas de date de début
|
// If no start date
|
||||||
if (empty($date_debut))
|
if (empty($date_debut))
|
||||||
{
|
{
|
||||||
header('Location: card.php?action=request&error=nodatedebut');
|
header('Location: card.php?action=request&error=nodatedebut');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Si pas de date de fin
|
// If no end date
|
||||||
if (empty($date_fin))
|
if (empty($date_fin))
|
||||||
{
|
{
|
||||||
header('Location: card.php?action=request&error=nodatefin');
|
header('Location: card.php?action=request&error=nodatefin');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Si date de début après la date de fin
|
// If start date after end date
|
||||||
if ($date_debut > $date_fin)
|
if ($date_debut > $date_fin)
|
||||||
{
|
{
|
||||||
header('Location: card.php?action=request&error=datefin');
|
header('Location: card.php?action=request&error=datefin');
|
||||||
@ -112,7 +113,7 @@ if ($action == 'create')
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Si aucun jours ouvrés dans la demande
|
// If there is no Business Days within request
|
||||||
$nbopenedday=num_open_day($date_debut_gmt, $date_fin_gmt, 0, 1, $halfday);
|
$nbopenedday=num_open_day($date_debut_gmt, $date_fin_gmt, 0, 1, $halfday);
|
||||||
if($nbopenedday < 0.5)
|
if($nbopenedday < 0.5)
|
||||||
{
|
{
|
||||||
@ -120,7 +121,7 @@ if ($action == 'create')
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Si pas de validateur choisi
|
// If no validator designated
|
||||||
if ($valideur < 1)
|
if ($valideur < 1)
|
||||||
{
|
{
|
||||||
header('Location: card.php?action=request&error=Valideur');
|
header('Location: card.php?action=request&error=Valideur');
|
||||||
@ -137,7 +138,7 @@ if ($action == 'create')
|
|||||||
|
|
||||||
$verif = $cp->create($user);
|
$verif = $cp->create($user);
|
||||||
|
|
||||||
// Si pas d'erreur SQL on redirige vers la fiche de la demande
|
// If no SQL error we redirect to the request card
|
||||||
if ($verif > 0)
|
if ($verif > 0)
|
||||||
{
|
{
|
||||||
$db->commit();
|
$db->commit();
|
||||||
@ -149,7 +150,7 @@ if ($action == 'create')
|
|||||||
{
|
{
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
|
|
||||||
// Sinon on affiche le formulaire de demande avec le message d'erreur SQL
|
// Otherwise we display the request form with the SQL error message
|
||||||
header('Location: card.php?action=request&error=SQL_Create&msg='.$cp->error);
|
header('Location: card.php?action=request&error=SQL_Create&msg='.$cp->error);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
@ -169,7 +170,7 @@ if ($action == 'update')
|
|||||||
else if ($starthalfday == 'afternoon') $halfday=-1;
|
else if ($starthalfday == 'afternoon') $halfday=-1;
|
||||||
else if ($endhalfday == 'morning') $halfday=1;
|
else if ($endhalfday == 'morning') $halfday=1;
|
||||||
|
|
||||||
// Si pas le droit de modifier une demande
|
// If no right to modify a request
|
||||||
if (! $user->rights->holiday->write)
|
if (! $user->rights->holiday->write)
|
||||||
{
|
{
|
||||||
header('Location: card.php?action=request&error=CantUpdate');
|
header('Location: card.php?action=request&error=CantUpdate');
|
||||||
@ -181,40 +182,40 @@ if ($action == 'update')
|
|||||||
|
|
||||||
$canedit=(($user->id == $cp->fk_user && $user->rights->holiday->write) || ($user->id != $cp->fk_user && $user->rights->holiday->write_all));
|
$canedit=(($user->id == $cp->fk_user && $user->rights->holiday->write) || ($user->id != $cp->fk_user && $user->rights->holiday->write_all));
|
||||||
|
|
||||||
// Si en attente de validation
|
// If under validation
|
||||||
if ($cp->statut == 1)
|
if ($cp->statut == 1)
|
||||||
{
|
{
|
||||||
// Si c'est le créateur ou qu'il a le droit de tout lire / modifier
|
// If this is the requestor or has read/write rights
|
||||||
if ($canedit)
|
if ($canedit)
|
||||||
{
|
{
|
||||||
$valideur = $_POST['valideur'];
|
$valideur = $_POST['valideur'];
|
||||||
$description = trim($_POST['description']);
|
$description = trim($_POST['description']);
|
||||||
|
|
||||||
// Si pas de date de début
|
// If no start date
|
||||||
if (empty($_POST['date_debut_'])) {
|
if (empty($_POST['date_debut_'])) {
|
||||||
header('Location: card.php?id='.$_POST['holiday_id'].'&action=edit&error=nodatedebut');
|
header('Location: card.php?id='.$_POST['holiday_id'].'&action=edit&error=nodatedebut');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Si pas de date de fin
|
// If no end date
|
||||||
if (empty($_POST['date_fin_'])) {
|
if (empty($_POST['date_fin_'])) {
|
||||||
header('Location: card.php?id='.$_POST['holiday_id'].'&action=edit&error=nodatefin');
|
header('Location: card.php?id='.$_POST['holiday_id'].'&action=edit&error=nodatefin');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Si date de début après la date de fin
|
// If start date after end date
|
||||||
if ($date_debut > $date_fin) {
|
if ($date_debut > $date_fin) {
|
||||||
header('Location: card.php?id='.$_POST['holiday_id'].'&action=edit&error=datefin');
|
header('Location: card.php?id='.$_POST['holiday_id'].'&action=edit&error=datefin');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Si pas de valideur choisi
|
// If no validator designated
|
||||||
if ($valideur < 1) {
|
if ($valideur < 1) {
|
||||||
header('Location: card.php?id='.$_POST['holiday_id'].'&action=edit&error=Valideur');
|
header('Location: card.php?id='.$_POST['holiday_id'].'&action=edit&error=Valideur');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Si pas de jours ouvrés dans la demande
|
// If there is no Business Days within request
|
||||||
$nbopenedday=num_open_day($date_debut_gmt, $date_fin_gmt, 0, 1, $halfday);
|
$nbopenedday=num_open_day($date_debut_gmt, $date_fin_gmt, 0, 1, $halfday);
|
||||||
if ($nbopenedday < 0.5)
|
if ($nbopenedday < 0.5)
|
||||||
{
|
{
|
||||||
@ -237,7 +238,7 @@ if ($action == 'update')
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Sinon on affiche le formulaire de demande avec le message d'erreur SQL
|
// Otherwise we display the request form with the SQL error message
|
||||||
header('Location: card.php?id='.$_POST['holiday_id'].'&action=edit&error=SQL_Create&msg='.$cp->error);
|
header('Location: card.php?id='.$_POST['holiday_id'].'&action=edit&error=SQL_Create&msg='.$cp->error);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
@ -248,7 +249,7 @@ if ($action == 'update')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Si suppression de la demande
|
// If delete of request
|
||||||
if ($action == 'confirm_delete' && GETPOST('confirm') == 'yes' && $user->rights->holiday->delete)
|
if ($action == 'confirm_delete' && GETPOST('confirm') == 'yes' && $user->rights->holiday->delete)
|
||||||
{
|
{
|
||||||
$error=0;
|
$error=0;
|
||||||
@ -260,7 +261,7 @@ if ($action == 'confirm_delete' && GETPOST('confirm') == 'yes' && $user->rights-
|
|||||||
|
|
||||||
$canedit=(($user->id == $cp->fk_user && $user->rights->holiday->write) || ($user->id != $cp->fk_user && $user->rights->holiday->write_all));
|
$canedit=(($user->id == $cp->fk_user && $user->rights->holiday->write) || ($user->id != $cp->fk_user && $user->rights->holiday->write_all));
|
||||||
|
|
||||||
// Si c'est bien un brouillon
|
// If this is a rough draft
|
||||||
if ($cp->statut == 1 || $cp->statut == 3)
|
if ($cp->statut == 1 || $cp->statut == 3)
|
||||||
{
|
{
|
||||||
// Si l'utilisateur à le droit de lire cette demande, il peut la supprimer
|
// Si l'utilisateur à le droit de lire cette demande, il peut la supprimer
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user