clean indent in compta, contact directory

This commit is contained in:
Frédéric FRANCE 2019-10-26 18:13:20 +02:00
parent c44425d0a0
commit a1f0245c79
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
27 changed files with 489 additions and 497 deletions

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

@ -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

@ -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

@ -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";