clean indent in compta, contact directory
This commit is contained in:
parent
c44425d0a0
commit
a1f0245c79
@ -186,7 +186,7 @@
|
||||
<!-- Check indent are done with spaces and with correct number -->
|
||||
<!-- Disabled as this does not support tab -->
|
||||
<!-- <rule ref="Generic.WhiteSpace.ScopeIndent" /> -->
|
||||
<!-- TODO Enable this
|
||||
|
||||
<arg name="tab-width" value="4"/>
|
||||
<rule ref="Generic.WhiteSpace.ScopeIndent">
|
||||
<properties>
|
||||
@ -194,7 +194,7 @@
|
||||
<property name="tabIndent" value="true"/>
|
||||
</properties>
|
||||
</rule>
|
||||
-->
|
||||
|
||||
|
||||
<rule ref="Squiz.WhiteSpace.ScopeClosingBrace.Indent" />
|
||||
|
||||
|
||||
@ -1360,10 +1360,10 @@ class Account extends CommonObject
|
||||
$linkstart = '<a href="'.$url.$linkclose;
|
||||
$linkend = '</a>';
|
||||
|
||||
if ($option == 'nolink') {
|
||||
$linkstart = '';
|
||||
$linkend = '';
|
||||
}
|
||||
if ($option == 'nolink') {
|
||||
$linkstart = '';
|
||||
$linkend = '';
|
||||
}
|
||||
|
||||
$result .= $linkstart;
|
||||
if ($withpicto) $result.=img_object(($notooltip?'':$label), $this->picto, ($notooltip?(($withpicto != 2) ? 'class="paddingright"' : ''):'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip?0:1);
|
||||
@ -1600,8 +1600,8 @@ class Account extends CommonObject
|
||||
//Replace the old AccountNumber key with the new BankAccountNumber key
|
||||
$fieldlists = explode(
|
||||
' ',
|
||||
preg_replace('/ ?[^Bank]AccountNumber ?/', 'BankAccountNumber',
|
||||
$conf->global->BANK_SHOW_ORDER_OPTION)
|
||||
preg_replace('/ ?[^Bank]AccountNumber ?/', 'BankAccountNumber',
|
||||
$conf->global->BANK_SHOW_ORDER_OPTION)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2014-2019 Ferran Marcet <fmarcet@2byte.es>
|
||||
* 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
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -809,14 +809,16 @@ if (empty($reshook))
|
||||
|
||||
// Total credit note and deposit
|
||||
$total_creditnote_and_deposit = 0;
|
||||
$sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,";
|
||||
$sql .= " re.description, re.fk_facture_source";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "societe_remise_except as re";
|
||||
$sql .= " WHERE fk_facture = " . $object->id;
|
||||
$resql = $db->query($sql);
|
||||
if (!empty($resql)) {
|
||||
while ($obj = $db->fetch_object($resql)) $total_creditnote_and_deposit += $obj->amount_ttc;
|
||||
} else dol_print_error($db);
|
||||
$sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,";
|
||||
$sql .= " re.description, re.fk_facture_source";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "societe_remise_except as re";
|
||||
$sql .= " WHERE fk_facture = " . $object->id;
|
||||
$resql = $db->query($sql);
|
||||
if (!empty($resql)) {
|
||||
while ($obj = $db->fetch_object($resql)) {
|
||||
$total_creditnote_and_deposit += $obj->amount_ttc;
|
||||
}
|
||||
} else dol_print_error($db);
|
||||
|
||||
$discount->amount_ht = $discount->amount_ttc = $total_paiements + $total_creditnote_and_deposit - $object->total_ttc;
|
||||
$discount->amount_tva = 0;
|
||||
@ -1516,7 +1518,7 @@ if (empty($reshook))
|
||||
$localtax1_tx = get_localtax($tva_tx, 1, $object->thirdparty);
|
||||
$localtax2_tx = get_localtax($tva_tx, 2, $object->thirdparty);
|
||||
|
||||
$result = $object->addline(
|
||||
$result = $object->addline(
|
||||
$desc, $lines[$i]->subprice, $lines[$i]->qty, $tva_tx, $localtax1_tx, $localtax2_tx, $lines[$i]->fk_product,
|
||||
$lines[$i]->remise_percent, $date_start, $date_end, 0, $lines[$i]->info_bits, $lines[$i]->fk_remise_except,
|
||||
'HT', 0, $product_type, $lines[$i]->rang, $lines[$i]->special_code, $object->origin, $lines[$i]->rowid,
|
||||
@ -2726,7 +2728,7 @@ if ($action == 'create')
|
||||
$text.=' '.$langs->trans("ToCreateARecurringInvoiceGene", $langs->transnoentitiesnoconv("MenuFinancial"), $langs->transnoentitiesnoconv("BillsCustomers"), $langs->transnoentitiesnoconv("ListOfTemplates"));
|
||||
if (empty($conf->global->INVOICE_DISABLE_AUTOMATIC_RECURRING_INVOICE))
|
||||
{
|
||||
$text.=' '.$langs->trans("ToCreateARecurringInvoiceGeneAuto", $langs->transnoentitiesnoconv('Module2300Name'));
|
||||
$text.=' '.$langs->trans("ToCreateARecurringInvoiceGeneAuto", $langs->transnoentitiesnoconv('Module2300Name'));
|
||||
}
|
||||
print info_admin($text, 0, 0, 0).'<br>';
|
||||
}
|
||||
@ -3274,12 +3276,12 @@ if ($action == 'create')
|
||||
print '<td colspan="2">';
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/modules/facture/modules_facture.php';
|
||||
$liste = ModelePDFFactures::liste_modeles($db);
|
||||
if(!empty($conf->global->INVOICE_USE_DEFAULT_DOCUMENT)){ // Hidden conf
|
||||
$paramkey='FACTURE_ADDON_PDF_'.$object->type;
|
||||
$curent = !empty($conf->global->$paramkey)?$conf->global->$paramkey:$conf->global->FACTURE_ADDON_PDF;
|
||||
}
|
||||
else{
|
||||
$curent = $conf->global->FACTURE_ADDON_PDF;
|
||||
if(!empty($conf->global->INVOICE_USE_DEFAULT_DOCUMENT)){
|
||||
// Hidden conf
|
||||
$paramkey='FACTURE_ADDON_PDF_'.$object->type;
|
||||
$curent = !empty($conf->global->$paramkey)?$conf->global->$paramkey:$conf->global->FACTURE_ADDON_PDF;
|
||||
} else {
|
||||
$curent = $conf->global->FACTURE_ADDON_PDF;
|
||||
}
|
||||
print $form->selectarray('model', $liste, $curent);
|
||||
print "</td></tr>";
|
||||
@ -3803,19 +3805,20 @@ elseif ($id > 0 || ! empty($ref))
|
||||
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
||||
if ($usercancreate)
|
||||
{
|
||||
if ($action != 'classify')
|
||||
if ($action != 'classify') {
|
||||
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
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 method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref.='</form>';
|
||||
} else {
|
||||
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
}
|
||||
}
|
||||
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 method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref.='</form>';
|
||||
} else {
|
||||
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
}
|
||||
} else {
|
||||
if (! empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
|
||||
@ -415,7 +415,7 @@ class Invoices extends DolibarrApi
|
||||
return $this->_cleanObjectDatas($this->invoice);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Delete a contact type of given invoice
|
||||
*
|
||||
* @param int $id Id of invoice to update
|
||||
@ -529,10 +529,9 @@ class Invoices extends DolibarrApi
|
||||
// update bank account
|
||||
if (!empty($this->invoice->fk_account))
|
||||
{
|
||||
if($this->invoice->setBankAccount($this->invoice->fk_account) == 0)
|
||||
{
|
||||
throw new RestException(400, $this->invoice->error);
|
||||
}
|
||||
if ($this->invoice->setBankAccount($this->invoice->fk_account) == 0) {
|
||||
throw new RestException(400, $this->invoice->error);
|
||||
}
|
||||
}
|
||||
|
||||
if($this->invoice->update(DolibarrApiAccess::$user))
|
||||
@ -909,18 +908,18 @@ class Invoices extends DolibarrApi
|
||||
|
||||
|
||||
$result = $this->invoice->fetch($id);
|
||||
if( ! $result ) {
|
||||
if (! $result) {
|
||||
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);
|
||||
}
|
||||
|
||||
return $this->_cleanObjectDatas($this->invoice);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Create a discount (credit available) for a credit note or a deposit.
|
||||
*
|
||||
* @param int $id Invoice ID
|
||||
|
||||
@ -862,10 +862,10 @@ class Facture extends CommonInvoice
|
||||
|
||||
if (! $error && ! $notrigger)
|
||||
{
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('BILL_CREATE', $user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('BILL_CREATE', $user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
@ -1605,9 +1605,9 @@ class Facture extends CommonInvoice
|
||||
|
||||
// multilangs
|
||||
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($objp->fk_product) && ! empty($loadalsotranslation)) {
|
||||
$line = new Product($this->db);
|
||||
$line->fetch($objp->fk_product);
|
||||
$line->getMultiLangs();
|
||||
$line = new Product($this->db);
|
||||
$line->fetch($objp->fk_product);
|
||||
$line->getMultiLangs();
|
||||
}
|
||||
|
||||
$this->lines[$i] = $line;
|
||||
@ -2545,7 +2545,7 @@ class Facture extends CommonInvoice
|
||||
if (empty($final)) $this->situation_final = 0;
|
||||
else $this->situation_final = 1;
|
||||
|
||||
$this->setFinal($user);
|
||||
$this->setFinal($user);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2587,10 +2587,12 @@ class Facture extends CommonInvoice
|
||||
$next_invoice->brouillon = 1;
|
||||
foreach ($next_invoice->lines as $line)
|
||||
{
|
||||
$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->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent,
|
||||
$line->fk_unit);
|
||||
$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->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent,
|
||||
$line->fk_unit
|
||||
);
|
||||
|
||||
if ($result < 0)
|
||||
{
|
||||
|
||||
@ -163,20 +163,21 @@ if ($id > 0 || ! empty($ref))
|
||||
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
||||
if ($user->rights->facture->creer)
|
||||
{
|
||||
if ($action != 'classify')
|
||||
if ($action != 'classify') {
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref.=' : ';
|
||||
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 method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref.='</form>';
|
||||
} else {
|
||||
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
}
|
||||
$morehtmlref.=' : ';
|
||||
}
|
||||
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 method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref.='</form>';
|
||||
} else {
|
||||
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
}
|
||||
} else {
|
||||
if (! empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
|
||||
@ -1242,19 +1242,20 @@ else
|
||||
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
||||
if ($user->rights->facture->creer)
|
||||
{
|
||||
if ($action != 'classify')
|
||||
if ($action != 'classify') {
|
||||
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
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 method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref.='</form>';
|
||||
} else {
|
||||
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
}
|
||||
}
|
||||
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 method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref.='</form>';
|
||||
} else {
|
||||
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
}
|
||||
} else {
|
||||
if (! empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
|
||||
@ -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.fk_cond_reglement, f.fk_mode_reglement";
|
||||
// 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 : '');
|
||||
}
|
||||
// Add fields from hooks
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
@ -513,68 +514,68 @@ if ($resql)
|
||||
|
||||
if (! empty($arrayfields['f.titre']['checked']))
|
||||
{
|
||||
print '<td>';
|
||||
print $invoicerectmp->getNomUrl(1);
|
||||
print "</a>";
|
||||
print "</td>\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
print '<td>';
|
||||
print $invoicerectmp->getNomUrl(1);
|
||||
print "</a>";
|
||||
print "</td>\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
if (! empty($arrayfields['s.nom']['checked']))
|
||||
{
|
||||
print '<td class="tdoverflowmax200">'.$companystatic->getNomUrl(1, 'customer').'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
print '<td class="tdoverflowmax200">'.$companystatic->getNomUrl(1, 'customer').'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
if (! empty($arrayfields['f.total']['checked']))
|
||||
{
|
||||
print '<td class="right">'.price($objp->total).'</td>'."\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
if (! $i) $totalarray['pos'][$totalarray['nbfield']]='f.total';
|
||||
$totalarray['val']['f.total'] += $objp->total;
|
||||
print '<td class="right">'.price($objp->total).'</td>'."\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
if (! $i) $totalarray['pos'][$totalarray['nbfield']]='f.total';
|
||||
$totalarray['val']['f.total'] += $objp->total;
|
||||
}
|
||||
if (! empty($arrayfields['f.tva']['checked']))
|
||||
{
|
||||
print '<td class="right">'.price($objp->total_vat).'</td>'."\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
if (! $i) $totalarray['pos'][$totalarray['nbfield']]='f.tva';
|
||||
$totalarray['val']['f.tva'] += $objp->total_vat;
|
||||
print '<td class="right">'.price($objp->total_vat).'</td>'."\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
if (! $i) $totalarray['pos'][$totalarray['nbfield']]='f.tva';
|
||||
$totalarray['val']['f.tva'] += $objp->total_vat;
|
||||
}
|
||||
if (! empty($arrayfields['f.total_ttc']['checked']))
|
||||
{
|
||||
print '<td class="right">'.price($objp->total_ttc).'</td>'."\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
if (! $i) $totalarray['pos'][$totalarray['nbfield']]='f.total_ttc';
|
||||
$totalarray['val']['f.total_ttc'] += $objp->total_ttc;
|
||||
print '<td class="right">'.price($objp->total_ttc).'</td>'."\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
if (! $i) $totalarray['pos'][$totalarray['nbfield']]='f.total_ttc';
|
||||
$totalarray['val']['f.total_ttc'] += $objp->total_ttc;
|
||||
}
|
||||
// Payment term
|
||||
if (! empty($arrayfields['f.fk_cond_reglement']['checked']))
|
||||
{
|
||||
print '<td class="right">';
|
||||
print $form->form_conditions_reglement('', $objp->fk_cond_reglement, 'none');
|
||||
print '</td>'."\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
print '<td class="right">';
|
||||
print $form->form_conditions_reglement('', $objp->fk_cond_reglement, 'none');
|
||||
print '</td>'."\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Payment mode
|
||||
if (! empty($arrayfields['f.fk_mode_reglement']['checked']))
|
||||
{
|
||||
print '<td class="right">';
|
||||
print $form->form_modes_reglement('', $objp->fk_mode_reglement, 'none');
|
||||
print '</td>'."\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
print '<td class="right">';
|
||||
print $form->form_modes_reglement('', $objp->fk_mode_reglement, 'none');
|
||||
print '</td>'."\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
if (! empty($arrayfields['recurring']['checked']))
|
||||
{
|
||||
print '<td align="center">'.yn($objp->frequency?1:0).'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
print '<td align="center">'.yn($objp->frequency?1:0).'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
if (! empty($arrayfields['f.frequency']['checked']))
|
||||
{
|
||||
print '<td align="center">'.($objp->frequency > 0 ? $objp->frequency : '').'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
print '<td align="center">'.($objp->frequency > 0 ? $objp->frequency : '').'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
if (! empty($arrayfields['f.unit_frequency']['checked']))
|
||||
{
|
||||
print '<td align="center">'.($objp->frequency > 0 ? $objp->unit_frequency : '').'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
print '<td align="center">'.($objp->frequency > 0 ? $objp->unit_frequency : '').'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
if (! empty($arrayfields['f.nb_gen_done']['checked']))
|
||||
{
|
||||
@ -586,10 +587,10 @@ if ($resql)
|
||||
// Date last generation
|
||||
if (! empty($arrayfields['f.date_last_gen']['checked']))
|
||||
{
|
||||
print '<td align="center">';
|
||||
print ($objp->frequency > 0 ? dol_print_date($db->jdate($objp->date_last_gen), 'day') : '<span class="opacitymedium">'.$langs->trans('NA').'</span>');
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
print '<td align="center">';
|
||||
print ($objp->frequency > 0 ? dol_print_date($db->jdate($objp->date_last_gen), 'day') : '<span class="opacitymedium">'.$langs->trans('NA').'</span>');
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Date next generation
|
||||
if (! empty($arrayfields['f.date_when']['checked']))
|
||||
@ -611,17 +612,17 @@ if ($resql)
|
||||
}
|
||||
if (! empty($arrayfields['f.datec']['checked']))
|
||||
{
|
||||
print '<td align="center">';
|
||||
print dol_print_date($db->jdate($objp->datec), 'dayhour');
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
print '<td align="center">';
|
||||
print dol_print_date($db->jdate($objp->datec), 'dayhour');
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
if (! empty($arrayfields['f.tms']['checked']))
|
||||
{
|
||||
print '<td align="center">';
|
||||
print dol_print_date($db->jdate($objp->tms), 'dayhour');
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
print '<td align="center">';
|
||||
print dol_print_date($db->jdate($objp->tms), 'dayhour');
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
$obj = $objp;
|
||||
@ -632,12 +633,11 @@ if ($resql)
|
||||
$reshook=$hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
// Status
|
||||
if (! empty($arrayfields['status']['checked']))
|
||||
{
|
||||
print '<td align="center">';
|
||||
print $invoicerectmp->getLibStatut(3, 0);
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
if (! empty($arrayfields['status']['checked'])) {
|
||||
print '<td align="center">';
|
||||
print $invoicerectmp->getLibStatut(3, 0);
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Action column
|
||||
print '<td align="center">';
|
||||
|
||||
@ -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 ($search_categ_cus) $sql .= ", cc.fk_categorie, cc.fk_soc";
|
||||
// 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 : '');
|
||||
}
|
||||
// Add fields from hooks
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
|
||||
@ -1346,32 +1347,31 @@ if ($resql)
|
||||
|
||||
// Show total line
|
||||
if (isset($totalarray['totalhtfield'])
|
||||
|| isset($totalarray['totalvatfield'])
|
||||
|| isset($totalarray['totallocaltax1field'])
|
||||
|| isset($totalarray['totallocaltax2field'])
|
||||
|| isset($totalarray['totalttcfield'])
|
||||
|| isset($totalarray['totalamfield'])
|
||||
|| isset($totalarray['totalrtpfield'])
|
||||
)
|
||||
{
|
||||
|| isset($totalarray['totalvatfield'])
|
||||
|| isset($totalarray['totallocaltax1field'])
|
||||
|| isset($totalarray['totallocaltax2field'])
|
||||
|| isset($totalarray['totalttcfield'])
|
||||
|| isset($totalarray['totalamfield'])
|
||||
|| isset($totalarray['totalrtpfield'])
|
||||
) {
|
||||
print '<tr class="liste_total">';
|
||||
$i=0;
|
||||
while ($i < $totalarray['nbfield'])
|
||||
{
|
||||
$i++;
|
||||
if ($i == 1)
|
||||
{
|
||||
$i++;
|
||||
if ($i == 1)
|
||||
{
|
||||
if ($num < $limit && empty($offset)) print '<td class="left">'.$langs->trans("Total").'</td>';
|
||||
else print '<td class="left">'.$langs->trans("Totalforthispage").'</td>';
|
||||
}
|
||||
elseif ($totalarray['totalhtfield'] == $i) print '<td class="right">'.price($totalarray['totalht']).'</td>';
|
||||
elseif ($totalarray['totalvatfield'] == $i) print '<td class="right">'.price($totalarray['totalvat']).'</td>';
|
||||
elseif ($totalarray['totallocaltax1field'] == $i) print '<td class="right">'.price($totalarray['totallocaltax1']).'</td>';
|
||||
elseif ($totalarray['totallocaltax2field'] == $i) print '<td class="right">'.price($totalarray['totallocaltax2']).'</td>';
|
||||
elseif ($totalarray['totalttcfield'] == $i) print '<td class="right">'.price($totalarray['totalttc']).'</td>';
|
||||
elseif ($totalarray['totalamfield'] == $i) print '<td class="right">'.price($totalarray['totalam']).'</td>';
|
||||
elseif ($totalarray['totalrtpfield'] == $i) print '<td class="right">'.price($totalarray['totalrtp']).'</td>';
|
||||
else print '<td></td>';
|
||||
}
|
||||
elseif ($totalarray['totalhtfield'] == $i) print '<td class="right">'.price($totalarray['totalht']).'</td>';
|
||||
elseif ($totalarray['totalvatfield'] == $i) print '<td class="right">'.price($totalarray['totalvat']).'</td>';
|
||||
elseif ($totalarray['totallocaltax1field'] == $i) print '<td class="right">'.price($totalarray['totallocaltax1']).'</td>';
|
||||
elseif ($totalarray['totallocaltax2field'] == $i) print '<td class="right">'.price($totalarray['totallocaltax2']).'</td>';
|
||||
elseif ($totalarray['totalttcfield'] == $i) print '<td class="right">'.price($totalarray['totalttc']).'</td>';
|
||||
elseif ($totalarray['totalamfield'] == $i) print '<td class="right">'.price($totalarray['totalam']).'</td>';
|
||||
elseif ($totalarray['totalrtpfield'] == $i) print '<td class="right">'.price($totalarray['totalrtp']).'</td>';
|
||||
else print '<td></td>';
|
||||
}
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
@ -189,20 +189,21 @@ if ($object->id > 0)
|
||||
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
||||
if ($user->rights->facture->creer)
|
||||
{
|
||||
if ($action != 'classify')
|
||||
if ($action != 'classify') {
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref.=' : ';
|
||||
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 method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref.='</form>';
|
||||
} else {
|
||||
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
}
|
||||
$morehtmlref.=' : ';
|
||||
}
|
||||
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 method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref.='</form>';
|
||||
} else {
|
||||
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
}
|
||||
} else {
|
||||
if (! empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
|
||||
@ -233,48 +233,45 @@ foreach ($tmp_companies as $value) {
|
||||
print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
|
||||
|
||||
//if (empty($socid))
|
||||
//{
|
||||
// Show filter box
|
||||
print '<form name="stats" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td class="liste_titre" colspan="2">'.$langs->trans("Filter").'</td></tr>';
|
||||
// Company
|
||||
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
|
||||
if ($mode == 'customer') $filter='s.client in (1,2,3)';
|
||||
if ($mode == 'supplier') $filter='s.fournisseur = 1';
|
||||
print $form->selectarray('socid', $companies, $socid, 1, 0, 0, 'style="width: 95%"', 0, 0, 0, '', '', 1);
|
||||
print '</td></tr>';
|
||||
// User
|
||||
print '<tr><td>'.$langs->trans("CreatedBy").'</td><td>';
|
||||
print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
|
||||
print '</td></tr>';
|
||||
// Status
|
||||
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"));
|
||||
print $form->selectarray('object_status', $liststatus, $object_status, 1);
|
||||
}
|
||||
if ($mode == 'supplier')
|
||||
{
|
||||
$liststatus=array('0'=>$langs->trans("BillStatusDraft"),'1'=>$langs->trans("BillStatusNotPaid"), '2'=>$langs->trans("BillStatusPaid"));
|
||||
print $form->selectarray('object_status', $liststatus, $object_status, 1);
|
||||
}
|
||||
print '</td></tr>';
|
||||
// Year
|
||||
print '<tr><td>'.$langs->trans("Year").'</td><td>';
|
||||
if (! in_array($year, $arrayyears)) $arrayyears[$year]=$year;
|
||||
if (! in_array($nowyear, $arrayyears)) $arrayyears[$nowyear]=$nowyear;
|
||||
arsort($arrayyears);
|
||||
print $form->selectarray('year', $arrayyears, $year, 0);
|
||||
print '</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 '</form>';
|
||||
print '<br><br>';
|
||||
//}
|
||||
// Show filter box
|
||||
print '<form name="stats" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td class="liste_titre" colspan="2">'.$langs->trans("Filter").'</td></tr>';
|
||||
// Company
|
||||
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
|
||||
if ($mode == 'customer') $filter='s.client in (1,2,3)';
|
||||
if ($mode == 'supplier') $filter='s.fournisseur = 1';
|
||||
print $form->selectarray('socid', $companies, $socid, 1, 0, 0, 'style="width: 95%"', 0, 0, 0, '', '', 1);
|
||||
print '</td></tr>';
|
||||
// User
|
||||
print '<tr><td>'.$langs->trans("CreatedBy").'</td><td>';
|
||||
print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
|
||||
print '</td></tr>';
|
||||
// Status
|
||||
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"));
|
||||
print $form->selectarray('object_status', $liststatus, $object_status, 1);
|
||||
}
|
||||
if ($mode == 'supplier')
|
||||
{
|
||||
$liststatus=array('0'=>$langs->trans("BillStatusDraft"),'1'=>$langs->trans("BillStatusNotPaid"), '2'=>$langs->trans("BillStatusPaid"));
|
||||
print $form->selectarray('object_status', $liststatus, $object_status, 1);
|
||||
}
|
||||
print '</td></tr>';
|
||||
// Year
|
||||
print '<tr><td>'.$langs->trans("Year").'</td><td>';
|
||||
if (! in_array($year, $arrayyears)) $arrayyears[$year]=$year;
|
||||
if (! in_array($nowyear, $arrayyears)) $arrayyears[$nowyear]=$nowyear;
|
||||
arsort($arrayyears);
|
||||
print $form->selectarray('year', $arrayyears, $year, 0);
|
||||
print '</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 '</form>';
|
||||
print '<br><br>';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
@ -24,11 +24,7 @@ if (empty($conf) || ! is_object($conf))
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<!-- BEGIN PHP TEMPLATE -->
|
||||
|
||||
<?php
|
||||
print "<!-- BEGIN PHP TEMPLATE -->\n";
|
||||
|
||||
global $user;
|
||||
global $noMoreLinkedObjectBlockAfter;
|
||||
@ -40,73 +36,70 @@ $langs->load("bills");
|
||||
|
||||
$linkedObjectBlock = dol_sort_array($linkedObjectBlock, 'date', 'desc', 0, 0, 1);
|
||||
|
||||
$total=0; $ilink=0;
|
||||
$total=0;
|
||||
$ilink=0;
|
||||
foreach($linkedObjectBlock as $key => $objectlink)
|
||||
{
|
||||
$ilink++;
|
||||
|
||||
$trclass='oddeven';
|
||||
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total';
|
||||
?>
|
||||
<tr class="<?php echo $trclass; ?>" data-element="<?php echo $objectlink->element; ?>" data-id="<?php echo $objectlink->id; ?>" >
|
||||
<td class="linkedcol-element"><?php
|
||||
switch ($objectlink->type) {
|
||||
case Facture::TYPE_REPLACEMENT:
|
||||
echo $langs->trans("InvoiceReplacement");
|
||||
break;
|
||||
case Facture::TYPE_CREDIT_NOTE:
|
||||
echo $langs->trans("InvoiceAvoir");
|
||||
break;
|
||||
case Facture::TYPE_DEPOSIT:
|
||||
echo $langs->trans("InvoiceDeposit");
|
||||
break;
|
||||
case Facture::TYPE_PROFORMA:
|
||||
echo $langs->trans("InvoiceProForma");
|
||||
break;
|
||||
case Facture::TYPE_SITUATION:
|
||||
echo $langs->trans("InvoiceSituation");
|
||||
break;
|
||||
default:
|
||||
echo $langs->trans("CustomerInvoice");
|
||||
break;
|
||||
}
|
||||
?></td>
|
||||
<td class="linkedcol-name nowraponall"><?php echo $objectlink->getNomUrl(1); ?></td>
|
||||
<td class="linkedcol-ref left"><?php echo $objectlink->ref_client; ?></td>
|
||||
<td class="linkedcol-date center"><?php echo dol_print_date($objectlink->date, 'day'); ?></td>
|
||||
<td class="linkedcol-amount right"><?php
|
||||
if ($user->rights->facture->lire) {
|
||||
$sign = 1;
|
||||
if ($object->type == Facture::TYPE_CREDIT_NOTE) $sign = -1;
|
||||
if ($objectlink->statut != 3) // If not abandonned
|
||||
{
|
||||
$total = $total + $sign * $objectlink->total_ht;
|
||||
echo price($objectlink->total_ht);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<strike>'.price($objectlink->total_ht).'</strike>';
|
||||
}
|
||||
} ?></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>
|
||||
</tr>
|
||||
<?php
|
||||
print '<tr class="'.$trclass.'" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" >';
|
||||
print '<td class="linkedcol-element">';
|
||||
switch ($objectlink->type) {
|
||||
case Facture::TYPE_REPLACEMENT:
|
||||
echo $langs->trans("InvoiceReplacement");
|
||||
break;
|
||||
case Facture::TYPE_CREDIT_NOTE:
|
||||
echo $langs->trans("InvoiceAvoir");
|
||||
break;
|
||||
case Facture::TYPE_DEPOSIT:
|
||||
echo $langs->trans("InvoiceDeposit");
|
||||
break;
|
||||
case Facture::TYPE_PROFORMA:
|
||||
echo $langs->trans("InvoiceProForma");
|
||||
break;
|
||||
case Facture::TYPE_SITUATION:
|
||||
echo $langs->trans("InvoiceSituation");
|
||||
break;
|
||||
default:
|
||||
echo $langs->trans("CustomerInvoice");
|
||||
break;
|
||||
}
|
||||
print '</td>';
|
||||
print '<td class="linkedcol-name nowraponall">'.$objectlink->getNomUrl(1).'</td>';
|
||||
print '<td class="linkedcol-ref left">'.$objectlink->ref_client.'</td>';
|
||||
print '<td class="linkedcol-date center">'.dol_print_date($objectlink->date, 'day').'</td>';
|
||||
print '<td class="linkedcol-amount right">';
|
||||
if ($user->rights->facture->lire) {
|
||||
$sign = 1;
|
||||
if ($object->type == Facture::TYPE_CREDIT_NOTE) $sign = -1;
|
||||
if ($objectlink->statut != 3) {
|
||||
// If not abandonned
|
||||
$total = $total + $sign * $objectlink->total_ht;
|
||||
echo price($objectlink->total_ht);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<strike>'.price($objectlink->total_ht).'</strike>';
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
print '<td class="linkedcol-statut right">'.$objectlink->getLibStatut(3).'</td>';
|
||||
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>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
if (count($linkedObjectBlock) > 1)
|
||||
{
|
||||
?>
|
||||
<tr class="liste_total <?php echo (empty($noMoreLinkedObjectBlockAfter)?'liste_sub_total':''); ?>">
|
||||
<td><?php echo $langs->trans("Total"); ?></td>
|
||||
<td></td>
|
||||
<td class="center"></td>
|
||||
<td class="center"></td>
|
||||
<td class="right"><?php echo price($total); ?></td>
|
||||
<td class="right"></td>
|
||||
<td class="right"></td>
|
||||
</tr>
|
||||
<?php
|
||||
print '<tr class="liste_total '.(empty($noMoreLinkedObjectBlockAfter)?'liste_sub_total':'').'">';
|
||||
print '<td>'.$langs->trans("Total").'</td>';
|
||||
print '<td></td>';
|
||||
print '<td class="center"></td>';
|
||||
print '<td class="center"></td>';
|
||||
print '<td class="right">'.price($total).'</td>';
|
||||
print '<td class="right"></td>';
|
||||
print '<td class="right"></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
?>
|
||||
|
||||
<!-- END PHP TEMPLATE -->
|
||||
print "<!-- END PHP TEMPLATE -->\n";
|
||||
|
||||
@ -24,11 +24,9 @@ if (empty($conf) || ! is_object($conf))
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<!-- BEGIN PHP TEMPLATE -->
|
||||
print "<!-- BEGIN PHP TEMPLATE -->\n";
|
||||
|
||||
<?php
|
||||
|
||||
global $user;
|
||||
global $noMoreLinkedObjectBlockAfter;
|
||||
@ -38,28 +36,30 @@ $linkedObjectBlock = $GLOBALS['linkedObjectBlock'];
|
||||
|
||||
$langs->load("bills");
|
||||
|
||||
$total=0; $ilink=0;
|
||||
$total=0;
|
||||
$ilink=0;
|
||||
foreach($linkedObjectBlock as $key => $objectlink)
|
||||
{
|
||||
$ilink++;
|
||||
|
||||
$trclass='oddeven';
|
||||
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total';
|
||||
?>
|
||||
?>
|
||||
<tr class="<?php echo $trclass; ?>" >
|
||||
<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-ref" align="center"></td>
|
||||
<td class="linkedcol-date" align="center"><?php echo dol_print_date($objectlink->date_when, 'day'); ?></td>
|
||||
<td class="linkedcol-amount right"><?php
|
||||
if ($user->rights->facture->lire) {
|
||||
$total = $total + $objectlink->total_ht;
|
||||
echo price($objectlink->total_ht);
|
||||
} ?></td>
|
||||
if ($user->rights->facture->lire) {
|
||||
$total = $total + $objectlink->total_ht;
|
||||
echo price($objectlink->total_ht);
|
||||
}
|
||||
?></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>
|
||||
</tr>
|
||||
<?php
|
||||
<?php
|
||||
}
|
||||
if (count($linkedObjectBlock) > 1)
|
||||
{
|
||||
@ -75,6 +75,5 @@ if (count($linkedObjectBlock) > 1)
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<!-- END PHP TEMPLATE -->
|
||||
print "<!-- END PHP TEMPLATE -->\n";
|
||||
|
||||
@ -271,7 +271,7 @@ if ($id > 0 || $ref)
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("TransMetod").'</td><td>';
|
||||
print $form->selectarray("methode", $object->methodes_trans);
|
||||
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 class="flat" type="file" name="userfile"><br>';
|
||||
print '</td></tr>';*/
|
||||
|
||||
@ -1686,7 +1686,7 @@ class BonPrelevement extends CommonObject
|
||||
$XML_DEBITOR ='';
|
||||
$XML_DEBITOR .=' <DrctDbtTxInf>'.$CrLf;
|
||||
$XML_DEBITOR .=' <PmtId>'.$CrLf;
|
||||
// $XML_DEBITOR .=' <EndToEndId>'.('AS-'.dol_trunc($row_ref,20).'-'.$Rowing).'</EndToEndId>'.$CrLf; // ISO20022 states that EndToEndId has a MaxLength of 35 characters
|
||||
// $XML_DEBITOR .=' <EndToEndId>'.('AS-'.dol_trunc($row_ref,20).'-'.$Rowing).'</EndToEndId>'.$CrLf; // ISO20022 states that EndToEndId has a MaxLength of 35 characters
|
||||
$XML_DEBITOR .=' <EndToEndId>'.(($conf->global->PRELEVEMENT_END_TO_END != "" ) ? $conf->global->PRELEVEMENT_END_TO_END : ('AS-'.dol_trunc($row_ref, 20)).'-'.$Rowing).'</EndToEndId>'.$CrLf; // ISO20022 states that EndToEndId has a MaxLength of 35 characters
|
||||
$XML_DEBITOR .=' </PmtId>'.$CrLf;
|
||||
$XML_DEBITOR .=' <InstdAmt Ccy="EUR">'.round($row_somme, 2).'</InstdAmt>'.$CrLf;
|
||||
@ -1718,8 +1718,8 @@ class BonPrelevement extends CommonObject
|
||||
$XML_DEBITOR .=' </Id>'.$CrLf;
|
||||
$XML_DEBITOR .=' </DbtrAcct>'.$CrLf;
|
||||
$XML_DEBITOR .=' <RmtInf>'.$CrLf;
|
||||
// $XML_DEBITOR .=' <Ustrd>'.($row_ref.'/'.$Rowing.'/'.$Rum).'</Ustrd>'.$CrLf;
|
||||
// $XML_DEBITOR .=' <Ustrd>'.dol_trunc($row_ref, 135).'</Ustrd>'.$CrLf; // 140 max
|
||||
// $XML_DEBITOR .=' <Ustrd>'.($row_ref.'/'.$Rowing.'/'.$Rum).'</Ustrd>'.$CrLf;
|
||||
// $XML_DEBITOR .=' <Ustrd>'.dol_trunc($row_ref, 135).'</Ustrd>'.$CrLf; // 140 max
|
||||
$XML_DEBITOR .=' <Ustrd>'.(($conf->global->PRELEVEMENT_USTRD != "" ) ? $conf->global->PRELEVEMENT_USTRD : dol_trunc($row_ref, 135) ).'</Ustrd>'.$CrLf; // 140 max
|
||||
$XML_DEBITOR .=' </RmtInf>'.$CrLf;
|
||||
$XML_DEBITOR .=' </DrctDbtTxInf>'.$CrLf;
|
||||
@ -1887,15 +1887,15 @@ class BonPrelevement extends CommonObject
|
||||
$XML_SEPA_INFO .= ' <BIC>'.$this->emetteur_bic.'</BIC>'.$CrLf;
|
||||
$XML_SEPA_INFO .= ' </FinInstnId>'.$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 .= ' <PstlAdr>'.$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_ZIP.' '.$conf->global->MAIN_INFO_SOCIETE_TOWN.'</AdrLine>'.$CrLf;
|
||||
$XML_SEPA_INFO .= ' </PstlAdr>'.$CrLf;
|
||||
$XML_SEPA_INFO .= ' </UltmtCdtr>'.$CrLf;
|
||||
*/ $XML_SEPA_INFO .= ' <ChrgBr>SLEV</ChrgBr>'.$CrLf;
|
||||
$XML_SEPA_INFO .= ' </UltmtCdtr>'.$CrLf;*/
|
||||
$XML_SEPA_INFO .= ' <ChrgBr>SLEV</ChrgBr>'.$CrLf;
|
||||
$XML_SEPA_INFO .= ' <CdtrSchmeId>'.$CrLf;
|
||||
$XML_SEPA_INFO .= ' <Id>'.$CrLf;
|
||||
$XML_SEPA_INFO .= ' <PrvtId>'.$CrLf;
|
||||
|
||||
@ -223,7 +223,7 @@ if ($resql)
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<tr><td colspan="5" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||
print '<tr><td colspan="5" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||
}
|
||||
|
||||
if ($num > 0)
|
||||
|
||||
@ -749,17 +749,17 @@ if (! empty($conf->don->enabled) && ($modecompta == 'CREANCES-DETTES' || $modeco
|
||||
$sql.= " AND fk_statut in (1,2)";
|
||||
if (! empty($date_start) && ! empty($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.= " FROM ".MAIN_DB_PREFIX."don as p";
|
||||
$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.= " WHERE p.entity IN (".getEntity('donation').")";
|
||||
$sql.= " AND fk_statut >= 2";
|
||||
if (! empty($date_start) && ! empty($date_end))
|
||||
$sql.= " AND pe.datep >= '".$db->idate($date_start)."' AND pe.datep <= '".$db->idate($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.= " GROUP BY p.societe, p.firstname, p.lastname, dm";
|
||||
|
||||
|
||||
@ -454,19 +454,20 @@ if ($id > 0)
|
||||
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
||||
if ($user->rights->tax->charges->creer)
|
||||
{
|
||||
if ($action != 'classify')
|
||||
if ($action != 'classify') {
|
||||
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
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 method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$morehtmlref.=$formproject->select_projects(0, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref.='</form>';
|
||||
} else {
|
||||
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
}
|
||||
}
|
||||
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 method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$morehtmlref.=$formproject->select_projects(0, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref.='</form>';
|
||||
} else {
|
||||
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
}
|
||||
} else {
|
||||
if (! empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
|
||||
@ -241,165 +241,163 @@ if (! empty($conf->accounting->enabled) && $modecompta != 'BOOKKEEPING')
|
||||
}
|
||||
|
||||
|
||||
if ($modecompta == 'CREANCES-DETTES')
|
||||
{
|
||||
print '<table class="noborder" width="100%">';
|
||||
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("Country") . '</td>';
|
||||
$i=0;
|
||||
while($i < 12)
|
||||
{
|
||||
$j = $i + (empty($conf->global->SOCIETE_FISCAL_MONTH_START)?1:$conf->global->SOCIETE_FISCAL_MONTH_START);
|
||||
if ($j > 12) $j -= 12;
|
||||
print '<td width="60" class="right">' . $langs->trans('MonthShort' . str_pad($j, 2, '0', STR_PAD_LEFT)) . '</td>';
|
||||
$i++;
|
||||
}
|
||||
print '<td width="60" class="right"><b>' . $langs->trans("TotalHT") . '</b></td></tr>';
|
||||
if ($modecompta == 'CREANCES-DETTES') {
|
||||
print '<table class="noborder" width="100%">';
|
||||
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("Country") . '</td>';
|
||||
$i=0;
|
||||
while($i < 12) {
|
||||
$j = $i + (empty($conf->global->SOCIETE_FISCAL_MONTH_START)?1:$conf->global->SOCIETE_FISCAL_MONTH_START);
|
||||
if ($j > 12) $j -= 12;
|
||||
print '<td width="60" class="right">' . $langs->trans('MonthShort' . str_pad($j, 2, '0', STR_PAD_LEFT)) . '</td>';
|
||||
$i++;
|
||||
}
|
||||
print '<td width="60" class="right"><b>' . $langs->trans("TotalHT") . '</b></td></tr>';
|
||||
|
||||
$sql = "SELECT fd.tva_tx AS vatrate,";
|
||||
$sql .= " fd.product_type AS product_type,";
|
||||
$sql .= " cc.label AS country,";
|
||||
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(fd.total_ht) as total";
|
||||
$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 . "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 .= " WHERE f.datef >= '" . $db->idate($date_start) . "'";
|
||||
$sql .= " AND f.datef <= '" . $db->idate($date_end) . "'";
|
||||
$sql.= " AND f.fk_statut in (1,2)";
|
||||
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)";
|
||||
}
|
||||
$sql .= " AND f.entity IN (" . getEntity('invoice', 0) . ")";
|
||||
$sql .= " GROUP BY fd.tva_tx,fd.product_type, cc.label ";
|
||||
$sql = "SELECT fd.tva_tx AS vatrate,";
|
||||
$sql .= " fd.product_type AS product_type,";
|
||||
$sql .= " cc.label AS country,";
|
||||
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(fd.total_ht) as total";
|
||||
$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 . "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 .= " WHERE f.datef >= '" . $db->idate($date_start) . "'";
|
||||
$sql .= " AND f.datef <= '" . $db->idate($date_end) . "'";
|
||||
$sql.= " AND f.fk_statut in (1,2)";
|
||||
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)";
|
||||
}
|
||||
$sql .= " AND f.entity IN (" . getEntity('invoice', 0) . ")";
|
||||
$sql .= " GROUP BY fd.tva_tx,fd.product_type, cc.label ";
|
||||
|
||||
dol_syslog("htdocs/compta/tva/index.php sql=" . $sql, LOG_DEBUG);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $db->num_rows($resql);
|
||||
$totalpermonth = array();
|
||||
while ( $obj = $db->fetch_object($resql)) {
|
||||
print '<tr class="oddeven"><td class="right">' . vatrate($obj->vatrate) . '</td>';
|
||||
if ($obj->product_type == 0) {
|
||||
print '<td class="left">'. $langs->trans("Product") . '</td>';
|
||||
} else {
|
||||
print '<td class="left">'. $langs->trans("Service") . '</td>';
|
||||
dol_syslog("htdocs/compta/tva/index.php sql=" . $sql, LOG_DEBUG);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $db->num_rows($resql);
|
||||
$totalpermonth = array();
|
||||
while ( $obj = $db->fetch_object($resql)) {
|
||||
print '<tr class="oddeven"><td class="right">' . vatrate($obj->vatrate) . '</td>';
|
||||
if ($obj->product_type == 0) {
|
||||
print '<td class="left">'. $langs->trans("Product") . '</td>';
|
||||
} else {
|
||||
print '<td class="left">'. $langs->trans("Service") . '</td>';
|
||||
}
|
||||
print '<td>' .$obj->country . '</td>';
|
||||
for($i = 0; $i < 12; $i++) {
|
||||
$j = $i + (empty($conf->global->SOCIETE_FISCAL_MONTH_START)?1:$conf->global->SOCIETE_FISCAL_MONTH_START);
|
||||
if ($j > 12) $j -= 12;
|
||||
$monthj = 'month'.str_pad($j, 2, '0', STR_PAD_LEFT);
|
||||
print '<td class="right" width="6%">' . price($obj->$monthj) . '</td>';
|
||||
$totalpermonth[$j]=(empty($totalpermonth[$j])?0:$totalpermonth[$j])+$obj->$monthj;
|
||||
}
|
||||
print '<td class="right" width="6%"><b>' . price($obj->total) . '</b></td>';
|
||||
$totalpermonth['total']=(empty($totalpermonth['total'])?0:$totalpermonth['total'])+$obj->total;
|
||||
print '</tr>';
|
||||
}
|
||||
print '<td>' .$obj->country . '</td>';
|
||||
$db->free($resql);
|
||||
|
||||
// Total
|
||||
print '<tr class="liste_total"><td class="right"></td>';
|
||||
print '<td class="left"></td>';
|
||||
print '<td></td>';
|
||||
for($i = 0; $i < 12; $i++) {
|
||||
$j = $i + (empty($conf->global->SOCIETE_FISCAL_MONTH_START)?1:$conf->global->SOCIETE_FISCAL_MONTH_START);
|
||||
if ($j > 12) $j -= 12;
|
||||
$monthj = 'month'.str_pad($j, 2, '0', STR_PAD_LEFT);
|
||||
print '<td class="right" width="6%">' . price($obj->$monthj) . '</td>';
|
||||
$totalpermonth[$j]=(empty($totalpermonth[$j])?0:$totalpermonth[$j])+$obj->$monthj;
|
||||
print '<td class="right" width="6%">' . price($totalpermonth[$j]) . '</td>';
|
||||
}
|
||||
print '<td class="right" width="6%"><b>' . price($obj->total) . '</b></td>';
|
||||
$totalpermonth['total']=(empty($totalpermonth['total'])?0:$totalpermonth['total'])+$obj->total;
|
||||
print '<td class="right" width="6%"><b>' . price($totalpermonth['total']) . '</b></td>';
|
||||
print '</tr>';
|
||||
} else {
|
||||
print $db->lasterror(); // Show last sql error
|
||||
}
|
||||
$db->free($resql);
|
||||
|
||||
// Total
|
||||
print '<tr class="liste_total"><td class="right"></td>';
|
||||
print '<td class="left"></td>';
|
||||
print '<td></td>';
|
||||
for($i = 0; $i < 12; $i++) {
|
||||
|
||||
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("Country") . '</td>';
|
||||
$i=0;
|
||||
while($i < 12)
|
||||
{
|
||||
$j = $i + (empty($conf->global->SOCIETE_FISCAL_MONTH_START)?1:$conf->global->SOCIETE_FISCAL_MONTH_START);
|
||||
if ($j > 12) $j -= 12;
|
||||
$monthj = 'month'.str_pad($j, 2, '0', STR_PAD_LEFT);
|
||||
print '<td class="right" width="6%">' . price($totalpermonth[$j]) . '</td>';
|
||||
print '<td width="60" class="right">' . $langs->trans('MonthShort' . str_pad($j, 2, '0', STR_PAD_LEFT)) . '</td>';
|
||||
$i++;
|
||||
}
|
||||
print '<td class="right" width="6%"><b>' . price($totalpermonth['total']) . '</b></td>';
|
||||
print '</tr>';
|
||||
} else {
|
||||
print $db->lasterror(); // Show last sql error
|
||||
}
|
||||
print '<td width="60" class="right"><b>' . $langs->trans("TotalHT") . '</b></td></tr>';
|
||||
|
||||
$sql2 = "SELECT ffd.tva_tx AS vatrate,";
|
||||
$sql2 .= " ffd.product_type AS product_type,";
|
||||
$sql2 .= " cc.label AS country,";
|
||||
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(ffd.total_ht) as total";
|
||||
$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 . "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 .= " WHERE ff.datef >= '" . $db->idate($date_start) . "'";
|
||||
$sql2 .= " AND ff.datef <= '" . $db->idate($date_end) . "'";
|
||||
$sql.= " AND ff.fk_statut in (1,2)";
|
||||
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||
$sql.= " AND ff.type IN (0,1,2,5)";
|
||||
} else {
|
||||
$sql.= " AND ff.type IN (0,1,2,3,5)";
|
||||
}
|
||||
$sql2 .= " AND ff.entity IN (" . getEntity("facture_fourn", 0) . ")";
|
||||
$sql2 .= " GROUP BY ffd.tva_tx, ffd.product_type, cc.label";
|
||||
|
||||
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("Country") . '</td>';
|
||||
$i=0;
|
||||
while($i < 12)
|
||||
{
|
||||
$j = $i + (empty($conf->global->SOCIETE_FISCAL_MONTH_START)?1:$conf->global->SOCIETE_FISCAL_MONTH_START);
|
||||
if ($j > 12) $j -= 12;
|
||||
print '<td width="60" class="right">' . $langs->trans('MonthShort' . str_pad($j, 2, '0', STR_PAD_LEFT)) . '</td>';
|
||||
$i++;
|
||||
}
|
||||
print '<td width="60" class="right"><b>' . $langs->trans("TotalHT") . '</b></td></tr>';
|
||||
|
||||
$sql2 = "SELECT ffd.tva_tx AS vatrate,";
|
||||
$sql2 .= " ffd.product_type AS product_type,";
|
||||
$sql2 .= " cc.label AS country,";
|
||||
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(ffd.total_ht) as total";
|
||||
$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 . "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 .= " WHERE ff.datef >= '" . $db->idate($date_start) . "'";
|
||||
$sql2 .= " AND ff.datef <= '" . $db->idate($date_end) . "'";
|
||||
$sql.= " AND ff.fk_statut in (1,2)";
|
||||
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||
$sql.= " AND ff.type IN (0,1,2,5)";
|
||||
} else {
|
||||
$sql.= " AND ff.type IN (0,1,2,3,5)";
|
||||
}
|
||||
$sql2 .= " AND ff.entity IN (" . getEntity("facture_fourn", 0) . ")";
|
||||
$sql2 .= " GROUP BY ffd.tva_tx, ffd.product_type, cc.label";
|
||||
|
||||
//print $sql2;
|
||||
dol_syslog("htdocs/compta/tva/index.php sql=" . $sql, LOG_DEBUG);
|
||||
$resql2 = $db->query($sql2);
|
||||
if ($resql2) {
|
||||
$num = $db->num_rows($resql2);
|
||||
$totalpermonth = array();
|
||||
while ( $obj = $db->fetch_object($resql2)) {
|
||||
print '<tr class="oddeven"><td class="right">' . vatrate($obj->vatrate) . '</td>';
|
||||
if ($obj->product_type == 0) {
|
||||
print '<td class="left">'. $langs->trans("Product") . '</td>';
|
||||
} else {
|
||||
print '<td class="left">'. $langs->trans("Service") . '</td>';
|
||||
//print $sql2;
|
||||
dol_syslog("htdocs/compta/tva/index.php sql=" . $sql, LOG_DEBUG);
|
||||
$resql2 = $db->query($sql2);
|
||||
if ($resql2) {
|
||||
$num = $db->num_rows($resql2);
|
||||
$totalpermonth = array();
|
||||
while ( $obj = $db->fetch_object($resql2)) {
|
||||
print '<tr class="oddeven"><td class="right">' . vatrate($obj->vatrate) . '</td>';
|
||||
if ($obj->product_type == 0) {
|
||||
print '<td class="left">'. $langs->trans("Product") . '</td>';
|
||||
} else {
|
||||
print '<td class="left">'. $langs->trans("Service") . '</td>';
|
||||
}
|
||||
print '<td>' . $obj->country . '</td>';
|
||||
for($i = 0; $i < 12; $i++) {
|
||||
$j = $i + (empty($conf->global->SOCIETE_FISCAL_MONTH_START)?1:$conf->global->SOCIETE_FISCAL_MONTH_START);
|
||||
if ($j > 12) $j -= 12;
|
||||
$monthj = 'month'.str_pad($j, 2, '0', STR_PAD_LEFT);
|
||||
print '<td class="right" width="6%">' . price($obj->$monthj) . '</td>';
|
||||
$totalpermonth[$j]=(empty($totalpermonth[$j])?0:$totalpermonth[$j])+$obj->$monthj;
|
||||
}
|
||||
print '<td class="right" width="6%"><b>' . price($obj->total) . '</b></td>';
|
||||
$totalpermonth['total']=(empty($totalpermonth['total'])?0:$totalpermonth['total'])+$obj->total;
|
||||
print '</tr>';
|
||||
}
|
||||
print '<td>' . $obj->country . '</td>';
|
||||
$db->free($resql2);
|
||||
|
||||
// Total
|
||||
print '<tr class="liste_total"><td class="right"></td>';
|
||||
print '<td class="left"></td>';
|
||||
print '<td></td>';
|
||||
for($i = 0; $i < 12; $i++) {
|
||||
$j = $i + (empty($conf->global->SOCIETE_FISCAL_MONTH_START)?1:$conf->global->SOCIETE_FISCAL_MONTH_START);
|
||||
if ($j > 12) $j -= 12;
|
||||
$monthj = 'month'.str_pad($j, 2, '0', STR_PAD_LEFT);
|
||||
print '<td class="right" width="6%">' . price($obj->$monthj) . '</td>';
|
||||
$totalpermonth[$j]=(empty($totalpermonth[$j])?0:$totalpermonth[$j])+$obj->$monthj;
|
||||
print '<td class="right" width="6%">' . price($totalpermonth[$j]) . '</td>';
|
||||
}
|
||||
print '<td class="right" width="6%"><b>' . price($obj->total) . '</b></td>';
|
||||
$totalpermonth['total']=(empty($totalpermonth['total'])?0:$totalpermonth['total'])+$obj->total;
|
||||
print '<td class="right" width="6%"><b>' . price($totalpermonth['total']) . '</b></td>';
|
||||
print '</tr>';
|
||||
} else {
|
||||
print $db->lasterror(); // Show last sql error
|
||||
}
|
||||
$db->free($resql2);
|
||||
|
||||
// Total
|
||||
print '<tr class="liste_total"><td class="right"></td>';
|
||||
print '<td class="left"></td>';
|
||||
print '<td></td>';
|
||||
for($i = 0; $i < 12; $i++) {
|
||||
$j = $i + (empty($conf->global->SOCIETE_FISCAL_MONTH_START)?1:$conf->global->SOCIETE_FISCAL_MONTH_START);
|
||||
if ($j > 12) $j -= 12;
|
||||
$monthj = 'month'.str_pad($j, 2, '0', STR_PAD_LEFT);
|
||||
print '<td class="right" width="6%">' . price($totalpermonth[$j]) . '</td>';
|
||||
}
|
||||
print '<td class="right" width="6%"><b>' . price($totalpermonth['total']) . '</b></td>';
|
||||
print '</tr>';
|
||||
} else {
|
||||
print $db->lasterror(); // Show last sql error
|
||||
}
|
||||
print "</table>\n";
|
||||
print "</table>\n";
|
||||
} else {
|
||||
// $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
|
||||
|
||||
@ -240,7 +240,7 @@ if ($modecompta == 'CREANCES-DETTES')
|
||||
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)";
|
||||
$sql.= " AND f.type IN (0,1,2,3,5)";
|
||||
}
|
||||
if ($date_start && $date_end) {
|
||||
$sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'";
|
||||
@ -326,7 +326,7 @@ if ($modecompta == 'CREANCES-DETTES')
|
||||
|
||||
// Array header
|
||||
print "<tr class=\"liste_titre\">";
|
||||
print_liste_field_titre(
|
||||
print_liste_field_titre(
|
||||
$langs->trans("Product"),
|
||||
$_SERVER["PHP_SELF"],
|
||||
"ref",
|
||||
@ -336,7 +336,7 @@ print_liste_field_titre(
|
||||
$sortfield,
|
||||
$sortorder
|
||||
);
|
||||
print_liste_field_titre(
|
||||
print_liste_field_titre(
|
||||
$langs->trans('Quantity'),
|
||||
$_SERVER["PHP_SELF"],
|
||||
"qty",
|
||||
@ -346,7 +346,7 @@ print_liste_field_titre(
|
||||
$sortfield,
|
||||
$sortorder
|
||||
);
|
||||
print_liste_field_titre(
|
||||
print_liste_field_titre(
|
||||
$langs->trans("Percentage"),
|
||||
$_SERVER["PHP_SELF"],
|
||||
"qty",
|
||||
@ -356,7 +356,7 @@ print_liste_field_titre(
|
||||
$sortfield,
|
||||
$sortorder
|
||||
);
|
||||
print_liste_field_titre(
|
||||
print_liste_field_titre(
|
||||
$langs->trans('AmountHT'),
|
||||
$_SERVER["PHP_SELF"],
|
||||
"amount",
|
||||
@ -366,7 +366,7 @@ print_liste_field_titre(
|
||||
$sortfield,
|
||||
$sortorder
|
||||
);
|
||||
print_liste_field_titre(
|
||||
print_liste_field_titre(
|
||||
$langs->trans("AmountTTC"),
|
||||
$_SERVER["PHP_SELF"],
|
||||
"amount_ttc",
|
||||
@ -376,7 +376,7 @@ print_liste_field_titre(
|
||||
$sortfield,
|
||||
$sortorder
|
||||
);
|
||||
print_liste_field_titre(
|
||||
print_liste_field_titre(
|
||||
$langs->trans("Percentage"),
|
||||
$_SERVER["PHP_SELF"],
|
||||
"amount_ttc",
|
||||
|
||||
@ -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)";
|
||||
else $sql.= " AND f.type IN (0,1,2,3,5)";
|
||||
$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")
|
||||
{
|
||||
@ -187,7 +187,7 @@ elseif ($modecompta=="RECETTES-DEPENSES")
|
||||
$sql.= " WHERE p.rowid = pf.fk_paiement";
|
||||
$sql.= " AND pf.fk_facture = f.rowid";
|
||||
$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")
|
||||
{
|
||||
|
||||
@ -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>
|
||||
</tr>
|
||||
|
||||
<?php if (! empty($this->control->tpl['contact_element'])) { ?>
|
||||
<?php foreach ($this->control->tpl['contact_element'] as $element) { ?>
|
||||
<tr>
|
||||
<td><?php echo $element['linked_element_label']; ?></td>
|
||||
<td colspan="3"><?php echo $element['linked_element_value']; ?></td>
|
||||
</tr>
|
||||
<?php } } ?>
|
||||
<?php
|
||||
if (! empty($this->control->tpl['contact_element'])) {
|
||||
foreach ($this->control->tpl['contact_element'] as $element) {
|
||||
print '<tr>';
|
||||
print '<td>'.$element['linked_element_label'].'</td>';
|
||||
print '<td colspan="3">'.$element['linked_element_value'].'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
} ?>
|
||||
|
||||
<tr>
|
||||
<td><?php echo $langs->trans("DolibarrLogin"); ?></td>
|
||||
|
||||
@ -24,17 +24,14 @@ if (empty($conf) || ! is_object($conf))
|
||||
|
||||
|
||||
$contact = $GLOBALS['objcanvas']->control->object;
|
||||
?>
|
||||
|
||||
<!-- BEGIN PHP TEMPLATE CONTACTCARD_VIEW.TPL.PHP DEFAULT -->
|
||||
<?php echo $this->control->tpl['showhead']; ?>
|
||||
print "<!-- BEGIN PHP TEMPLATE CONTACTCARD_VIEW.TPL.PHP DEFAULT -->\n";
|
||||
echo $this->control->tpl['showhead'];
|
||||
|
||||
<?php
|
||||
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']; ?>
|
||||
<?php if (! empty($this->control->tpl['action_delete'])) echo $this->control->tpl['action_delete']; ?>
|
||||
if (! empty($this->control->tpl['action_create_user'])) echo $this->control->tpl['action_create_user'];
|
||||
if (! empty($this->control->tpl['action_delete'])) echo $this->control->tpl['action_delete']; ?>
|
||||
|
||||
<table class="border allwidth">
|
||||
|
||||
@ -134,29 +131,27 @@ dol_htmloutput_errors($this->control->tpl['error'], $this->control->tpl['errors'
|
||||
|
||||
</table>
|
||||
|
||||
<?php echo $this->control->tpl['showend']; ?>
|
||||
<?php echo $this->control->tpl['showend'];
|
||||
|
||||
<?php if (empty($user->societe_id)) { ?>
|
||||
<div class="tabsAction">
|
||||
if (empty($user->societe_id)) {
|
||||
print '<div class="tabsAction">';
|
||||
if ($user->rights->societe->contact->creer) {
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$this->control->tpl['id'].'&action=edit&canvas='.$canvas.'">'.$langs->trans('Modify').'</a>';
|
||||
}
|
||||
|
||||
<?php if ($user->rights->societe->contact->creer) { ?>
|
||||
<a class="butAction" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->control->tpl['id'].'&action=edit&canvas='.$canvas; ?>"><?php echo $langs->trans('Modify'); ?></a>
|
||||
<?php } ?>
|
||||
if (! $this->control->tpl['user_id'] && $user->rights->user->user->creer) {
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$this->control->tpl['id'].'&action=create_user&canvas='.$canvas.'">'.$langs->trans("CreateDolibarrLogin").'</a>';
|
||||
}
|
||||
|
||||
<?php 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'].'&action=create_user&canvas='.$canvas; ?>"><?php echo $langs->trans("CreateDolibarrLogin"); ?></a>
|
||||
<?php } ?>
|
||||
if ($user->rights->societe->contact->supprimer) {
|
||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$this->control->tpl['id'].'&action=delete&canvas='.$canvas.'">'.$langs->trans('Delete').'</a>';
|
||||
}
|
||||
|
||||
<?php if ($user->rights->societe->contact->supprimer) { ?>
|
||||
<a class="butActionDelete" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->control->tpl['id'].'&action=delete&canvas='.$canvas; ?>"><?php echo $langs->trans('Delete'); ?></a>
|
||||
<?php } ?>
|
||||
|
||||
</div><br>
|
||||
<?php }
|
||||
print '</div><br>';
|
||||
}
|
||||
|
||||
echo $this->control->tpl['actionstodo'];
|
||||
|
||||
echo $this->control->tpl['actionsdone'];
|
||||
?>
|
||||
|
||||
<!-- END PHP TEMPLATE -->
|
||||
print "<!-- END PHP TEMPLATE -->\n";
|
||||
|
||||
@ -678,7 +678,7 @@ else
|
||||
print $formcompany->select_state(GETPOST("state_id", 'alpha')?GETPOST("state_id", 'alpha'):$object->state_id, $object->country_code, 'state_id');
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
print $countrynotdefined;
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
@ -151,7 +151,7 @@ if ($object->thirdparty->fournisseur)
|
||||
if ($conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire) $elementTypeArray['supplier_order']=$langs->transnoentitiesnoconv('SuppliersOrders');
|
||||
|
||||
// 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>';
|
||||
@ -298,7 +298,7 @@ if (!empty($sql_select))
|
||||
$sql.= " ";
|
||||
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;
|
||||
// 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.= dolSqlDateFilter($dateprint, 0, $month, $year);
|
||||
if ($sref) $sql.= " AND ".$doc_number." LIKE '%".$db->escape($sref)."%'";
|
||||
|
||||
@ -63,8 +63,8 @@ $offset = $conf->liste_limit * $page;
|
||||
$pageprev = $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_ORDER)) { $sortorder=$conf->global->MAIN_DOC_SORT_ORDER; }
|
||||
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 (! $sortorder) $sortorder="ASC";
|
||||
if (! $sortfield) $sortfield="name";
|
||||
|
||||
@ -680,9 +680,9 @@ if (! empty($arrayfields['p.thirdparty']['checked']))
|
||||
if (! empty($arrayfields['p.priv']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre center">';
|
||||
$selectarray=array('0'=>$langs->trans("ContactPublic"),'1'=>$langs->trans("ContactPrivate"));
|
||||
print $form->selectarray('search_priv', $selectarray, $search_priv, 1);
|
||||
print '</td>';
|
||||
$selectarray=array('0'=>$langs->trans("ContactPublic"),'1'=>$langs->trans("ContactPrivate"));
|
||||
print $form->selectarray('search_priv', $selectarray, $search_priv, 1);
|
||||
print '</td>';
|
||||
}
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
|
||||
@ -930,9 +930,9 @@ while ($i < min($num, $limit))
|
||||
print '<td>';
|
||||
if ($obj->socid)
|
||||
{
|
||||
$objsoc = new Societe($db);
|
||||
$objsoc->fetch($obj->socid);
|
||||
print $objsoc->getNomUrl(1);
|
||||
$objsoc = new Societe($db);
|
||||
$objsoc->fetch($obj->socid);
|
||||
print $objsoc->getNomUrl(1);
|
||||
}
|
||||
else
|
||||
print ' ';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user