Merge remote-tracking branch 'Upstream/develop' into develop-loan

This commit is contained in:
aspangaro 2014-10-05 16:35:38 +02:00
commit 7e11fa06bb
223 changed files with 7107 additions and 898 deletions

View File

@ -115,6 +115,7 @@ For developers:
- New: [ task #1511, #1426 ] Added hook "doActions" for supplier card and supplier order card. - New: [ task #1511, #1426 ] Added hook "doActions" for supplier card and supplier order card.
- New: renamed table llx_c_pays to llx_c_country & libelle field to label. - New: renamed table llx_c_pays to llx_c_country & libelle field to label.
- New: Added hook "formConfirm" and "doActions" for fichinter card - New: Added hook "formConfirm" and "doActions" for fichinter card
- New: Can search list of thirdparties from web service on part of name.
- Qual: Renamed table llx_c_civilite into llx_c_civility, - Qual: Renamed table llx_c_civilite into llx_c_civility,
field civilite into label in the same table, field civilite into label in the same table,
and field civilite into civility in other table. and field civilite into civility in other table.

View File

@ -3,7 +3,7 @@
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2014 Ari Elbaz (elarifr) <github@accedinfo.com> * Copyright (C) 2014 Ari Elbaz (elarifr) <github@accedinfo.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* 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
@ -26,7 +26,7 @@
*/ */
require '../../main.inc.php'; require '../../main.inc.php';
// Class // Class
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
@ -64,22 +64,22 @@ if ($action == 'ventil') {
$cpt = 0; $cpt = 0;
foreach ( $mesCasesCochees as $maLigneCochee ) { foreach ( $mesCasesCochees as $maLigneCochee ) {
// print '<div><font color="red">id selectionnee : '.$monChoix."</font></div>"; // print '<div><font color="red">id selectionnee : '.$monChoix."</font></div>";
$maLigneCourante = split("_", $maLigneCochee); $maLigneCourante = explode("_", $maLigneCochee);
$monId = $maLigneCourante[0]; $monId = $maLigneCourante[0];
$monNumLigne = $maLigneCourante[1]; $monNumLigne = $maLigneCourante[1];
$monCompte = $mesCodesVentilChoisis[$monNumLigne]; $monCompte = $mesCodesVentilChoisis[$monNumLigne];
$sql = " UPDATE " . MAIN_DB_PREFIX . "facturedet"; $sql = " UPDATE " . MAIN_DB_PREFIX . "facturedet";
$sql .= " SET fk_code_ventilation = " . $monCompte; $sql .= " SET fk_code_ventilation = " . $monCompte;
$sql .= " WHERE rowid = " . $monId; $sql .= " WHERE rowid = " . $monId;
dol_syslog("/accountancy/customer/list.php sql=" . $sql, LOG_DEBUG); dol_syslog("/accountancy/customer/list.php sql=" . $sql, LOG_DEBUG);
if ($db->query($sql)) { if ($db->query($sql)) {
print '<div><font color="green">' . $langs->trans("Lineofinvoice") . ' ' . $monId . ' ' . $langs->trans("VentilatedinAccount") . ' : ' . $monCompte . '</font></div>'; print '<div><font color="green">' . $langs->trans("Lineofinvoice") . ' ' . $monId . ' ' . $langs->trans("VentilatedinAccount") . ' : ' . $monCompte . '</font></div>';
} else { } else {
print '<div><font color="red">' . $langs->trans("ErrorDB") . ' : ' . $langs->trans("Lineofinvoice") . ' ' . $monId . ' ' . $langs->trans("NotVentilatedinAccount") . ' : ' . $monCompte . '<br/> <pre>' . $sql . '</pre></font></div>'; print '<div><font color="red">' . $langs->trans("ErrorDB") . ' : ' . $langs->trans("Lineofinvoice") . ' ' . $monId . ' ' . $langs->trans("NotVentilatedinAccount") . ' : ' . $monCompte . '<br/> <pre>' . $sql . '</pre></font></div>';
} }
$cpt ++; $cpt ++;
} }
} else { } else {
@ -130,15 +130,15 @@ $result = $db->query($sql);
if ($result) { if ($result) {
$num_lines = $db->num_rows($result); $num_lines = $db->num_rows($result);
$i = 0; $i = 0;
// TODO : print_barre_liste always use $conf->liste_limit and do not care about custom limit in list... // TODO : print_barre_liste always use $conf->liste_limit and do not care about custom limit in list...
print_barre_liste($langs->trans("InvoiceLines"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num_lines); print_barre_liste($langs->trans("InvoiceLines"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num_lines);
print '<br><b>' . $langs->trans("DescVentilTodoCustomer") . '</b></br>'; print '<br><b>' . $langs->trans("DescVentilTodoCustomer") . '</b></br>';
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">' . "\n"; print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">' . "\n";
print '<input type="hidden" name="action" value="ventil">'; print '<input type="hidden" name="action" value="ventil">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td>' . $langs->trans("Invoice") . '</td>'; print '<tr class="liste_titre"><td>' . $langs->trans("Invoice") . '</td>';
print '<td>' . $langs->trans("Ref") . '</td>'; print '<td>' . $langs->trans("Ref") . '</td>';
@ -149,24 +149,24 @@ if ($result) {
print '<td align="center">' . $langs->trans("IntoAccount") . '</td>'; print '<td align="center">' . $langs->trans("IntoAccount") . '</td>';
print '<td align="center">' . $langs->trans("Ventilate") . '</td>'; print '<td align="center">' . $langs->trans("Ventilate") . '</td>';
print '</tr>'; print '</tr>';
$facture_static = new Facture($db); $facture_static = new Facture($db);
$product_static = new Product($db); $product_static = new Product($db);
$form = new Form($db); $form = new Form($db);
$var = True; $var = True;
while ( $i < min($num_lines, $limit) ) { while ( $i < min($num_lines, $limit) ) {
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
$var = ! $var; $var = ! $var;
// product_type: 0 = service ? 1 = product // product_type: 0 = service ? 1 = product
// if product does not exist we use the value of product_type provided in facturedet to define if this is a product or service // if product does not exist we use the value of product_type provided in facturedet to define if this is a product or service
// issue : if we change product_type value in product DB it should differ from the value stored in facturedet DB ! // issue : if we change product_type value in product DB it should differ from the value stored in facturedet DB !
$code_sell_notset = ''; $code_sell_notset = '';
if (empty($objp->code_sell)) { if (empty($objp->code_sell)) {
$code_sell_notset = 'color:red'; $code_sell_notset = 'color:red';
if (! empty($objp->type)) { if (! empty($objp->type)) {
if ($objp->type == 1) { if ($objp->type == 1) {
$objp->code_sell = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef")); $objp->code_sell = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
@ -175,7 +175,7 @@ if ($result) {
} }
} else { } else {
$code_sell_notset = 'color:blue'; $code_sell_notset = 'color:blue';
if ($objp->type == 1) { if ($objp->type == 1) {
$objp->code_sell = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef")); $objp->code_sell = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
} else { } else {
@ -183,14 +183,14 @@ if ($result) {
} }
} }
} }
print "<tr $bc[$var]>"; print "<tr $bc[$var]>";
// Ref facture // Ref facture
$facture_static->ref = $objp->facnumber; $facture_static->ref = $objp->facnumber;
$facture_static->id = $objp->facid; $facture_static->id = $objp->facid;
print '<td>' . $facture_static->getNomUrl(1) . '</td>'; print '<td>' . $facture_static->getNomUrl(1) . '</td>';
// Ref produit // Ref produit
$product_static->ref = $objp->product_ref; $product_static->ref = $objp->product_ref;
$product_static->id = $objp->product_id; $product_static->id = $objp->product_id;
@ -201,34 +201,34 @@ if ($result) {
else else
print '&nbsp;'; print '&nbsp;';
print '</td>'; print '</td>';
print '<td>' . dol_trunc($objp->product_label, 24) . '</td>'; print '<td>' . dol_trunc($objp->product_label, 24) . '</td>';
print '<td>' . nl2br(dol_trunc($objp->description, 32)) . '</td>'; print '<td>' . nl2br(dol_trunc($objp->description, 32)) . '</td>';
print '<td align="right">'; print '<td align="right">';
print price($objp->total_ht); print price($objp->total_ht);
print '</td>'; print '</td>';
print '<td align="center" style="' . $code_sell_notset . '">'; print '<td align="center" style="' . $code_sell_notset . '">';
print $objp->code_sell; print $objp->code_sell;
print '</td>'; print '</td>';
// Colonne choix du compte // Colonne choix du compte
print '<td align="center">'; print '<td align="center">';
print $formventilation->select_account($objp->aarowid, 'codeventil[]', 1); print $formventilation->select_account($objp->aarowid, 'codeventil[]', 1);
print '</td>'; print '</td>';
// Colonne choix ligne a ventiler // Colonne choix ligne a ventiler
print '<td align="center">'; print '<td align="center">';
print '<input type="checkbox" name="mesCasesCochees[]" value="' . $objp->rowid . "_" . $i . '"' . ($objp->aarowid ? "checked" : "") . '/>'; print '<input type="checkbox" name="mesCasesCochees[]" value="' . $objp->rowid . "_" . $i . '"' . ($objp->aarowid ? "checked" : "") . '/>';
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
$i ++; $i ++;
} }
print '<tr><td colspan="8">&nbsp;</td></tr><tr><td colspan="8" align="center"><input type="submit" class="butAction" value="' . $langs->trans("Ventilate") . '"></td></tr>'; print '<tr><td colspan="8">&nbsp;</td></tr><tr><td colspan="8" align="center"><input type="submit" class="butAction" value="' . $langs->trans("Ventilate") . '"></td></tr>';
print '</table>'; print '</table>';
print '</form>'; print '</form>';
} else { } else {

View File

@ -189,7 +189,7 @@ if ($result) {
else if ($links[$key]['type'] == 'company') else if ($links[$key]['type'] == 'company')
{ {
$societestatic->id = $links[$key]['url_id']; $societestatic->id = $links[$key]['url_id'];
$societestatic->nom = $links[$key]['label']; $societestatic->name = $links[$key]['label'];
$tabpay[$obj->rowid]["soclib"] = $societestatic->getNomUrl(1, '', 30); $tabpay[$obj->rowid]["soclib"] = $societestatic->getNomUrl(1, '', 30);
$tabtp[$obj->rowid][$compta_soc] += $obj->amount; $tabtp[$obj->rowid][$compta_soc] += $obj->amount;
} }

View File

@ -171,7 +171,7 @@ if ($result) {
} else if ($links[$key]['type'] == 'company') { } else if ($links[$key]['type'] == 'company') {
$societestatic->id = $links[$key]['url_id']; $societestatic->id = $links[$key]['url_id'];
$societestatic->nom = $links[$key]['label']; $societestatic->name = $links[$key]['label'];
$tabpay[$obj->rowid]["soclib"] = $societestatic->getNomUrl(1, '', 30); $tabpay[$obj->rowid]["soclib"] = $societestatic->getNomUrl(1, '', 30);
$tabtp[$obj->rowid][$compta_soc] += $obj->amount; $tabtp[$obj->rowid][$compta_soc] += $obj->amount;
} else if ($links[$key]['type'] == 'sc') { } else if ($links[$key]['type'] == 'sc') {
@ -448,14 +448,14 @@ if ($action == 'export_csv') {
llxHeader('', $langs->trans("CashJournal"), ''); llxHeader('', $langs->trans("CashJournal"), '');
$nom = $langs->trans("CashJournal"); $name = $langs->trans("CashJournal");
$nomlink = ''; $nomlink = '';
$periodlink = ''; $periodlink = '';
$exportlink = ''; $exportlink = '';
$builddate = time(); $builddate = time();
$description = $langs->trans("DescCashJournal") . '<br>'; $description = $langs->trans("DescCashJournal") . '<br>';
$period = $form->select_date($date_start, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end, 'date_end', 0, 0, 0, '', 1, 0, 1); $period = $form->select_date($date_start, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end, 'date_end', 0, 0, 0, '', 1, 0, 1);
report_header($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => '')); report_header($name, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''));
print '<input type="button" class="button" style="float: right;" value="Export CSV" onclick="launch_export();" />'; print '<input type="button" class="button" style="float: right;" value="Export CSV" onclick="launch_export();" />';

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> /* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2014 Ari Elbaz (elarifr) <github@accedinfo.com> * Copyright (C) 2014 Ari Elbaz (elarifr) <github@accedinfo.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>s * Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>s
* *
@ -26,7 +26,7 @@
*/ */
require '../../main.inc.php'; require '../../main.inc.php';
// Class // Class
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
@ -63,25 +63,25 @@ if ($action == 'ventil') {
print '<div><font color="red">' . count($_POST["mesCasesCochees"]) . ' ' . $langs->trans("SelectedLines") . '</font></div>'; print '<div><font color="red">' . count($_POST["mesCasesCochees"]) . ' ' . $langs->trans("SelectedLines") . '</font></div>';
$mesCodesVentilChoisis = $codeventil; $mesCodesVentilChoisis = $codeventil;
$cpt = 0; $cpt = 0;
foreach ( $mesCasesCochees as $maLigneCochee ) { foreach ( $mesCasesCochees as $maLigneCochee ) {
// print '<div><font color="red">id selectionnee : '.$monChoix."</font></div>"; // print '<div><font color="red">id selectionnee : '.$monChoix."</font></div>";
$maLigneCourante = split("_", $maLigneCochee); $maLigneCourante = explode("_", $maLigneCochee);
$monId = $maLigneCourante[0]; $monId = $maLigneCourante[0];
$monNumLigne = $maLigneCourante[1]; $monNumLigne = $maLigneCourante[1];
$monCompte = $mesCodesVentilChoisis[$monNumLigne]; $monCompte = $mesCodesVentilChoisis[$monNumLigne];
$sql = " UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det"; $sql = " UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det";
$sql .= " SET fk_code_ventilation = " . $monCompte; $sql .= " SET fk_code_ventilation = " . $monCompte;
$sql .= " WHERE rowid = " . $monId; $sql .= " WHERE rowid = " . $monId;
dol_syslog('accountancy/supplier/list.php:: sql=' . $sql); dol_syslog('accountancy/supplier/list.php:: sql=' . $sql);
if ($db->query($sql)) { if ($db->query($sql)) {
print '<div><font color="green">' . $langs->trans("Lineofinvoice") . ' ' . $monId . ' ' . $langs->trans("VentilatedinAccount") . ' : ' . $monCompte . '</font></div>'; print '<div><font color="green">' . $langs->trans("Lineofinvoice") . ' ' . $monId . ' ' . $langs->trans("VentilatedinAccount") . ' : ' . $monCompte . '</font></div>';
} else { } else {
print '<div><font color="red">' . $langs->trans("ErrorDB") . ' : ' . $langs->trans("Lineofinvoice") . ' ' . $monId . ' ' . $langs->trans("NotVentilatedinAccount") . ' : ' . $monCompte . '<br/> <pre>' . $sql . '</pre></font></div>'; print '<div><font color="red">' . $langs->trans("ErrorDB") . ' : ' . $langs->trans("Lineofinvoice") . ' ' . $monId . ' ' . $langs->trans("NotVentilatedinAccount") . ' : ' . $monCompte . '<br/> <pre>' . $sql . '</pre></font></div>';
} }
$cpt ++; $cpt ++;
} }
} else { } else {
@ -133,15 +133,15 @@ $result = $db->query($sql);
if ($result) { if ($result) {
$num_lines = $db->num_rows($result); $num_lines = $db->num_rows($result);
$i = 0; $i = 0;
// TODO : print_barre_liste always use $conf->liste_limit and do not care about custom limit in list... // TODO : print_barre_liste always use $conf->liste_limit and do not care about custom limit in list...
print_barre_liste($langs->trans("InvoiceLines"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num_lines); print_barre_liste($langs->trans("InvoiceLines"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num_lines);
print '<td align="left"><br><b>' . $langs->trans("DescVentilTodoSupplier") . '</b></br></td>'; print '<td align="left"><br><b>' . $langs->trans("DescVentilTodoSupplier") . '</b></br></td>';
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">' . "\n"; print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">' . "\n";
print '<input type="hidden" name="action" value="ventil">'; print '<input type="hidden" name="action" value="ventil">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td>Facture</td>'; print '<tr class="liste_titre"><td>Facture</td>';
print '<td align="left">' . $langs->trans("Ref") . '</td>'; print '<td align="left">' . $langs->trans("Ref") . '</td>';
@ -152,22 +152,22 @@ if ($result) {
print '<td align="center">' . $langs->trans("IntoAccount") . '</td>'; print '<td align="center">' . $langs->trans("IntoAccount") . '</td>';
print '<td align="center">' . $langs->trans("Ventilate") . '</td>'; print '<td align="center">' . $langs->trans("Ventilate") . '</td>';
print "</tr>\n"; print "</tr>\n";
$facturefourn_static = new FactureFournisseur($db); $facturefourn_static = new FactureFournisseur($db);
$productfourn_static = new ProductFournisseur($db); $productfourn_static = new ProductFournisseur($db);
$form = new Form($db); $form = new Form($db);
$var = True; $var = True;
while ( $i < min($num_lines, $limit) ) { while ( $i < min($num_lines, $limit) ) {
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
$var = ! $var; $var = ! $var;
print "<tr $bc[$var]>"; print "<tr $bc[$var]>";
// Ref facture // Ref facture
$facturefourn_static->ref = $objp->ref; $facturefourn_static->ref = $objp->ref;
$facturefourn_static->id = $objp->facid; $facturefourn_static->id = $objp->facid;
print '<td>' . $facturefourn_static->getNomUrl(1) . '</td>'; print '<td>' . $facturefourn_static->getNomUrl(1) . '</td>';
// Ref facture supplier // Ref facture supplier
$productfourn_static->ref = $objp->product_ref; $productfourn_static->ref = $objp->product_ref;
$productfourn_static->id = $objp->product_id; $productfourn_static->id = $objp->product_id;
@ -178,23 +178,23 @@ if ($result) {
else else
print '&nbsp;'; print '&nbsp;';
print '</td>'; print '</td>';
// print '<td><a href="'.DOL_URL_ROOT.'/fourn/facture/card.php?facid='.$objp->facid.'">'.$objp->ref.'</a></td>'; // print '<td><a href="'.DOL_URL_ROOT.'/fourn/facture/card.php?facid='.$objp->facid.'">'.$objp->ref.'</a></td>';
// print '<td><a href="'.DOL_URL_ROOT.'/fourn/facture/card.php?facid='.$objp->facid.'">'.$objp->ref_supplier.'</a></td>'; // print '<td><a href="'.DOL_URL_ROOT.'/fourn/facture/card.php?facid='.$objp->facid.'">'.$objp->ref_supplier.'</a></td>';
print '<td>' . dol_trunc($objp->product_label, 24) . '</td>'; print '<td>' . dol_trunc($objp->product_label, 24) . '</td>';
print '<td>' . stripslashes(nl2br($objp->description)) . '</td>'; print '<td>' . stripslashes(nl2br($objp->description)) . '</td>';
print '<td align="right">'; print '<td align="right">';
print price($objp->price); print price($objp->price);
print '</td>'; print '</td>';
print '<td align="right">'; print '<td align="right">';
print $objp->code_buy; print $objp->code_buy;
print '</td>'; print '</td>';
// Colonne choix du compte // Colonne choix du compte
print '<td align="center">'; print '<td align="center">';
print $formventilation->select_account($objp->aarowid, 'codeventil[]', 1); print $formventilation->select_account($objp->aarowid, 'codeventil[]', 1);
@ -203,15 +203,15 @@ if ($result) {
print '<td align="center">'; print '<td align="center">';
print '<input type="checkbox" name="mesCasesCochees[]" value="' . $objp->rowid . "_" . $i . '"' . ($objp->aarowid ? "checked" : "") . '/>'; print '<input type="checkbox" name="mesCasesCochees[]" value="' . $objp->rowid . "_" . $i . '"' . ($objp->aarowid ? "checked" : "") . '/>';
print '</td>'; print '</td>';
print "</tr>"; print "</tr>";
$i ++; $i ++;
} }
print '<tr><td colspan="8">&nbsp;</td></tr><tr><td colspan="8" align="center"><input type="submit" class="butAction" value="' . $langs->trans("Ventiler") . '"></td></tr>'; print '<tr><td colspan="8">&nbsp;</td></tr><tr><td colspan="8" align="center"><input type="submit" class="butAction" value="' . $langs->trans("Ventiler") . '"></td></tr>';
print "</table>"; print "</table>";
print '</form>'; print '</form>';
} else { } else {
print $db->error(); print $db->error();

View File

@ -119,7 +119,7 @@ class AdherentType extends CommonObject
if ($result) if ($result)
{ {
$action='update'; $action='update';
// Actions on extra fields (by external module or standard code) // Actions on extra fields (by external module or standard code)
$hookmanager->initHooks(array('membertypedao')); $hookmanager->initHooks(array('membertypedao'));
$parameters=array('membertype'=>$this->id); $parameters=array('membertype'=>$this->id);
@ -151,21 +151,23 @@ class AdherentType extends CommonObject
* Fonction qui permet de supprimer le status de l'adherent * Fonction qui permet de supprimer le status de l'adherent
* *
* @param int $rowid Id of member type to delete * @param int $rowid Id of member type to delete
* @return int >0 if OK, < 0 if KO * @return int >0 if OK, 0 if not found, < 0 if KO
*/ */
function delete($rowid) function delete($rowid='')
{ {
$sql = "DELETE FROM ".MAIN_DB_PREFIX."adherent_type WHERE rowid = $rowid"; if (empty($rowid)) $rowid=$this->id;
$sql = "DELETE FROM ".MAIN_DB_PREFIX."adherent_type WHERE rowid = ".$rowid;
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if ($resql) if ($resql)
{ {
if ( $this->db->affected_rows($resql) ) if ($this->db->affected_rows($resql))
{ {
return 1; return 1;
} }
else else
{ {
return 0; return 0;
} }
} }

View File

@ -396,7 +396,7 @@ if ($conf->produit->enabled)
$var = !$var; $var = !$var;
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
print '<td>'.$modBarCode->nom."</td><td>\n"; print '<td>'.(isset($modBarCode->name)?$modBarCode->name:$modBarCode->nom)."</td><td>\n";
print $modBarCode->info($langs); print $modBarCode->info($langs);
print '</td>'; print '</td>';
print '<td class="nowrap">'.$modBarCode->getExample($langs)."</td>\n"; print '<td class="nowrap">'.$modBarCode->getExample($langs)."</td>\n";

View File

@ -287,7 +287,7 @@ if ($conf->product->enabled || $conf->product->service)
{ {
print $langs->trans("BarCodeNumberManager").": "; print $langs->trans("BarCodeNumberManager").": ";
$objproduct=new Product($db); $objproduct=new Product($db);
print '<b>'.$modBarCodeProduct->nom.'</b> - '.$langs->trans("NextValue").': <b>'.$modBarCodeProduct->getNextValue($objproduct).'</b><br>'; print '<b>'.(isset($modBarCodeProduct->name)?$modBarCodeProduct->name:$modBarCodeProduct->nom).'</b> - '.$langs->trans("NextValue").': <b>'.$modBarCodeProduct->getNextValue($objproduct).'</b><br>';
$disabled=0; $disabled=0;
} }
else else

View File

@ -170,7 +170,7 @@ if ($action == 'add')
} }
// Initialisation objet cactioncomm // Initialisation objet cactioncomm
if (! GETPOST('actioncode') > 0) if (! GETPOST('actioncode') > 0) // actioncode is id
{ {
$error++; $donotclearsession=1; $error++; $donotclearsession=1;
$action = 'create'; $action = 'create';
@ -178,62 +178,63 @@ if ($action == 'add')
} }
else else
{ {
$result=$cactioncomm->fetch(GETPOST('actioncode')); $object->type_code = GETPOST('actioncode');
} }
// Initialisation objet actioncomm if (! $error)
$object->type_id = $cactioncomm->id;
$object->type_code = $cactioncomm->code;
$object->priority = GETPOST("priority")?GETPOST("priority"):0;
$object->fulldayevent = (! empty($fulldayevent)?1:0);
$object->location = GETPOST("location");
$object->label = trim(GETPOST('label'));
$object->fk_element = GETPOST("fk_element");
$object->elementtype = GETPOST("elementtype");
if (! GETPOST('label'))
{ {
if (GETPOST('actioncode') == 'AC_RDV' && $contact->getFullName($langs)) // Initialisation objet actioncomm
$object->priority = GETPOST("priority")?GETPOST("priority"):0;
$object->fulldayevent = (! empty($fulldayevent)?1:0);
$object->location = GETPOST("location");
$object->label = trim(GETPOST('label'));
$object->fk_element = GETPOST("fk_element");
$object->elementtype = GETPOST("elementtype");
if (! GETPOST('label'))
{ {
$object->label = $langs->transnoentitiesnoconv("TaskRDVWith",$contact->getFullName($langs)); if (GETPOST('actioncode') == 'AC_RDV' && $contact->getFullName($langs))
}
else
{
if ($langs->trans("Action".$object->type_code) != "Action".$object->type_code)
{ {
$object->label = $langs->transnoentitiesnoconv("Action".$object->type_code)."\n"; $object->label = $langs->transnoentitiesnoconv("TaskRDVWith",$contact->getFullName($langs));
} }
else $object->label = $cactioncomm->libelle; else
{
if ($langs->trans("Action".$object->type_code) != "Action".$object->type_code)
{
$object->label = $langs->transnoentitiesnoconv("Action".$object->type_code)."\n";
}
else $object->label = $cactioncomm->libelle;
}
}
$object->fk_project = isset($_POST["projectid"])?$_POST["projectid"]:0;
$object->datep = $datep;
$object->datef = $datef;
$object->percentage = $percentage;
$object->duree=((float) (GETPOST('dureehour') * 60) + (float) GETPOST('dureemin')) * 60;
$listofuserid=array();
if (! empty($_SESSION['assignedtouser'])) $listofuserid=dol_json_decode($_SESSION['assignedtouser']);
$i=0;
foreach($listofuserid as $key => $value)
{
if ($i == 0) // First entry
{
$usertodo=new User($db);
if ($value['id'] > 0)
{
$usertodo->fetch($value['id']);
$object->userownerid = $usertodo->id;
}
$object->usertodo = $usertodo;
$object->transparency = (GETPOST("transparency")=='on'?1:0);
}
$object->userassigned[$value['id']]=array('id'=>$value['id'], 'transparency'=>(GETPOST("transparency")=='on'?1:0));
$i++;
} }
} }
$object->fk_project = isset($_POST["projectid"])?$_POST["projectid"]:0;
$object->datep = $datep;
$object->datef = $datef;
$object->percentage = $percentage;
$object->duree=((float) (GETPOST('dureehour') * 60) + (float) GETPOST('dureemin')) * 60;
$listofuserid=array(); if (! $error && ! empty($conf->global->AGENDA_ENABLE_DONEBY))
if (! empty($_SESSION['assignedtouser'])) $listofuserid=dol_json_decode($_SESSION['assignedtouser']);
$i=0;
foreach($listofuserid as $key => $value)
{
if ($i == 0) // First entry
{
$usertodo=new User($db);
if ($value['id'] > 0)
{
$usertodo->fetch($value['id']);
$object->userownerid = $usertodo->id;
}
$object->usertodo = $usertodo;
$object->transparency = (GETPOST("transparency")=='on'?1:0);
}
$object->userassigned[$value['id']]=array('id'=>$value['id'], 'transparency'=>(GETPOST("transparency")=='on'?1:0));
$i++;
}
if (! empty($conf->global->AGENDA_ENABLE_DONEBY))
{ {
$userdone=new User($db); $userdone=new User($db);
if ($_POST["doneby"] > 0) if ($_POST["doneby"] > 0)
@ -250,10 +251,10 @@ if ($action == 'add')
if (GETPOST('socid','int') > 0) if (GETPOST('socid','int') > 0)
{ {
$societe = new Societe($db); $object->socid=GETPOST('socid','int');
$societe->fetch(GETPOST('socid','int')); $object->fetch_thirdparty();
$object->societe = $societe; // deprecated
$object->thirdparty = $societe; $object->societe = $object->thirdparty; // For backward compatibility
} }
// Special for module webcal and phenix // Special for module webcal and phenix
@ -607,6 +608,7 @@ if ($action == 'create')
print '<input type="hidden" name="action" value="add">'; print '<input type="hidden" name="action" value="add">';
print '<input type="hidden" name="donotclearsession" value="1">'; print '<input type="hidden" name="donotclearsession" value="1">';
if ($backtopage) print '<input type="hidden" name="backtopage" value="'.($backtopage != '1' ? $backtopage : $_SERVER["HTTP_REFERER"]).'">'; if ($backtopage) print '<input type="hidden" name="backtopage" value="'.($backtopage != '1' ? $backtopage : $_SERVER["HTTP_REFERER"]).'">';
if (empty($conf->global->AGENDA_USE_EVENT_TYPE)) print '<input type="hidden" name="actioncode" value="'.dol_getIdFromCode($db, 'AC_OTH', 'c_actioncomm').'">';
if (GETPOST("actioncode") == 'AC_RDV') print_fiche_titre($langs->trans("AddActionRendezVous")); if (GETPOST("actioncode") == 'AC_RDV') print_fiche_titre($langs->trans("AddActionRendezVous"));
else print_fiche_titre($langs->trans("AddAnAction")); else print_fiche_titre($langs->trans("AddAnAction"));
@ -620,7 +622,6 @@ if ($action == 'create')
$formactions->select_type_actions(GETPOST("actioncode")?GETPOST("actioncode"):$object->type_code, "actioncode","systemauto"); $formactions->select_type_actions(GETPOST("actioncode")?GETPOST("actioncode"):$object->type_code, "actioncode","systemauto");
print '</td></tr>'; print '</td></tr>';
} }
else print '<input type="hidden" name="actioncode" value="AC_OTH">';
// Title // Title
print '<tr><td'.(empty($conf->global->AGENDA_USE_EVENT_TYPE)?' class="fieldrequired"':'').'>'.$langs->trans("Title").'</td><td><input type="text" id="label" name="label" size="60" value="'.GETPOST('label').'"></td></tr>'; print '<tr><td'.(empty($conf->global->AGENDA_USE_EVENT_TYPE)?' class="fieldrequired"':'').'>'.$langs->trans("Title").'</td><td><input type="text" id="label" name="label" size="60" value="'.GETPOST('label').'"></td></tr>';
@ -679,8 +680,15 @@ if ($action == 'create')
if ($assignedtouser) $listofuserid[$assignedtouser]=array('id'=>$assignedtouser,'mandatory'=>0,'transparency'=>$object->transparency); // Owner first if ($assignedtouser) $listofuserid[$assignedtouser]=array('id'=>$assignedtouser,'mandatory'=>0,'transparency'=>$object->transparency); // Owner first
$_SESSION['assignedtouser']=dol_json_encode($listofuserid); $_SESSION['assignedtouser']=dol_json_encode($listofuserid);
} }
else
{
if (!empty($_SESSION['assignedtouser']))
{
$listofuserid=dol_json_decode($_SESSION['assignedtouser'], true);
}
}
print $form->select_dolusers_forevent(($action=='create'?'add':'update'),'assignedtouser',1); print $form->select_dolusers_forevent(($action=='create'?'add':'update'),'assignedtouser',1);
print $langs->trans("MyAvailability").': <input id="transparency" type="checkbox" name="transparency"'.(((! isset($_GET['transparency']) && ! isset($_POST['transparency'])) || GETPOST('transparency'))?' checked="checked"':'').'> '.$langs->trans("Busy"); if (in_array($user->id,array_keys($listofuserid))) print $langs->trans("MyAvailability").': <input id="transparency" type="checkbox" name="transparency"'.(((! isset($_GET['transparency']) && ! isset($_POST['transparency'])) || GETPOST('transparency'))?' checked="checked"':'').'> '.$langs->trans("Busy");
print '</td></tr>'; print '</td></tr>';
// Realised by // Realised by
@ -857,6 +865,7 @@ if ($id > 0)
print '<input type="hidden" name="id" value="'.$id.'">'; print '<input type="hidden" name="id" value="'.$id.'">';
print '<input type="hidden" name="ref_ext" value="'.$object->ref_ext.'">'; print '<input type="hidden" name="ref_ext" value="'.$object->ref_ext.'">';
if ($backtopage) print '<input type="hidden" name="backtopage" value="'.($backtopage != '1'? $backtopage : $_SERVER["HTTP_REFERER"]).'">'; if ($backtopage) print '<input type="hidden" name="backtopage" value="'.($backtopage != '1'? $backtopage : $_SERVER["HTTP_REFERER"]).'">';
if (empty($conf->global->AGENDA_USE_EVENT_TYPE)) print '<input type="hidden" name="actioncode" value="'.$object->type_code.'">';
dol_fiche_head($head, 'card', $langs->trans("Action"),0,'action'); dol_fiche_head($head, 'card', $langs->trans("Action"),0,'action');
@ -872,7 +881,6 @@ if ($id > 0)
$formactions->select_type_actions(GETPOST("actioncode")?GETPOST("actioncode"):$object->type_code, "actioncode","systemauto"); $formactions->select_type_actions(GETPOST("actioncode")?GETPOST("actioncode"):$object->type_code, "actioncode","systemauto");
print '</td></tr>'; print '</td></tr>';
} }
else print '<input type="hidden" name="actioncode" value="'.$object->type_code.'">';
// Title // Title
print '<tr><td'.(empty($conf->global->AGENDA_USE_EVENT_TYPE)?' class="fieldrequired"':'').'>'.$langs->trans("Title").'</td><td colspan="3"><input type="text" name="label" size="50" value="'.$object->label.'"></td></tr>'; print '<tr><td'.(empty($conf->global->AGENDA_USE_EVENT_TYPE)?' class="fieldrequired"':'').'>'.$langs->trans("Title").'</td><td colspan="3"><input type="text" name="label" size="50" value="'.$object->label.'"></td></tr>';
@ -922,8 +930,15 @@ if ($id > 0)
} }
$_SESSION['assignedtouser']=dol_json_encode($listofuserid); $_SESSION['assignedtouser']=dol_json_encode($listofuserid);
} }
else
{
if (!empty($_SESSION['assignedtouser']))
{
$listofuserid=dol_json_decode($_SESSION['assignedtouser'], true);
}
}
print $form->select_dolusers_forevent(($action=='create'?'add':'update'),'assignedtouser',1); print $form->select_dolusers_forevent(($action=='create'?'add':'update'),'assignedtouser',1);
print $langs->trans("MyAvailability").': <input id="transparency" type="checkbox" name="transparency"'.($listofuserid[$user->id]['transparency']?' checked="checked"':'').'">'.$langs->trans("Busy"); if (in_array($user->id,array_keys($listofuserid))) print $langs->trans("MyAvailability").': <input id="transparency" type="checkbox" name="transparency"'.($listofuserid[$user->id]['transparency']?' checked="checked"':'').'">'.$langs->trans("Busy");
print '</td></tr>'; print '</td></tr>';
// Realised by // Realised by
@ -1085,8 +1100,15 @@ if ($id > 0)
} }
$_SESSION['assignedtouser']=dol_json_encode($listofuserid); $_SESSION['assignedtouser']=dol_json_encode($listofuserid);
} }
else
{
if (!empty($_SESSION['assignedtouser']))
{
$listofuserid=dol_json_decode($_SESSION['assignedtouser'], true);
}
}
print $form->select_dolusers_forevent('view','assignedtouser',1); print $form->select_dolusers_forevent('view','assignedtouser',1);
print $langs->trans("MyAvailability").': '.(($object->userassigned[$user->id]['transparency'] > 0)?$langs->trans("Busy"):$langs->trans("Available")); // We show nothing if event is assigned to nobody if (in_array($user->id,array_keys($listofuserid))) print $langs->trans("MyAvailability").': '.(($object->userassigned[$user->id]['transparency'] > 0)?$langs->trans("Busy"):$langs->trans("Available")); // We show nothing if event is assigned to nobody
print ' </td></tr>'; print ' </td></tr>';
// Done by // Done by

View File

@ -108,7 +108,8 @@ class ActionComm extends CommonObject
} }
/** /**
* Add an action/event into database * Add an action/event into database.
* $this->type_id OR $this->type_code must be set.
* *
* @param User $user Object user making action * @param User $user Object user making action
* @param int $notrigger 1 = disable triggers, 0 = enable triggers * @param int $notrigger 1 = disable triggers, 0 = enable triggers
@ -144,24 +145,26 @@ class ActionComm extends CommonObject
$userownerid=isset($this->usertodo->id)?$this->usertodo->id:$this->userownerid; // For backward compatibility $userownerid=isset($this->usertodo->id)?$this->usertodo->id:$this->userownerid; // For backward compatibility
$userdoneid=isset($this->userdone->id)?$this->userdone->id:$this->userdoneid; // For backward compatibility $userdoneid=isset($this->userdone->id)?$this->userdone->id:$this->userdoneid; // For backward compatibility
if (! $this->type_id && $this->type_code) if (! $this->type_id || ! $this->type_code)
{ {
$key=empty($this->type_id)?$this->type_code:$this->type_id;
// Get id from code // Get id from code
$cactioncomm=new CActionComm($this->db); $cactioncomm=new CActionComm($this->db);
$result=$cactioncomm->fetch($this->type_code); $result=$cactioncomm->fetch($key);
if ($result > 0) if ($result > 0)
{ {
$this->type_id=$cactioncomm->id; $this->type_id=$cactioncomm->id;
$this->code=$cactioncomm->code; $this->type_code=$cactioncomm->code;
} }
else if ($result == 0) else if ($result == 0)
{ {
$this->error='Failed to get record with code '.$this->type_code.' from dictionary "type of events"'; $this->error='Failed to get record with id '.$this->type_id.' code '.$this->type_code.' from dictionary "type of events"';
return -1; return -1;
} }
else else
{ {
$this->error=$cactioncomm->error; $this->error=$cactioncomm->error;
return -1; return -1;
} }
@ -201,7 +204,7 @@ class ActionComm extends CommonObject
$sql.= (strval($this->datef)!=''?"'".$this->db->idate($this->datef)."'":"null").","; $sql.= (strval($this->datef)!=''?"'".$this->db->idate($this->datef)."'":"null").",";
$sql.= (isset($this->durationp) && $this->durationp >= 0 && $this->durationp != ''?"'".$this->durationp."'":"null").","; // deprecated $sql.= (isset($this->durationp) && $this->durationp >= 0 && $this->durationp != ''?"'".$this->durationp."'":"null").","; // deprecated
$sql.= (isset($this->type_id)?$this->type_id:"null").","; $sql.= (isset($this->type_id)?$this->type_id:"null").",";
$sql.= (isset($this->code)?" '".$this->code."'":"null").","; $sql.= (isset($this->type_code)?" '".$this->type_code."'":"null").",";
$sql.= (isset($this->socid) && $this->socid > 0?" '".$this->socid."'":"null").","; $sql.= (isset($this->socid) && $this->socid > 0?" '".$this->socid."'":"null").",";
$sql.= (isset($this->fk_project) && $this->fk_project > 0?" '".$this->fk_project."'":"null").","; $sql.= (isset($this->fk_project) && $this->fk_project > 0?" '".$this->fk_project."'":"null").",";
$sql.= " '".$this->db->escape($this->note)."',"; $sql.= " '".$this->db->escape($this->note)."',";

View File

@ -1,8 +1,8 @@
<?php <?php
/* Copyright (C) 2006 Roman Ozana <ozana@omdesign.cz> /* Copyright (C) 2006 Roman Ozana <ozana@omdesign.cz>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2013-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
* *
* 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
@ -261,6 +261,7 @@ class ICal
*/ */
function ical_rrule($value) function ical_rrule($value)
{ {
$result=aray();
$rrule = explode(';',$value); $rrule = explode(';',$value);
foreach ($rrule as $line) foreach ($rrule as $line)
{ {
@ -299,6 +300,7 @@ class ICal
*/ */
function ical_dt_date($key, $value) function ical_dt_date($key, $value)
{ {
$return_value=array();
$value = $this->ical_date_to_unix($value); $value = $this->ical_date_to_unix($value);
// Analyse TZID // Analyse TZID
@ -309,8 +311,8 @@ class ICal
$value = str_replace('T', '', $value); $value = str_replace('T', '', $value);
return array($key,$value); return array($key,$value);
} }
// adding $value and $tzid
$key = $temp[0]; $key = $temp[0];
$temp = explode("=", $temp[1]); $temp = explode("=", $temp[1]);
$return_value[$temp[0]] = $temp[1]; $return_value[$temp[0]] = $temp[1];
$return_value['unixtime'] = $value; $return_value['unixtime'] = $value;
@ -330,8 +332,9 @@ class ICal
{ {
usort($temp, array(&$this, "ical_dtstart_compare")); usort($temp, array(&$this, "ical_dtstart_compare"));
return $temp; return $temp;
} else }
{ else
{
return false; return false;
} }
} }

View File

@ -893,7 +893,8 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
$title1='';$title2=''; $title1='';$title2='';
if (isset($cases1[$h]) && $cases1[$h] != '') if (isset($cases1[$h]) && $cases1[$h] != '')
{ {
$title1=count($cases1[$h]).' '.(count($cases1[$h])==1?$langs->trans("Event"):$langs->trans("Events")); //$title1.=count($cases1[$h]).' '.(count($cases1[$h])==1?$langs->trans("Event"):$langs->trans("Events"));
if (count($cases1[$h]) > 1) $title1.=count($cases1[$h]).' '.(count($cases1[$h])==1?$langs->trans("Event"):$langs->trans("Events"));
$string1='&nbsp;'; $string1='&nbsp;';
$style1='peruser_notbusy'; $style1='peruser_notbusy';
foreach($cases1[$h] as $id => $ev) foreach($cases1[$h] as $id => $ev)
@ -903,7 +904,8 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
} }
if (isset($cases2[$h]) && $cases2[$h] != '') if (isset($cases2[$h]) && $cases2[$h] != '')
{ {
$title2=count($cases2[$h]).' '.(count($cases2[$h])==1?$langs->trans("Event"):$langs->trans("Events")); //$title2.=count($cases2[$h]).' '.(count($cases2[$h])==1?$langs->trans("Event"):$langs->trans("Events"));
if (count($cases2[$h]) > 1) $title2.=count($cases2[$h]).' '.(count($cases2[$h])==1?$langs->trans("Event"):$langs->trans("Events"));
$string2='&nbsp;'; $string2='&nbsp;';
$style2='peruser_notbusy'; $style2='peruser_notbusy';
foreach($cases2[$h] as $id => $ev) foreach($cases2[$h] as $id => $ev)
@ -919,7 +921,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
{ {
$ids=array_keys($cases1[$h]); $ids=array_keys($cases1[$h]);
$output = array_slice($cases1[$h], 0, 1); $output = array_slice($cases1[$h], 0, 1);
if ($output[0]['string']) $title1.=' - '.$output[0]['string']; if ($output[0]['string']) $title1.=($title1?' - ':'').$output[0]['string'];
if ($output[0]['color']) $color1 = $output[0]['color']; if ($output[0]['color']) $color1 = $output[0]['color'];
} }
else if (count($cases1[$h]) > 1) $color1='222222'; else if (count($cases1[$h]) > 1) $color1='222222';
@ -928,7 +930,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
{ {
$ids=array_keys($cases2[$h]); $ids=array_keys($cases2[$h]);
$output = array_slice($cases2[$h], 0, 1); $output = array_slice($cases2[$h], 0, 1);
if ($output[0]['string']) $title2.=' - '.$output[0]['string']; if ($output[0]['string']) $title2.=($title2?' - ':'').$output[0]['string'];
if ($output[0]['color']) $color2 = $output[0]['color']; if ($output[0]['color']) $color2 = $output[0]['color'];
} }
else if (count($cases2[$h]) > 1) $color2='222222'; else if (count($cases2[$h]) > 1) $color2='222222';

View File

@ -72,7 +72,7 @@ if ($type == "f")
* *
*/ */
$sql = "SELECT s.rowid, s.nom, st.libelle as stcomm"; $sql = "SELECT s.rowid, s.nom as name, st.libelle as stcomm";
$sql.= ", p.rowid as cidp, p.name, p.firstname, p.email, p.phone"; $sql.= ", p.rowid as cidp, p.name, p.firstname, p.email, p.phone";
$sql.= " FROM ".MAIN_DB_PREFIX."c_stcomm as st,"; $sql.= " FROM ".MAIN_DB_PREFIX."c_stcomm as st,";
if (! $user->rights->societe->client->voir && ! $socid) $sql .= " ".MAIN_DB_PREFIX."societe_commerciaux as sc,"; if (! $user->rights->societe->client->voir && ! $socid) $sql .= " ".MAIN_DB_PREFIX."societe_commerciaux as sc,";
@ -159,7 +159,7 @@ if ($resql)
print "<td>$obj->firstname</TD>"; print "<td>$obj->firstname</TD>";
print '<td><a href="'.$_SERVER["PHP_SELF"].'?type='.$type.'&socid='.$obj->rowid.'">'.img_object($langs->trans("ShowCompany"),"company").'</a>&nbsp;'; print '<td><a href="'.$_SERVER["PHP_SELF"].'?type='.$type.'&socid='.$obj->rowid.'">'.img_object($langs->trans("ShowCompany"),"company").'</a>&nbsp;';
print "<a href=\"".$urlfiche."?socid=".$obj->rowid."\">$obj->nom</a></td>\n"; print "<a href=\"".$urlfiche."?socid=".$obj->rowid."\">$obj->name</a></td>\n";
print '<td>'.dol_print_phone($obj->email,$obj->cidp,$obj->rowid,'AC_EMAIL').'</td>'; print '<td>'.dol_print_phone($obj->email,$obj->cidp,$obj->rowid,'AC_EMAIL').'</td>';

View File

@ -444,7 +444,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
{ {
$langs->load("propal"); $langs->load("propal");
$sql = "SELECT s.nom, s.rowid, p.rowid as propalid, p.total as total_ttc, p.total_ht, p.ref, p.fk_statut, p.datep as dp, p.fin_validite as dfv"; $sql = "SELECT s.nom as name, s.rowid, p.rowid as propalid, p.total as total_ttc, p.total_ht, p.ref, p.fk_statut, p.datep as dp, p.fin_validite as dfv";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql.= ", ".MAIN_DB_PREFIX."propal as p"; $sql.= ", ".MAIN_DB_PREFIX."propal as p";
if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -497,7 +497,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
print "</td>"; print "</td>";
print '<td align="left"><a href="card.php?socid='.$obj->rowid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->nom,44).'</a></td>'."\n"; print '<td align="left"><a href="card.php?socid='.$obj->rowid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->name,44).'</a></td>'."\n";
print '<td align="right">'; print '<td align="right">';
print dol_print_date($db->jdate($obj->dp),'day').'</td>'."\n"; print dol_print_date($db->jdate($obj->dp),'day').'</td>'."\n";
print '<td align="right">'.price($obj->total_ttc).'</td>'; print '<td align="right">'.price($obj->total_ttc).'</td>';

View File

@ -381,7 +381,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire)
/* /*
if (! empty($conf->propal->enabled)) if (! empty($conf->propal->enabled))
{ {
$sql = "SELECT c.rowid, c.ref, c.fk_statut, s.nom, s.rowid as socid"; $sql = "SELECT c.rowid, c.ref, c.fk_statut, s.nom as name, s.rowid as socid";
$sql.=" FROM ".MAIN_DB_PREFIX."propal as c"; $sql.=" FROM ".MAIN_DB_PREFIX."propal as c";
$sql.= ", ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -433,7 +433,7 @@ if (! empty($conf->propal->enabled))
print '</td>'; print '</td>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->nom,24).'</a></td>'; print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->name,24).'</a></td>';
print '<td align="right">'.$propalstatic->LibStatut($obj->fk_statut,$obj->facture,5).'</td>'; print '<td align="right">'.$propalstatic->LibStatut($obj->fk_statut,$obj->facture,5).'</td>';
@ -453,7 +453,7 @@ if (! empty($conf->propal->enabled))
*/ */
/*if (! empty($conf->propal->enabled)) /*if (! empty($conf->propal->enabled))
{ {
$sql = "SELECT c.rowid, c.ref, c.fk_statut, c.facture, s.nom, s.rowid as socid"; $sql = "SELECT c.rowid, c.ref, c.fk_statut, c.facture, s.nom as name, s.rowid as socid";
$sql.= " FROM ".MAIN_DB_PREFIX."commande as c"; $sql.= " FROM ".MAIN_DB_PREFIX."commande as c";
$sql.= ", ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -505,7 +505,7 @@ if (! empty($conf->propal->enabled))
print '</td>'; print '</td>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->nom.'</a></td>'; print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->name.'</a></td>';
print '<td align="right">'.$propalstatic->LibStatut($obj->fk_statut,$obj->facture,5).'</td>'; print '<td align="right">'.$propalstatic->LibStatut($obj->fk_statut,$obj->facture,5).'</td>';

View File

@ -142,7 +142,7 @@ if (! $sortorder) $sortorder='DESC';
$limit = $conf->liste_limit; $limit = $conf->liste_limit;
$sql = 'SELECT s.rowid, s.nom, s.town, s.client, s.code_client,'; $sql = 'SELECT s.rowid, s.nom as name, s.town, s.client, s.code_client,';
$sql.= ' p.rowid as propalid, p.note_private, p.total_ht, p.ref, p.ref_client, p.fk_statut, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,'; $sql.= ' p.rowid as propalid, p.note_private, p.total_ht, p.ref, p.ref_client, p.fk_statut, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,';
if (! $user->rights->societe->client->voir && ! $socid) $sql .= " sc.fk_soc, sc.fk_user,"; if (! $user->rights->societe->client->voir && ! $socid) $sql .= " sc.fk_soc, sc.fk_user,";
$sql.= ' u.login'; $sql.= ' u.login';
@ -246,7 +246,7 @@ if ($result)
if ($search_montant_ht) $param.='&search_montant_ht='.$search_montant_ht; if ($search_montant_ht) $param.='&search_montant_ht='.$search_montant_ht;
if ($search_author) $param.='&search_author='.$search_author; if ($search_author) $param.='&search_author='.$search_author;
if ($search_town) $param.='&search_town='.$search_town; if ($search_town) $param.='&search_town='.$search_town;
print_barre_liste($langs->trans('ListOfProposals').' '.($socid?'- '.$soc->nom:''), $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords); print_barre_liste($langs->trans('ListOfProposals').' '.($socid?'- '.$soc->name:''), $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords);
// Lignes des champs de filtre // Lignes des champs de filtre
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">'; print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
@ -375,7 +375,7 @@ if ($result)
// Company // Company
$companystatic->id=$objp->rowid; $companystatic->id=$objp->rowid;
$companystatic->nom=$objp->nom; $companystatic->name=$objp->name;
$companystatic->client=$objp->client; $companystatic->client=$objp->client;
$companystatic->code_client=$objp->code_client; $companystatic->code_client=$objp->code_client;
print '<td>'; print '<td>';

View File

@ -178,7 +178,7 @@ if ($action == 'cstc')
$formother=new FormOther($db); $formother=new FormOther($db);
$form=new Form($db); $form=new Form($db);
$sql = "SELECT s.rowid, s.nom, s.zip, s.town, s.datec, s.status as status, s.code_client, s.client,"; $sql = "SELECT s.rowid, s.nom as name, s.zip, s.town, s.datec, s.status as status, s.code_client, s.client,";
$sql.= " st.libelle as stcomm, s.prefix_comm, s.fk_stcomm, s.fk_prospectlevel,"; $sql.= " st.libelle as stcomm, s.prefix_comm, s.fk_stcomm, s.fk_prospectlevel,";
$sql.= " d.nom as departement"; $sql.= " d.nom as departement";
if ((!$user->rights->societe->client->voir && !$socid) || $search_sale) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects) if ((!$user->rights->societe->client->voir && !$socid) || $search_sale) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects)
@ -402,7 +402,7 @@ if ($resql)
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
print '<td>'; print '<td>';
$prospectstatic->id=$obj->rowid; $prospectstatic->id=$obj->rowid;
$prospectstatic->nom=$obj->nom; $prospectstatic->name=$obj->name;
$prospectstatic->status=$obj->status; $prospectstatic->status=$obj->status;
$prospectstatic->code_client=$obj->code_client; $prospectstatic->code_client=$obj->code_client;
$prospectstatic->client=$obj->client; $prospectstatic->client=$obj->client;

View File

@ -64,8 +64,8 @@ if ($socid > 0)
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
// Nom // Name
print '<tr><td width="20%">'.$langs->trans("Name").'</td><td width="80%" colspan="3">'.$societe->nom.'</td></tr>'; print '<tr><td width="20%">'.$langs->trans("Thirdpary").'</td><td width="80%" colspan="3">'.$societe->getNomUrl(1).'</td></tr>';
// Prefix // Prefix
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field

View File

@ -63,8 +63,8 @@ if ($socid > 0)
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
// Nom // Name
print '<tr><td width="20%">'.$langs->trans("Name").'</td><td width="80%" colspan="3">'.$societe->nom.'</td></tr>'; print '<tr><td width="20%">'.$langs->trans("Thirdparty").'</td><td width="80%" colspan="3">'.$societe->getNomUrl(1).'</td></tr>';
// Prefix // Prefix
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field

View File

@ -167,7 +167,7 @@ if ($id > 0 || ! empty($ref))
// Client // Client
print "<tr><td>".$langs->trans("Customer")."</td>"; print "<tr><td>".$langs->trans("Customer")."</td>";
print '<td colspan="2">'; print '<td colspan="2">';
print '<a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$soc->id.'">'.$soc->nom.'</a>'; print '<a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$soc->id.'">'.$soc->getNomUrl(1).'</a>';
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';

View File

@ -67,7 +67,7 @@ $thirdpartystatic=new Societe($db);
* Mode List * Mode List
*/ */
$sql = "SELECT s.rowid, s.nom, s.client, s.town, s.datec, s.datea"; $sql = "SELECT s.rowid, s.nom as name, s.client, s.town, s.datec, s.datea";
$sql.= ", st.libelle as stcomm, s.prefix_comm, s.code_client, s.code_compta "; $sql.= ", st.libelle as stcomm, s.prefix_comm, s.code_client, s.code_compta ";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user "; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user ";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."c_stcomm as st, ".MAIN_DB_PREFIX."commande as c"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."c_stcomm as st, ".MAIN_DB_PREFIX."commande as c";
@ -161,7 +161,7 @@ if ($resql)
$lien=$lienfin=''; $lien=$lienfin='';
$lien = '<a href="'.dol_buildpath('/commande/orderstoinvoice.php',1).'?socid='.$obj->rowid.'">'; $lien = '<a href="'.dol_buildpath('/commande/orderstoinvoice.php',1).'?socid='.$obj->rowid.'">';
$lienfin='</a>'; $lienfin='</a>';
$name=$obj->nom; $name=$obj->name;
$result.=($lien.img_object($langs->trans("ShowCompany").': '.$name,'company').$lienfin); $result.=($lien.img_object($langs->trans("ShowCompany").': '.$name,'company').$lienfin);
$result.=$lien.(dol_trunc($name,$maxlen)).$lienfin; $result.=$lien.(dol_trunc($name,$maxlen)).$lienfin;

View File

@ -166,7 +166,7 @@ else
*/ */
if (! empty($conf->commande->enabled)) if (! empty($conf->commande->enabled))
{ {
$sql = "SELECT c.rowid, c.ref, s.nom, s.rowid as socid"; $sql = "SELECT c.rowid, c.ref, s.nom as name, s.rowid as socid";
$sql.= " FROM ".MAIN_DB_PREFIX."commande as c"; $sql.= " FROM ".MAIN_DB_PREFIX."commande as c";
$sql.= ", ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -195,7 +195,7 @@ if (! empty($conf->commande->enabled))
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
print '<td class="nowrap">'; print '<td class="nowrap">';
print "<a href=\"card.php?id=".$obj->rowid."\">".img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref."</a></td>"; print "<a href=\"card.php?id=".$obj->rowid."\">".img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref."</a></td>";
print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->nom,24).'</a></td></tr>'; print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->name,24).'</a></td></tr>';
$i++; $i++;
} }
} }
@ -215,7 +215,7 @@ $max=5;
*/ */
$sql = "SELECT c.rowid, c.ref, c.fk_statut, c.facture, c.date_cloture as datec, c.tms as datem,"; $sql = "SELECT c.rowid, c.ref, c.fk_statut, c.facture, c.date_cloture as datec, c.tms as datem,";
$sql.= " s.nom, s.rowid as socid"; $sql.= " s.nom as name, s.rowid as socid";
$sql.= " FROM ".MAIN_DB_PREFIX."commande as c,"; $sql.= " FROM ".MAIN_DB_PREFIX."commande as c,";
$sql.= " ".MAIN_DB_PREFIX."societe as s"; $sql.= " ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -268,7 +268,7 @@ if ($resql)
print '</td>'; print '</td>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->nom.'</a></td>'; print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->name.'</a></td>';
print '<td>'.dol_print_date($db->jdate($obj->datem),'day').'</td>'; print '<td>'.dol_print_date($db->jdate($obj->datem),'day').'</td>';
print '<td align="right">'.$commandestatic->LibStatut($obj->fk_statut,$obj->facture,5).'</td>'; print '<td align="right">'.$commandestatic->LibStatut($obj->fk_statut,$obj->facture,5).'</td>';
print '</tr>'; print '</tr>';
@ -285,7 +285,7 @@ else dol_print_error($db);
*/ */
if (! empty($conf->commande->enabled)) if (! empty($conf->commande->enabled))
{ {
$sql = "SELECT c.rowid, c.ref, c.fk_statut, c.facture, s.nom, s.rowid as socid"; $sql = "SELECT c.rowid, c.ref, c.fk_statut, c.facture, s.nom as name, s.rowid as socid";
$sql.=" FROM ".MAIN_DB_PREFIX."commande as c"; $sql.=" FROM ".MAIN_DB_PREFIX."commande as c";
$sql.= ", ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -337,7 +337,7 @@ if (! empty($conf->commande->enabled))
print '</td>'; print '</td>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->nom,24).'</a></td>'; print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->name,24).'</a></td>';
print '<td align="right">'.$commandestatic->LibStatut($obj->fk_statut,$obj->facture,5).'</td>'; print '<td align="right">'.$commandestatic->LibStatut($obj->fk_statut,$obj->facture,5).'</td>';
@ -356,7 +356,7 @@ if (! empty($conf->commande->enabled))
*/ */
if (! empty($conf->commande->enabled)) if (! empty($conf->commande->enabled))
{ {
$sql = "SELECT c.rowid, c.ref, c.fk_statut, c.facture, s.nom, s.rowid as socid"; $sql = "SELECT c.rowid, c.ref, c.fk_statut, c.facture, s.nom as name, s.rowid as socid";
$sql.= " FROM ".MAIN_DB_PREFIX."commande as c"; $sql.= " FROM ".MAIN_DB_PREFIX."commande as c";
$sql.= ", ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -408,7 +408,7 @@ if (! empty($conf->commande->enabled))
print '</td>'; print '</td>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->nom.'</a></td>'; print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->name.'</a></td>';
print '<td align="right">'.$commandestatic->LibStatut($obj->fk_statut,$obj->facture,5).'</td>'; print '<td align="right">'.$commandestatic->LibStatut($obj->fk_statut,$obj->facture,5).'</td>';

View File

@ -112,7 +112,7 @@ $companystatic = new Societe($db);
$help_url="EN:Module_Customers_Orders|FR:Module_Commandes_Clients|ES:Módulo_Pedidos_de_clientes"; $help_url="EN:Module_Customers_Orders|FR:Module_Commandes_Clients|ES:Módulo_Pedidos_de_clientes";
llxHeader('',$langs->trans("Orders"),$help_url); llxHeader('',$langs->trans("Orders"),$help_url);
$sql = 'SELECT s.nom, s.rowid as socid, s.client, c.rowid, c.ref, c.total_ht, c.ref_client,'; $sql = 'SELECT s.nom as name, s.rowid as socid, s.client, c.rowid, c.ref, c.total_ht, c.ref_client,';
$sql.= ' c.date_valid, c.date_commande, c.note_private, c.date_livraison, c.fk_statut, c.facture as facturee'; $sql.= ' c.date_valid, c.date_commande, c.note_private, c.date_livraison, c.fk_statut, c.facture as facturee';
$sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s'; $sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s';
$sql.= ', '.MAIN_DB_PREFIX.'commande as c'; $sql.= ', '.MAIN_DB_PREFIX.'commande as c';
@ -221,7 +221,7 @@ if ($resql)
{ {
$soc = new Societe($db); $soc = new Societe($db);
$soc->fetch($socid); $soc->fetch($socid);
$title = $langs->trans('ListOfOrders') . ' - '.$soc->nom; $title = $langs->trans('ListOfOrders') . ' - '.$soc->name;
} }
else else
{ {
@ -367,7 +367,7 @@ if ($resql)
// Company // Company
$companystatic->id=$objp->socid; $companystatic->id=$objp->socid;
$companystatic->nom=$objp->nom; $companystatic->name=$objp->name;
$companystatic->client=$objp->client; $companystatic->client=$objp->client;
print '<td>'; print '<td>';
print $companystatic->getNomUrl(1,'customer'); print $companystatic->getNomUrl(1,'customer');
@ -380,7 +380,7 @@ if ($resql)
if (($objp->fk_statut > 0 && $objp->fk_statut < 3) || ($objp->fk_statut == 3 && $objp->facturee == 0)) if (($objp->fk_statut > 0 && $objp->fk_statut < 3) || ($objp->fk_statut == 3 && $objp->facturee == 0))
{ {
print '&nbsp;<a href="'.DOL_URL_ROOT.'/commande/orderstoinvoice.php?socid='.$companystatic->id.'">'; print '&nbsp;<a href="'.DOL_URL_ROOT.'/commande/orderstoinvoice.php?socid='.$companystatic->id.'">';
print img_picto($langs->trans("CreateInvoiceForThisCustomer").' : '.$companystatic->nom, 'object_bill', 'hideonsmartphone').'</a>'; print img_picto($langs->trans("CreateInvoiceForThisCustomer").' : '.$companystatic->name, 'object_bill', 'hideonsmartphone').'</a>';
} }
} }
} }

View File

@ -573,7 +573,7 @@ if (($action != 'create' && $action != 'add') || !$error)
{ {
// Company // Company
$companystatic->id=$socid; $companystatic->id=$socid;
$companystatic->nom=$soc->nom; $companystatic->name=$soc->name;
print '<h3>'.$companystatic->getNomUrl(1,'customer').'</h3>'; print '<h3>'.$companystatic->getNomUrl(1,'customer').'</h3>';
} }

View File

@ -689,7 +689,7 @@ if ($id > 0 || ! empty($ref))
if ($links[$key]['type']=='company') if ($links[$key]['type']=='company')
{ {
$societestatic->id=$links[$key]['url_id']; $societestatic->id=$links[$key]['url_id'];
$societestatic->nom=$links[$key]['label']; $societestatic->name=$links[$key]['label'];
print $societestatic->getNomUrl(1,'',16); print $societestatic->getNomUrl(1,'',16);
} }
else if ($links[$key]['type']=='user') else if ($links[$key]['type']=='user')

View File

@ -4,7 +4,7 @@
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Vinícius Nogueira <viniciusvgn@gmail.com> * Copyright (C) 2012 Vinícius Nogueira <viniciusvgn@gmail.com>
* Copyright (C) 2014 Florian Henry <florian.henry@open-cooncept.pro> * Copyright (C) 2014 Florian Henry <florian.henry@open-cooncept.pro>
* *
* 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
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or
@ -158,7 +158,7 @@ if ($resql)
if (GETPOST("bid")) if (GETPOST("bid"))
{ {
$result=$bankcateg->fetch(GETPOST("bid")); $result=$bankcateg->fetch(GETPOST("bid"));
print_barre_liste($langs->trans("BankTransactionForCategory",$bankcateg->label).' '.($socid?' '.$soc->nom:''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num); print_barre_liste($langs->trans("BankTransactionForCategory",$bankcateg->label).' '.($socid?' '.$soc->name:''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num);
} }
else else
{ {
@ -166,18 +166,18 @@ if ($resql)
} }
print '<form method="post" action="search.php" name="search_form">'; print '<form method="post" action="search.php" name="search_form">';
$moreforfilter .= $langs->trans('Period') . ' ' . $langs->trans('StartDate') . ': '; $moreforfilter .= $langs->trans('Period') . ' ' . $langs->trans('StartDate') . ': ';
$moreforfilter .= $form->select_date($search_dt_start, 'search_start_dt', 0, 0, 1, "search_form", 1, 1, 1); $moreforfilter .= $form->select_date($search_dt_start, 'search_start_dt', 0, 0, 1, "search_form", 1, 1, 1);
$moreforfilter .= $langs->trans('EndDate') . ':' . $form->select_date($search_dt_end, 'search_end_dt', 0, 0, 1, "search_form", 1, 1, 1); $moreforfilter .= $langs->trans('EndDate') . ':' . $form->select_date($search_dt_end, 'search_end_dt', 0, 0, 1, "search_form", 1, 1, 1);
if ($moreforfilter) { if ($moreforfilter) {
print '<div class="liste_titre">'; print '<div class="liste_titre">';
print $moreforfilter; print $moreforfilter;
print '</div>'; print '</div>';
} }
print '<table class="liste" width="100%">'; print '<table class="liste" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans('Ref'),$_SERVER['PHP_SELF'],'b.rowid','',$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans('Ref'),$_SERVER['PHP_SELF'],'b.rowid','',$param,'',$sortfield,$sortorder);
@ -278,7 +278,7 @@ if ($resql)
if ($objp->url_id) if ($objp->url_id)
{ {
$companystatic->id=$objp->url_id; $companystatic->id=$objp->url_id;
$companystatic->nom=$objp->labelurl; $companystatic->name=$objp->labelurl;
print $companystatic->getNomUrl(1); print $companystatic->getNomUrl(1);
} }
else else

View File

@ -148,7 +148,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
// Customer invoices // Customer invoices
$sql = "SELECT 'invoice' as family, f.rowid as objid, f.facnumber as ref, f.total_ttc, f.type, f.date_lim_reglement as dlr,"; $sql = "SELECT 'invoice' as family, f.rowid as objid, f.facnumber as ref, f.total_ttc, f.type, f.date_lim_reglement as dlr,";
$sql.= " s.rowid as socid, s.nom, s.fournisseur"; $sql.= " s.rowid as socid, s.nom as name, s.fournisseur";
$sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; $sql.= " FROM ".MAIN_DB_PREFIX."facture as f";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON f.fk_soc = s.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON f.fk_soc = s.rowid";
$sql.= " WHERE f.entity = ".$conf->entity; $sql.= " WHERE f.entity = ".$conf->entity;
@ -158,7 +158,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
// Supplier invoices // Supplier invoices
$sql2= " SELECT 'invoice_supplier' as family, ff.rowid as objid, ff.ref_supplier as ref, (-1*ff.total_ttc) as total_ttc, ff.type, ff.date_lim_reglement as dlr,"; $sql2= " SELECT 'invoice_supplier' as family, ff.rowid as objid, ff.ref_supplier as ref, (-1*ff.total_ttc) as total_ttc, ff.type, ff.date_lim_reglement as dlr,";
$sql2.= " s.rowid as socid, s.nom, s.fournisseur"; $sql2.= " s.rowid as socid, s.nom as name, s.fournisseur";
$sql2.= " FROM ".MAIN_DB_PREFIX."facture_fourn as ff"; $sql2.= " FROM ".MAIN_DB_PREFIX."facture_fourn as ff";
$sql2.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON ff.fk_soc = s.rowid"; $sql2.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON ff.fk_soc = s.rowid";
$sql2.= " WHERE ff.entity = ".$conf->entity; $sql2.= " WHERE ff.entity = ".$conf->entity;
@ -265,7 +265,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
$ref = $facturefournstatic->getNomUrl(1,''); $ref = $facturefournstatic->getNomUrl(1,'');
$societestatic->id = $obj->socid; $societestatic->id = $obj->socid;
$societestatic->nom = $obj->nom; $societestatic->name = $obj->name;
$refcomp=$societestatic->getNomUrl(1,'',24); $refcomp=$societestatic->getNomUrl(1,'',24);
$paiement = -1*$facturefournstatic->getSommePaiement(); // Payment already done $paiement = -1*$facturefournstatic->getSommePaiement(); // Payment already done
@ -279,7 +279,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
$ref = $facturestatic->getNomUrl(1,''); $ref = $facturestatic->getNomUrl(1,'');
$societestatic->id = $obj->socid; $societestatic->id = $obj->socid;
$societestatic->nom = $obj->nom; $societestatic->name = $obj->name;
$refcomp=$societestatic->getNomUrl(1,'',24); $refcomp=$societestatic->getNomUrl(1,'',24);
$paiement = $facturestatic->getSommePaiement(); // Payment already done $paiement = $facturestatic->getSommePaiement(); // Payment already done

View File

@ -73,7 +73,7 @@ if ($action == 'note')
if ($mode == 'search') { if ($mode == 'search') {
if ($modesearch == 'soc') { if ($modesearch == 'soc') {
$sql = "SELECT s.rowid FROM ".MAIN_DB_PREFIX."societe as s "; $sql = "SELECT s.rowid FROM ".MAIN_DB_PREFIX."societe as s ";
$sql.= " WHERE lower(s.nom) LIKE '%".$db->escape(strtolower($socname))."%'"; $sql.= " WHERE s.nom LIKE '%".$db->escape(strtolower($socname))."%'";
$sql.= " AND s.entity IN (".getEntity('societe', 1).")"; $sql.= " AND s.entity IN (".getEntity('societe', 1).")";
} }
@ -93,7 +93,7 @@ if ($mode == 'search') {
* Mode List * Mode List
*/ */
$sql = "SELECT s.rowid, s.nom, s.client, s.town, s.datec, s.datea"; $sql = "SELECT s.rowid, s.nom as name, s.client, s.town, s.datec, s.datea";
$sql.= ", st.libelle as stcomm, s.prefix_comm, s.code_client, s.code_compta "; $sql.= ", st.libelle as stcomm, s.prefix_comm, s.code_client, s.code_compta ";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user "; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user ";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."c_stcomm as st"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."c_stcomm as st";
@ -107,13 +107,13 @@ if (dol_strlen($stcomm))
} }
if ($socname) if ($socname)
{ {
$sql.= " AND s.nom LIKE '%".$db->escape(strtolower($socname))."%'"; $sql.= " AND s.nom LIKE '%".$db->escape($socname)."%'";
$sortfield = "s.nom"; $sortfield = "s.nom";
$sortorder = "ASC"; $sortorder = "ASC";
} }
if ($_GET["search_nom"]) if ($_GET["search_nom"])
{ {
$sql.= " AND s.nom LIKE '%".$db->escape(strtolower($_GET["search_nom"]))."%'"; $sql.= " AND s.nom LIKE '%".$db->escape($_GET["search_nom"])."%'";
} }
if ($_GET["search_compta"]) if ($_GET["search_compta"])
{ {
@ -141,7 +141,7 @@ if ($resql)
$i = 0; $i = 0;
$langs->load('commercial'); $langs->load('commercial');
print_barre_liste($langs->trans("ListOfCustomers"), $page, $_SERVER["PHP_SELF"],"",$sortfield,$sortorder,'',$num); print_barre_liste($langs->trans("ListOfCustomers"), $page, $_SERVER["PHP_SELF"],"",$sortfield,$sortorder,'',$num);
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">'; print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
@ -188,7 +188,7 @@ if ($resql)
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
print '<td>'; print '<td>';
$thirdpartystatic->id=$obj->rowid; $thirdpartystatic->id=$obj->rowid;
$thirdpartystatic->nom=$obj->nom; $thirdpartystatic->name=$obj->name;
$thirdpartystatic->client=$obj->client; $thirdpartystatic->client=$obj->client;
print $thirdpartystatic->getNomUrl(1,'compta'); print $thirdpartystatic->getNomUrl(1,'compta');
print '</td>'; print '</td>';

View File

@ -231,7 +231,7 @@ class Deplacement extends CommonObject
$sql.= " FROM ".MAIN_DB_PREFIX."deplacement"; $sql.= " FROM ".MAIN_DB_PREFIX."deplacement";
$sql.= " WHERE entity IN (".getEntity('deplacement').")"; $sql.= " WHERE entity IN (".getEntity('deplacement').")";
if ($ref) $sql.= " AND ref ='".$this->db->escape($ref)."'"; if ($ref) $sql.= " AND ref ='".$this->db->escape($ref)."'";
else $sql.= " AND id = ".$id; else $sql.= " AND rowid = ".$id;
dol_syslog(get_class($this)."::fetch", LOG_DEBUG); dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
$result = $this->db->query($sql); $result = $this->db->query($sql);

View File

@ -202,7 +202,8 @@ class Don extends CommonObject
/** /**
* Check params * Check params and init ->errors array.
* TODO This function seems to not be used by core code.
* *
* @param int $minimum Minimum * @param int $minimum Minimum
* @return int 0 if KO, >0 if OK * @return int 0 if KO, >0 if OK
@ -212,39 +213,40 @@ class Don extends CommonObject
global $langs; global $langs;
$langs->load('main'); $langs->load('main');
$langs->load('companies'); $langs->load('companies');
$error_string = array();
$err = 0; $err = 0;
if (dol_strlen(trim($this->societe)) == 0) if (dol_strlen(trim($this->societe)) == 0)
{ {
if ((dol_strlen(trim($this->lastname)) + dol_strlen(trim($this->firstname))) == 0) if ((dol_strlen(trim($this->lastname)) + dol_strlen(trim($this->firstname))) == 0)
{ {
$error_string[$err] = $langs->trans('ErrorFieldRequired',$langs->trans('Company').'/'.$langs->trans('Firstname').'-'.$langs->trans('Lastname')); $error_string[] = $langs->trans('ErrorFieldRequired',$langs->trans('Company').'/'.$langs->trans('Firstname').'-'.$langs->trans('Lastname'));
$err++; $err++;
} }
} }
if (dol_strlen(trim($this->address)) == 0) if (dol_strlen(trim($this->address)) == 0)
{ {
$error_string[$err] = $langs->trans('ErrorFieldRequired',$langs->trans('Address')); $error_string[] = $langs->trans('ErrorFieldRequired',$langs->trans('Address'));
$err++; $err++;
} }
if (dol_strlen(trim($this->zip)) == 0) if (dol_strlen(trim($this->zip)) == 0)
{ {
$error_string[$err] = $langs->trans('ErrorFieldRequired',$langs->trans('Zip')); $error_string[] = $langs->trans('ErrorFieldRequired',$langs->trans('Zip'));
$err++; $err++;
} }
if (dol_strlen(trim($this->town)) == 0) if (dol_strlen(trim($this->town)) == 0)
{ {
$error_string[$err] = $langs->trans('ErrorFieldRequired',$langs->trans('Town')); $error_string[] = $langs->trans('ErrorFieldRequired',$langs->trans('Town'));
$err++; $err++;
} }
if (dol_strlen(trim($this->email)) == 0) if (dol_strlen(trim($this->email)) == 0)
{ {
$error_string[$err] = $langs->trans('ErrorFieldRequired',$langs->trans('EMail')); $error_string[] = $langs->trans('ErrorFieldRequired',$langs->trans('EMail'));
$err++; $err++;
} }
@ -256,7 +258,7 @@ class Don extends CommonObject
{ {
if (!isset($map[substr($this->amount, $i, 1)] )) if (!isset($map[substr($this->amount, $i, 1)] ))
{ {
$error_string[$err] = $langs->trans('ErrorFieldRequired',$langs->trans('Amount')); $error_string[] = $langs->trans('ErrorFieldRequired',$langs->trans('Amount'));
$err++; $err++;
$amount_invalid = 1; $amount_invalid = 1;
break; break;
@ -267,14 +269,14 @@ class Don extends CommonObject
{ {
if ($this->amount == 0) if ($this->amount == 0)
{ {
$error_string[$err] = $langs->trans('ErrorFieldRequired',$langs->trans('Amount')); $error_string[] = $langs->trans('ErrorFieldRequired',$langs->trans('Amount'));
$err++; $err++;
} }
else else
{ {
if ($this->amount < $minimum && $minimum > 0) if ($this->amount < $minimum && $minimum > 0)
{ {
$error_string[$err] = $langs->trans('MinimumAmount',$langs->trans('$minimum')); $error_string[] = $langs->trans('MinimumAmount',$langs->trans('$minimum'));
$err++; $err++;
} }
} }
@ -282,14 +284,13 @@ class Don extends CommonObject
if ($err) if ($err)
{ {
$this->error = $error_string; $this->errors = $error_string;
return 0; return 0;
} }
else else
{ {
return 1; return 1;
} }
} }
/** /**
@ -311,7 +312,7 @@ class Don extends CommonObject
$this->country=($this->country?$this->country:$this->country); $this->country=($this->country?$this->country:$this->country);
$now=dol_now(); $now=dol_now();
$this->db->begin(); $this->db->begin();
$sql = "INSERT INTO ".MAIN_DB_PREFIX."don ("; $sql = "INSERT INTO ".MAIN_DB_PREFIX."don (";
@ -368,7 +369,7 @@ class Don extends CommonObject
// Call trigger // Call trigger
$result=$this->call_trigger('DON_CREATE',$user); $result=$this->call_trigger('DON_CREATE',$user);
if ($result < 0) { $error++; $this->db->rollback(); return -1; } if ($result < 0) { $error++; $this->db->rollback(); return -1; }
// End call triggers // End call triggers
$this->db->commit(); $this->db->commit();
@ -398,7 +399,7 @@ class Don extends CommonObject
$this->country=($this->country?$this->country:$this->country); $this->country=($this->country?$this->country:$this->country);
$this->db->begin(); $this->db->begin();
$sql = "UPDATE ".MAIN_DB_PREFIX."don SET "; $sql = "UPDATE ".MAIN_DB_PREFIX."don SET ";
$sql .= "amount = " . price2num($this->amount); $sql .= "amount = " . price2num($this->amount);
$sql .= ",fk_paiement = ".($this->modepaiementid?$this->modepaiementid:"null"); $sql .= ",fk_paiement = ".($this->modepaiementid?$this->modepaiementid:"null");
@ -426,9 +427,9 @@ class Don extends CommonObject
{ {
// Call trigger // Call trigger
$result=$this->call_trigger('DON_UPDATE',$user); $result=$this->call_trigger('DON_UPDATE',$user);
if ($result < 0) { $error++; $this->db->rollback(); return -1; } if ($result < 0) { $error++; $this->db->rollback(); return -1; }
// End call triggers // End call triggers
$this->db->commit(); $this->db->commit();
return 1; return 1;
} }
@ -448,7 +449,7 @@ class Don extends CommonObject
*/ */
function delete($rowid) function delete($rowid)
{ {
$this->db-begin(); $this->db-begin();
$sql = "DELETE FROM ".MAIN_DB_PREFIX."don WHERE rowid = $rowid AND fk_statut = 0;"; $sql = "DELETE FROM ".MAIN_DB_PREFIX."don WHERE rowid = $rowid AND fk_statut = 0;";
@ -460,9 +461,9 @@ class Don extends CommonObject
{ {
// Call trigger // Call trigger
$result=$this->call_trigger('DON_DELETE',$user); $result=$this->call_trigger('DON_DELETE',$user);
if ($result < 0) { $error++; $this->db->rollback(); return -1; } if ($result < 0) { $error++; $this->db->rollback(); return -1; }
// End call triggers // End call triggers
$this->db->commit(); $this->db->commit();
return 1; return 1;
} }

View File

@ -526,7 +526,7 @@ else
{ {
echo '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture.php?action=create&amp;socid='.$object->thirdparty->id.'&amp;fac_rec='.$object->id.'">'.$langs->trans("CreateBill").'</a></div>'; echo '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture.php?action=create&amp;socid='.$object->thirdparty->id.'&amp;fac_rec='.$object->id.'">'.$langs->trans("CreateBill").'</a></div>';
} }
if ($object->statut == 0 && $user->rights->facture->supprimer) if ($object->statut == 0 && $user->rights->facture->supprimer)
{ {
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?action=delete&id='.$object->id.'">'.$langs->trans('Delete').'</a></div>'; print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?action=delete&id='.$object->id.'">'.$langs->trans('Delete').'</a></div>';
@ -544,7 +544,7 @@ else
/* /*
* List mode * List mode
*/ */
$sql = "SELECT s.nom, s.rowid as socid, f.titre, f.total, f.rowid as facid"; $sql = "SELECT s.nom as name, s.rowid as socid, f.titre, f.total, f.rowid as facid";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture_rec as f"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture_rec as f";
$sql.= " WHERE f.fk_soc = s.rowid"; $sql.= " WHERE f.fk_soc = s.rowid";
$sql.= " AND f.entity = ".$conf->entity; $sql.= " AND f.entity = ".$conf->entity;
@ -584,13 +584,13 @@ else
print "</a></td>\n"; print "</a></td>\n";
$companystatic->id=$objp->socid; $companystatic->id=$objp->socid;
$companystatic->name=$objp->nom; $companystatic->name=$objp->name;
print '<td>'.$companystatic->getNomUrl(1,'customer').'</td>'; print '<td>'.$companystatic->getNomUrl(1,'customer').'</td>';
print '<td align="right">'.price($objp->total).'</td>'."\n"; print '<td align="right">'.price($objp->total).'</td>'."\n";
echo '<td align="center">'; echo '<td align="center">';
if ($user->rights->facture->creer) if ($user->rights->facture->creer)
{ {
echo '<a href="'.DOL_URL_ROOT.'/compta/facture.php?action=create&amp;socid='.$objp->socid.'&amp;fac_rec='.$objp->facid.'">'; echo '<a href="'.DOL_URL_ROOT.'/compta/facture.php?action=create&amp;socid='.$objp->socid.'&amp;fac_rec='.$objp->facid.'">';

View File

@ -395,7 +395,7 @@ if (! $sortorder) $sortorder="ASC";
$limit = $conf->liste_limit; $limit = $conf->liste_limit;
$sql = "SELECT s.nom, s.rowid as socid, s.email"; $sql = "SELECT s.nom as name, s.rowid as socid, s.email";
$sql.= ", f.rowid as facid, f.facnumber, f.ref_client, f.increment, f.total as total_ht, f.tva as total_tva, f.total_ttc, f.localtax1, f.localtax2, f.revenuestamp"; $sql.= ", f.rowid as facid, f.facnumber, f.ref_client, f.increment, f.total as total_ht, f.tva as total_tva, f.total_ttc, f.localtax1, f.localtax2, f.revenuestamp";
$sql.= ", f.datef as df, f.date_lim_reglement as datelimite"; $sql.= ", f.datef as df, f.date_lim_reglement as datelimite";
$sql.= ", f.paye as paye, f.fk_statut, f.type, f.fk_mode_reglement"; $sql.= ", f.paye as paye, f.fk_statut, f.type, f.fk_mode_reglement";
@ -462,7 +462,7 @@ if ($resql)
$urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder; $urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
$urlsource.=str_replace('&amp;','&',$param); $urlsource.=str_replace('&amp;','&',$param);
$titre=(! empty($socid)?$langs->trans("BillsCustomersUnpaidForCompany",$soc->nom):$langs->trans("BillsCustomersUnpaid")); $titre=(! empty($socid)?$langs->trans("BillsCustomersUnpaidForCompany",$soc->name):$langs->trans("BillsCustomersUnpaid"));
if ($option == 'late') $titre.=' ('.$langs->trans("Late").')'; if ($option == 'late') $titre.=' ('.$langs->trans("Late").')';
else $titre.=' ('.$langs->trans("All").')'; else $titre.=' ('.$langs->trans("All").')';
@ -658,7 +658,7 @@ if ($resql)
print '<td>'; print '<td>';
$thirdparty=new Societe($db); $thirdparty=new Societe($db);
$thirdparty->id=$objp->socid; $thirdparty->id=$objp->socid;
$thirdparty->nom=$objp->nom; $thirdparty->name=$objp->name;
$thirdparty->client=$objp->client; $thirdparty->client=$objp->client;
$thirdparty->code_client=$objp->code_client; $thirdparty->code_client=$objp->code_client;
print $thirdparty->getNomUrl(1,'customer'); print $thirdparty->getNomUrl(1,'customer');

View File

@ -144,7 +144,7 @@ else $sql = 'SELECT DISTINCT';
$sql.= ' f.rowid as facid, f.facnumber, f.ref_client, f.type, f.note_private, f.increment, f.total as total_ht, f.tva as total_tva, f.total_ttc,'; $sql.= ' f.rowid as facid, f.facnumber, f.ref_client, f.type, f.note_private, f.increment, f.total as total_ht, f.tva as total_tva, f.total_ttc,';
$sql.= ' f.datef as df, f.date_lim_reglement as datelimite,'; $sql.= ' f.datef as df, f.date_lim_reglement as datelimite,';
$sql.= ' f.paye as paye, f.fk_statut,'; $sql.= ' f.paye as paye, f.fk_statut,';
$sql.= ' s.nom, s.rowid as socid, s.code_client, s.client '; $sql.= ' s.nom as name, s.rowid as socid, s.code_client, s.client ';
if (! $sall) $sql.= ', SUM(pf.amount) as am'; // To be able to sort on status if (! $sall) $sql.= ', SUM(pf.amount) as am'; // To be able to sort on status
$sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s'; $sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s';
$sql.= ', '.MAIN_DB_PREFIX.'facture as f'; $sql.= ', '.MAIN_DB_PREFIX.'facture as f';
@ -265,7 +265,7 @@ if ($resql)
if ($search_user > 0) $param.='&search_user=' .$search_user; if ($search_user > 0) $param.='&search_user=' .$search_user;
if ($search_montant_ht) $param.='&search_montant_ht='.$search_montant_ht; if ($search_montant_ht) $param.='&search_montant_ht='.$search_montant_ht;
if ($search_montant_ttc) $param.='&search_montant_ttc='.$search_montant_ttc; if ($search_montant_ttc) $param.='&search_montant_ttc='.$search_montant_ttc;
print_barre_liste($langs->trans('BillsCustomers').' '.($socid?' '.$soc->nom:''),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords); print_barre_liste($langs->trans('BillsCustomers').' '.($socid?' '.$soc->name:''),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords);
$i = 0; $i = 0;
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">'."\n"; print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">'."\n";
@ -400,7 +400,7 @@ if ($resql)
print '<td>'; print '<td>';
$thirdparty=new Societe($db); $thirdparty=new Societe($db);
$thirdparty->id=$objp->socid; $thirdparty->id=$objp->socid;
$thirdparty->nom=$objp->nom; $thirdparty->name=$objp->name;
$thirdparty->client=$objp->client; $thirdparty->client=$objp->client;
$thirdparty->code_client=$objp->code_client; $thirdparty->code_client=$objp->code_client;
print $thirdparty->getNomUrl(1,'customer'); print $thirdparty->getNomUrl(1,'customer');

View File

@ -145,7 +145,7 @@ if (! empty($conf->don->enabled) && $user->rights->don->lire)
if (! empty($conf->facture->enabled) && $user->rights->facture->lire) if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
{ {
$sql = "SELECT f.facnumber, f.rowid, f.total_ttc, f.type,"; $sql = "SELECT f.facnumber, f.rowid, f.total_ttc, f.type,";
$sql.= " s.nom, s.rowid as socid"; $sql.= " s.nom as name, s.rowid as socid";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user "; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user ";
$sql.= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."societe as s"; $sql.= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -185,7 +185,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
print '</td>'; print '</td>';
print '<td class="nowrap">'; print '<td class="nowrap">';
$companystatic->id=$obj->socid; $companystatic->id=$obj->socid;
$companystatic->nom=$obj->nom; $companystatic->name=$obj->name;
$companystatic->client=1; $companystatic->client=1;
print $companystatic->getNomUrl(1,'',16); print $companystatic->getNomUrl(1,'',16);
print '</td>'; print '</td>';
@ -219,7 +219,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire) if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire)
{ {
$sql = "SELECT f.ref, f.rowid, f.total_ttc, f.type,"; $sql = "SELECT f.ref, f.rowid, f.total_ttc, f.type,";
$sql.= " s.nom, s.rowid as socid"; $sql.= " s.nom as name, s.rowid as socid";
$sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn as f, ".MAIN_DB_PREFIX."societe as s"; $sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn as f, ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE s.rowid = f.fk_soc AND f.fk_statut = 0"; $sql.= " WHERE s.rowid = f.fk_soc AND f.fk_statut = 0";
@ -254,7 +254,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
print '</td>'; print '</td>';
print '<td>'; print '<td>';
$companystatic->id=$obj->socid; $companystatic->id=$obj->socid;
$companystatic->nom=$obj->nom; $companystatic->name=$obj->name;
$companystatic->client=1; $companystatic->client=1;
print $companystatic->getNomUrl(1,'',16); print $companystatic->getNomUrl(1,'',16);
print '</td>'; print '</td>';
@ -294,7 +294,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
$sql = "SELECT f.rowid, f.facnumber, f.fk_statut, f.type, f.total, f.total_ttc, f.paye, f.tms,"; $sql = "SELECT f.rowid, f.facnumber, f.fk_statut, f.type, f.total, f.total_ttc, f.paye, f.tms,";
$sql.= " f.date_lim_reglement as datelimite,"; $sql.= " f.date_lim_reglement as datelimite,";
$sql.= " s.nom, s.rowid as socid,"; $sql.= " s.nom as name, s.rowid as socid,";
$sql.= " sum(pf.amount) as am"; $sql.= " sum(pf.amount) as am";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf on f.rowid=pf.fk_facture"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf on f.rowid=pf.fk_facture";
@ -351,7 +351,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
print '</td>'; print '</td>';
print '<td align="left">'; print '<td align="left">';
$thirdpartystatic->id=$obj->socid; $thirdpartystatic->id=$obj->socid;
$thirdpartystatic->nom=$obj->nom; $thirdpartystatic->name=$obj->name;
$thirdpartystatic->client=1; $thirdpartystatic->client=1;
print $thirdpartystatic->getNomUrl(1,'customer',44); print $thirdpartystatic->getNomUrl(1,'customer',44);
print '</td>'; print '</td>';
@ -392,7 +392,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
$facstatic=new FactureFournisseur($db); $facstatic=new FactureFournisseur($db);
$sql = "SELECT ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.total_ttc, ff.tms, ff.paye"; $sql = "SELECT ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.total_ttc, ff.tms, ff.paye";
$sql.= ", s.nom, s.rowid as socid"; $sql.= ", s.nom as name, s.rowid as socid";
$sql.= ", SUM(pf.amount) as am"; $sql.= ", SUM(pf.amount) as am";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as ff"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as ff";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf on ff.rowid=pf.fk_facturefourn"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf on ff.rowid=pf.fk_facturefourn";
@ -432,7 +432,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
print '</td>'; print '</td>';
print '<td>'; print '<td>';
$thirdpartystatic->id=$obj->socid; $thirdpartystatic->id=$obj->socid;
$thirdpartystatic->nom=$obj->nom; $thirdpartystatic->name=$obj->name;
$thirdpartystatic->fournisseur=1; $thirdpartystatic->fournisseur=1;
print $thirdpartystatic->getNomUrl(1,'supplier',44); print $thirdpartystatic->getNomUrl(1,'supplier',44);
print '</td>'; print '</td>';
@ -613,7 +613,7 @@ if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $us
$langs->load("orders"); $langs->load("orders");
$sql = "SELECT sum(f.total) as tot_fht, sum(f.total_ttc) as tot_fttc,"; $sql = "SELECT sum(f.total) as tot_fht, sum(f.total_ttc) as tot_fttc,";
$sql.= " s.nom, s.rowid as socid,"; $sql.= " s.nom as name, s.rowid as socid,";
$sql.= " c.rowid, c.ref, c.facture, c.fk_statut, c.total_ht, c.total_ttc"; $sql.= " c.rowid, c.ref, c.facture, c.fk_statut, c.total_ht, c.total_ttc";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -675,7 +675,7 @@ if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $us
print '<td align="left">'; print '<td align="left">';
$societestatic->id=$obj->socid; $societestatic->id=$obj->socid;
$societestatic->nom=$obj->nom; $societestatic->name=$obj->name;
$societestatic->client=1; $societestatic->client=1;
print $societestatic->getNomUrl(1,'customer',44); print $societestatic->getNomUrl(1,'customer',44);
print '</a></td>'; print '</a></td>';
@ -717,7 +717,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
$sql = "SELECT f.rowid, f.facnumber, f.fk_statut, f.datef, f.type, f.total, f.total_ttc, f.paye, f.tms,"; $sql = "SELECT f.rowid, f.facnumber, f.fk_statut, f.datef, f.type, f.total, f.total_ttc, f.paye, f.tms,";
$sql.= " f.date_lim_reglement as datelimite,"; $sql.= " f.date_lim_reglement as datelimite,";
$sql.= " s.nom, s.rowid as socid,"; $sql.= " s.nom as name, s.rowid as socid,";
$sql.= " sum(pf.amount) as am"; $sql.= " sum(pf.amount) as am";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf on f.rowid=pf.fk_facture"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf on f.rowid=pf.fk_facture";
@ -774,7 +774,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
print '</td>'; print '</td>';
print '<td align="left">' ; print '<td align="left">' ;
$societestatic->id=$obj->socid; $societestatic->id=$obj->socid;
$societestatic->nom=$obj->nom; $societestatic->name=$obj->name;
$societestatic->client=1; $societestatic->client=1;
print $societestatic->getNomUrl(1,'customer',44); print $societestatic->getNomUrl(1,'customer',44);
print '</a></td>'; print '</a></td>';
@ -821,7 +821,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
$facstatic=new FactureFournisseur($db); $facstatic=new FactureFournisseur($db);
$sql = "SELECT ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.total_ttc, ff.paye,"; $sql = "SELECT ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.total_ttc, ff.paye,";
$sql.= " s.nom, s.rowid as socid,"; $sql.= " s.nom as name, s.rowid as socid,";
$sql.= " sum(pf.amount) as am"; $sql.= " sum(pf.amount) as am";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as ff"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as ff";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf on ff.rowid=pf.fk_facturefourn"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf on ff.rowid=pf.fk_facturefourn";
@ -863,7 +863,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
print $facstatic->getNomUrl(1,''); print $facstatic->getNomUrl(1,'');
print '</td>'; print '</td>';
$societestatic->id=$obj->socid; $societestatic->id=$obj->socid;
$societestatic->nom=$obj->nom; $societestatic->name=$obj->name;
$societestatic->client=0; $societestatic->client=0;
print '<td>'.$societestatic->getNomUrl(1, 'supplier', 44).'</td>'; print '<td>'.$societestatic->getNomUrl(1, 'supplier', 44).'</td>';
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($obj->total_ht).'</td>'; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($obj->total_ht).'</td>';

View File

@ -149,7 +149,8 @@ $vatcust=$langs->transcountry($local==1?"LT1":"LT2",$mysoc->country_code);
$vatsup=$langs->transcountry($local==1?"LT1":"LT2",$mysoc->country_code); $vatsup=$langs->transcountry($local==1?"LT1":"LT2",$mysoc->country_code);
// IRPF that the customer has retained me // IRPF that the customer has retained me
if($conf->global->$calc ==0 || $conf->global->$calc == 2){ if($conf->global->$calc ==0 || $conf->global->$calc == 2)
{
print "<table class=\"noborder\" width=\"100%\">"; print "<table class=\"noborder\" width=\"100%\">";
print "<tr class=\"liste_titre\">"; print "<tr class=\"liste_titre\">";
print '<td align="left">'.$langs->trans("Num")."</td>"; print '<td align="left">'.$langs->trans("Num")."</td>";
@ -160,7 +161,7 @@ if($conf->global->$calc ==0 || $conf->global->$calc == 2){
print "</tr>\n"; print "</tr>\n";
$coll_list = vat_by_thirdparty($db,0,$date_start,$date_end,$modetax,'sell'); $coll_list = vat_by_thirdparty($db,0,$date_start,$date_end,$modetax,'sell');
$action = "tvaclient"; $action = "tvaclient";
$object = &$coll_list; $object = &$coll_list;
$parameters["mode"] = $modetax; $parameters["mode"] = $modetax;
@ -170,7 +171,7 @@ if($conf->global->$calc ==0 || $conf->global->$calc == 2){
// Initialize technical object to manage hooks of expenses. Note that conf->hooks_modules contains array array // Initialize technical object to manage hooks of expenses. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('externalbalance')); $hookmanager->initHooks(array('externalbalance'));
$reshook=$hookmanager->executeHooks('addStatisticLine',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks $reshook=$hookmanager->executeHooks('addStatisticLine',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if (is_array($coll_list)) if (is_array($coll_list))
{ {
$var=true; $var=true;
@ -196,7 +197,7 @@ if($conf->global->$calc ==0 || $conf->global->$calc == 2){
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
print '<td class="nowrap">'.$i."</td>"; print '<td class="nowrap">'.$i."</td>";
$company_static->id=$coll->socid; $company_static->id=$coll->socid;
$company_static->nom=$coll->nom; $company_static->name=$coll->name;
print '<td class="nowrap">'.$company_static->getNomUrl(1).'</td>'; print '<td class="nowrap">'.$company_static->getNomUrl(1).'</td>';
$find = array(' ','.'); $find = array(' ','.');
$replace = array('',''); $replace = array('','');
@ -210,7 +211,7 @@ if($conf->global->$calc ==0 || $conf->global->$calc == 2){
} }
} }
$x_coll_sum = $total; $x_coll_sum = $total;
print '<tr class="liste_total"><td align="right" colspan="3">'.$langs->trans("Total").':</td>'; print '<tr class="liste_total"><td align="right" colspan="3">'.$langs->trans("Total").':</td>';
print '<td class="nowrap" align="right">'.price($totalamount).'</td>'; print '<td class="nowrap" align="right">'.price($totalamount).'</td>';
print '<td class="nowrap" align="right">'.price($total).'</td>'; print '<td class="nowrap" align="right">'.price($total).'</td>';
@ -240,7 +241,7 @@ if($conf->global->$calc ==0 || $conf->global->$calc == 1){
print "</tr>\n"; print "</tr>\n";
$company_static=new Societe($db); $company_static=new Societe($db);
$coll_list = vat_by_thirdparty($db,0,$date_start,$date_end,$modetax,'buy'); $coll_list = vat_by_thirdparty($db,0,$date_start,$date_end,$modetax,'buy');
$parameters["direction"] = 'buy'; $parameters["direction"] = 'buy';
$reshook=$hookmanager->executeHooks('addStatisticLine',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks $reshook=$hookmanager->executeHooks('addStatisticLine',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
@ -269,7 +270,7 @@ if($conf->global->$calc ==0 || $conf->global->$calc == 1){
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
print '<td class="nowrap">'.$i."</td>"; print '<td class="nowrap">'.$i."</td>";
$company_static->id=$coll->socid; $company_static->id=$coll->socid;
$company_static->nom=$coll->nom; $company_static->name=$coll->name;
print '<td class="nowrap">'.$company_static->getNomUrl(1).'</td>'; print '<td class="nowrap">'.$company_static->getNomUrl(1).'</td>';
$find = array(' ','.'); $find = array(' ','.');
$replace = array('',''); $replace = array('','');
@ -283,14 +284,14 @@ if($conf->global->$calc ==0 || $conf->global->$calc == 1){
} }
} }
$x_paye_sum = $total; $x_paye_sum = $total;
print '<tr class="liste_total"><td align="right" colspan="3">'.$langs->trans("Total").':</td>'; print '<tr class="liste_total"><td align="right" colspan="3">'.$langs->trans("Total").':</td>';
print '<td class="nowrap" align="right">'.price($totalamount).'</td>'; print '<td class="nowrap" align="right">'.price($totalamount).'</td>';
print '<td class="nowrap" align="right">'.price($total).'</td>'; print '<td class="nowrap" align="right">'.price($total).'</td>';
print '</tr>'; print '</tr>';
print '</table>'; print '</table>';
} }
else else
{ {

View File

@ -273,7 +273,7 @@ print '</table>';
*/ */
$disable_delete = 0; $disable_delete = 0;
$sql = 'SELECT f.rowid as facid, f.facnumber, f.type, f.total_ttc, f.paye, f.fk_statut, pf.amount, s.nom, s.rowid as socid'; $sql = 'SELECT f.rowid as facid, f.facnumber, f.type, f.total_ttc, f.paye, f.fk_statut, pf.amount, s.nom as name, s.rowid as socid';
$sql.= ' FROM '.MAIN_DB_PREFIX.'paiement_facture as pf,'.MAIN_DB_PREFIX.'facture as f,'.MAIN_DB_PREFIX.'societe as s'; $sql.= ' FROM '.MAIN_DB_PREFIX.'paiement_facture as pf,'.MAIN_DB_PREFIX.'facture as f,'.MAIN_DB_PREFIX.'societe as s';
$sql.= ' WHERE pf.fk_facture = f.rowid'; $sql.= ' WHERE pf.fk_facture = f.rowid';
$sql.= ' AND f.fk_soc = s.rowid'; $sql.= ' AND f.fk_soc = s.rowid';
@ -322,7 +322,7 @@ if ($resql)
// Third party // Third party
print '<td>'; print '<td>';
$thirdpartystatic->id=$objp->socid; $thirdpartystatic->id=$objp->socid;
$thirdpartystatic->nom=$objp->nom; $thirdpartystatic->name=$objp->name;
print $thirdpartystatic->getNomUrl(1); print $thirdpartystatic->getNomUrl(1);
print '</td>'; print '</td>';

View File

@ -221,7 +221,7 @@ class Paiement extends CommonObject
if (!in_array($invoice->type, $affected_types)) dol_syslog("Invoice ".$facid." is not a standard, nor replacement invoice, nor credit note, nor deposit invoice. We do nothing more."); if (!in_array($invoice->type, $affected_types)) dol_syslog("Invoice ".$facid." is not a standard, nor replacement invoice, nor credit note, nor deposit invoice. We do nothing more.");
else if ($remaintopay) dol_syslog("Remain to pay for invoice ".$facid." not null. We do nothing more."); else if ($remaintopay) dol_syslog("Remain to pay for invoice ".$facid." not null. We do nothing more.");
else if ($mustwait) dol_syslog("There is ".$mustwait." differed payment to process, we do nothing more."); else if ($mustwait) dol_syslog("There is ".$mustwait." differed payment to process, we do nothing more.");
else else
{ {
$result=$invoice->set_paid($user,'',''); $result=$invoice->set_paid($user,'','');
if ($result<0) if ($result<0)
@ -360,8 +360,8 @@ class Paiement extends CommonObject
{ {
// Appel des triggers // Appel des triggers
$result=$this->call_trigger('PAYMENT_DELETE', $user); $result=$this->call_trigger('PAYMENT_DELETE', $user);
if ($result < 0) if ($result < 0)
{ {
$this->db->rollback(); $this->db->rollback();
return -1; return -1;
} }
@ -483,7 +483,7 @@ class Paiement extends CommonObject
$bank_line_id, $bank_line_id,
$fac->thirdparty->id, $fac->thirdparty->id,
DOL_URL_ROOT.'/comm/card.php?socid=', DOL_URL_ROOT.'/comm/card.php?socid=',
$fac->thirdparty->nom, $fac->thirdparty->name,
'company' 'company'
); );
if ($result <= 0) dol_print_error($this->db); if ($result <= 0) dol_print_error($this->db);
@ -501,7 +501,7 @@ class Paiement extends CommonObject
$bank_line_id, $bank_line_id,
$fac->thirdparty->id, $fac->thirdparty->id,
DOL_URL_ROOT.'/fourn/card.php?socid=', DOL_URL_ROOT.'/fourn/card.php?socid=',
$fac->thirdparty->nom, $fac->thirdparty->name,
'company' 'company'
); );
if ($result <= 0) dol_print_error($this->db); if ($result <= 0) dol_print_error($this->db);

View File

@ -85,7 +85,7 @@ else
//$sql.= " c.libelle as paiement_type,"; //$sql.= " c.libelle as paiement_type,";
$sql.= " c.code as paiement_code,"; $sql.= " c.code as paiement_code,";
$sql.= " ba.rowid as bid, ba.label,"; $sql.= " ba.rowid as bid, ba.label,";
$sql.= " s.rowid as socid, s.nom"; $sql.= " s.rowid as socid, s.nom as name";
//$sql.= " f.facnumber"; //$sql.= " f.facnumber";
$sql.= " FROM (".MAIN_DB_PREFIX."c_paiement as c, ".MAIN_DB_PREFIX."paiement as p)"; $sql.= " FROM (".MAIN_DB_PREFIX."c_paiement as c, ".MAIN_DB_PREFIX."paiement as p)";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON p.fk_bank = b.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON p.fk_bank = b.rowid";
@ -197,7 +197,7 @@ if ($resql)
if ($objp->socid) if ($objp->socid)
{ {
$companystatic->id=$objp->socid; $companystatic->id=$objp->socid;
$companystatic->nom=$objp->nom; $companystatic->name=$objp->name;
print $companystatic->getNomUrl(1,'',24); print $companystatic->getNomUrl(1,'',24);
} }
else print '&nbsp;'; else print '&nbsp;';

View File

@ -760,7 +760,7 @@ class BonPrelevement extends CommonObject
$sql = "SELECT f.rowid, pfd.rowid as pfdrowid, f.fk_soc"; $sql = "SELECT f.rowid, pfd.rowid as pfdrowid, f.fk_soc";
$sql.= ", pfd.code_banque, pfd.code_guichet, pfd.number, pfd.cle_rib"; $sql.= ", pfd.code_banque, pfd.code_guichet, pfd.number, pfd.cle_rib";
$sql.= ", pfd.amount"; $sql.= ", pfd.amount";
$sql.= ", s.nom"; $sql.= ", s.nom as name";
$sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; $sql.= " FROM ".MAIN_DB_PREFIX."facture as f";
$sql.= ", ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."societe as s";
$sql.= ", ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; $sql.= ", ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd";
@ -829,8 +829,8 @@ class BonPrelevement extends CommonObject
} }
else else
{ {
dol_syslog("Error on default bank number RIB/IBAN for thirdparty reported by verif() ".$fact->socid." ".$soc->nom, LOG_ERR); dol_syslog("Error on default bank number RIB/IBAN for thirdparty reported by verif() ".$fact->socid." ".$soc->name, LOG_ERR);
$facture_errors[$fac[0]]="Error on default bank number RIB/IBAN for thirdparty reported by function verif() ".$fact->socid." ".$soc->nom; $facture_errors[$fac[0]]="Error on default bank number RIB/IBAN for thirdparty reported by function verif() ".$fact->socid." ".$soc->name;
} }
} }
else else
@ -1262,7 +1262,7 @@ class BonPrelevement extends CommonObject
* section Debiteur (sepa Debiteurs bloc lines) * section Debiteur (sepa Debiteurs bloc lines)
*/ */
$sql = "SELECT soc.code_client as code, soc.address, soc.zip, soc.town, soc.datec, c.code as country_code,"; $sql = "SELECT soc.code_client as code, soc.address, soc.zip, soc.town, soc.datec, c.code as country_code,";
$sql.= " pl.client_nom as nom, pl.code_banque as cb, pl.code_guichet as cg, pl.number as cc, pl.amount as somme,"; $sql.= " pl.client_nom as name, pl.code_banque as cb, pl.code_guichet as cg, pl.number as cc, pl.amount as somme,";
$sql.= " f.facnumber as fac, pf.fk_facture as idfac, rib.iban_prefix as iban, rib.bic as bic, rib.rowid as drum"; $sql.= " f.facnumber as fac, pf.fk_facture as idfac, rib.iban_prefix as iban, rib.bic as bic, rib.rowid as drum";
$sql.= " FROM"; $sql.= " FROM";
$sql.= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,"; $sql.= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,";
@ -1286,7 +1286,7 @@ class BonPrelevement extends CommonObject
while ($i < $num) while ($i < $num)
{ {
$obj = $this->db->fetch_object($resql); $obj = $this->db->fetch_object($resql);
$fileDebiteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $obj->facnumber, $obj->idfac, $obj->iban, $obj->bic, $obj->datec, $obj->drum); $fileDebiteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->name, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $obj->facnumber, $obj->idfac, $obj->iban, $obj->bic, $obj->datec, $obj->drum);
$this->total = $this->total + $obj->somme; $this->total = $this->total + $obj->somme;
$i++; $i++;
} }
@ -1490,7 +1490,7 @@ class BonPrelevement extends CommonObject
* Write recipient of request (customer) * Write recipient of request (customer)
* *
* @param string $row_code_client soc.code_client as code, * @param string $row_code_client soc.code_client as code,
* @param string $row_nom pl.client_nom AS nom, * @param string $row_nom pl.client_nom AS name,
* @param string $row_address soc.address AS adr, * @param string $row_address soc.address AS adr,
* @param string $row_zip soc.zip * @param string $row_zip soc.zip
* @param string $row_town soc.town * @param string $row_town soc.town

View File

@ -244,7 +244,7 @@ class RejetPrelevement
$arr_mime = array(); $arr_mime = array();
$arr_name = array(); $arr_name = array();
$facref = $fac->ref; $facref = $fac->ref;
$socname = $soc->nom; $socname = $soc->name;
$amount = price($fac->total_ttc); $amount = price($fac->total_ttc);
$userinfo = $this->user->getFullName($langs); $userinfo = $this->user->getFullName($langs);

View File

@ -156,7 +156,7 @@ print '<br>';
* Invoices waiting for withdraw * Invoices waiting for withdraw
*/ */
$sql = "SELECT f.facnumber, f.rowid, f.total_ttc, s.nom, s.rowid as socid,"; $sql = "SELECT f.facnumber, f.rowid, f.total_ttc, s.nom as name, s.rowid as socid,";
$sql.= " pfd.date_demande"; $sql.= " pfd.date_demande";
$sql.= " FROM ".MAIN_DB_PREFIX."facture as f,"; $sql.= " FROM ".MAIN_DB_PREFIX."facture as f,";
$sql.= " ".MAIN_DB_PREFIX."societe as s,"; $sql.= " ".MAIN_DB_PREFIX."societe as s,";
@ -197,7 +197,7 @@ if ($resql)
print '</td>'; print '</td>';
print '<td>'; print '<td>';
$thirdpartystatic->id=$obj->socid; $thirdpartystatic->id=$obj->socid;
$thirdpartystatic->nom=$obj->nom; $thirdpartystatic->name=$obj->name;
print $thirdpartystatic->getNomUrl(1,'customer'); print $thirdpartystatic->getNomUrl(1,'customer');
print '</td>'; print '</td>';
print '<td align="right">'; print '<td align="right">';

View File

@ -67,7 +67,7 @@ if (! $sortfield) $sortfield="f.facnumber";
*/ */
$sql= "SELECT f.facnumber, f.rowid, f.total_ttc,"; $sql= "SELECT f.facnumber, f.rowid, f.total_ttc,";
$sql.= " s.nom, s.rowid as socid,"; $sql.= " s.nom as name, s.rowid as socid,";
$sql.= " pfd.date_demande as date_demande,"; $sql.= " pfd.date_demande as date_demande,";
$sql.= " pfd.fk_user_demande"; $sql.= " pfd.fk_user_demande";
$sql.= " FROM ".MAIN_DB_PREFIX."facture as f,"; $sql.= " FROM ".MAIN_DB_PREFIX."facture as f,";
@ -137,7 +137,7 @@ if ($resql)
print '<td>'; print '<td>';
$thirdpartystatic->id=$obj->socid; $thirdpartystatic->id=$obj->socid;
$thirdpartystatic->nom=$obj->nom; $thirdpartystatic->name=$obj->name;
print $thirdpartystatic->getNomUrl(1,'customer'); print $thirdpartystatic->getNomUrl(1,'customer');
print '</td>'; print '</td>';

View File

@ -63,17 +63,17 @@ if ($prev_id)
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td>'.$bon->getNomUrl(1).'</td></tr>'; print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td>'.$bon->getNomUrl(1).'</td></tr>';
print '<tr><td width="20%">'.$langs->trans("Date").'</td><td>'.dol_print_date($bon->datec,'day').'</td></tr>'; print '<tr><td width="20%">'.$langs->trans("Date").'</td><td>'.dol_print_date($bon->datec,'day').'</td></tr>';
print '<tr><td width="20%">'.$langs->trans("Amount").'</td><td>'.price($bon->amount).'</td></tr>'; print '<tr><td width="20%">'.$langs->trans("Amount").'</td><td>'.price($bon->amount).'</td></tr>';
// Status // Status
print '<tr><td width="20%">'.$langs->trans('Status').'</td>'; print '<tr><td width="20%">'.$langs->trans('Status').'</td>';
print '<td>'.$bon->getLibStatut(1).'</td>'; print '<td>'.$bon->getLibStatut(1).'</td>';
print '</tr>'; print '</tr>';
if($bon->date_trans <> 0) if($bon->date_trans <> 0)
{ {
$muser = new User($db); $muser = new User($db);
$muser->fetch($bon->user_trans); $muser->fetch($bon->user_trans);
print '<tr><td width="20%">'.$langs->trans("TransData").'</td><td>'; print '<tr><td width="20%">'.$langs->trans("TransData").'</td><td>';
print dol_print_date($bon->date_trans,'day'); print dol_print_date($bon->date_trans,'day');
print ' '.$langs->trans("By").' '.$muser->getFullName($langs).'</td></tr>'; print ' '.$langs->trans("By").' '.$muser->getFullName($langs).'</td></tr>';
@ -87,19 +87,19 @@ if ($prev_id)
print dol_print_date($bon->date_credit,'day'); print dol_print_date($bon->date_credit,'day');
print '</td></tr>'; print '</td></tr>';
} }
print '</table>'; print '</table>';
print '<br>'; print '<br>';
print '<table class="border" width="100%"><tr><td width="20%">'; print '<table class="border" width="100%"><tr><td width="20%">';
print $langs->trans("WithdrawalFile").'</td><td>'; print $langs->trans("WithdrawalFile").'</td><td>';
$relativepath = 'receipts/'.$bon->ref; $relativepath = 'receipts/'.$bon->ref;
print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?type=text/plain&amp;modulepart=prelevement&amp;file='.urlencode($relativepath).'">'.$relativepath.'</a>'; print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?type=text/plain&amp;modulepart=prelevement&amp;file='.urlencode($relativepath).'">'.$relativepath.'</a>';
print '</td></tr></table>'; print '</td></tr></table>';
dol_fiche_end(); dol_fiche_end();
} }
else else
{ {
@ -114,7 +114,7 @@ $offset = $conf->liste_limit * $page ;
*/ */
$sql = "SELECT pf.rowid"; $sql = "SELECT pf.rowid";
$sql.= ",f.rowid as facid, f.facnumber as ref, f.total_ttc"; $sql.= ",f.rowid as facid, f.facnumber as ref, f.total_ttc";
$sql.= ", s.rowid as socid, s.nom, pl.statut"; $sql.= ", s.rowid as socid, s.nom as name, pl.statut";
$sql.= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p"; $sql.= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
$sql.= ", ".MAIN_DB_PREFIX."prelevement_lignes as pl"; $sql.= ", ".MAIN_DB_PREFIX."prelevement_lignes as pl";
$sql.= ", ".MAIN_DB_PREFIX."prelevement_facture as pf"; $sql.= ", ".MAIN_DB_PREFIX."prelevement_facture as pf";
@ -166,7 +166,7 @@ if ($result)
print '<a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$obj->facid.'">'.$obj->ref."</a></td>\n"; print '<a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$obj->facid.'">'.$obj->ref."</a></td>\n";
print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'; print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">';
print img_object($langs->trans("ShowCompany"),"company"). ' '.stripslashes($obj->nom)."</a></td>\n"; print img_object($langs->trans("ShowCompany"),"company"). ' '.$obj->name."</a></td>\n";
print '<td align="center">'.price($obj->total_ttc)."</td>\n"; print '<td align="center">'.price($obj->total_ttc)."</td>\n";

View File

@ -62,17 +62,17 @@ if ($prev_id)
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td>'.$bon->getNomUrl(1).'</td></tr>'; print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td>'.$bon->getNomUrl(1).'</td></tr>';
print '<tr><td width="20%">'.$langs->trans("Date").'</td><td>'.dol_print_date($bon->datec,'day').'</td></tr>'; print '<tr><td width="20%">'.$langs->trans("Date").'</td><td>'.dol_print_date($bon->datec,'day').'</td></tr>';
print '<tr><td width="20%">'.$langs->trans("Amount").'</td><td>'.price($bon->amount).'</td></tr>'; print '<tr><td width="20%">'.$langs->trans("Amount").'</td><td>'.price($bon->amount).'</td></tr>';
// Status // Status
print '<tr><td width="20%">'.$langs->trans('Status').'</td>'; print '<tr><td width="20%">'.$langs->trans('Status').'</td>';
print '<td>'.$bon->getLibStatut(1).'</td>'; print '<td>'.$bon->getLibStatut(1).'</td>';
print '</tr>'; print '</tr>';
if($bon->date_trans <> 0) if($bon->date_trans <> 0)
{ {
$muser = new User($db); $muser = new User($db);
$muser->fetch($bon->user_trans); $muser->fetch($bon->user_trans);
print '<tr><td width="20%">'.$langs->trans("TransData").'</td><td>'; print '<tr><td width="20%">'.$langs->trans("TransData").'</td><td>';
print dol_print_date($bon->date_trans,'day'); print dol_print_date($bon->date_trans,'day');
print ' '.$langs->trans("By").' '.$muser->getFullName($langs).'</td></tr>'; print ' '.$langs->trans("By").' '.$muser->getFullName($langs).'</td></tr>';
@ -86,19 +86,19 @@ if ($prev_id)
print dol_print_date($bon->date_credit,'day'); print dol_print_date($bon->date_credit,'day');
print '</td></tr>'; print '</td></tr>';
} }
print '</table>'; print '</table>';
print '<br>'; print '<br>';
print '<table class="border" width="100%"><tr><td width="20%">'; print '<table class="border" width="100%"><tr><td width="20%">';
print $langs->trans("WithdrawalFile").'</td><td>'; print $langs->trans("WithdrawalFile").'</td><td>';
$relativepath = 'receipts/'.$bon->ref; $relativepath = 'receipts/'.$bon->ref;
print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?type=text/plain&amp;modulepart=prelevement&amp;file='.urlencode($relativepath).'">'.$relativepath.'</a>'; print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?type=text/plain&amp;modulepart=prelevement&amp;file='.urlencode($relativepath).'">'.$relativepath.'</a>';
print '</td></tr></table>'; print '</td></tr></table>';
dol_fiche_end(); dol_fiche_end();
} }
else else
{ {
@ -112,7 +112,7 @@ $rej = new RejetPrelevement($db, $user);
* Liste des factures * Liste des factures
*/ */
$sql = "SELECT pl.rowid, pl.amount, pl.statut"; $sql = "SELECT pl.rowid, pl.amount, pl.statut";
$sql.= " , s.rowid as socid, s.nom"; $sql.= " , s.rowid as socid, s.nom as name";
$sql.= " , pr.motif, pr.afacturer, pr.fk_facture"; $sql.= " , pr.motif, pr.afacturer, pr.fk_facture";
$sql.= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p"; $sql.= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
$sql.= " , ".MAIN_DB_PREFIX."prelevement_lignes as pl"; $sql.= " , ".MAIN_DB_PREFIX."prelevement_lignes as pl";
@ -152,7 +152,7 @@ if ($resql)
print img_picto('', 'statut'.$obj->statut).' '; print img_picto('', 'statut'.$obj->statut).' ';
print substr('000000'.$obj->rowid, -6); print substr('000000'.$obj->rowid, -6);
print '</a></td>'; print '</a></td>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.stripslashes($obj->nom)."</a></td>\n"; print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.$obj->name."</a></td>\n";
print '<td align="right">'.price($obj->amount)."</td>\n"; print '<td align="right">'.price($obj->amount)."</td>\n";
print '<td>'.$rej->motifs[$obj->motif].'</td>'; print '<td>'.$rej->motifs[$obj->motif].'</td>';

View File

@ -96,7 +96,7 @@ print '</td></tr></table><br>';
*/ */
$sql = "SELECT f.facnumber, f.rowid, f.total_ttc, f.fk_statut, f.paye, f.type,"; $sql = "SELECT f.facnumber, f.rowid, f.total_ttc, f.fk_statut, f.paye, f.type,";
$sql.= " pfd.date_demande,"; $sql.= " pfd.date_demande,";
$sql.= " s.nom, s.rowid as socid"; $sql.= " s.nom as name, s.rowid as socid";
$sql.= " FROM ".MAIN_DB_PREFIX."facture as f,"; $sql.= " FROM ".MAIN_DB_PREFIX."facture as f,";
$sql.= " ".MAIN_DB_PREFIX."societe as s"; $sql.= " ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -137,7 +137,7 @@ if ($resql)
print '<td>'; print '<td>';
$thirdpartystatic->id=$obj->socid; $thirdpartystatic->id=$obj->socid;
$thirdpartystatic->nom=$obj->nom; $thirdpartystatic->name=$obj->name;
print $thirdpartystatic->getNomUrl(1,'customer'); print $thirdpartystatic->getNomUrl(1,'customer');
print '</td>'; print '</td>';

View File

@ -190,7 +190,7 @@ if ($id)
print '<td colspan="3">'.$langs->trans("WithdrawalRefused").'</td></tr>'; print '<td colspan="3">'.$langs->trans("WithdrawalRefused").'</td></tr>';
//Select yes/no //Select yes/no
print '<tr><td class="valid">'.$langs->trans("WithdrawalRefusedConfirm").' '.$soc->nom.' ?</td>'; print '<tr><td class="valid">'.$langs->trans("WithdrawalRefusedConfirm").' '.$soc->name.' ?</td>';
print '<td colspan="2" class="valid">'; print '<td colspan="2" class="valid">';
print $form->selectyesno("confirm",1,0); print $form->selectyesno("confirm",1,0);
print '</td></tr>'; print '</td></tr>';
@ -257,7 +257,7 @@ if ($id)
*/ */
$sql = "SELECT pf.rowid"; $sql = "SELECT pf.rowid";
$sql.= " ,f.rowid as facid, f.facnumber as ref, f.total_ttc"; $sql.= " ,f.rowid as facid, f.facnumber as ref, f.total_ttc";
$sql.= " , s.rowid as socid, s.nom"; $sql.= " , s.rowid as socid, s.nom as name";
$sql.= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p"; $sql.= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
$sql.= " , ".MAIN_DB_PREFIX."prelevement_lignes as pl"; $sql.= " , ".MAIN_DB_PREFIX."prelevement_lignes as pl";
$sql.= " , ".MAIN_DB_PREFIX."prelevement_facture as pf"; $sql.= " , ".MAIN_DB_PREFIX."prelevement_facture as pf";
@ -308,7 +308,7 @@ if ($id)
print '<a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$obj->facid.'">'.$obj->ref."</a></td>\n"; print '<a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$obj->facid.'">'.$obj->ref."</a></td>\n";
print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'; print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">';
print img_object($langs->trans("ShowCompany"),"company"). ' '.stripslashes($obj->nom)."</a></td>\n"; print img_object($langs->trans("ShowCompany"),"company"). ' '.$obj->name."</a></td>\n";
print '<td align="right">'.price($obj->total_ttc)."</td>\n"; print '<td align="right">'.price($obj->total_ttc)."</td>\n";

View File

@ -106,7 +106,7 @@ if ($prev_id)
print '</td></tr></table>'; print '</td></tr></table>';
dol_fiche_end(); dol_fiche_end();
} }
else else
{ {
@ -128,7 +128,7 @@ $pagenext = $page + 1;
* *
*/ */
$sql = "SELECT pl.rowid, pl.statut, pl.amount"; $sql = "SELECT pl.rowid, pl.statut, pl.amount";
$sql.= ", s.rowid as socid, s.nom"; $sql.= ", s.rowid as socid, s.nom as name";
$sql.= " FROM ".MAIN_DB_PREFIX."prelevement_lignes as pl"; $sql.= " FROM ".MAIN_DB_PREFIX."prelevement_lignes as pl";
$sql.= ", ".MAIN_DB_PREFIX."prelevement_bons as pb"; $sql.= ", ".MAIN_DB_PREFIX."prelevement_bons as pb";
$sql.= ", ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."societe as s";
@ -175,7 +175,7 @@ if ($result)
print substr('000000'.$obj->rowid, -6); print substr('000000'.$obj->rowid, -6);
print '</a></td>'; print '</a></td>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.stripslashes($obj->nom)."</a></td>\n"; print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.$obj->name."</a></td>\n";
print '<td align="center">'.price($obj->amount)."</td>\n"; print '<td align="center">'.price($obj->amount)."</td>\n";

View File

@ -63,7 +63,7 @@ llxHeader('',$langs->trans("WithdrawalsLines"));
$sql = "SELECT p.rowid, p.ref, p.statut, p.datec"; $sql = "SELECT p.rowid, p.ref, p.statut, p.datec";
$sql.= " ,f.rowid as facid, f.facnumber, f.total_ttc"; $sql.= " ,f.rowid as facid, f.facnumber, f.total_ttc";
$sql.= " , s.rowid as socid, s.nom, s.code_client"; $sql.= " , s.rowid as socid, s.nom as name, s.code_client";
$sql.= " , pl.amount, pl.statut as statut_ligne, pl.rowid as rowid_ligne"; $sql.= " , pl.amount, pl.statut as statut_ligne, pl.rowid as rowid_ligne";
$sql.= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p"; $sql.= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
$sql.= " , ".MAIN_DB_PREFIX."prelevement_lignes as pl"; $sql.= " , ".MAIN_DB_PREFIX."prelevement_lignes as pl";
@ -162,7 +162,7 @@ if ($result)
print '&nbsp;<a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$obj->facid.'">'.$obj->facnumber."</a></td>\n"; print '&nbsp;<a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$obj->facid.'">'.$obj->facnumber."</a></td>\n";
print '</a></td>'; print '</a></td>';
print '<td><a href="card.php?id='.$obj->rowid.'">'.$obj->nom."</a></td>\n"; print '<td><a href="card.php?id='.$obj->rowid.'">'.$obj->name."</a></td>\n";
print '<td align="center"><a href="card.php?id='.$obj->rowid.'">'.$obj->code_client."</a></td>\n"; print '<td align="center"><a href="card.php?id='.$obj->rowid.'">'.$obj->code_client."</a></td>\n";

View File

@ -64,8 +64,8 @@ if ($socid > 0)
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
// Nom // Name
print '<tr><td width="20%">'.$langs->trans("Name").'</td><td width="80%" colspan="3">'.$societe->nom.'</td></tr>'; print '<tr><td width="20%">'.$langs->trans("Name").'</td><td width="80%" colspan="3">'.$societe->name.'</td></tr>';
// Prefix // Prefix
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field

View File

@ -120,7 +120,7 @@ $total_ttc=0;
// Affiche en-tete de rapport // Affiche en-tete de rapport
if ($modecompta=="CREANCES-DETTES") if ($modecompta=="CREANCES-DETTES")
{ {
$nom=$langs->trans("AnnualByCompaniesDueDebtMode"); $name=$langs->trans("AnnualByCompaniesDueDebtMode");
$calcmode=$langs->trans("CalcModeDebt"); $calcmode=$langs->trans("CalcModeDebt");
$calcmode.='<br>('.$langs->trans("SeeReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year.(GETPOST("month")>0?'&month='.GETPOST("month"):'').'&modecompta=RECETTES-DEPENSES">','</a>').')'; $calcmode.='<br>('.$langs->trans("SeeReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year.(GETPOST("month")>0?'&month='.GETPOST("month"):'').'&modecompta=RECETTES-DEPENSES">','</a>').')';
$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
@ -132,7 +132,7 @@ if ($modecompta=="CREANCES-DETTES")
//$exportlink=$langs->trans("NotYetAvailable"); //$exportlink=$langs->trans("NotYetAvailable");
} }
else { else {
$nom=$langs->trans("AnnualByCompaniesInputOutputMode"); $name=$langs->trans("AnnualByCompaniesInputOutputMode");
$calcmode=$langs->trans("CalcModeEngagement"); $calcmode=$langs->trans("CalcModeEngagement");
$calcmode.='<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year.(GETPOST("month")>0?'&month='.GETPOST("month"):'').'&modecompta=CREANCES-DETTES">','</a>').')'; $calcmode.='<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year.(GETPOST("month")>0?'&month='.GETPOST("month"):'').'&modecompta=CREANCES-DETTES">','</a>').')';
//$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',1,1,0,'',1,0,1); //$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',1,1,0,'',1,0,1);
@ -142,7 +142,7 @@ else {
$builddate=time(); $builddate=time();
//$exportlink=$langs->trans("NotYetAvailable"); //$exportlink=$langs->trans("NotYetAvailable");
} }
report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,array('modecompta'=>$modecompta),$calcmode); report_header($name,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,array('modecompta'=>$modecompta),$calcmode);
// Show report array // Show report array
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
@ -160,7 +160,7 @@ print '<tr><td colspan="4">'.$langs->trans("CustomersInvoices").'</td></tr>';
if ($modecompta == 'CREANCES-DETTES') if ($modecompta == 'CREANCES-DETTES')
{ {
$sql = "SELECT s.nom, s.rowid as socid, sum(f.total) as amount_ht, sum(f.total_ttc) as amount_ttc"; $sql = "SELECT s.nom as name, s.rowid as socid, sum(f.total) as amount_ht, sum(f.total_ttc) as amount_ttc";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql.= ", ".MAIN_DB_PREFIX."facture as f"; $sql.= ", ".MAIN_DB_PREFIX."facture as f";
$sql.= " WHERE f.fk_soc = s.rowid"; $sql.= " WHERE f.fk_soc = s.rowid";
@ -178,7 +178,7 @@ else
* Liste des paiements (les anciens paiements ne sont pas vus par cette requete car, sur les * Liste des paiements (les anciens paiements ne sont pas vus par cette requete car, sur les
* vieilles versions, ils n'etaient pas lies via paiement_facture. On les ajoute plus loin) * vieilles versions, ils n'etaient pas lies via paiement_facture. On les ajoute plus loin)
*/ */
$sql = "SELECT s.nom as nom, s.rowid as socid, sum(pf.amount) as amount_ttc"; $sql = "SELECT s.nom as name, s.rowid as socid, sum(pf.amount) as amount_ttc";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql.= ", ".MAIN_DB_PREFIX."facture as f"; $sql.= ", ".MAIN_DB_PREFIX."facture as f";
$sql.= ", ".MAIN_DB_PREFIX."paiement_facture as pf"; $sql.= ", ".MAIN_DB_PREFIX."paiement_facture as pf";
@ -206,7 +206,7 @@ if ($result) {
$var=!$var; $var=!$var;
print "<tr ".$bc[$var]."><td>&nbsp;</td>"; print "<tr ".$bc[$var]."><td>&nbsp;</td>";
print "<td>".$langs->trans("Bills").' <a href="'.DOL_URL_ROOT.'/compta/facture/list.php?socid='.$objp->socid.'">'.$objp->nom."</td>\n"; print "<td>".$langs->trans("Bills").' <a href="'.DOL_URL_ROOT.'/compta/facture/list.php?socid='.$objp->socid.'">'.$objp->name."</td>\n";
if ($modecompta == 'CREANCES-DETTES') if ($modecompta == 'CREANCES-DETTES')
print "<td align=\"right\">".price($objp->amount_ht)."</td>\n"; print "<td align=\"right\">".price($objp->amount_ht)."</td>\n";
@ -225,7 +225,7 @@ if ($result) {
// On ajoute les paiements clients anciennes version, non lie par paiement_facture // On ajoute les paiements clients anciennes version, non lie par paiement_facture
if ($modecompta != 'CREANCES-DETTES') if ($modecompta != 'CREANCES-DETTES')
{ {
$sql = "SELECT 'Autres' as nom, '0' as idp, sum(p.amount) as amount_ttc"; $sql = "SELECT 'Autres' as name, '0' as idp, sum(p.amount) as amount_ttc";
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b"; $sql.= " FROM ".MAIN_DB_PREFIX."bank as b";
$sql.= ", ".MAIN_DB_PREFIX."bank_account as ba"; $sql.= ", ".MAIN_DB_PREFIX."bank_account as ba";
$sql.= ", ".MAIN_DB_PREFIX."paiement as p"; $sql.= ", ".MAIN_DB_PREFIX."paiement as p";
@ -236,8 +236,8 @@ if ($modecompta != 'CREANCES-DETTES')
$sql.= " AND ba.entity = ".$conf->entity; $sql.= " AND ba.entity = ".$conf->entity;
if (! empty($date_start) && ! empty($date_end)) if (! empty($date_start) && ! empty($date_end))
$sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'";
$sql.= " GROUP BY nom, idp"; $sql.= " GROUP BY name, idp";
$sql.= " ORDER BY nom"; $sql.= " ORDER BY name";
dol_syslog("get old customer payments not linked to invoices", LOG_DEBUG); dol_syslog("get old customer payments not linked to invoices", LOG_DEBUG);
$result = $db->query($sql); $result = $db->query($sql);
@ -290,7 +290,7 @@ print '</tr>';
*/ */
if ($modecompta == 'CREANCES-DETTES') if ($modecompta == 'CREANCES-DETTES')
{ {
$sql = "SELECT s.nom, s.rowid as socid, sum(f.total_ht) as amount_ht, sum(f.total_ttc) as amount_ttc"; $sql = "SELECT s.nom as name, s.rowid as socid, sum(f.total_ht) as amount_ht, sum(f.total_ttc) as amount_ttc";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql.= ", ".MAIN_DB_PREFIX."facture_fourn as f"; $sql.= ", ".MAIN_DB_PREFIX."facture_fourn as f";
$sql.= " WHERE f.fk_soc = s.rowid"; $sql.= " WHERE f.fk_soc = s.rowid";
@ -338,7 +338,7 @@ if ($result) {
$var=!$var; $var=!$var;
print "<tr ".$bc[$var]."><td>&nbsp;</td>"; print "<tr ".$bc[$var]."><td>&nbsp;</td>";
print "<td>".$langs->trans("Bills")." <a href=\"".DOL_URL_ROOT."/fourn/facture/list.php?socid=".$objp->socid."\">".$objp->nom."</a></td>\n"; print "<td>".$langs->trans("Bills")." <a href=\"".DOL_URL_ROOT."/fourn/facture/list.php?socid=".$objp->socid."\">".$objp->name."</a></td>\n";
if ($modecompta == 'CREANCES-DETTES') if ($modecompta == 'CREANCES-DETTES')
print "<td align=\"right\">".price(-$objp->amount_ht)."</td>\n"; print "<td align=\"right\">".price(-$objp->amount_ht)."</td>\n";
@ -381,7 +381,7 @@ print '<tr><td colspan="4">'.$langs->trans("SocialContributions").' ('.$langs->t
if ($modecompta == 'CREANCES-DETTES') if ($modecompta == 'CREANCES-DETTES')
{ {
$sql = "SELECT c.id, c.libelle as nom, sum(cs.amount) as amount"; $sql = "SELECT c.id, c.libelle as label, sum(cs.amount) as amount";
$sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c";
$sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs";
$sql.= " WHERE cs.fk_type = c.id"; $sql.= " WHERE cs.fk_type = c.id";
@ -391,7 +391,7 @@ if ($modecompta == 'CREANCES-DETTES')
} }
else else
{ {
$sql = "SELECT c.id, c.libelle as nom, sum(p.amount) as amount"; $sql = "SELECT c.id, c.libelle as label, sum(p.amount) as amount";
$sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c";
$sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs";
$sql.= ", ".MAIN_DB_PREFIX."paiementcharge as p"; $sql.= ", ".MAIN_DB_PREFIX."paiementcharge as p";
@ -424,7 +424,7 @@ if ($result) {
$var = !$var; $var = !$var;
print "<tr ".$bc[$var]."><td>&nbsp;</td>"; print "<tr ".$bc[$var]."><td>&nbsp;</td>";
print '<td>'.$obj->nom.'</td>'; print '<td>'.$obj->label.'</td>';
if ($modecompta == 'CREANCES-DETTES') print '<td align="right">'.price(-$obj->amount).'</td>'; if ($modecompta == 'CREANCES-DETTES') print '<td align="right">'.price(-$obj->amount).'</td>';
print '<td align="right">'.price(-$obj->amount).'</td>'; print '<td align="right">'.price(-$obj->amount).'</td>';
print '</tr>'; print '</tr>';
@ -455,7 +455,7 @@ print '<tr><td colspan="4">'.$langs->trans("SocialContributions").' ('.$langs->t
if ($modecompta == 'CREANCES-DETTES') if ($modecompta == 'CREANCES-DETTES')
{ {
$sql = "SELECT c.id, c.libelle as nom, sum(cs.amount) as amount"; $sql = "SELECT c.id, c.libelle as label, sum(cs.amount) as amount";
$sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c";
$sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs";
$sql.= " WHERE cs.fk_type = c.id"; $sql.= " WHERE cs.fk_type = c.id";
@ -468,7 +468,7 @@ if ($modecompta == 'CREANCES-DETTES')
} }
else else
{ {
$sql = "SELECT c.id, c.libelle as nom, sum(p.amount) as amount"; $sql = "SELECT c.id, c.libelle as label, sum(p.amount) as amount";
$sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c";
$sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs";
$sql.= ", ".MAIN_DB_PREFIX."paiementcharge as p"; $sql.= ", ".MAIN_DB_PREFIX."paiementcharge as p";
@ -501,7 +501,7 @@ if ($result) {
$var = !$var; $var = !$var;
print "<tr ".$bc[$var]."><td>&nbsp;</td>"; print "<tr ".$bc[$var]."><td>&nbsp;</td>";
print '<td>'.$obj->nom.'</td>'; print '<td>'.$obj->label.'</td>';
if ($modecompta == 'CREANCES-DETTES') if ($modecompta == 'CREANCES-DETTES')
print '<td align="right">'.price(-$obj->amount).'</td>'; print '<td align="right">'.price(-$obj->amount).'</td>';
print '<td align="right">'.price(-$obj->amount).'</td>'; print '<td align="right">'.price(-$obj->amount).'</td>';
@ -550,7 +550,7 @@ if ($mysoc->tva_assuj == 'franchise') // Non assujeti
if ($conf->salaries->enabled) if ($conf->salaries->enabled)
{ {
print '<tr><td colspan="4">'.$langs->trans("Salaries").'</td></tr>'; print '<tr><td colspan="4">'.$langs->trans("Salaries").'</td></tr>';
$sql = "SELECT u.rowid, u.firstname, u.lastname, p.fk_user, p.label as nom, date_format(p.datep,'%Y-%m') as dm, sum(p.amount) as amount"; $sql = "SELECT u.rowid, u.firstname, u.lastname, p.fk_user, p.label as label, date_format(p.datep,'%Y-%m') as dm, sum(p.amount) as amount";
$sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as p"; $sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as p";
$sql.= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user"; $sql.= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user";
$sql.= " WHERE p.entity = ".$conf->entity; $sql.= " WHERE p.entity = ".$conf->entity;
@ -618,7 +618,7 @@ if ($conf->salaries->enabled)
if ($conf->donation->enabled) if ($conf->donation->enabled)
{ {
print '<tr><td colspan="4">'.$langs->trans("Donation").'</td></tr>'; print '<tr><td colspan="4">'.$langs->trans("Donation").'</td></tr>';
$sql = "SELECT p.societe as nom, p.firstname, p.lastname, date_format(p.datedon,'%Y-%m') as dm, sum(p.amount) as amount"; $sql = "SELECT p.societe as name, p.firstname, p.lastname, date_format(p.datedon,'%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.= " WHERE p.entity = ".$conf->entity; $sql.= " WHERE p.entity = ".$conf->entity;
$sql.= " AND fk_statut=2"; $sql.= " AND fk_statut=2";
@ -650,7 +650,7 @@ if ($conf->donation->enabled)
$var = !$var; $var = !$var;
print "<tr ".$bc[$var]."><td>&nbsp;</td>"; print "<tr ".$bc[$var]."><td>&nbsp;</td>";
print "<td>".$langs->trans("Donation")." <a href=\"".DOL_URL_ROOT."/compta/dons/list.php?search_company=".$obj->nom."&search_name=".$obj->firstname." ".$obj->lastname."\">".$obj->nom. " ".$obj->firstname." ".$obj->lastname."</a></td>\n"; print "<td>".$langs->trans("Donation")." <a href=\"".DOL_URL_ROOT."/compta/dons/list.php?search_company=".$obj->name."&search_name=".$obj->firstname." ".$obj->lastname."\">".$obj->name. " ".$obj->firstname." ".$obj->lastname."</a></td>\n";
if ($modecompta == 'CREANCES-DETTES') print '<td align="right">'.price($obj->amount).'</td>'; if ($modecompta == 'CREANCES-DETTES') print '<td align="right">'.price($obj->amount).'</td>';
print '<td align="right">'.price($obj->amount).'</td>'; print '<td align="right">'.price($obj->amount).'</td>';

View File

@ -153,60 +153,49 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->tax->charges->cr
if ($action == 'confirm_clone' && $confirm != 'yes') { $action=''; } if ($action == 'confirm_clone' && $confirm != 'yes') { $action=''; }
if ($action == 'confirm_clone' && $confirm == 'yes' && ($user->rights->tax->charges->creer)) if ($action == 'confirm_clone' && $confirm == 'yes' && ($user->rights->tax->charges->creer))
{ {
$db->begin();
$db->begin();
$originalId = $id; $originalId = $id;
$object = new ChargeSociales($db);
$object->fetch($id);
if ($object->id > 0) $object = new ChargeSociales($db);
{ $object->fetch($id);
$object->paye = 0;
$object->id = $object->ref = null;
if(GETPOST('clone_for_next_month') != '') {
$object->date_ech = strtotime('+1month', $object->date_ech);
$object->periode = strtotime('+1month', $object->periode);
}
if ($object->check())
{
$id = $object->create($user);
if ($id > 0)
{
$db->commit();
$db->close();
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); if ($object->id > 0)
exit; {
} $object->paye = 0;
else $object->id = $object->ref = null;
{
$id=$originalId; if(GETPOST('clone_for_next_month') != '') {
$db->rollback();
$object->date_ech = strtotime('+1month', $object->date_ech);
if (count($object->errors)) $object->periode = strtotime('+1month', $object->periode);
{ }
setEventMessage($object->errors, 'errors');
dol_print_error($db,$object->errors); if ($object->check())
} {
else $id = $object->create($user);
{ if ($id > 0)
setEventMessage($langs->trans($object->error), 'errors'); {
dol_print_error($db,$object->error); $db->commit();
} $db->close();
}
} header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
} exit;
else }
{ else
$db->rollback(); {
dol_print_error($db,$object->error); $id=$originalId;
} $db->rollback();
setEventMessages($object->error,$object->errors, 'errors');
}
}
}
else
{
$db->rollback();
dol_print_error($db,$object->error);
}
} }
@ -301,18 +290,18 @@ if ($id > 0)
$head=tax_prepare_head($object); $head=tax_prepare_head($object);
dol_fiche_head($head, 'card', $langs->trans("SocialContribution"),0,'bill'); dol_fiche_head($head, 'card', $langs->trans("SocialContribution"),0,'bill');
// Clone confirmation // Clone confirmation
if ($action === 'clone') if ($action === 'clone')
{ {
$formclone=array( $formclone=array(
array('type' => 'checkbox', 'name' => 'clone_for_next_month','label' => $langs->trans("CloneTaxForNextMonth"), 'value' => 1), array('type' => 'checkbox', 'name' => 'clone_for_next_month','label' => $langs->trans("CloneTaxForNextMonth"), 'value' => 1),
); );
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans('CloneTax'),$langs->trans('ConfirmCloneTax',$object->ref),'confirm_clone',$formclone,'yes'); print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans('CloneTax'),$langs->trans('ConfirmCloneTax',$object->ref),'confirm_clone',$formclone,'yes');
} }
// Confirmation de la suppression de la charge // Confirmation de la suppression de la charge
if ($action == 'paid') if ($action == 'paid')
{ {
@ -492,7 +481,7 @@ if ($id > 0)
{ {
print "<a class=\"butAction\" href=\"".DOL_URL_ROOT."/compta/sociales/charges.php?id=$object->id&amp;action=paid\">".$langs->trans("ClassifyPaid")."</a>"; print "<a class=\"butAction\" href=\"".DOL_URL_ROOT."/compta/sociales/charges.php?id=$object->id&amp;action=paid\">".$langs->trans("ClassifyPaid")."</a>";
} }
// Clone // Clone
if ($user->rights->tax->charges->creer) if ($user->rights->tax->charges->creer)
{ {

View File

@ -106,22 +106,23 @@ class ChargeSociales extends CommonObject
return -1; return -1;
} }
} }
/*
* Check if a social contribution can be created into database /**
* * Check if a social contribution can be created into database
*/ *
function check() { * @return boolean True or false
*/
function check()
{
$newamount=price2num($this->amount,'MT'); $newamount=price2num($this->amount,'MT');
// Validation parametres // Validation parametres
if (! $newamount > 0 || empty($this->date_ech) || empty($this->periode)) if (! $newamount > 0 || empty($this->date_ech) || empty($this->periode))
{ {
return false; return false;
} }
return true; return true;
} }
@ -138,7 +139,8 @@ class ChargeSociales extends CommonObject
// Nettoyage parametres // Nettoyage parametres
$newamount=price2num($this->amount,'MT'); $newamount=price2num($this->amount,'MT');
if(!$this->check()) { if (!$this->check())
{
$this->error="ErrorBadParameter"; $this->error="ErrorBadParameter";
return -2; return -2;
} }
@ -357,7 +359,7 @@ class ChargeSociales extends CommonObject
global $langs; global $langs;
$langs->load('customers'); $langs->load('customers');
$langs->load('bills'); $langs->load('bills');
if ($mode == 0) if ($mode == 0)
{ {
if ($statut == 0) return $langs->trans("Unpaid"); if ($statut == 0) return $langs->trans("Unpaid");

View File

@ -110,10 +110,10 @@ $fsearch.=' <input type="text" name="min" id="min" value="'.$min.'" size="6">';
// Affiche en-tete du rapport // Affiche en-tete du rapport
if ($modetax==1) // Calculate on invoice for goods and services if ($modetax==1) // Calculate on invoice for goods and services
{ {
$nom=$langs->trans("VATReportByCustomersInDueDebtMode"); $name=$langs->trans("VATReportByCustomersInDueDebtMode");
$calcmode=$langs->trans("CalcModeVATDebt"); $calcmode=$langs->trans("CalcModeVATDebt");
$calcmode.='<br>('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')'; $calcmode.='<br>('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')';
//$nom.='<br>('.$langs->trans("SeeVATReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&modetax=0">','</a>').')'; //$name.='<br>('.$langs->trans("SeeVATReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&modetax=0">','</a>').')';
$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
//$periodlink=($year_start?"<a href='".$_SERVER["PHP_SELF"]."?year=".($year_start-1)."&modetax=".$modetax."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".($year_start+1)."&modetax=".$modetax."'>".img_next()."</a>":""); //$periodlink=($year_start?"<a href='".$_SERVER["PHP_SELF"]."?year=".($year_start-1)."&modetax=".$modetax."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".($year_start+1)."&modetax=".$modetax."'>".img_next()."</a>":"");
$description=$langs->trans("RulesVATDueServices"); $description=$langs->trans("RulesVATDueServices");
@ -138,10 +138,10 @@ if ($modetax==1) // Calculate on invoice for goods and services
} }
if ($modetax==0) // Invoice for goods, payment for services if ($modetax==0) // Invoice for goods, payment for services
{ {
$nom=$langs->trans("VATReportByCustomersInInputOutputMode"); $name=$langs->trans("VATReportByCustomersInInputOutputMode");
$calcmode=$langs->trans("CalcModeVATEngagement"); $calcmode=$langs->trans("CalcModeVATEngagement");
$calcmode.='<br>('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')'; $calcmode.='<br>('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')';
//$nom.='<br>('.$langs->trans("SeeVATReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&modetax=1">','</a>').')'; //$name.='<br>('.$langs->trans("SeeVATReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&modetax=1">','</a>').')';
$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
//$periodlink=($year_start?"<a href='".$_SERVER["PHP_SELF"]."?year=".($year_start-1)."&modetax=".$modetax."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".($year_start+1)."&modetax=".$modetax."'>".img_next()."</a>":""); //$periodlink=($year_start?"<a href='".$_SERVER["PHP_SELF"]."?year=".($year_start-1)."&modetax=".$modetax."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".($year_start+1)."&modetax=".$modetax."'>".img_next()."</a>":"");
$description=$langs->trans("RulesVATInServices"); $description=$langs->trans("RulesVATInServices");
@ -165,7 +165,7 @@ if ($modetax==0) // Invoice for goods, payment for services
$amountsup=$langs->trans("AmountHT"); $amountsup=$langs->trans("AmountHT");
if ($mysoc->tva_assuj) $vatsup.=' ('.$langs->trans("ToGetBack").')'; if ($mysoc->tva_assuj) $vatsup.=' ('.$langs->trans("ToGetBack").')';
} }
report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,array(),$calcmode); report_header($name,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,array(),$calcmode);
$vatcust=$langs->trans("VATReceived"); $vatcust=$langs->trans("VATReceived");
$vatsup=$langs->trans("VATPaid"); $vatsup=$langs->trans("VATPaid");
@ -223,7 +223,7 @@ if (is_array($coll_list))
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
print '<td class="nowrap">'.$i."</td>"; print '<td class="nowrap">'.$i."</td>";
$company_static->id=$coll->socid; $company_static->id=$coll->socid;
$company_static->nom=$coll->nom; $company_static->name=$coll->name;
$company_static->client=1; $company_static->client=1;
print '<td class="nowrap">'.$company_static->getNomUrl(1,'customer').'</td>'; print '<td class="nowrap">'.$company_static->getNomUrl(1,'customer').'</td>';
$find = array(' ','.'); $find = array(' ','.');
@ -304,7 +304,7 @@ if (is_array($coll_list))
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
print '<td class="nowrap">'.$i."</td>"; print '<td class="nowrap">'.$i."</td>";
$company_static->id=$coll->socid; $company_static->id=$coll->socid;
$company_static->nom=$coll->nom; $company_static->name=$coll->name;
$company_static->fournisseur=1; $company_static->fournisseur=1;
print '<td class="nowrap">'.$company_static->getNomUrl(1,'supplier').'</td>'; print '<td class="nowrap">'.$company_static->getNomUrl(1,'supplier').'</td>';
$find = array(' ','.'); $find = array(' ','.');

View File

@ -185,7 +185,7 @@ class Contact extends CommonObject
{ {
// Call trigger // Call trigger
$result=$this->call_trigger('CONTACT_CREATE',$user); $result=$this->call_trigger('CONTACT_CREATE',$user);
if ($result < 0) { $error++; } if ($result < 0) { $error++; }
// End call triggers // End call triggers
} }
@ -304,7 +304,7 @@ class Contact extends CommonObject
{ {
// Call trigger // Call trigger
$result=$this->call_trigger('CONTACT_MODIFY',$user); $result=$this->call_trigger('CONTACT_MODIFY',$user);
if ($result < 0) { $error++; } if ($result < 0) { $error++; }
// End call triggers // End call triggers
} }
@ -374,7 +374,7 @@ class Contact extends CommonObject
$soc = new Societe($this->db); $soc = new Societe($this->db);
$soc->fetch($this->socid); $soc->fetch($this->socid);
$info[$conf->global->LDAP_CONTACT_FIELD_COMPANY] = $soc->nom; $info[$conf->global->LDAP_CONTACT_FIELD_COMPANY] = $soc->name;
if ($soc->client == 1) $info["businessCategory"] = "Customers"; if ($soc->client == 1) $info["businessCategory"] = "Customers";
if ($soc->client == 2) $info["businessCategory"] = "Prospects"; if ($soc->client == 2) $info["businessCategory"] = "Prospects";
if ($soc->fournisseur == 1) $info["businessCategory"] = "Suppliers"; if ($soc->fournisseur == 1) $info["businessCategory"] = "Suppliers";
@ -774,7 +774,7 @@ class Contact extends CommonObject
{ {
// Call trigger // Call trigger
$result=$this->call_trigger('CONTACT_DELETE',$user); $result=$this->call_trigger('CONTACT_DELETE',$user);
if ($result < 0) { $error++; } if ($result < 0) { $error++; }
// End call triggers // End call triggers
} }
@ -1060,7 +1060,7 @@ class Contact extends CommonObject
{ {
// Call trigger // Call trigger
$result=$this->call_trigger('CONTACT_ENABLEDISABLE',$user); $result=$this->call_trigger('CONTACT_ENABLEDISABLE',$user);
if ($result < 0) { $error++; } if ($result < 0) { $error++; }
// End call triggers // End call triggers
} }

View File

@ -75,7 +75,7 @@ if ($company->id)
if (! $contact->zip) $v->setAddress("", "", $company->address, $company->town, "", $company->zip, $company->country_code, "WORK;POSTAL"); if (! $contact->zip) $v->setAddress("", "", $company->address, $company->town, "", $company->zip, $company->country_code, "WORK;POSTAL");
if ($company->email != $contact->email) $v->setEmail($company->email,'internet'); if ($company->email != $contact->email) $v->setEmail($company->email,'internet');
// Si contact lie a un tiers non de type "particulier" // Si contact lie a un tiers non de type "particulier"
if ($contact->typent_code != 'TE_PRIVATE') $v->setOrg($company->nom); if ($contact->typent_code != 'TE_PRIVATE') $v->setOrg($company->name);
} }
// Personal informations // Personal informations

View File

@ -227,7 +227,7 @@ print "</table><br>";
if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire) if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire)
{ {
$sql = "SELECT c.rowid as ref, c.rowid,"; $sql = "SELECT c.rowid as ref, c.rowid,";
$sql.= " s.nom, s.rowid as socid"; $sql.= " s.nom as name, s.rowid as socid";
$sql .= " FROM ".MAIN_DB_PREFIX."contrat as c, ".MAIN_DB_PREFIX."societe as s"; $sql .= " FROM ".MAIN_DB_PREFIX."contrat as c, ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE s.rowid = c.fk_soc"; $sql.= " WHERE s.rowid = c.fk_soc";
@ -262,7 +262,7 @@ if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire)
print '</td>'; print '</td>';
print '<td>'; print '<td>';
$companystatic->id=$obj->socid; $companystatic->id=$obj->socid;
$companystatic->nom=$obj->nom; $companystatic->name=$obj->name;
$companystatic->client=1; $companystatic->client=1;
print $companystatic->getNomUrl(1,'',16); print $companystatic->getNomUrl(1,'',16);
print '</td>'; print '</td>';
@ -298,7 +298,7 @@ $sql.= ' sum('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NULL OR cd.d
$sql.= ' sum('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NOT NULL AND cd.date_fin_validite < '".$db->idate($now)."')",1,0).') as nb_expired,'; $sql.= ' sum('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NOT NULL AND cd.date_fin_validite < '".$db->idate($now)."')",1,0).') as nb_expired,';
$sql.= ' sum('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NOT NULL AND cd.date_fin_validite < '".$db->idate($now - $conf->contrat->services->expires->warning_delay)."')",1,0).') as nb_late,'; $sql.= ' sum('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NOT NULL AND cd.date_fin_validite < '".$db->idate($now - $conf->contrat->services->expires->warning_delay)."')",1,0).') as nb_late,';
$sql.= ' sum('.$db->ifsql("cd.statut=5",1,0).') as nb_closed,'; $sql.= ' sum('.$db->ifsql("cd.statut=5",1,0).') as nb_closed,';
$sql.= " c.rowid as cid, c.ref, c.datec, c.tms, c.statut, s.nom, s.rowid as socid"; $sql.= " c.rowid as cid, c.ref, c.datec, c.tms, c.statut, s.nom as name, s.rowid as socid";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s,";
if (!$user->rights->societe->client->voir && !$socid) $sql.= " ".MAIN_DB_PREFIX."societe_commerciaux as sc,"; if (!$user->rights->societe->client->voir && !$socid) $sql.= " ".MAIN_DB_PREFIX."societe_commerciaux as sc,";
$sql.= " ".MAIN_DB_PREFIX."contrat as c"; $sql.= " ".MAIN_DB_PREFIX."contrat as c";
@ -342,7 +342,7 @@ if ($result)
print '</td>'; print '</td>';
print '<td>'; print '<td>';
$staticcompany->id=$obj->socid; $staticcompany->id=$obj->socid;
$staticcompany->nom=$obj->nom; $staticcompany->name=$obj->name;
print $staticcompany->getNomUrl(1,'',20); print $staticcompany->getNomUrl(1,'',20);
print '</td>'; print '</td>';
print '<td align="center">'.dol_print_date($obj->tms,'dayhour').'</td>'; print '<td align="center">'.dol_print_date($obj->tms,'dayhour').'</td>';
@ -369,7 +369,7 @@ print '<br>';
// Last modified services // Last modified services
$sql = "SELECT c.ref, c.fk_soc, "; $sql = "SELECT c.ref, c.fk_soc, ";
$sql.= " cd.rowid as cid, cd.statut, cd.label, cd.fk_product, cd.description as note, cd.fk_contrat, cd.date_fin_validite,"; $sql.= " cd.rowid as cid, cd.statut, cd.label, cd.fk_product, cd.description as note, cd.fk_contrat, cd.date_fin_validite,";
$sql.= " s.nom,"; $sql.= " s.nom as name,";
$sql.= " p.rowid as pid, p.ref as pref, p.label as plabel, p.fk_product_type as ptype"; $sql.= " p.rowid as pid, p.ref as pref, p.label as plabel, p.fk_product_type as ptype";
$sql.= " FROM (".MAIN_DB_PREFIX."contrat as c"; $sql.= " FROM (".MAIN_DB_PREFIX."contrat as c";
$sql.= ", ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."societe as s";
@ -423,7 +423,7 @@ if ($resql)
print '</td>'; print '</td>';
print '<td>'; print '<td>';
$staticcompany->id=$obj->fk_soc; $staticcompany->id=$obj->fk_soc;
$staticcompany->nom=$obj->nom; $staticcompany->name=$obj->name;
print $staticcompany->getNomUrl(1,'',20); print $staticcompany->getNomUrl(1,'',20);
print '</td>'; print '</td>';
print '<td class="nowrap" align="right"><a href="'.DOL_URL_ROOT.'/contrat/card.php?id='.$obj->fk_contrat.'&ligne='.$obj->cid.'">'; print '<td class="nowrap" align="right"><a href="'.DOL_URL_ROOT.'/contrat/card.php?id='.$obj->fk_contrat.'&ligne='.$obj->cid.'">';
@ -447,7 +447,7 @@ print '<br>';
// Not activated services // Not activated services
$sql = "SELECT c.ref, c.fk_soc, cd.rowid as cid, cd.statut, cd.label, cd.fk_product, cd.description as note, cd.fk_contrat,"; $sql = "SELECT c.ref, c.fk_soc, cd.rowid as cid, cd.statut, cd.label, cd.fk_product, cd.description as note, cd.fk_contrat,";
$sql.= " s.nom,"; $sql.= " s.nom as name,";
$sql.= " p.rowid as pid, p.ref as pref, p.label as plabel, p.fk_product_type as ptype"; $sql.= " p.rowid as pid, p.ref as pref, p.label as plabel, p.fk_product_type as ptype";
$sql.= " FROM (".MAIN_DB_PREFIX."contrat as c"; $sql.= " FROM (".MAIN_DB_PREFIX."contrat as c";
$sql.= ", ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."societe as s";
@ -503,7 +503,7 @@ if ($resql)
print '</td>'; print '</td>';
print '<td>'; print '<td>';
$staticcompany->id=$obj->fk_soc; $staticcompany->id=$obj->fk_soc;
$staticcompany->nom=$obj->nom; $staticcompany->name=$obj->name;
print $staticcompany->getNomUrl(1,'',20); print $staticcompany->getNomUrl(1,'',20);
print '</td>'; print '</td>';
print '<td width="16" align="right"><a href="ligne.php?id='.$obj->fk_contrat.'&ligne='.$obj->cid.'">'; print '<td width="16" align="right"><a href="ligne.php?id='.$obj->fk_contrat.'&ligne='.$obj->cid.'">';
@ -526,7 +526,7 @@ print '<br>';
// Expired services // Expired services
$sql = "SELECT c.ref, c.fk_soc, cd.rowid as cid, cd.statut, cd.label, cd.fk_product, cd.description as note, cd.fk_contrat,"; $sql = "SELECT c.ref, c.fk_soc, cd.rowid as cid, cd.statut, cd.label, cd.fk_product, cd.description as note, cd.fk_contrat,";
$sql.= " s.nom,"; $sql.= " s.nom as name,";
$sql.= " p.rowid as pid, p.ref as pref, p.label as plabel, p.fk_product_type as ptype"; $sql.= " p.rowid as pid, p.ref as pref, p.label as plabel, p.fk_product_type as ptype";
$sql.= " FROM (".MAIN_DB_PREFIX."contrat as c"; $sql.= " FROM (".MAIN_DB_PREFIX."contrat as c";
$sql.= ", ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."societe as s";
@ -583,7 +583,7 @@ if ($resql)
print '</td>'; print '</td>';
print '<td>'; print '<td>';
$staticcompany->id=$obj->fk_soc; $staticcompany->id=$obj->fk_soc;
$staticcompany->nom=$obj->nom; $staticcompany->name=$obj->name;
print $staticcompany->getNomUrl(1,'',20); print $staticcompany->getNomUrl(1,'',20);
print '</td>'; print '</td>';
print '<td width="16" align="right"><a href="ligne.php?id='.$obj->fk_contrat.'&ligne='.$obj->cid.'">'; print '<td width="16" align="right"><a href="ligne.php?id='.$obj->fk_contrat.'&ligne='.$obj->cid.'">';

View File

@ -96,9 +96,8 @@ if (!empty($search_ref_supplier)) {
if ($sall) { if ($sall) {
$sql .= natural_search(array('s.nom', 'cd.label', 'cd.description'), $sall); $sql .= natural_search(array('s.nom', 'cd.label', 'cd.description'), $sall);
} }
$sql.= " GROUP BY c.rowid, c.ref, c.datec, c.date_contrat, c.statut,"; $sql.= " GROUP BY c.rowid, c.ref, c.datec, c.date_contrat, c.statut, s.nom, s.rowid";
$sql.= " s.nom, s.rowid"; $sql.= $db->order($sortfield,$sortorder);
$sql.= " ORDER BY $sortfield $sortorder";
$sql.= $db->plimit($conf->liste_limit + 1, $offset); $sql.= $db->plimit($conf->liste_limit + 1, $offset);
$resql=$db->query($sql); $resql=$db->query($sql);
@ -157,7 +156,7 @@ if ($resql)
if ($obj->nb_late) print img_warning($langs->trans("Late")); if ($obj->nb_late) print img_warning($langs->trans("Late"));
print '</td>'; print '</td>';
print '<td>'.$obj->ref_supplier.'</td>'; print '<td>'.$obj->ref_supplier.'</td>';
print '<td><a href="../comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->nom.'</a></td>'; print '<td><a href="../comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->name.'</a></td>';
//print '<td align="center">'.dol_print_date($obj->datec).'</td>'; //print '<td align="center">'.dol_print_date($obj->datec).'</td>';
print '<td align="center">'.dol_print_date($db->jdate($obj->date_contrat)).'</td>'; print '<td align="center">'.dol_print_date($db->jdate($obj->date_contrat)).'</td>';
//print '<td align="center">'.$staticcontrat->LibStatut($obj->statut,3).'</td>'; //print '<td align="center">'.$staticcontrat->LibStatut($obj->statut,3).'</td>';

View File

@ -80,7 +80,7 @@ $form=new Form($db);
llxHeader(); llxHeader();
$sql = "SELECT c.rowid as cid, c.ref, c.statut as cstatut,"; $sql = "SELECT c.rowid as cid, c.ref, c.statut as cstatut,";
$sql.= " s.rowid as socid, s.nom,"; $sql.= " s.rowid as socid, s.nom as name,";
$sql.= " cd.rowid, cd.description, cd.statut,"; $sql.= " cd.rowid, cd.description, cd.statut,";
$sql.= " p.rowid as pid, p.ref as pref, p.label as label, p.fk_product_type as ptype,"; $sql.= " p.rowid as pid, p.ref as pref, p.label as label, p.fk_product_type as ptype,";
if (!$user->rights->societe->client->voir && !$socid) $sql .= " sc.fk_soc, sc.fk_user,"; if (!$user->rights->societe->client->voir && !$socid) $sql .= " sc.fk_soc, sc.fk_user,";
@ -225,7 +225,7 @@ if ($resql)
// Third party // Third party
print '<td>'; print '<td>';
$companystatic->id=$obj->socid; $companystatic->id=$obj->socid;
$companystatic->nom=$obj->nom; $companystatic->name=$obj->name;
$companystatic->client=1; $companystatic->client=1;
print $companystatic->getNomUrl(1,'customer',28); print $companystatic->getNomUrl(1,'customer',28);
print '</td>'; print '</td>';

View File

@ -64,7 +64,7 @@ class box_actions extends ModeleBoxes
{ {
$sql = "SELECT a.id, a.label, a.datep as dp, a.percent as percentage,"; $sql = "SELECT a.id, a.label, a.datep as dp, a.percent as percentage,";
$sql.= " ta.code,"; $sql.= " ta.code,";
$sql.= " s.nom, s.rowid as socid"; $sql.= " s.nom as name, s.rowid as socid";
$sql.= " FROM (".MAIN_DB_PREFIX."c_actioncomm AS ta, "; $sql.= " FROM (".MAIN_DB_PREFIX."c_actioncomm AS ta, ";
$sql.= MAIN_DB_PREFIX."actioncomm AS a)"; $sql.= MAIN_DB_PREFIX."actioncomm AS a)";
if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc"; if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
@ -112,7 +112,7 @@ class box_actions extends ModeleBoxes
'url' => ($objp->socid?DOL_URL_ROOT."/societe/soc.php?socid=".$objp->socid:'')); 'url' => ($objp->socid?DOL_URL_ROOT."/societe/soc.php?socid=".$objp->socid:''));
$this->info_box_contents[$i][3] = array('td' => 'align="left"', $this->info_box_contents[$i][3] = array('td' => 'align="left"',
'text' => dol_trunc($objp->nom,24), 'text' => dol_trunc($objp->name,24),
'url' => DOL_URL_ROOT."/societe/soc.php?socid=".$objp->socid); 'url' => DOL_URL_ROOT."/societe/soc.php?socid=".$objp->socid);
$this->info_box_contents[$i][4] = array('td' => 'align="left" class="nowrap"', $this->info_box_contents[$i][4] = array('td' => 'align="left" class="nowrap"',
@ -155,7 +155,7 @@ class box_actions extends ModeleBoxes
global $langs, $conf; global $langs, $conf;
parent::showBox($this->info_box_head, $this->info_box_contents); parent::showBox($this->info_box_head, $this->info_box_contents);
if ($conf->global->SHOW_DIALOG_HOMEPAGE) if ($conf->global->SHOW_DIALOG_HOMEPAGE)
{ {
$actioncejour=false; $actioncejour=false;
$contents=$this->info_box_contents; $contents=$this->info_box_contents;
$nblines=count($contents); $nblines=count($contents);
@ -170,7 +170,7 @@ class box_actions extends ModeleBoxes
if (isset($contents[$i])) if (isset($contents[$i]))
{ {
// on affiche que les évènement du jours ou passé // on affiche que les évènement du jours ou passé
// qui ne sont pas à 100% // qui ne sont pas à 100%
$actioncejour=true; $actioncejour=true;
$var=!$var; $var=!$var;
// TR // TR
@ -193,8 +193,8 @@ class box_actions extends ModeleBoxes
print '</tr>'; print '</tr>';
} }
} }
print '</table>'; print '</table>';
} }
print '</div>'; print '</div>';
if ($actioncejour) if ($actioncejour)

View File

@ -63,7 +63,7 @@ class box_clients extends ModeleBoxes
if ($user->rights->societe->lire) if ($user->rights->societe->lire)
{ {
$sql = "SELECT s.nom, s.rowid as socid, s.datec, s.tms, s.status"; $sql = "SELECT s.nom as name, s.rowid as socid, s.datec, s.tms, s.status";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE s.client IN (1, 3)"; $sql.= " WHERE s.client IN (1, 3)";
@ -93,7 +93,7 @@ class box_clients extends ModeleBoxes
'url' => $url.$objp->socid); 'url' => $url.$objp->socid);
$this->info_box_contents[$i][1] = array('td' => 'align="left"', $this->info_box_contents[$i][1] = array('td' => 'align="left"',
'text' => $objp->nom, 'text' => $objp->name,
'url' => $url.$objp->socid); 'url' => $url.$objp->socid);
$this->info_box_contents[$i][2] = array('td' => 'align="right"', $this->info_box_contents[$i][2] = array('td' => 'align="right"',

View File

@ -63,7 +63,7 @@ class box_commandes extends ModeleBoxes
if ($user->rights->commande->lire) if ($user->rights->commande->lire)
{ {
$sql = "SELECT s.nom, s.rowid as socid,"; $sql = "SELECT s.nom as name, s.rowid as socid,";
$sql.= " c.ref, c.tms, c.rowid,"; $sql.= " c.ref, c.tms, c.rowid,";
$sql.= " c.fk_statut, c.facture"; $sql.= " c.fk_statut, c.facture";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
@ -101,7 +101,7 @@ class box_commandes extends ModeleBoxes
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid); 'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);
$this->info_box_contents[$i][3] = array('td' => 'align="left"', $this->info_box_contents[$i][3] = array('td' => 'align="left"',
'text' => $objp->nom, 'text' => $objp->name,
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid); 'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);
$this->info_box_contents[$i][4] = array('td' => 'align="right"', $this->info_box_contents[$i][4] = array('td' => 'align="right"',

View File

@ -60,7 +60,7 @@ class box_contracts extends ModeleBoxes
if ($user->rights->contrat->lire) if ($user->rights->contrat->lire)
{ {
$sql = "SELECT s.nom, s.rowid as socid,"; $sql = "SELECT s.nom as name, s.rowid as socid,";
$sql.= " c.rowid, c.ref, c.statut as fk_statut, c.date_contrat, c.datec, c.fin_validite, c.date_cloture"; $sql.= " c.rowid, c.ref, c.statut as fk_statut, c.date_contrat, c.datec, c.fin_validite, c.date_cloture";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as c"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as c";
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -108,7 +108,7 @@ class box_contracts extends ModeleBoxes
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid); 'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);
$this->info_box_contents[$i][3] = array('td' => 'align="left"', $this->info_box_contents[$i][3] = array('td' => 'align="left"',
'text' => dol_trunc($objp->nom,40), 'text' => dol_trunc($objp->name,40),
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid); 'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);
$this->info_box_contents[$i][4] = array('td' => 'align="right"', $this->info_box_contents[$i][4] = array('td' => 'align="right"',

View File

@ -66,7 +66,7 @@ class box_factures extends ModeleBoxes
{ {
$sql = "SELECT f.rowid as facid, f.facnumber, f.type, f.amount, f.datef as df"; $sql = "SELECT f.rowid as facid, f.facnumber, f.type, f.amount, f.datef as df";
$sql.= ", f.paye, f.fk_statut, f.datec, f.tms"; $sql.= ", f.paye, f.fk_statut, f.datec, f.tms";
$sql.= ", s.nom, s.rowid as socid"; $sql.= ", s.nom as name, s.rowid as socid";
$sql.= ", f.date_lim_reglement as datelimite"; $sql.= ", f.date_lim_reglement as datelimite";
$sql.= " FROM (".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f"; $sql.= " FROM (".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -113,7 +113,7 @@ class box_factures extends ModeleBoxes
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid); 'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);
$this->info_box_contents[$i][3] = array('td' => 'align="left"', $this->info_box_contents[$i][3] = array('td' => 'align="left"',
'text' => $objp->nom, 'text' => $objp->name,
'maxlength'=>40, 'maxlength'=>40,
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid); 'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);

View File

@ -63,7 +63,7 @@ class box_factures_fourn extends ModeleBoxes
if ($user->rights->fournisseur->facture->lire) if ($user->rights->fournisseur->facture->lire)
{ {
$sql = "SELECT s.nom, s.rowid as socid,"; $sql = "SELECT s.nom as name, s.rowid as socid,";
$sql.= " f.rowid as facid, f.ref, f.ref_supplier, f.amount,"; $sql.= " f.rowid as facid, f.ref, f.ref_supplier, f.amount,";
$sql.= " f.paye, f.fk_statut,"; $sql.= " f.paye, f.fk_statut,";
$sql.= ' f.datef as df,'; $sql.= ' f.datef as df,';
@ -115,7 +115,7 @@ class box_factures_fourn extends ModeleBoxes
'url' => DOL_URL_ROOT."/fourn/card.php?socid=".$objp->socid); 'url' => DOL_URL_ROOT."/fourn/card.php?socid=".$objp->socid);
$this->info_box_contents[$i][4] = array('td' => 'align="left"', $this->info_box_contents[$i][4] = array('td' => 'align="left"',
'text' => $objp->nom, 'text' => $objp->name,
'url' => DOL_URL_ROOT."/fourn/card.php?socid=".$objp->socid); 'url' => DOL_URL_ROOT."/fourn/card.php?socid=".$objp->socid);
$this->info_box_contents[$i][5] = array('td' => 'align="right"', $this->info_box_contents[$i][5] = array('td' => 'align="right"',

View File

@ -60,7 +60,7 @@ class box_factures_fourn_imp extends ModeleBoxes
if ($user->rights->fournisseur->facture->lire) if ($user->rights->fournisseur->facture->lire)
{ {
$sql = "SELECT s.nom, s.rowid as socid,"; $sql = "SELECT s.nom as name, s.rowid as socid,";
$sql.= " f.rowid as facid, f.ref, f.ref_supplier, f.date_lim_reglement as datelimite,"; $sql.= " f.rowid as facid, f.ref, f.ref_supplier, f.date_lim_reglement as datelimite,";
$sql.= " f.amount, f.datef as df,"; $sql.= " f.amount, f.datef as df,";
$sql.= " f.paye, f.fk_statut, f.type"; $sql.= " f.paye, f.fk_statut, f.type";
@ -111,7 +111,7 @@ class box_factures_fourn_imp extends ModeleBoxes
'url' => DOL_URL_ROOT."/fourn/card.php?socid=".$objp->socid); 'url' => DOL_URL_ROOT."/fourn/card.php?socid=".$objp->socid);
$this->info_box_contents[$i][4] = array('td' => 'align="left"', $this->info_box_contents[$i][4] = array('td' => 'align="left"',
'text' => $objp->nom, 'text' => $objp->name,
'url' => DOL_URL_ROOT."/fourn/card.php?socid=".$objp->socid); 'url' => DOL_URL_ROOT."/fourn/card.php?socid=".$objp->socid);
$this->info_box_contents[$i][5] = array('td' => 'align="right"', $this->info_box_contents[$i][5] = array('td' => 'align="right"',

View File

@ -63,7 +63,7 @@ class box_factures_imp extends ModeleBoxes
if ($user->rights->facture->lire) if ($user->rights->facture->lire)
{ {
$sql = "SELECT s.nom, s.rowid as socid,"; $sql = "SELECT s.nom as name, s.rowid as socid,";
$sql.= " f.facnumber, f.date_lim_reglement as datelimite,"; $sql.= " f.facnumber, f.date_lim_reglement as datelimite,";
$sql.= " f.amount, f.datef as df,"; $sql.= " f.amount, f.datef as df,";
$sql.= " f.paye, f.fk_statut, f.rowid as facid"; $sql.= " f.paye, f.fk_statut, f.rowid as facid";
@ -110,7 +110,7 @@ class box_factures_imp extends ModeleBoxes
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid); 'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);
$this->info_box_contents[$i][3] = array('td' => 'align="left"', $this->info_box_contents[$i][3] = array('td' => 'align="left"',
'text' => $objp->nom, 'text' => $objp->name,
'maxlength'=>44, 'maxlength'=>44,
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid); 'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);

View File

@ -65,7 +65,7 @@ class box_ficheinter extends ModeleBoxes
$sql.= " f.datec,"; $sql.= " f.datec,";
$sql.= " f.date_valid as datev,"; $sql.= " f.date_valid as datev,";
$sql.= " f.tms as datem,"; $sql.= " f.tms as datem,";
$sql.= " s.nom, s.rowid as socid, s.client"; $sql.= " s.nom as name, s.rowid as socid, s.client";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
if (! $user->rights->societe->client->voir) if (! $user->rights->societe->client->voir)
$sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -109,7 +109,7 @@ class box_ficheinter extends ModeleBoxes
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid); 'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);
$this->info_box_contents[$i][3] = array('td' => 'align="left"', $this->info_box_contents[$i][3] = array('td' => 'align="left"',
'text' => dol_trunc($objp->nom,40), 'text' => dol_trunc($objp->name,40),
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid); 'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);
$this->info_box_contents[$i][4] = array('td' => 'align="right"', $this->info_box_contents[$i][4] = array('td' => 'align="right"',

View File

@ -62,7 +62,7 @@ class box_fournisseurs extends ModeleBoxes
if ($user->rights->societe->lire) if ($user->rights->societe->lire)
{ {
$sql = "SELECT s.nom, s.rowid as socid, s.datec, s.tms, s.status"; $sql = "SELECT s.nom as name, s.rowid as socid, s.datec, s.tms, s.status";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE s.fournisseur = 1"; $sql.= " WHERE s.fournisseur = 1";
@ -89,7 +89,7 @@ class box_fournisseurs extends ModeleBoxes
'url' => DOL_URL_ROOT."/fourn/card.php?socid=".$objp->socid); 'url' => DOL_URL_ROOT."/fourn/card.php?socid=".$objp->socid);
$this->info_box_contents[$i][1] = array('td' => 'align="left"', $this->info_box_contents[$i][1] = array('td' => 'align="left"',
'text' => $objp->nom, 'text' => $objp->name,
'url' => DOL_URL_ROOT."/fourn/card.php?socid=".$objp->socid); 'url' => DOL_URL_ROOT."/fourn/card.php?socid=".$objp->socid);
$this->info_box_contents[$i][2] = array('td' => 'align="right"', $this->info_box_contents[$i][2] = array('td' => 'align="right"',

View File

@ -62,7 +62,7 @@ class box_propales extends ModeleBoxes
if ($user->rights->propale->lire) if ($user->rights->propale->lire)
{ {
$sql = "SELECT s.nom, s.rowid as socid,"; $sql = "SELECT s.nom as name, s.rowid as socid,";
$sql.= " p.rowid, p.ref, p.fk_statut, p.datep as dp, p.datec, p.fin_validite, p.date_cloture"; $sql.= " p.rowid, p.ref, p.fk_statut, p.datep as dp, p.datec, p.fin_validite, p.date_cloture";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql.= ", ".MAIN_DB_PREFIX."propal as p"; $sql.= ", ".MAIN_DB_PREFIX."propal as p";
@ -106,7 +106,7 @@ class box_propales extends ModeleBoxes
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid); 'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);
$this->info_box_contents[$i][3] = array('td' => 'align="left"', $this->info_box_contents[$i][3] = array('td' => 'align="left"',
'text' => dol_trunc($objp->nom,40), 'text' => dol_trunc($objp->name,40),
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid); 'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);
$this->info_box_contents[$i][4] = array('td' => 'align="right"', $this->info_box_contents[$i][4] = array('td' => 'align="right"',

View File

@ -63,7 +63,7 @@ class box_prospect extends ModeleBoxes
if ($user->rights->societe->lire) if ($user->rights->societe->lire)
{ {
$sql = "SELECT s.nom, s.rowid as socid, s.fk_stcomm, s.datec, s.tms, s.status"; $sql = "SELECT s.nom as name, s.rowid as socid, s.fk_stcomm, s.datec, s.tms, s.status";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE s.client IN (2, 3)"; $sql.= " WHERE s.client IN (2, 3)";
@ -92,7 +92,7 @@ class box_prospect extends ModeleBoxes
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid); 'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);
$this->info_box_contents[$i][1] = array('td' => 'align="left"', $this->info_box_contents[$i][1] = array('td' => 'align="left"',
'text' => $objp->nom, 'text' => $objp->name,
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid); 'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);
$this->info_box_contents[$i][2] = array('td' => 'align="right"', $this->info_box_contents[$i][2] = array('td' => 'align="right"',

View File

@ -62,7 +62,7 @@ class box_services_contracts extends ModeleBoxes
if ($user->rights->service->lire && $user->rights->contrat->lire) if ($user->rights->service->lire && $user->rights->contrat->lire)
{ {
$sql = "SELECT s.nom, s.rowid as socid,"; $sql = "SELECT s.nom as name, s.rowid as socid,";
$sql.= " c.rowid,"; $sql.= " c.rowid,";
$sql.= " cd.rowid as cdid, cd.tms as datem, cd.statut,"; $sql.= " cd.rowid as cdid, cd.tms as datem, cd.statut,";
$sql.= " p.rowid as pid, p.label, p.fk_product_type"; $sql.= " p.rowid as pid, p.label, p.fk_product_type";
@ -125,7 +125,7 @@ class box_services_contracts extends ModeleBoxes
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid); 'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);
$this->info_box_contents[$i][3] = array('td' => 'align="left"', $this->info_box_contents[$i][3] = array('td' => 'align="left"',
'text' => $objp->nom, 'text' => $objp->name,
'maxlength' => 28, 'maxlength' => 28,
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid); 'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);

View File

@ -63,7 +63,7 @@ class box_services_expired extends ModeleBoxes
// Select contracts with at least one expired service // Select contracts with at least one expired service
$sql = "SELECT "; $sql = "SELECT ";
$sql.= " c.rowid, c.ref, c.statut as fk_statut, c.date_contrat,"; $sql.= " c.rowid, c.ref, c.statut as fk_statut, c.date_contrat,";
$sql.= " s.nom, s.rowid as socid,"; $sql.= " s.nom as name, s.rowid as socid,";
$sql.= " MIN(cd.date_fin_validite) as date_line, COUNT(cd.rowid) as nb_services"; $sql.= " MIN(cd.date_fin_validite) as date_line, COUNT(cd.rowid) as nb_services";
$sql.= " FROM ".MAIN_DB_PREFIX."contrat as c, ".MAIN_DB_PREFIX."societe s, ".MAIN_DB_PREFIX."contratdet as cd"; $sql.= " FROM ".MAIN_DB_PREFIX."contrat as c, ".MAIN_DB_PREFIX."societe s, ".MAIN_DB_PREFIX."contratdet as cd";
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -104,7 +104,7 @@ class box_services_expired extends ModeleBoxes
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid); 'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);
$this->info_box_contents[$i][3] = array('td' => 'align="left"', $this->info_box_contents[$i][3] = array('td' => 'align="left"',
'text' => dol_trunc($objp->nom,40), 'text' => dol_trunc($objp->name,40),
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid); 'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);
$this->info_box_contents[$i][4] = array('td' => 'align="center"', $this->info_box_contents[$i][4] = array('td' => 'align="center"',

View File

@ -62,7 +62,7 @@ class box_supplier_orders extends ModeleBoxes
if ($user->rights->fournisseur->commande->lire) if ($user->rights->fournisseur->commande->lire)
{ {
$sql = "SELECT s.nom, s.rowid as socid,"; $sql = "SELECT s.nom as name, s.rowid as socid,";
$sql.= " c.ref, c.tms, c.rowid,"; $sql.= " c.ref, c.tms, c.rowid,";
$sql.= " c.fk_statut"; $sql.= " c.fk_statut";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
@ -102,7 +102,7 @@ class box_supplier_orders extends ModeleBoxes
'url' => $urls); 'url' => $urls);
$this->info_box_contents[$i][3] = array('td' => 'align="left"', $this->info_box_contents[$i][3] = array('td' => 'align="left"',
'text' => $objp->nom, 'text' => $objp->name,
'url' => $urls); 'url' => $urls);
$this->info_box_contents[$i][4] = array('td' => 'align="right"', $this->info_box_contents[$i][4] = array('td' => 'align="right"',

View File

@ -157,8 +157,6 @@ class HookManager
{ {
if (! empty($modules)) if (! empty($modules))
{ {
$modulealreadyexecuted[$context]=array(); // Filter by context
foreach($modules as $module => $actionclassinstance) foreach($modules as $module => $actionclassinstance)
{ {
//print "Before hook ".get_class($actionclassinstance)." method=".$method." hooktype=".$hooktype." results=".count($actionclassinstance->results)." resprints=".count($actionclassinstance->resprints)." resaction=".$resaction." result=".$result."<br>\n"; //print "Before hook ".get_class($actionclassinstance)." method=".$method." hooktype=".$hooktype." results=".count($actionclassinstance->results)." resprints=".count($actionclassinstance->resprints)." resaction=".$resaction." result=".$result."<br>\n";
@ -167,8 +165,8 @@ class HookManager
// jump to next class if method does not exists // jump to next class if method does not exists
if (! method_exists($actionclassinstance,$method)) continue; if (! method_exists($actionclassinstance,$method)) continue;
// test to avoid to run twice a hook, when a module implements several active contexts // test to avoid to run twice a hook, when a module implements several active contexts
if (in_array($module,$modulealreadyexecuted[$context])) continue; if (in_array($module,$modulealreadyexecuted)) continue;
$modulealreadyexecuted[$context][$module]=$module; // Use the $currentcontext in method for avoid to run twice $modulealreadyexecuted[$module]=$module; // Use the $currentcontext in method for avoid to run twice
// Add current context for avoid method execution in bad context, you can add this test in your method : eg if($currentcontext != 'formfile') return; // Add current context for avoid method execution in bad context, you can add this test in your method : eg if($currentcontext != 'formfile') return;
$parameters['currentcontext'] = $context; $parameters['currentcontext'] = $context;
// Hooks that must return int (hooks with type 'addreplace') // Hooks that must return int (hooks with type 'addreplace')

View File

@ -769,7 +769,7 @@ class Form
$outarray=array(); $outarray=array();
// On recherche les societes // On recherche les societes
$sql = "SELECT s.rowid, s.nom, s.client, s.fournisseur, s.code_client, s.code_fournisseur"; $sql = "SELECT s.rowid, s.nom as name, s.client, s.fournisseur, s.code_client, s.code_fournisseur";
$sql.= " FROM ".MAIN_DB_PREFIX ."societe as s"; $sql.= " FROM ".MAIN_DB_PREFIX ."societe as s";
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE s.entity IN (".getEntity('societe', 1).")"; $sql.= " WHERE s.entity IN (".getEntity('societe', 1).")";
@ -836,11 +836,11 @@ class Form
if (($obj->fournisseur) && (!empty($obj->code_fournisseur))) { if (($obj->fournisseur) && (!empty($obj->code_fournisseur))) {
$label .= $obj->code_fournisseur. ' - '; $label .= $obj->code_fournisseur. ' - ';
} }
$label.=' '.$obj->nom; $label.=' '.$obj->name;
} }
else else
{ {
$label=$obj->nom; $label=$obj->name;
} }
if ($showtype) if ($showtype)
@ -996,16 +996,12 @@ class Form
// On recherche les societes // On recherche les societes
$sql = "SELECT sp.rowid, sp.lastname, sp.statut, sp.firstname, sp.poste"; $sql = "SELECT sp.rowid, sp.lastname, sp.statut, sp.firstname, sp.poste";
if ($showsoc > 0) { if ($showsoc > 0) $sql.= " , s.nom as company";
$sql.= " , s.nom as company";
}
$sql.= " FROM ".MAIN_DB_PREFIX ."socpeople as sp"; $sql.= " FROM ".MAIN_DB_PREFIX ."socpeople as sp";
if ($showsoc > 0) { if ($showsoc > 0) $sql.= " LEFT OUTER JOIN ".MAIN_DB_PREFIX ."societe as s ON s.rowid=sp.fk_soc";
$sql.= " LEFT OUTER JOIN ".MAIN_DB_PREFIX ."societe as s ON s.rowid=sp.fk_soc ";
}
$sql.= " WHERE sp.entity IN (".getEntity('societe', 1).")"; $sql.= " WHERE sp.entity IN (".getEntity('societe', 1).")";
if ($socid > 0) $sql.= " AND sp.fk_soc=".$socid; if ($socid > 0) $sql.= " AND sp.fk_soc=".$socid;
if (! empty($conf->global->CONTACT_HIDE_INACTIVE_IN_COMBOBOX)) $sql.= " AND sp.statut<>0 "; if (! empty($conf->global->CONTACT_HIDE_INACTIVE_IN_COMBOBOX)) $sql.= " AND sp.statut<>0";
$sql.= " ORDER BY sp.lastname ASC"; $sql.= " ORDER BY sp.lastname ASC";
dol_syslog(get_class($this)."::select_contacts", LOG_DEBUG); dol_syslog(get_class($this)."::select_contacts", LOG_DEBUG);
@ -1839,7 +1835,7 @@ class Form
$sql = "SELECT p.rowid, p.label, p.ref, p.price, p.duration,"; $sql = "SELECT p.rowid, p.label, p.ref, p.price, p.duration,";
$sql.= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.quantity, pfp.remise_percent, pfp.remise, pfp.unitprice,"; $sql.= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.quantity, pfp.remise_percent, pfp.remise, pfp.unitprice,";
$sql.= " s.nom"; $sql.= " s.nom as name";
$sql.= " FROM ".MAIN_DB_PREFIX."product as p"; $sql.= " FROM ".MAIN_DB_PREFIX."product as p";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
if ($socid) $sql.= " AND pfp.fk_soc = ".$socid; if ($socid) $sql.= " AND pfp.fk_soc = ".$socid;
@ -1951,8 +1947,8 @@ class Form
} }
if (! $socid) if (! $socid)
{ {
$opt .= " - ".dol_trunc($objp->nom,8); $opt .= " - ".dol_trunc($objp->name,8);
$outval.=" - ".dol_trunc($objp->nom,8); $outval.=" - ".dol_trunc($objp->name,8);
} }
} }
else else
@ -2007,7 +2003,7 @@ class Form
$sql = "SELECT p.rowid, p.label, p.ref, p.price, p.duration,"; $sql = "SELECT p.rowid, p.label, p.ref, p.price, p.duration,";
$sql.= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.quantity, pfp.unitprice,"; $sql.= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.quantity, pfp.unitprice,";
$sql.= " s.nom"; $sql.= " s.nom as name";
$sql.= " FROM ".MAIN_DB_PREFIX."product as p"; $sql.= " FROM ".MAIN_DB_PREFIX."product as p";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON pfp.fk_soc = s.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON pfp.fk_soc = s.rowid";
@ -2044,7 +2040,7 @@ class Form
if($num == 1) { if($num == 1) {
$opt .= ' selected="selected"'; $opt .= ' selected="selected"';
} }
$opt.= '>'.$objp->nom.' - '.$objp->ref_fourn.' - '; $opt.= '>'.$objp->name.' - '.$objp->ref_fourn.' - ';
if ($objp->quantity == 1) if ($objp->quantity == 1)
{ {
@ -4433,7 +4429,7 @@ class Form
$out=''; $out='';
// On recherche les groupes // On recherche les groupes
$sql = "SELECT ug.rowid, ug.nom "; $sql = "SELECT ug.rowid, ug.nom as name";
if (! empty($conf->multicompany->enabled) && $conf->entity == 1 && $user->admin && ! $user->entity) if (! empty($conf->multicompany->enabled) && $conf->entity == 1 && $user->admin && ! $user->entity)
{ {
$sql.= ", e.label"; $sql.= ", e.label";
@ -4478,7 +4474,7 @@ class Form
} }
$out.= '>'; $out.= '>';
$out.= $obj->nom; $out.= $obj->name;
if (! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode) && $conf->entity == 1) if (! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode) && $conf->entity == 1)
{ {
$out.= " (".$obj->label.")"; $out.= " (".$obj->label.")";

View File

@ -222,7 +222,7 @@ class FormCompany
$out=''; $out='';
// On recherche les departements/cantons/province active d'une region et pays actif // On recherche les departements/cantons/province active d'une region et pays actif
$sql = "SELECT d.rowid, d.code_departement as code , d.nom, d.active, c.label as country, c.code as country_code FROM"; $sql = "SELECT d.rowid, d.code_departement as code, d.nom as name, d.active, c.label as country, c.code as country_code FROM";
$sql .= " ".MAIN_DB_PREFIX ."c_departements as d, ".MAIN_DB_PREFIX."c_regions as r,".MAIN_DB_PREFIX."c_country as c"; $sql .= " ".MAIN_DB_PREFIX ."c_departements as d, ".MAIN_DB_PREFIX."c_regions as r,".MAIN_DB_PREFIX."c_country as c";
$sql .= " WHERE d.fk_region=r.code_region and r.fk_pays=c.rowid"; $sql .= " WHERE d.fk_region=r.code_region and r.fk_pays=c.rowid";
$sql .= " AND d.active = 1 AND r.active = 1 AND c.active = 1"; $sql .= " AND d.active = 1 AND r.active = 1 AND c.active = 1";
@ -270,7 +270,7 @@ class FormCompany
$out.= '<option value="'.$obj->rowid.'">'; $out.= '<option value="'.$obj->rowid.'">';
} }
// Si traduction existe, on l'utilise, sinon on prend le libelle par defaut // Si traduction existe, on l'utilise, sinon on prend le libelle par defaut
$out.= $obj->code . ' - ' . ($langs->trans($obj->code)!=$obj->code?$langs->trans($obj->code):($obj->nom!='-'?$obj->nom:'')); $out.= $obj->code . ' - ' . ($langs->trans($obj->code)!=$obj->code?$langs->trans($obj->code):($obj->name!='-'?$obj->name:''));
$out.= '</option>'; $out.= '</option>';
} }
$i++; $i++;
@ -292,7 +292,7 @@ class FormCompany
* Retourne la liste deroulante des regions actives dont le pays est actif * Retourne la liste deroulante des regions actives dont le pays est actif
* La cle de la liste est le code (il peut y avoir plusieurs entree pour * La cle de la liste est le code (il peut y avoir plusieurs entree pour
* un code donnee mais dans ce cas, le champ pays et lang differe). * un code donnee mais dans ce cas, le champ pays et lang differe).
* Ainsi les liens avec les regions se font sur une region independemment de son nom. * Ainsi les liens avec les regions se font sur une region independemment de son name.
* *
* @param string $selected Preselected value * @param string $selected Preselected value
* @param string $htmlname Name of HTML select field * @param string $htmlname Name of HTML select field
@ -529,20 +529,20 @@ class FormCompany
global $conf, $langs; global $conf, $langs;
// On recherche les societes // On recherche les societes
$sql = "SELECT s.rowid, s.nom FROM"; $sql = "SELECT s.rowid, s.nom as name FROM";
$sql.= " ".MAIN_DB_PREFIX."societe as s"; $sql.= " ".MAIN_DB_PREFIX."societe as s";
$sql.= " WHERE s.entity IN (".getEntity('societe', 1).")"; $sql.= " WHERE s.entity IN (".getEntity('societe', 1).")";
if ($selected && $conf->use_javascript_ajax && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT)) $sql.= " AND rowid = ".$selected; if ($selected && $conf->use_javascript_ajax && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT)) $sql.= " AND s.rowid = ".$selected;
else else
{ {
// For ajax search we limit here. For combo list, we limit later // For ajax search we limit here. For combo list, we limit later
if ($conf->use_javascript_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT if ($conf->use_javascript_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT
&& is_array($limitto) && count($limitto)) && is_array($limitto) && count($limitto))
{ {
$sql.= " AND rowid IN (".join(',',$limitto).")"; $sql.= " AND s.rowid IN (".join(',',$limitto).")";
} }
} }
$sql.= " ORDER BY nom ASC"; $sql.= " ORDER BY s.nom ASC";
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) if ($resql)
@ -620,7 +620,7 @@ class FormCompany
} }
else else
{ {
print '<input type="text" size="30" id="search_'.$htmlname.'" name="search_'.$htmlname.'" value="'.$obj->nom.'" '.$htmloption.' />'; print '<input type="text" size="30" id="search_'.$htmlname.'" name="search_'.$htmlname.'" value="'.$obj->name.'" '.$htmloption.' />';
} }
print ajax_autocompleter(($socid?$socid:-1),$htmlname,DOL_URL_ROOT.'/societe/ajaxcompanies.php','',$minLength); print ajax_autocompleter(($socid?$socid:-1),$htmlname,DOL_URL_ROOT.'/societe/ajaxcompanies.php','',$minLength);
//print '</td>'; //print '</td>';
@ -653,14 +653,14 @@ class FormCompany
{ {
print '<option value="'.$obj->rowid.'"'; print '<option value="'.$obj->rowid.'"';
if ($disabled) print ' disabled="disabled"'; if ($disabled) print ' disabled="disabled"';
print ' selected="selected">'.dol_trunc($obj->nom,24).'</option>'; print ' selected="selected">'.dol_trunc($obj->name,24).'</option>';
$firstCompany = $obj->rowid; $firstCompany = $obj->rowid;
} }
else else
{ {
print '<option value="'.$obj->rowid.'"'; print '<option value="'.$obj->rowid.'"';
if ($disabled) print ' disabled="disabled"'; if ($disabled) print ' disabled="disabled"';
print '>'.dol_trunc($obj->nom,24).'</option>'; print '>'.dol_trunc($obj->name,24).'</option>';
} }
$i ++; $i ++;
} }

View File

@ -202,7 +202,8 @@ class InfoBox
$db->begin(); $db->begin();
// Sauve parametre indiquant que le user a une config dediee // Save parameters to say user has a dedicated setup
$tab=array();
$confuserzone='MAIN_BOXES_'.$zone; $confuserzone='MAIN_BOXES_'.$zone;
$tab[$confuserzone]=1; $tab[$confuserzone]=1;
if (dol_set_user_param($db, $conf, $user, $tab) < 0) if (dol_set_user_param($db, $conf, $user, $tab) < 0)

View File

@ -1073,39 +1073,37 @@ class MobileDetect
/** /**
* Check the version of the given property in the User-Agent. * Check the version of the given property in the User-Agent.
* Will return a float number. (eg. 2_0 will return 2.0, 4.3.1 will return 4.31) * Will return a string or float number. (eg. 2_0 will return 2.0, 4.3.1 will return 4.31)
* *
* @param string $propertyName The name of the property. See self::getProperties() array * @param string $propertyName The name of the property. See self::getProperties() array keys for all possible properties (Ex: 'iPad', 'Android', ...).
* keys for all possible properties. * @param string $type Either self::VERSION_TYPE_STRING to get a string value or
* @param string $type Either self::VERSION_TYPE_STRING to get a string value or * self::VERSION_TYPE_FLOAT indicating a float value. This parameter
* self::VERSION_TYPE_FLOAT indicating a float value. This parameter * is optional and defaults to self::VERSION_TYPE_STRING. Passing an
* is optional and defaults to self::VERSION_TYPE_STRING. Passing an * invalid parameter will default to this type as well.
* invalid parameter will default to the this type as well.
* *
* @return string|float The version of the property we are trying to extract. * @return string|float|boolean The version of the property we are trying to extract.
*/ */
public function version($propertyName, $type = self::VERSION_TYPE_STRING) public function version($propertyName, $type = self::VERSION_TYPE_STRING)
{ {
if (empty($propertyName)) { if (empty($propertyName)) return false;
return false;
}
//set the $type to the default if we don't recognize the type //set the $type to the default if we don't recognize the type
if ($type != self::VERSION_TYPE_STRING && $type != self::VERSION_TYPE_FLOAT) { if ($type != self::VERSION_TYPE_STRING && $type != self::VERSION_TYPE_FLOAT)
{
$type = self::VERSION_TYPE_STRING; $type = self::VERSION_TYPE_STRING;
} }
$properties = self::getProperties(); $properties = self::getProperties();
// Check if the property exists in the properties array. // Check if the property exists in the properties array.
if (array_key_exists($propertyName, $properties)) { if (array_key_exists($propertyName, $properties))
{
// Prepare the pattern to be matched. // Prepare the pattern to be matched.
// Make sure we always deal with an array (string is converted). // Make sure we always deal with an array (string is converted).
$properties[$propertyName] = (array) $properties[$propertyName]; $properties[$propertyName] = (array) $properties[$propertyName];
foreach ($properties[$propertyName] as $propertyMatchString) { foreach ($properties[$propertyName] as $propertyMatchString)
{
$propertyPattern = str_replace('[VER]', self::VER, $propertyMatchString); $propertyPattern = str_replace('[VER]', self::VER, $propertyMatchString);
// Escape the special character which is the delimiter. // Escape the special character which is the delimiter.
@ -1114,14 +1112,13 @@ class MobileDetect
// Identify and extract the version. // Identify and extract the version.
preg_match('/'.$propertyPattern.'/is', $this->userAgent, $match); preg_match('/'.$propertyPattern.'/is', $this->userAgent, $match);
if (!empty($match[1])) { if (!empty($match[1]))
{
$version = ( $type == self::VERSION_TYPE_FLOAT ? $this->prepareVersionNo($match[1]) : $match[1] ); $version = ( $type == self::VERSION_TYPE_FLOAT ? $this->prepareVersionNo($match[1]) : $match[1] );
return $version; return $version;
} }
} }
} }
return false; return false;
@ -1130,7 +1127,7 @@ class MobileDetect
/** /**
* Retrieve the mobile grading, using self::MOBILE_GRADE_* constants. * Retrieve the mobile grading, using self::MOBILE_GRADE_* constants.
* *
* @return string One of the self::MOBILE_GRADE_* constants. * @return string One of the self::MOBILE_GRADE_* constants.
*/ */
public function mobileGrade() public function mobileGrade()
{ {
@ -1210,7 +1207,8 @@ class MobileDetect
// @reference: http://my.opera.com/community/openweb/idopera/ // @reference: http://my.opera.com/community/openweb/idopera/
$this->version('Opera', self::VERSION_TYPE_FLOAT)>=10 && !$isMobile $this->version('Opera', self::VERSION_TYPE_FLOAT)>=10 && !$isMobile
){ )
{
return self::MOBILE_GRADE_A; return self::MOBILE_GRADE_A;
} }
@ -1231,7 +1229,8 @@ class MobileDetect
// @todo: report this (tested on Nokia N71) // @todo: report this (tested on Nokia N71)
$this->version('Opera Mobi', self::VERSION_TYPE_FLOAT)>=11 && $this->is('SymbianOS') $this->version('Opera Mobi', self::VERSION_TYPE_FLOAT)>=11 && $this->is('SymbianOS')
){ )
{
return self::MOBILE_GRADE_B; return self::MOBILE_GRADE_B;
} }
@ -1241,7 +1240,8 @@ class MobileDetect
// Windows Mobile - Tested on the HTC Leo (WinMo 5.2) // Windows Mobile - Tested on the HTC Leo (WinMo 5.2)
$this->match('MSIEMobile|Windows CE.*Mobile') || $this->version('Windows Mobile', self::VERSION_TYPE_FLOAT)<=5.2 $this->match('MSIEMobile|Windows CE.*Mobile') || $this->version('Windows Mobile', self::VERSION_TYPE_FLOAT)<=5.2
){ )
{
return self::MOBILE_GRADE_C; return self::MOBILE_GRADE_C;
} }

View File

@ -137,8 +137,12 @@ abstract class DoliDB implements Database
{ {
$this->transaction_opened=0; $this->transaction_opened=0;
dol_syslog("COMMIT Transaction".($log?' '.$log:''),LOG_DEBUG); dol_syslog("COMMIT Transaction".($log?' '.$log:''),LOG_DEBUG);
return 1;
}
else
{
return 0;
} }
return $ret;
} }
else else
{ {
@ -248,7 +252,7 @@ abstract class DoliDB implements Database
/** /**
* Return last error label * Return last error label
* *
* @return string lasterror * @return string Last error
*/ */
function lasterror() function lasterror()
{ {
@ -260,9 +264,9 @@ abstract class DoliDB implements Database
* 19700101020000 -> 3600 with TZ+1 and gmt=0 * 19700101020000 -> 3600 with TZ+1 and gmt=0
* 19700101020000 -> 7200 whaterver is TZ if gmt=1 * 19700101020000 -> 7200 whaterver is TZ if gmt=1
* *
* @param string $string Date in a string (YYYYMMDDHHMMSS, YYYYMMDD, YYYY-MM-DD HH:MM:SS) * @param string $string Date in a string (YYYYMMDDHHMMSS, YYYYMMDD, YYYY-MM-DD HH:MM:SS)
* @param int $gm 1=Input informations are GMT values, otherwise local to server TZ * @param int $gm 1=Input informations are GMT values, otherwise local to server TZ
* @return date Date TMS * @return timestamp|string Date TMS
*/ */
function jdate($string, $gm=false) function jdate($string, $gm=false)
{ {

View File

@ -255,8 +255,12 @@ class DoliDBMssql extends DoliDB
{ {
$this->transaction_opened=0; $this->transaction_opened=0;
dol_syslog("COMMIT Transaction",LOG_DEBUG); dol_syslog("COMMIT Transaction",LOG_DEBUG);
return 1;
}
else
{
return 0;
} }
return $ret;
} }
else else
{ {
@ -672,7 +676,7 @@ class DoliDBMssql extends DoliDB
* *
* @param string $database Name of database * @param string $database Name of database
* @param string $table Nmae of table filter ('xxx%') * @param string $table Nmae of table filter ('xxx%')
* @return resource Resource * @return array List of tables in an array
*/ */
function DDLListTables($database,$table='') function DDLListTables($database,$table='')
{ {

View File

@ -585,7 +585,7 @@ class DoliDBMysql extends DoliDB
* *
* @param string $database Name of database * @param string $database Name of database
* @param string $table Nmae of table filter ('xxx%') * @param string $table Nmae of table filter ('xxx%')
* @return resource Resource * @return array List of tables in an array
*/ */
function DDLListTables($database, $table='') function DDLListTables($database, $table='')
{ {

View File

@ -590,7 +590,7 @@ class DoliDBMysqli extends DoliDB
* *
* @param string $database Name of database * @param string $database Name of database
* @param string $table Nmae of table filter ('xxx%') * @param string $table Nmae of table filter ('xxx%')
* @return resource Resource * @return array List of tables in an array
*/ */
function DDLListTables($database, $table='') function DDLListTables($database, $table='')
{ {

View File

@ -846,8 +846,8 @@ class DoliDBPgsql extends DoliDB
* List tables into a database * List tables into a database
* *
* @param string $database Name of database * @param string $database Name of database
* @param string $table Nmae of table filter ('xxx%') * @param string $table Name of table filter ('xxx%')
* @return resource Resource * @return array List of tables in an array
*/ */
function DDLListTables($database, $table='') function DDLListTables($database, $table='')
{ {
@ -860,7 +860,7 @@ class DoliDBPgsql extends DoliDB
{ {
$listtables[] = $row[0]; $listtables[] = $row[0];
} }
return $listtables; return $listtables;
} }
/** /**

View File

@ -737,8 +737,8 @@ class DoliDBSqlite extends DoliDB
* List tables into a database * List tables into a database
* *
* @param string $database Name of database * @param string $database Name of database
* @param string $table Nmae of table filter ('xxx%') * @param string $table Name of table filter ('xxx%')
* @return resource Resource * @return array List of tables in an array
*/ */
function DDLListTables($database, $table='') function DDLListTables($database, $table='')
{ {

View File

@ -954,7 +954,7 @@ function dol_meta_create($object)
if (is_dir($dir)) if (is_dir($dir))
{ {
$nblignes = count($object->lines); $nblignes = count($object->lines);
$client = $object->client->nom . " " . $object->client->address . " " . $object->client->zip . " " . $object->client->town; $client = $object->client->name . " " . $object->client->address . " " . $object->client->zip . " " . $object->client->town;
$meta = "REFERENCE=\"" . $object->ref . "\" $meta = "REFERENCE=\"" . $object->ref . "\"
DATE=\"" . dol_print_date($object->date,'') . "\" DATE=\"" . dol_print_date($object->date,'') . "\"
NB_ITEMS=\"" . $nblignes . "\" NB_ITEMS=\"" . $nblignes . "\"

View File

@ -1026,7 +1026,7 @@ function dol_getdate($timestamp,$fast=false)
* @param int $year Year * @param int $year Year
* @param mixed $gm True or 1 or 'gmt'=Input informations are GMT values, False or 0 or 'server' = local to server TZ, 'user' = local to user TZ * @param mixed $gm True or 1 or 'gmt'=Input informations are GMT values, False or 0 or 'server' = local to server TZ, 'user' = local to user TZ
* @param int $check 0=No check on parameters (Can use day 32, etc...) * @param int $check 0=No check on parameters (Can use day 32, etc...)
* @return int Date as a timestamp, '' if error * @return timestamp|string Date as a timestamp, '' if error
* @see dol_print_date, dol_stringtotime, dol_getdate * @see dol_print_date, dol_stringtotime, dol_getdate
*/ */
function dol_mktime($hour,$minute,$second,$month,$day,$year,$gm=false,$check=1) function dol_mktime($hour,$minute,$second,$month,$day,$year,$gm=false,$check=1)
@ -1075,6 +1075,7 @@ function dol_mktime($hour,$minute,$second,$month,$day,$year,$gm=false,$check=1)
$dt->setDate($year,$month,$day); $dt->setDate($year,$month,$day);
$dt->setTime((int) $hour, (int) $minute, (int) $second); $dt->setTime((int) $hour, (int) $minute, (int) $second);
$date=$dt->getTimestamp(); // should include daylight saving time $date=$dt->getTimestamp(); // should include daylight saving time
return $date;
} }
else else
{ {
@ -1092,8 +1093,8 @@ function dol_mktime($hour,$minute,$second,$month,$day,$year,$gm=false,$check=1)
{ {
$date=mktime($hour,$minute,$second,$month,$day,$year); $date=mktime($hour,$minute,$second,$month,$day,$year);
}*/ }*/
return '';
} }
return $date;
} }

View File

@ -1143,8 +1143,8 @@ function weight_convert($weight,&$from_unit,$to_unit)
* *
* @param DoliDB $db Handler database * @param DoliDB $db Handler database
* @param Conf $conf Object conf * @param Conf $conf Object conf
* @param User $user Object user * @param User $user Object user
* @param array $tab Tableau (cle=>valeur) des parametres a sauvegarder * @param array $tab Array (key=>value) with all parameters to save
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
* *
* @see dolibarr_get_const, dolibarr_set_const, dolibarr_del_const * @see dolibarr_get_const, dolibarr_set_const, dolibarr_del_const

View File

@ -682,7 +682,7 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass
{ {
// Make substitution // Make substitution
$substitutionarray=array( $substitutionarray=array(
'__FROM_NAME__' => $fromcompany->nom, '__FROM_NAME__' => $fromcompany->name,
'__FROM_EMAIL__' => $fromcompany->email, '__FROM_EMAIL__' => $fromcompany->email,
'__TOTAL_TTC__' => $object->total_ttc, '__TOTAL_TTC__' => $object->total_ttc,
'__TOTAL_HT__' => $object->total_ht, '__TOTAL_HT__' => $object->total_ht,

View File

@ -124,7 +124,7 @@ function vat_by_thirdparty($db, $y, $date_start, $date_end, $modetax, $direction
} }
if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) if (! empty($conf->global->MAIN_MODULE_COMPTABILITE))
{ {
$sql = "SELECT s.rowid as socid, s.nom as nom, s.siren as tva_intra, s.tva_assuj as assuj,"; $sql = "SELECT s.rowid as socid, s.nom as name, s.siren as tva_intra, s.tva_assuj as assuj,";
$sql.= " sum(fd.total_ht) as amount, sum(fd.".$total_tva.") as tva,"; $sql.= " sum(fd.total_ht) as amount, sum(fd.".$total_tva.") as tva,";
$sql.= " sum(fd.".$total_localtax1.") as localtax1,"; $sql.= " sum(fd.".$total_localtax1.") as localtax1,";
$sql.= " sum(fd.".$total_localtax2.") as localtax2"; $sql.= " sum(fd.".$total_localtax2.") as localtax2";

View File

@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/barcode/modules_barcode.class.php'
*/ */
class mod_barcode_product_standard extends ModeleNumRefBarCode class mod_barcode_product_standard extends ModeleNumRefBarCode
{ {
var $nom='Standard'; // Model Name var $name='Standard'; // Model Name
var $code_modifiable; // Editable code var $code_modifiable; // Editable code
var $code_modifiable_invalide; // Modified code if it is invalid var $code_modifiable_invalide; // Modified code if it is invalid
var $code_modifiable_null; // Modified code if it is null var $code_modifiable_null; // Modified code if it is null

View File

@ -62,7 +62,7 @@ abstract class ModeleNumRefBarCode
$langs->load("bills"); $langs->load("bills");
return $langs->trans("NoDescription"); return $langs->trans("NoDescription");
} }
/** Return model name /** Return model name
* *
* @param Translate $langs Object langs * @param Translate $langs Object langs
@ -70,10 +70,10 @@ abstract class ModeleNumRefBarCode
*/ */
function getNom($langs) function getNom($langs)
{ {
return $this->nom; return empty($this->name)?$this->nom:$this->name;
} }
/** Return a numbering example /** Return a numbering example
* *
* @param Translate $langs Object langs * @param Translate $langs Object langs
* @return string Example * @return string Example
@ -96,7 +96,7 @@ abstract class ModeleNumRefBarCode
global $langs; global $langs;
return $langs->trans("Function_getNextValue_InModuleNotWorking"); return $langs->trans("Function_getNextValue_InModuleNotWorking");
} }
/** Return version of module /** Return version of module
* *
* @return string Version * @return string Version
@ -112,7 +112,7 @@ abstract class ModeleNumRefBarCode
if ($this->version) return $this->version; if ($this->version) return $this->version;
return $langs->trans("NotAvailable"); return $langs->trans("NotAvailable");
} }
/** /**
* Return description of module parameters * Return description of module parameters
* *
@ -128,7 +128,7 @@ abstract class ModeleNumRefBarCode
$langs->load("admin"); $langs->load("admin");
$s=''; $s='';
$s.=$langs->trans("Name").': <b>'.$this->nom.'</b><br>'; $s.=$langs->trans("Name").': <b>'.$this->name.'</b><br>';
$s.=$langs->trans("Version").': <b>'.$this->getVersion().'</b><br>'; $s.=$langs->trans("Version").': <b>'.$this->getVersion().'</b><br>';
if ($type != -1) $s.=$langs->trans("ValidityControledByModule").': <b>'.$this->getNom($langs).'</b><br>'; if ($type != -1) $s.=$langs->trans("ValidityControledByModule").': <b>'.$this->getNom($langs).'</b><br>';
$s.='<br>'; $s.='<br>';
@ -171,6 +171,6 @@ abstract class ModeleNumRefBarCode
return $s; return $s;
} }
} }

View File

@ -277,7 +277,7 @@ class doc_generic_order_odt extends ModelePDFCommandes
// Make substitution // Make substitution
$substitutionarray=array( $substitutionarray=array(
'__FROM_NAME__' => $this->emetteur->nom, '__FROM_NAME__' => $this->emetteur->name,
'__FROM_EMAIL__' => $this->emetteur->email, '__FROM_EMAIL__' => $this->emetteur->email,
'__TOTAL_TTC__' => $object->total_ttc, '__TOTAL_TTC__' => $object->total_ttc,
'__TOTAL_HT__' => $object->total_ht, '__TOTAL_HT__' => $object->total_ht,
@ -483,7 +483,7 @@ class doc_generic_order_odt extends ModelePDFCommandes
} }
$reshook=$hookmanager->executeHooks('afterODTCreation',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks $reshook=$hookmanager->executeHooks('afterODTCreation',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
if (! empty($conf->global->MAIN_UMASK)) if (! empty($conf->global->MAIN_UMASK))
@chmod($file, octdec($conf->global->MAIN_UMASK)); @chmod($file, octdec($conf->global->MAIN_UMASK));

View File

@ -1233,12 +1233,12 @@ class pdf_einstein extends ModelePDFCommandes
{ {
// On peut utiliser le nom de la societe du contact // On peut utiliser le nom de la societe du contact
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname; if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname;
else $socname = $object->client->nom; else $socname = $object->client->name;
$carac_client_name=$outputlangs->convToOutputCharset($socname); $carac_client_name=$outputlangs->convToOutputCharset($socname);
} }
else else
{ {
$carac_client_name=$outputlangs->convToOutputCharset($object->client->nom); $carac_client_name=$outputlangs->convToOutputCharset($object->client->name);
} }
$carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,($usecontact?$object->contact:''),$usecontact,'target'); $carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,($usecontact?$object->contact:''),$usecontact,'target');

View File

@ -1190,12 +1190,12 @@ class pdf_proforma extends ModelePDFCommandes
{ {
// On peut utiliser le nom de la societe du contact // On peut utiliser le nom de la societe du contact
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname; if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname;
else $socname = $object->client->nom; else $socname = $object->client->name;
$carac_client_name=$outputlangs->convToOutputCharset($socname); $carac_client_name=$outputlangs->convToOutputCharset($socname);
} }
else else
{ {
$carac_client_name=$outputlangs->convToOutputCharset($object->client->nom); $carac_client_name=$outputlangs->convToOutputCharset($object->client->name);
} }
$carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,($usecontact?$object->contact:''),$usecontact,'target'); $carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,($usecontact?$object->contact:''),$usecontact,'target');

View File

@ -586,12 +586,12 @@ class pdf_strato extends ModelePDFContract
{ {
// On peut utiliser le nom de la societe du contact // On peut utiliser le nom de la societe du contact
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname; if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname;
else $socname = $object->client->nom; else $socname = $object->client->name;
$this->recipient->name=$outputlangs->convToOutputCharset($socname); $this->recipient->name=$outputlangs->convToOutputCharset($socname);
} }
else else
{ {
$this->recipient->name=$outputlangs->convToOutputCharset($object->client->nom); $this->recipient->name=$outputlangs->convToOutputCharset($object->client->name);
} }
$carac_client=pdf_build_address($outputlangs, $this->emetteur, $object->client, (isset($object->contact)?$object->contact:''), $usecontact, 'target'); $carac_client=pdf_build_address($outputlangs, $this->emetteur, $object->client, (isset($object->contact)?$object->contact:''), $usecontact, 'target');

View File

@ -277,7 +277,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
// Make substitution // Make substitution
$substitutionarray=array( $substitutionarray=array(
'__FROM_NAME__' => $this->emetteur->nom, '__FROM_NAME__' => $this->emetteur->name,
'__FROM_EMAIL__' => $this->emetteur->email, '__FROM_EMAIL__' => $this->emetteur->email,
'__TOTAL_TTC__' => $object->total_ttc, '__TOTAL_TTC__' => $object->total_ttc,
'__TOTAL_HT__' => $object->total_ht, '__TOTAL_HT__' => $object->total_ht,
@ -483,7 +483,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
} }
$reshook=$hookmanager->executeHooks('afterODTCreation',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks $reshook=$hookmanager->executeHooks('afterODTCreation',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
if (! empty($conf->global->MAIN_UMASK)) if (! empty($conf->global->MAIN_UMASK))
@chmod($file, octdec($conf->global->MAIN_UMASK)); @chmod($file, octdec($conf->global->MAIN_UMASK));

View File

@ -617,12 +617,12 @@ class pdf_merou extends ModelePdfExpedition
{ {
// On peut utiliser le nom de la societe du contact // On peut utiliser le nom de la societe du contact
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname; if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname;
else $socname = $object->client->nom; else $socname = $object->client->name;
$carac_client_name=$outputlangs->convToOutputCharset($socname); $carac_client_name=$outputlangs->convToOutputCharset($socname);
} }
else else
{ {
$carac_client_name=$outputlangs->convToOutputCharset($object->client->nom); $carac_client_name=$outputlangs->convToOutputCharset($object->client->name);
} }
$carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,((!empty($object->contact))?$object->contact:null),$usecontact,'targetwithdetails'); $carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,((!empty($object->contact))?$object->contact:null),$usecontact,'targetwithdetails');

View File

@ -631,12 +631,12 @@ class pdf_rouget extends ModelePdfExpedition
{ {
// On peut utiliser le nom de la societe du contact // On peut utiliser le nom de la societe du contact
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname; if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname;
else $socname = $object->client->nom; else $socname = $object->client->name;
$carac_client_name=$outputlangs->convToOutputCharset($socname); $carac_client_name=$outputlangs->convToOutputCharset($socname);
} }
else else
{ {
$carac_client_name=$outputlangs->convToOutputCharset($object->client->nom); $carac_client_name=$outputlangs->convToOutputCharset($object->client->name);
} }
$carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,(!empty($object->contact)?$object->contact:null),$usecontact,'targetwithdetails'); $carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,(!empty($object->contact)?$object->contact:null),$usecontact,'targetwithdetails');

View File

@ -285,7 +285,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures
// Make substitution // Make substitution
$substitutionarray=array( $substitutionarray=array(
'__FROM_NAME__' => $this->emetteur->nom, '__FROM_NAME__' => $this->emetteur->name,
'__FROM_EMAIL__' => $this->emetteur->email, '__FROM_EMAIL__' => $this->emetteur->email,
'__TOTAL_TTC__' => $object->total_ttc, '__TOTAL_TTC__' => $object->total_ttc,
'__TOTAL_HT__' => $object->total_ht, '__TOTAL_HT__' => $object->total_ht,
@ -440,7 +440,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures
} }
$reshook=$hookmanager->executeHooks('afterODTCreation',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks $reshook=$hookmanager->executeHooks('afterODTCreation',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
if (! empty($conf->global->MAIN_UMASK)) if (! empty($conf->global->MAIN_UMASK))
@chmod($file, octdec($conf->global->MAIN_UMASK)); @chmod($file, octdec($conf->global->MAIN_UMASK));

View File

@ -182,7 +182,7 @@ class pdf_crabe extends ModelePDFFactures
} }
} }
if (count($realpatharray) == 0) $this->posxpicture=$this->posxtva; if (count($realpatharray) == 0) $this->posxpicture=$this->posxtva;
if ($conf->facture->dir_output) if ($conf->facture->dir_output)
{ {
$object->fetch_thirdparty(); $object->fetch_thirdparty();
@ -369,7 +369,7 @@ class pdf_crabe extends ModelePDFFactures
// $pdf->Image does not increase value return by getY, so we save it manually // $pdf->Image does not increase value return by getY, so we save it manually
$posYAfterImage=$curY+$imglinesize['height']; $posYAfterImage=$curY+$imglinesize['height'];
} }
// Description of product line // Description of product line
$curX = $this->posxdesc-1; $curX = $this->posxdesc-1;
@ -407,7 +407,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->commitTransaction(); $pdf->commitTransaction();
} }
$posYAfterDescription=$pdf->GetY(); $posYAfterDescription=$pdf->GetY();
$nexY = $pdf->GetY(); $nexY = $pdf->GetY();
$pageposafter=$pdf->getPage(); $pageposafter=$pdf->getPage();
$pdf->setPage($pageposbefore); $pdf->setPage($pageposbefore);
@ -487,7 +487,7 @@ class pdf_crabe extends ModelePDFFactures
$this->tva[$vatrate] += $tvaligne; $this->tva[$vatrate] += $tvaligne;
if ($posYAfterImage > $posYAfterDescription) $nexY=$posYAfterImage; if ($posYAfterImage > $posYAfterDescription) $nexY=$posYAfterImage;
// Add line // Add line
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1)) if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))
{ {
@ -1241,7 +1241,7 @@ class pdf_crabe extends ModelePDFFactures
//$pdf->MultiCell($this->posxtva-$this->posxpicture-1,2, $outputlangs->transnoentities("Photo"),'','C'); //$pdf->MultiCell($this->posxtva-$this->posxpicture-1,2, $outputlangs->transnoentities("Photo"),'','C');
} }
} }
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
{ {
$pdf->line($this->posxtva-1, $tab_top, $this->posxtva-1, $tab_top + $tab_height); $pdf->line($this->posxtva-1, $tab_top, $this->posxtva-1, $tab_top + $tab_height);
@ -1479,12 +1479,12 @@ class pdf_crabe extends ModelePDFFactures
{ {
// On peut utiliser le nom de la societe du contact // On peut utiliser le nom de la societe du contact
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname; if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname;
else $socname = $object->client->nom; else $socname = $object->client->name;
$carac_client_name=$outputlangs->convToOutputCharset($socname); $carac_client_name=$outputlangs->convToOutputCharset($socname);
} }
else else
{ {
$carac_client_name=$outputlangs->convToOutputCharset($object->client->nom); $carac_client_name=$outputlangs->convToOutputCharset($object->client->name);
} }
$carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,($usecontact?$object->contact:''),$usecontact,'target'); $carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,($usecontact?$object->contact:''),$usecontact,'target');

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