Merge branch 'develop' into langs_en_US
This commit is contained in:
commit
55487da03e
@ -342,6 +342,9 @@ script:
|
||||
php upgrade.php 8.0.0 9.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade800900.log
|
||||
php upgrade2.php 8.0.0 9.0.0 > $TRAVIS_BUILD_DIR/upgrade800900-2.log
|
||||
php step5.php 8.0.0 9.0.0 > $TRAVIS_BUILD_DIR/upgrade800900-3.log
|
||||
php upgrade.php 9.0.0 10.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade9001000.log
|
||||
php upgrade2.php 9.0.0 10.0.0 > $TRAVIS_BUILD_DIR/upgrade9001000-2.log
|
||||
php step5.php 9.0.0 10.0.0 > $TRAVIS_BUILD_DIR/upgrade9001000-3.log
|
||||
cd -
|
||||
set +e
|
||||
echo
|
||||
|
||||
@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<uml:Model xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1" xmlns:uml="http://www.eclipse.org/uml2/2.1.0/UML" xmi:id="_qb8akM37EdqwVrslYOdUDA">
|
||||
<packagedElement xmi:type="uml:Package" xmi:id="_w8IxIM37EdqwVrslYOdUDA" name="dolibarr">
|
||||
<packagedElement xmi:type="uml:Package" xmi:id="_T5aZ4FK9Ed60vaZbVikprw" name="OrdersModule"/>
|
||||
<packagedElement xmi:type="uml:Package" xmi:id="_ZhuGMlK9Ed60vaZbVikprw" name="InvoiceModule"/>
|
||||
<packagedElement xmi:type="uml:Package" xmi:id="_cf3SUlK9Ed60vaZbVikprw" name="UserModule"/>
|
||||
<packagedElement xmi:type="uml:Package" xmi:id="_maM0glK9Ed60vaZbVikprw" name="FoundationModule"/>
|
||||
<packagedElement xmi:type="uml:Package" xmi:id="_oqTO4lK9Ed60vaZbVikprw" name="ContractsModule"/>
|
||||
<packagedElement xmi:type="uml:Package" xmi:id="_rEq_klK9Ed60vaZbVikprw" name="ProposalsModule"/>
|
||||
<packagedElement xmi:type="uml:Package" xmi:id="_vxYmUlK9Ed60vaZbVikprw" name="EMailingManagement"/>
|
||||
</packagedElement>
|
||||
</uml:Model>
|
||||
@ -1,53 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<diagrams:Diagrams xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:di="http://www.topcased.org/DI/1.0" xmlns:diagrams="http://www.topcased.org/Diagrams/1.0" xmi:id="_SI6FkFK9Ed60vaZbVikprw" activeDiagram="_SI6FkVK9Ed60vaZbVikprw">
|
||||
<model href="dolibarr.uml#_w8IxIM37EdqwVrslYOdUDA"/>
|
||||
<diagrams xmi:id="_SI6FkVK9Ed60vaZbVikprw" position="0,0" size="100,100" name="dolibarr" viewport="0,0">
|
||||
<property xmi:id="_SJ9OcFK9Ed60vaZbVikprw" key="pageFormatName" value="A4"/>
|
||||
<property xmi:id="_SJ9OcVK9Ed60vaZbVikprw" key="diagramWidth" value="840"/>
|
||||
<property xmi:id="_SJ9OclK9Ed60vaZbVikprw" key="diagramHeight" value="1188"/>
|
||||
<property xmi:id="_SJ9Oc1K9Ed60vaZbVikprw" key="pageMarginName" value="Small Margin"/>
|
||||
<property xmi:id="_SJ9OdFK9Ed60vaZbVikprw" key="diagramTopMargin" value="20"/>
|
||||
<property xmi:id="_SJ9OdVK9Ed60vaZbVikprw" key="diagramBottomMargin" value="20"/>
|
||||
<property xmi:id="_SJ9OdlK9Ed60vaZbVikprw" key="diagramLeftMargin" value="20"/>
|
||||
<property xmi:id="_SJ9Od1K9Ed60vaZbVikprw" key="diagramRightMargin" value="20"/>
|
||||
<property xmi:id="_SJ9OeFK9Ed60vaZbVikprw" key="orientation" value="portrait"/>
|
||||
<semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_SI6FklK9Ed60vaZbVikprw" presentation="org.topcased.modeler.uml.classdiagram">
|
||||
<element href="dolibarr.uml#_w8IxIM37EdqwVrslYOdUDA"/>
|
||||
</semanticModel>
|
||||
<contained xsi:type="di:GraphNode" xmi:id="_T2b-YFK9Ed60vaZbVikprw" position="15,190" size="176,81">
|
||||
<semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_T2b-YVK9Ed60vaZbVikprw" presentation="default">
|
||||
<element href="dolibarr.uml#_T5aZ4FK9Ed60vaZbVikprw"/>
|
||||
</semanticModel>
|
||||
</contained>
|
||||
<contained xsi:type="di:GraphNode" xmi:id="_ZhuGMFK9Ed60vaZbVikprw" position="15,118" size="177,68">
|
||||
<semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_ZhuGMVK9Ed60vaZbVikprw" presentation="default">
|
||||
<element href="dolibarr.uml#_ZhuGMlK9Ed60vaZbVikprw"/>
|
||||
</semanticModel>
|
||||
</contained>
|
||||
<contained xsi:type="di:GraphNode" xmi:id="_cf3SUFK9Ed60vaZbVikprw" position="15,10" size="174,81">
|
||||
<semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_cf3SUVK9Ed60vaZbVikprw" presentation="default">
|
||||
<element href="dolibarr.uml#_cf3SUlK9Ed60vaZbVikprw"/>
|
||||
</semanticModel>
|
||||
</contained>
|
||||
<contained xsi:type="di:GraphNode" xmi:id="_maM0gFK9Ed60vaZbVikprw" position="291,118" size="145,73">
|
||||
<semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_maM0gVK9Ed60vaZbVikprw" presentation="default">
|
||||
<element href="dolibarr.uml#_maM0glK9Ed60vaZbVikprw"/>
|
||||
</semanticModel>
|
||||
</contained>
|
||||
<contained xsi:type="di:GraphNode" xmi:id="_oqTO4FK9Ed60vaZbVikprw" position="15,274" size="179,80">
|
||||
<semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_oqTO4VK9Ed60vaZbVikprw" presentation="default">
|
||||
<element href="dolibarr.uml#_oqTO4lK9Ed60vaZbVikprw"/>
|
||||
</semanticModel>
|
||||
</contained>
|
||||
<contained xsi:type="di:GraphNode" xmi:id="_rEq_kFK9Ed60vaZbVikprw" position="15,358" size="181,73">
|
||||
<semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_rEq_kVK9Ed60vaZbVikprw" presentation="default">
|
||||
<element href="dolibarr.uml#_rEq_klK9Ed60vaZbVikprw"/>
|
||||
</semanticModel>
|
||||
</contained>
|
||||
<contained xsi:type="di:GraphNode" xmi:id="_vxYmUFK9Ed60vaZbVikprw" position="15,490" size="181,80">
|
||||
<semanticModel xsi:type="di:EMFSemanticModelBridge" xmi:id="_vxYmUVK9Ed60vaZbVikprw" presentation="default">
|
||||
<element href="dolibarr.uml#_vxYmUlK9Ed60vaZbVikprw"/>
|
||||
</semanticModel>
|
||||
</contained>
|
||||
</diagrams>
|
||||
</diagrams:Diagrams>
|
||||
Binary file not shown.
@ -7,12 +7,12 @@ Download
|
||||
--------------------------------
|
||||
|
||||
* Dolibarr ERP/CRM can be downloaded at sourceforge:
|
||||
http://sourceforge.net/projects/dolibarr/files
|
||||
or from Dolibarr official web site:
|
||||
http://www.dolibarr.org
|
||||
https://sourceforge.net/projects/dolibarr/files
|
||||
or from Dolibarr official web site:
|
||||
https://www.dolibarr.org
|
||||
|
||||
* Most external modules are only available on DoliStore:
|
||||
http://www.dolistore.org
|
||||
https://www.dolistore.com
|
||||
|
||||
|
||||
--------------------------------
|
||||
@ -22,4 +22,4 @@ Install
|
||||
* For a Quick guide, take a look at README file into root directory.
|
||||
|
||||
* More complete documentations are also available on line on the Dolibarr Wiki:
|
||||
http://wiki.dolibarr.org
|
||||
https://wiki.dolibarr.org
|
||||
|
||||
33
doc/install/README-DE
Normal file
33
doc/install/README-DE
Normal file
@ -0,0 +1,33 @@
|
||||
README (deutsch / german / allemand)
|
||||
--------------------------------
|
||||
|
||||
|
||||
--------------------------------
|
||||
Download / Herunterladen
|
||||
--------------------------------
|
||||
|
||||
* Dolibarr ERP/CRM kann man über die offizielle Dolibarr Website
|
||||
https://www.dolibarr.org/downloads
|
||||
oder direkt von Sourceforge
|
||||
https://sourceforge.net/projects/dolibarr/files/
|
||||
herunterladen.
|
||||
|
||||
|
||||
|
||||
* Die meisten externen Module/Themens sind über den DoliStore verfügbar:
|
||||
https://www.dolistore.com/de/
|
||||
|
||||
|
||||
--------------------------------
|
||||
Installation
|
||||
--------------------------------
|
||||
|
||||
* Für eine kurze Einleitung, schau auf die README Datei im Hauptverzeichnis.
|
||||
|
||||
* Umfangreiche Dokumentationen sind im Dolibarr Wiki zu finden:
|
||||
https://wiki.dolibarr.org/index.php/Hauptseite
|
||||
|
||||
* eine Deutsche Community bietet der Dolibarr e.V. unter
|
||||
https://www.dolibarr.de/
|
||||
|
||||
|
||||
@ -94,7 +94,7 @@ $facture_static = new Facture($db);
|
||||
$formaccounting = new FormAccounting($db);
|
||||
|
||||
if (! empty($id)) {
|
||||
$sql = "SELECT f.facnumber, f.rowid as facid, l.fk_product, l.description, l.price,";
|
||||
$sql = "SELECT f.ref, f.rowid as facid, l.fk_product, l.description, l.price,";
|
||||
$sql .= " l.qty, l.rowid, l.tva_tx, l.remise_percent, l.subprice, p.accountancy_code_sell as code_sell,";
|
||||
$sql .= " l.fk_code_ventilation, aa.account_number, aa.label";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "facturedet as l";
|
||||
@ -128,7 +128,7 @@ if (! empty($id)) {
|
||||
|
||||
// Ref facture
|
||||
print '<tr><td>' . $langs->trans("Invoice") . '</td>';
|
||||
$facture_static->ref = $objp->facnumber;
|
||||
$facture_static->ref = $objp->ref;
|
||||
$facture_static->id = $objp->facid;
|
||||
print '<td>' . $facture_static->getNomUrl(1) . '</td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -64,7 +64,7 @@ $pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
$offset = $limit * $page;
|
||||
if (! $sortfield)
|
||||
$sortfield = "f.datef, f.facnumber, fd.rowid";
|
||||
$sortfield = "f.datef, f.ref, fd.rowid";
|
||||
if (! $sortorder) {
|
||||
if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE > 0) {
|
||||
$sortorder = "DESC";
|
||||
@ -167,7 +167,7 @@ print '<script type="text/javascript">
|
||||
/*
|
||||
* Customer Invoice lines
|
||||
*/
|
||||
$sql = "SELECT f.rowid as facid, f.facnumber as ref, f.type, f.datef, f.ref_client,";
|
||||
$sql = "SELECT f.rowid as facid, f.ref as ref, f.type, f.datef, f.ref_client,";
|
||||
$sql.= " fd.rowid, fd.description, fd.product_type as line_type, fd.total_ht, fd.total_tva, fd.tva_tx, fd.vat_src_code, fd.total_ttc,";
|
||||
$sql.= " s.rowid as socid, s.nom as name, s.code_compta, s.code_client,";
|
||||
$sql.= " p.rowid as product_id, p.fk_product_type as product_type, p.ref as product_ref, p.label as product_label, p.accountancy_code_sell, aa.rowid as fk_compte, aa.account_number, aa.label as label_compte,";
|
||||
@ -195,7 +195,7 @@ if ($search_lineid) {
|
||||
$sql .= natural_search("fd.rowid", $search_lineid, 1);
|
||||
}
|
||||
if (strlen(trim($search_invoice))) {
|
||||
$sql .= natural_search("f.facnumber", $search_invoice);
|
||||
$sql .= natural_search("f.ref", $search_invoice);
|
||||
}
|
||||
if (strlen(trim($search_ref))) {
|
||||
$sql .= natural_search("p.ref", $search_ref);
|
||||
@ -331,8 +331,8 @@ if ($result) {
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("LineId", $_SERVER["PHP_SELF"], "fd.rowid", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Invoice", $_SERVER["PHP_SELF"], "f.facnumber", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "f.datef, f.facnumber, fd.rowid", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Invoice", $_SERVER["PHP_SELF"], "f.ref", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "f.datef, f.ref, fd.rowid", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("ProductRef", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder);
|
||||
//print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "fd.description", "", $param, '', $sortfield, $sortorder);
|
||||
|
||||
@ -75,7 +75,7 @@ $offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
if (! $sortfield)
|
||||
$sortfield = "f.datef, f.facnumber, l.rowid";
|
||||
$sortfield = "f.datef, f.ref, l.rowid";
|
||||
if (! $sortorder) {
|
||||
if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO > 0) {
|
||||
$sortorder = "DESC";
|
||||
@ -209,7 +209,7 @@ if (empty($chartaccountcode))
|
||||
}
|
||||
|
||||
// Customer Invoice lines
|
||||
$sql = "SELECT f.rowid as facid, f.facnumber as ref, f.datef, f.type as ftype,";
|
||||
$sql = "SELECT f.rowid as facid, f.ref as ref, f.datef, f.type as ftype,";
|
||||
$sql.= " l.rowid, l.fk_product, l.description, l.total_ht, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line, l.vat_src_code,";
|
||||
$sql.= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_sell as code_sell, p.tva_tx as tva_tx_prod,";
|
||||
$sql.= " aa.rowid as aarowid,";
|
||||
@ -233,7 +233,7 @@ if ($search_lineid) {
|
||||
$sql .= natural_search("l.rowid", $search_lineid, 1);
|
||||
}
|
||||
if (strlen(trim($search_invoice))) {
|
||||
$sql .= natural_search("f.facnumber", $search_invoice);
|
||||
$sql .= natural_search("f.ref", $search_invoice);
|
||||
}
|
||||
if (strlen(trim($search_ref))) {
|
||||
$sql .= natural_search("p.ref", $search_ref);
|
||||
@ -399,8 +399,8 @@ if ($result) {
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("LineId", $_SERVER["PHP_SELF"], "l.rowid", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Invoice", $_SERVER["PHP_SELF"], "f.facnumber", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "f.datef, f.facnumber, l.rowid", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Invoice", $_SERVER["PHP_SELF"], "f.ref", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "f.datef, f.ref, l.rowid", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("ProductRef", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder);
|
||||
//print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder);
|
||||
|
||||
@ -1179,7 +1179,7 @@ function getSourceDocRef($val, $typerecord)
|
||||
$sqlmid = '';
|
||||
if ($typerecord == 'payment')
|
||||
{
|
||||
$sqlmid = 'SELECT payfac.fk_facture as id, f.facnumber as ref';
|
||||
$sqlmid = 'SELECT payfac.fk_facture as id, f.ref as ref';
|
||||
$sqlmid .= " FROM ".MAIN_DB_PREFIX."paiement_facture as payfac, ".MAIN_DB_PREFIX."facture as f";
|
||||
$sqlmid .= " WHERE payfac.fk_facture = f.rowid AND payfac.fk_paiement=" . $val["paymentid"];
|
||||
$ref = $langs->trans("Invoice");
|
||||
|
||||
@ -97,7 +97,7 @@ if (! GETPOSTISSET('date_startmonth') && (empty($date_start) || empty($date_end)
|
||||
|
||||
$idpays = $mysoc->country_id;
|
||||
|
||||
$sql = "SELECT f.rowid, f.facnumber, f.type, f.datef as df, f.ref_client, f.date_lim_reglement as dlr, f.close_code,";
|
||||
$sql = "SELECT f.rowid, f.ref, f.type, f.datef as df, f.ref_client, f.date_lim_reglement as dlr, f.close_code,";
|
||||
$sql .= " fd.rowid as fdid, fd.description, fd.product_type, fd.total_ht, fd.total_tva, fd.total_localtax1, fd.total_localtax2, fd.tva_tx, fd.total_ttc, fd.situation_percent, fd.vat_src_code,";
|
||||
$sql .= " s.rowid as socid, s.nom as name, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,";
|
||||
$sql .= " p.rowid as pid, p.ref as pref, p.accountancy_code_sell, aa.rowid as fk_compte, aa.account_number as compte, aa.label as label_compte";
|
||||
@ -195,7 +195,7 @@ if ($result) {
|
||||
// Invoice lines
|
||||
$tabfac[$obj->rowid]["date"] = $db->jdate($obj->df);
|
||||
$tabfac[$obj->rowid]["datereg"] = $db->jdate($obj->dlr);
|
||||
$tabfac[$obj->rowid]["ref"] = $obj->facnumber;
|
||||
$tabfac[$obj->rowid]["ref"] = $obj->ref;
|
||||
$tabfac[$obj->rowid]["type"] = $obj->type;
|
||||
$tabfac[$obj->rowid]["description"] = $obj->label_compte;
|
||||
$tabfac[$obj->rowid]["close_code"] = $obj->close_code; // close_code = 'replaced' for replacement invoices (not used in most european countries)
|
||||
|
||||
@ -96,7 +96,7 @@ $facturefournisseur_static = new FactureFournisseur($db);
|
||||
$formaccounting = new FormAccounting($db);
|
||||
|
||||
if (! empty($id)) {
|
||||
$sql = "SELECT f.ref as facnumber, f.rowid as facid, l.fk_product, l.description, l.rowid, l.fk_code_ventilation, ";
|
||||
$sql = "SELECT f.ref as ref, f.rowid as facid, l.fk_product, l.description, l.rowid, l.fk_code_ventilation, ";
|
||||
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label";
|
||||
$sql .= ", aa.account_number, aa.label";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn_det as l";
|
||||
@ -129,7 +129,7 @@ if (! empty($id)) {
|
||||
|
||||
// ref invoice
|
||||
print '<tr><td>' . $langs->trans("BillsSuppliers") . '</td>';
|
||||
$facturefournisseur_static->ref = $objp->facnumber;
|
||||
$facturefournisseur_static->ref = $objp->ref;
|
||||
$facturefournisseur_static->id = $objp->facid;
|
||||
print '<td>' . $facturefournisseur_static->getNomUrl(1) . '</td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -448,8 +448,6 @@ $sql.=$db->plimit($listlimit+1,$offset);
|
||||
$fieldlist=explode(',',$tabfield[$id]);
|
||||
|
||||
// Form to add a new line
|
||||
$alabelisused=0;
|
||||
|
||||
print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$id.'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="from" value="'.dol_escape_htmltag(GETPOST('from','alpha')).'">';
|
||||
@ -461,38 +459,37 @@ print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
foreach ($fieldlist as $field => $value)
|
||||
{
|
||||
// Determine le nom du champ par rapport aux noms possibles
|
||||
// dans les dictionnaires de donnees
|
||||
$valuetoshow=ucfirst($fieldlist[$field]); // Par defaut
|
||||
$valuetoshow=$langs->trans($valuetoshow); // try to translate
|
||||
$align="left";
|
||||
if ($fieldlist[$field]=='fk_user') { $valuetoshow=$langs->trans("Owner");}
|
||||
if ($fieldlist[$field]=='lang') { $valuetoshow=(empty($conf->global->MAIN_MULTILANGS) ? ' ' : $langs->trans("Language")); }
|
||||
if ($fieldlist[$field]=='type') { $valuetoshow=$langs->trans("Type"); }
|
||||
if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); }
|
||||
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { $valuetoshow=$langs->trans("Code"); }
|
||||
if ($fieldlist[$field]=='type_template') { $valuetoshow=$langs->trans("TypeOfTemplate"); }
|
||||
if ($fieldlist[$field]=='private') { $align='center'; }
|
||||
if ($fieldlist[$field]=='position') { $align='center'; }
|
||||
// Determine le nom du champ par rapport aux noms possibles
|
||||
// dans les dictionnaires de donnees
|
||||
$valuetoshow=ucfirst($fieldlist[$field]); // Par defaut
|
||||
$valuetoshow=$langs->trans($valuetoshow); // try to translate
|
||||
$align="left";
|
||||
if ($fieldlist[$field]=='fk_user') { $valuetoshow=$langs->trans("Owner");}
|
||||
if ($fieldlist[$field]=='lang') { $valuetoshow=(empty($conf->global->MAIN_MULTILANGS) ? ' ' : $langs->trans("Language")); }
|
||||
if ($fieldlist[$field]=='type') { $valuetoshow=$langs->trans("Type"); }
|
||||
if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); }
|
||||
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { $valuetoshow=$langs->trans("Code"); }
|
||||
if ($fieldlist[$field]=='type_template') { $valuetoshow=$langs->trans("TypeOfTemplate"); }
|
||||
if ($fieldlist[$field]=='private') { $align='center'; }
|
||||
if ($fieldlist[$field]=='position') { $align='center'; }
|
||||
|
||||
if ($fieldlist[$field]=='topic') { $valuetoshow=''; }
|
||||
if ($fieldlist[$field]=='joinfiles') { $valuetoshow=''; }
|
||||
if ($fieldlist[$field]=='content') { $valuetoshow=''; }
|
||||
if ($fieldlist[$field]=='content_lines') { $valuetoshow=''; }
|
||||
if ($fieldlist[$field]=='topic') { $valuetoshow=''; }
|
||||
if ($fieldlist[$field]=='joinfiles') { $valuetoshow=''; }
|
||||
if ($fieldlist[$field]=='content') { $valuetoshow=''; }
|
||||
if ($fieldlist[$field]=='content_lines') { $valuetoshow=''; }
|
||||
|
||||
if ($valuetoshow != '')
|
||||
{
|
||||
print '<td align="'.$align.'">';
|
||||
if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i',$tabhelp[$id][$value])) print '<a href="'.$tabhelp[$id][$value].'" target="_blank">'.$valuetoshow.' '.img_help(1,$valuetoshow).'</a>';
|
||||
else if (! empty($tabhelp[$id][$value]))
|
||||
{
|
||||
if (in_array($value, array('topic'))) print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value], 1, 'help', '', 0, 2, $value); // Tooltip on click
|
||||
else print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value], 1, 'help', '', 0, 2); // Tooltip on hover
|
||||
}
|
||||
else print $valuetoshow;
|
||||
print '</td>';
|
||||
}
|
||||
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') $alabelisused=1;
|
||||
if ($valuetoshow != '')
|
||||
{
|
||||
print '<td align="'.$align.'">';
|
||||
if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i',$tabhelp[$id][$value])) print '<a href="'.$tabhelp[$id][$value].'" target="_blank">'.$valuetoshow.' '.img_help(1,$valuetoshow).'</a>';
|
||||
else if (! empty($tabhelp[$id][$value]))
|
||||
{
|
||||
if (in_array($value, array('topic'))) print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value], 1, 'help', '', 0, 2, $value); // Tooltip on click
|
||||
else print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value], 1, 'help', '', 0, 2); // Tooltip on hover
|
||||
}
|
||||
else print $valuetoshow;
|
||||
print '</td>';
|
||||
}
|
||||
}
|
||||
print '<td>';
|
||||
print '<input type="hidden" name="id" value="' . $id . '">';
|
||||
@ -535,6 +532,7 @@ print '<td align="right">';
|
||||
print '</td>';
|
||||
print "</tr>";
|
||||
|
||||
// Show fields for topic, join files and body
|
||||
$fieldsforcontent = array('topic', 'joinfiles', 'content');
|
||||
if (! empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) { $fieldsforcontent = array('content','content_lines'); }
|
||||
foreach ($fieldsforcontent as $tmpfieldlist)
|
||||
@ -631,11 +629,11 @@ if ($resql)
|
||||
$filterfound=0;
|
||||
foreach ($fieldlist as $field => $value)
|
||||
{
|
||||
if ($value == 'label') print '<td class="liste_titre"><input type="text" name="search_label" value="'.dol_escape_htmltag($search_label).'"></td>';
|
||||
if ($value == 'label') print '<td class="liste_titre"><input type="text" name="search_label" class="maxwidth100" value="'.dol_escape_htmltag($search_label).'"></td>';
|
||||
elseif ($value == 'lang')
|
||||
{
|
||||
print '<td class="liste_titre">';
|
||||
print $formadmin->select_language($search_lang, 'search_lang', 0, null, 1, 0, 0, 'maxwidth150');
|
||||
print $formadmin->select_language($search_lang, 'search_lang', 0, null, 1, 0, 0, 'maxwidth100');
|
||||
print '</td>';
|
||||
}
|
||||
elseif ($value == 'fk_user')
|
||||
@ -644,13 +642,13 @@ if ($resql)
|
||||
$restrictid=array();
|
||||
if (! $user->admin) $restrictid=array($user->id);
|
||||
//var_dump($restrictid);
|
||||
print $form->select_dolusers($search_fk_user, 'search_fk_user', 1, null, 0, 'hierarchyme', null, 0, 0, 1, '', 0, '', 'maxwidth200');
|
||||
print $form->select_dolusers($search_fk_user, 'search_fk_user', 1, null, 0, 'hierarchyme', null, 0, 0, 1, '', 0, '', 'maxwidth100');
|
||||
print '</td>';
|
||||
}
|
||||
elseif ($value == 'topic') print '<td class="liste_titre"><input type="text" name="search_topic" value="'.dol_escape_htmltag($search_topic).'"></td>';
|
||||
elseif ($value == 'type_template')
|
||||
{
|
||||
print '<td class="liste_titre">'.$form->selectarray('search_type_template', $elementList, $search_type_template, 1, 0, 0, '', 0, 0, 0, '', 'maxwidth200 maxwidth100onsmartphone').'</td>';
|
||||
print '<td class="liste_titre">'.$form->selectarray('search_type_template', $elementList, $search_type_template, 1, 0, 0, '', 0, 0, 0, '', 'maxwidth100 maxwidth100onsmartphone').'</td>';
|
||||
}
|
||||
elseif (! in_array($value, array('content', 'content_lines'))) print '<td class="liste_titre"></td>';
|
||||
}
|
||||
@ -672,6 +670,7 @@ if ($resql)
|
||||
$align="left";
|
||||
$sortable=1;
|
||||
$valuetoshow='';
|
||||
$forcenowrap=1;
|
||||
/*
|
||||
$tmparray=getLabelOfField($fieldlist[$field]);
|
||||
$showfield=$tmp['showfield'];
|
||||
@ -689,7 +688,7 @@ if ($resql)
|
||||
if ($fieldlist[$field]=='private') { $align='center'; }
|
||||
if ($fieldlist[$field]=='position') { $align='center'; }
|
||||
|
||||
if ($fieldlist[$field]=='joinfiles') { $valuetoshow=$langs->trans("FilesAttachedToEmail"); $align='center'; }
|
||||
if ($fieldlist[$field]=='joinfiles') { $valuetoshow=$langs->trans("FilesAttachedToEmail"); $align='center'; $forcenowrap=0; }
|
||||
if ($fieldlist[$field]=='content') { $valuetoshow=$langs->trans("Content"); $showfield=0;}
|
||||
if ($fieldlist[$field]=='content_lines') { $valuetoshow=$langs->trans("ContentLines"); $showfield=0; }
|
||||
|
||||
@ -698,8 +697,8 @@ if ($resql)
|
||||
{
|
||||
if (! empty($tabhelp[$id][$value]))
|
||||
{
|
||||
if (in_array($value, array('topic'))) $valuetoshow = $form->textwithpicto($valuetoshow, $tabhelp[$id][$value], 1, 'help', '', 0, 2, 'tooltip'.$value); // Tooltip on click
|
||||
else $valuetoshow = $form->textwithpicto($valuetoshow, $tabhelp[$id][$value], 1, 'help', '', 0, 2, '', 1); // Tooltip on hover
|
||||
if (in_array($value, array('topic'))) $valuetoshow = $form->textwithpicto($valuetoshow, $tabhelp[$id][$value], 1, 'help', '', 0, 2, 'tooltip'.$value, $forcenowrap); // Tooltip on click
|
||||
else $valuetoshow = $form->textwithpicto($valuetoshow, $tabhelp[$id][$value], 1, 'help', '', 0, 2, '', $forcenowrap); // Tooltip on hover
|
||||
}
|
||||
print getTitleFieldOfList($valuetoshow, 0, $_SERVER["PHP_SELF"], ($sortable?$fieldlist[$field]:''), ($page?'page='.$page.'&':''), $param, "align=".$align, $sortfield, $sortorder);
|
||||
}
|
||||
@ -1024,17 +1023,18 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='')
|
||||
}
|
||||
else
|
||||
{
|
||||
print $form->selectarray('type_template', $elementList, (! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:''), 1, 0, 0, '', 0, 0, 0, '', 'maxwidth200');
|
||||
print $form->selectarray('type_template', $elementList, (! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:''), 1, 0, 0, '', 0, 0, 0, '', 'maxwidth150 maxwidth100onsmartphone');
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
elseif ($context == 'add' && in_array($fieldlist[$field], array('topic', 'joinfiles', 'content', 'content_lines'))) continue;
|
||||
elseif ($context == 'add' && in_array($fieldlist[$field], array('topic', 'joinfiles', 'content', 'content_lines'))) continue;
|
||||
elseif ($context == 'edit' && in_array($fieldlist[$field], array('topic', 'joinfiles', 'content', 'content_lines'))) continue;
|
||||
elseif ($context == 'hide' && in_array($fieldlist[$field], array('topic', 'joinfiles', 'content', 'content_lines'))) continue;
|
||||
else
|
||||
{
|
||||
$size=''; $class=''; $classtd='';
|
||||
if ($fieldlist[$field]=='code') $class='maxwidth100';
|
||||
if ($fieldlist[$field]=='label') $class='maxwidth100';
|
||||
if ($fieldlist[$field]=='private') { $class='maxwidth50'; $classtd='center'; }
|
||||
if ($fieldlist[$field]=='position') { $class='maxwidth50'; $classtd='center'; }
|
||||
if ($fieldlist[$field]=='libelle') $class='quatrevingtpercent';
|
||||
|
||||
@ -96,6 +96,7 @@ if ($action == 'update')
|
||||
$menu->perms=GETPOST('perms','alpha');
|
||||
$menu->target=GETPOST('target','alpha');
|
||||
$menu->user=GETPOST('user','alpha');
|
||||
$menu->mainmenu=GETPOST('propertymainmenu','alpha');
|
||||
if (is_numeric(GETPOST('menuIdParent','alpha')))
|
||||
{
|
||||
$menu->fk_menu=GETPOST('menuIdParent','alpha');
|
||||
@ -123,14 +124,11 @@ if ($action == 'update')
|
||||
setEventMessages($menu->error, $menu->errors, 'errors');
|
||||
}
|
||||
$action = "edit";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
header("Location: ".DOL_URL_ROOT."/admin/menus/index.php?menu_handler=".$menu_handler);
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($_GET['return'])
|
||||
else
|
||||
{
|
||||
header("Location: ".DOL_URL_ROOT."/admin/menus/index.php?menu_handler=".$menu_handler);
|
||||
exit;
|
||||
@ -215,6 +213,7 @@ if ($action == 'add')
|
||||
$menu->perms=GETPOST('perms','alpha');
|
||||
$menu->target=GETPOST('target','alpha');
|
||||
$menu->user=GETPOST('user','alpha');
|
||||
$menu->mainmenu=GETPOST('propertymainmenu','alpha');
|
||||
if (is_numeric(GETPOST('menuId','int')))
|
||||
{
|
||||
$menu->fk_menu=GETPOST('menuId','int');
|
||||
@ -289,10 +288,13 @@ if ($action == 'create')
|
||||
{
|
||||
jQuery("#menuId").prop("disabled", true);
|
||||
jQuery("#menuId").val(\'\');
|
||||
jQuery("#propertymainmenu").removeAttr("disabled");
|
||||
jQuery("#propertymainmenu").val(\'\');
|
||||
}
|
||||
else
|
||||
if (jQuery("#topleft").val() == \'left\')
|
||||
{
|
||||
jQuery("#menuId").removeAttr("disabled");
|
||||
jQuery("#propertymainmenu").prop("disabled", true);
|
||||
}
|
||||
}
|
||||
init_topleft();
|
||||
@ -338,7 +340,7 @@ if ($action == 'create')
|
||||
print '</td>';
|
||||
print '<td>'.$langs->trans('DetailMenuHandler').'</td></tr>';
|
||||
|
||||
//User
|
||||
// User
|
||||
print '<tr><td class="nowrap fieldrequired">'.$langs->trans('MenuForUsers').'</td>';
|
||||
print '<td><select class="flat" name="user">';
|
||||
print '<option value="2" selected>'.$langs->trans("AllMenus").'</option>';
|
||||
@ -362,9 +364,15 @@ if ($action == 'create')
|
||||
print '<option value="left"'.($_POST["type"] && $_POST["type"]=='left'?' selected':'').'>'.$langs->trans('Left').'</option>';
|
||||
print '</select>';
|
||||
}
|
||||
// print '<input type="text" size="50" name="type" value="'.$type.'">';
|
||||
print '</td><td>'.$langs->trans('DetailType').'</td></tr>';
|
||||
|
||||
// Mainmenu code
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans('MainMenuCode').'</td>';
|
||||
print '<td><input type="text" class="minwidth300" id="propertymainmenu" name="propertymainmenu" value="'.(GETPOST("propertymainmenu", 'alpha')?GETPOST("propertymainmenu", 'alpha'):'').'"></td>';
|
||||
print '<td>';
|
||||
print $langs->trans("Example").': mytopmenukey';
|
||||
print '</td></tr>';
|
||||
|
||||
// MenuId Parent
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans('MenuIdParent').'</td>';
|
||||
if ($parent_rowid)
|
||||
@ -373,23 +381,23 @@ if ($action == 'create')
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td><input type="text" size="48" id="menuId" name="menuId" value="'.(GETPOST("menuId", 'int')?GETPOST("menuId", 'int'):'').'"></td>';
|
||||
print '<td><input type="text" class="minwidth300" id="menuId" name="menuId" value="'.(GETPOST("menuId", 'int')?GETPOST("menuId", 'int'):'').'"></td>';
|
||||
}
|
||||
print '<td>'.$langs->trans('DetailMenuIdParent');
|
||||
print ', '.$langs->trans("Example").': fk_mainmenu=abc&fk_leftmenu=def';
|
||||
print '</td></tr>';
|
||||
|
||||
// Title
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans('Title').'</td><td><input type="text" size="30" name="titre" value="'.dol_escape_htmltag(GETPOST("titre",'alpha')).'"></td><td>'.$langs->trans('DetailTitre').'</td></tr>';
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans('Title').'</td><td><input type="text" class="minwidth300" name="titre" value="'.dol_escape_htmltag(GETPOST("titre",'alpha')).'"></td><td>'.$langs->trans('DetailTitre').'</td></tr>';
|
||||
|
||||
// URL
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans('URL').'</td><td><input type="text" size="60" name="url" value="'.GETPOST("url",'alpha').'"></td><td>'.$langs->trans('DetailUrl').'</td></tr>';
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans('URL').'</td><td><input type="text" class="minwidth500" name="url" value="'.GETPOST("url",'alpha').'"></td><td>'.$langs->trans('DetailUrl').'</td></tr>';
|
||||
|
||||
// Langs
|
||||
print '<tr><td>'.$langs->trans('LangFile').'</td><td><input type="text" size="30" name="langs" value="'.$parent_langs.'"></td><td>'.$langs->trans('DetailLangs').'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans('LangFile').'</td><td><input type="text" class="minwidth300" name="langs" value="'.$parent_langs.'"></td><td>'.$langs->trans('DetailLangs').'</td></tr>';
|
||||
|
||||
// Position
|
||||
print '<tr><td>'.$langs->trans('Position').'</td><td><input type="text" size="5" name="position" value="'.dol_escape_htmltag(isset($_POST["position"])?$_POST["position"]:100).'"></td><td>'.$langs->trans('DetailPosition').'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans('Position').'</td><td><input type="text" class="width100" name="position" value="'.dol_escape_htmltag(isset($_POST["position"])?$_POST["position"]:100).'"></td><td>'.$langs->trans('DetailPosition').'</td></tr>';
|
||||
|
||||
// Target
|
||||
print '<tr><td>'.$langs->trans('Target').'</td><td><select class="flat" name="target">';
|
||||
@ -398,10 +406,10 @@ if ($action == 'create')
|
||||
print '</select></td></td><td>'.$langs->trans('DetailTarget').'</td></tr>';
|
||||
|
||||
// Enabled
|
||||
print '<tr><td>'.$langs->trans('Enabled').'</td><td><input type="text" size="60" name="enabled" value="'.GETPOST("enabled",'alpha').'"></td><td>'.$langs->trans('DetailEnabled').'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans('Enabled').'</td><td><input type="text" class="minwidth500" name="enabled" value="'.(GETPOSTISSET('enabled')?GETPOST("enabled",'alpha'):'1').'"></td><td>'.$langs->trans('DetailEnabled').'</td></tr>';
|
||||
|
||||
// Perms
|
||||
print '<tr><td>'.$langs->trans('Rights').'</td><td><input type="text" size="60" name="perms" value="'.GETPOST('perms','alpha').'"></td><td>'.$langs->trans('DetailRight').'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans('Rights').'</td><td><input type="text" class="minwidth500" name="perms" value="'.(GETPOSTISSET('perms')?GETPOST('perms','alpha'):'1').'"></td><td>'.$langs->trans('DetailRight').'</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -455,13 +463,30 @@ elseif ($action == 'edit')
|
||||
// Type
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans('Type').'</td><td>'.$langs->trans(ucfirst($menu->type)).'</td><td>'.$langs->trans('DetailType').'</td></tr>';
|
||||
|
||||
// Mainmenu code
|
||||
if ($menu->type == 'top')
|
||||
{
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans('MainMenuCode').'</td>';
|
||||
/*if ($parent_rowid)
|
||||
{
|
||||
print '<td>'.$parent_rowid.'<input type="hidden" name="propertyleftmenu" value="'.$parent_rowid.'"></td>';
|
||||
}
|
||||
else
|
||||
{*/
|
||||
print '<td><input type="text" class="minwidth300" id="propertymainmenu" name="propertymainmenu" value="'.(GETPOST("propertymainmenu", 'alpha')?GETPOST("propertymainmenu", 'alpha'):$menu->mainmenu).'"></td>';
|
||||
//}
|
||||
print '<td>';
|
||||
print $langs->trans("Example").': mytopmenukey';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// MenuId Parent
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans('MenuIdParent');
|
||||
print '</td>';
|
||||
$valtouse=$menu->fk_menu;
|
||||
if ($menu->fk_mainmenu) $valtouse='fk_mainmenu='.$menu->fk_mainmenu;
|
||||
if ($menu->fk_leftmenu) $valtouse.='&fk_leftmenu='.$menu->fk_leftmenu;
|
||||
print '<td><input type="text" name="menuIdParent" value="'.$valtouse.'" size="48"></td>';
|
||||
print '<td><input type="text" name="menuIdParent" value="'.$valtouse.'" class="minwidth300"></td>';
|
||||
print '<td>'.$langs->trans('DetailMenuIdParent');
|
||||
print ', '.$langs->trans("Example").': fk_mainmenu=abc&fk_leftmenu=def';
|
||||
print '</td></tr>';
|
||||
@ -470,16 +495,16 @@ elseif ($action == 'edit')
|
||||
//print '<tr><td>'.$langs->trans('Level').'</td><td>'.$menu->level.'</td><td>'.$langs->trans('DetailLevel').'</td></tr>';
|
||||
|
||||
// Title
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans('Title').'</td><td><input type="text" size="30" name="titre" value="'.dol_escape_htmltag($menu->titre).'"></td><td>'.$langs->trans('DetailTitre').'</td></tr>';
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans('Title').'</td><td><input type="text" class="minwidth300" name="titre" value="'.dol_escape_htmltag($menu->titre).'"></td><td>'.$langs->trans('DetailTitre').'</td></tr>';
|
||||
|
||||
// Url
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans('URL').'</td><td><input type="text" class="quatrevingtpercent" name="url" value="'.$menu->url.'"></td><td>'.$langs->trans('DetailUrl').'</td></tr>';
|
||||
|
||||
// Langs
|
||||
print '<tr><td>'.$langs->trans('LangFile').'</td><td><input type="text" size="30" name="langs" value="'.dol_escape_htmltag($menu->langs).'"></td><td>'.$langs->trans('DetailLangs').'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans('LangFile').'</td><td><input type="text" class="minwidth300" name="langs" value="'.dol_escape_htmltag($menu->langs).'"></td><td>'.$langs->trans('DetailLangs').'</td></tr>';
|
||||
|
||||
// Position
|
||||
print '<tr><td>'.$langs->trans('Position').'</td><td><input type="text" size="5" name="position" value="'.$menu->position.'"></td><td>'.$langs->trans('DetailPosition').'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans('Position').'</td><td><input type="text" class="minwidth100" name="position" value="'.$menu->position.'"></td><td>'.$langs->trans('DetailPosition').'</td></tr>';
|
||||
|
||||
// Target
|
||||
print '<tr><td>'.$langs->trans('Target').'</td><td><select class="flat" name="target">';
|
||||
@ -488,12 +513,12 @@ elseif ($action == 'edit')
|
||||
print '</select></td><td>'.$langs->trans('DetailTarget').'</td></tr>';
|
||||
|
||||
// Enabled
|
||||
print '<tr><td>'.$langs->trans('Enabled').'</td><td><input type="text" size="60" name="enabled" value="'.dol_escape_htmltag($menu->enabled).'"></td><td>'.$langs->trans('DetailEnabled');
|
||||
print '<tr><td>'.$langs->trans('Enabled').'</td><td><input type="text" class="minwidth500" name="enabled" value="'.dol_escape_htmltag($menu->enabled).'"></td><td>'.$langs->trans('DetailEnabled');
|
||||
if (! empty($menu->enabled)) print ' ('.$langs->trans("ConditionIsCurrently").': '.yn(dol_eval($menu->enabled,1)).')';
|
||||
print '</td></tr>';
|
||||
|
||||
// Perms
|
||||
print '<tr><td>'.$langs->trans('Rights').'</td><td><input type="text" size="60" name="perms" value="'.dol_escape_htmltag($menu->perms).'"></td><td>'.$langs->trans('DetailRight');
|
||||
print '<tr><td>'.$langs->trans('Rights').'</td><td><input type="text" class="minwidth500" name="perms" value="'.dol_escape_htmltag($menu->perms).'"></td><td>'.$langs->trans('DetailRight');
|
||||
if (! empty($menu->perms)) print ' ('.$langs->trans("ConditionIsCurrently").': '.yn(dol_eval($menu->perms,1)).')';
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
@ -89,7 +89,7 @@ dol_fiche_head($head, 'setup', '', 0, 'user');
|
||||
|
||||
print '<br>';
|
||||
|
||||
$arrayofsocialnetworks=array('skype'=>'Skype', 'twitter'=>'Twitter', 'facebook'=>'Facebook');
|
||||
$arrayofsocialnetworks=array('jabber'=>'Jabber', 'skype'=>'Skype', 'twitter'=>'Twitter', 'facebook'=>'Facebook');
|
||||
|
||||
foreach($arrayofsocialnetworks as $snkey => $snlabel)
|
||||
{
|
||||
|
||||
@ -413,7 +413,7 @@ class BlockedLog
|
||||
{
|
||||
if (in_array($key, $arrayoffieldstoexclude)) continue; // Discard some properties
|
||||
if (! in_array($key, array(
|
||||
'ref','facnumber','ref_client','ref_supplier','date','datef','type','total_ht','total_tva','total_ttc','localtax1','localtax2','revenuestamp','datepointoftax','note_public','lines'
|
||||
'ref','ref_client','ref_supplier','date','datef','type','total_ht','total_tva','total_ttc','localtax1','localtax2','revenuestamp','datepointoftax','note_public','lines'
|
||||
))) continue; // Discard if not into a dedicated list
|
||||
if ($key == 'lines')
|
||||
{
|
||||
@ -444,7 +444,7 @@ class BlockedLog
|
||||
{
|
||||
if (in_array($key, $arrayoffieldstoexclude)) continue; // Discard some properties
|
||||
if (! in_array($key, array(
|
||||
'ref','facnumber','ref_client','ref_supplier','date','datef','type','total_ht','total_tva','total_ttc','localtax1','localtax2','revenuestamp','datepointoftax','note_public'
|
||||
'ref','ref_client','ref_supplier','date','datef','type','total_ht','total_tva','total_ttc','localtax1','localtax2','revenuestamp','datepointoftax','note_public'
|
||||
))) continue; // Discard if not into a dedicated list
|
||||
if (!is_object($value)) $this->object_data->{$key} = $value;
|
||||
}
|
||||
@ -557,7 +557,7 @@ class BlockedLog
|
||||
{
|
||||
if (in_array($key, $arrayoffieldstoexclude)) continue; // Discard some properties
|
||||
if (! in_array($key, array(
|
||||
'ref','facnumber','ref_client','ref_supplier','date','datef','type','total_ht','total_tva','total_ttc','localtax1','localtax2','revenuestamp','datepointoftax','note_public'
|
||||
'ref','ref_client','ref_supplier','date','datef','type','total_ht','total_tva','total_ttc','localtax1','localtax2','revenuestamp','datepointoftax','note_public'
|
||||
))) continue; // Discard if not into a dedicated list
|
||||
if (!is_object($value))
|
||||
{
|
||||
|
||||
@ -65,7 +65,7 @@ class Categorie extends CommonObject
|
||||
*
|
||||
* @note This array should be remove in future, once previous constants are moved to the string value. Deprecated
|
||||
*/
|
||||
private $MAP_ID = array(
|
||||
protected $MAP_ID = array(
|
||||
'product' => 0,
|
||||
'supplier' => 1,
|
||||
'customer' => 2,
|
||||
@ -97,7 +97,7 @@ class Categorie extends CommonObject
|
||||
*
|
||||
* @note Move to const array when PHP 5.6 will be our minimum target
|
||||
*/
|
||||
private $MAP_CAT_FK = array(
|
||||
protected $MAP_CAT_FK = array(
|
||||
'product' => 'product',
|
||||
'customer' => 'soc',
|
||||
'supplier' => 'soc',
|
||||
@ -114,7 +114,7 @@ class Categorie extends CommonObject
|
||||
*
|
||||
* @note Move to const array when PHP 5.6 will be our minimum target
|
||||
*/
|
||||
private $MAP_CAT_TABLE = array(
|
||||
protected $MAP_CAT_TABLE = array(
|
||||
'product' => 'product',
|
||||
'customer' => 'societe',
|
||||
'supplier' => 'fournisseur',
|
||||
@ -131,7 +131,7 @@ class Categorie extends CommonObject
|
||||
*
|
||||
* @note Move to const array when PHP 5.6 will be our minimum target
|
||||
*/
|
||||
private $MAP_OBJ_CLASS = array(
|
||||
protected $MAP_OBJ_CLASS = array(
|
||||
'product' => 'Product',
|
||||
'customer' => 'Societe',
|
||||
'supplier' => 'Fournisseur',
|
||||
@ -148,7 +148,7 @@ class Categorie extends CommonObject
|
||||
*
|
||||
* @note Move to const array when PHP 5.6 will be our minimum target
|
||||
*/
|
||||
private $MAP_OBJ_TABLE = array(
|
||||
protected $MAP_OBJ_TABLE = array(
|
||||
'product' => 'product',
|
||||
'customer' => 'societe',
|
||||
'supplier' => 'societe',
|
||||
@ -944,7 +944,7 @@ class Categorie extends CommonObject
|
||||
*
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
private function load_motherof()
|
||||
protected function load_motherof()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
@ -1536,7 +1536,7 @@ class Categorie extends CommonObject
|
||||
if (colorIsLight($this->color)) $forced_color='categtextblack';
|
||||
}
|
||||
|
||||
$link = '<a href="'.DOL_URL_ROOT.'/categories/viewcat.php?id='.$this->id.'&type='.$this->type.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip '.$forced_color .'">';
|
||||
$link = '<a href="'.DOL_URL_ROOT.'/categories/viewcat.php?id='.$this->id.'&type='.$this->type.'&backtopage='.urlencode($_SERVER['PHP_SELF']).'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip '.$forced_color .'">';
|
||||
$linkend='</a>';
|
||||
|
||||
$picto='category';
|
||||
|
||||
@ -1292,7 +1292,8 @@ class ActionComm extends CommonObject
|
||||
$tooltip .= '<br><b>' . $langs->trans('Type') . ':</b> ' . $labeltype;
|
||||
if (! empty($this->location))
|
||||
$tooltip .= '<br><b>' . $langs->trans('Location') . ':</b> ' . $this->location;
|
||||
|
||||
if (! empty($this->note))
|
||||
$tooltip .= '<br><b>' . $langs->trans('Note') . ':</b> ' . $this->note;
|
||||
$linkclose='';
|
||||
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE) && $this->type_color)
|
||||
$linkclose = ' style="background-color:#'.$this->type_color.'"';
|
||||
|
||||
@ -1136,7 +1136,7 @@ if ($object->id > 0)
|
||||
*/
|
||||
if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
||||
{
|
||||
$sql = 'SELECT f.rowid as facid, f.facnumber, f.type, f.amount';
|
||||
$sql = 'SELECT f.rowid as facid, f.ref, f.type, f.amount';
|
||||
$sql.= ', f.total as total_ht';
|
||||
$sql.= ', f.tva as total_tva';
|
||||
$sql.= ', f.total_ttc';
|
||||
@ -1147,7 +1147,7 @@ if ($object->id > 0)
|
||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiement_facture as pf ON f.rowid=pf.fk_facture';
|
||||
$sql.= " WHERE f.fk_soc = s.rowid AND s.rowid = ".$object->id;
|
||||
$sql.= " AND f.entity = ".$conf->entity;
|
||||
$sql.= ' GROUP BY f.rowid, f.facnumber, f.type, f.amount, f.total, f.tva, f.total_ttc,';
|
||||
$sql.= ' GROUP BY f.rowid, f.ref, f.type, f.amount, f.total, f.tva, f.total_ttc,';
|
||||
$sql.= ' f.datef, f.datec, f.paye, f.fk_statut,';
|
||||
$sql.= ' s.nom, s.rowid';
|
||||
$sql.= " ORDER BY f.datef DESC, f.datec DESC";
|
||||
@ -1176,7 +1176,7 @@ if ($object->id > 0)
|
||||
$objp = $db->fetch_object($resql);
|
||||
|
||||
$facturestatic->id = $objp->facid;
|
||||
$facturestatic->ref = $objp->facnumber;
|
||||
$facturestatic->ref = $objp->ref;
|
||||
$facturestatic->type = $objp->type;
|
||||
$facturestatic->total_ht = $objp->total_ht;
|
||||
$facturestatic->total_tva = $objp->total_tva;
|
||||
|
||||
@ -72,7 +72,7 @@ $object = new Mailing($db);
|
||||
|
||||
if ($action == 'add')
|
||||
{
|
||||
$module=GETPOST("module");
|
||||
$module=GETPOST("module",'alpha');
|
||||
$result=-1;
|
||||
|
||||
foreach ($modulesdir as $dir)
|
||||
@ -89,14 +89,10 @@ if ($action == 'add')
|
||||
{
|
||||
require_once $file;
|
||||
|
||||
// We fill $filtersarray. Using this variable is now deprecated. Kept for backward compatibility.
|
||||
$filtersarray=array();
|
||||
if (isset($_POST["filter"])) $filtersarray[0]=$_POST["filter"];
|
||||
|
||||
// Add targets into database
|
||||
$obj = new $classname($db);
|
||||
dol_syslog("Call add_to_target on class ".$classname);
|
||||
$result=$obj->add_to_target($id,$filtersarray);
|
||||
$result=$obj->add_to_target($id);
|
||||
}
|
||||
}
|
||||
if ($result > 0)
|
||||
@ -329,14 +325,16 @@ if ($object->fetch($id) >= 0)
|
||||
// Si le module mailing est qualifie
|
||||
if ($qualified)
|
||||
{
|
||||
$var = ! $var;
|
||||
|
||||
if ($allowaddtarget)
|
||||
{
|
||||
print '<form class="oddeven tagtr" name="'.$modulename.'" action="'.$_SERVER['PHP_SELF'].'?action=add&id='.$object->id.'&module='.$modulename.'" method="POST" enctype="multipart/form-data">';
|
||||
print '<form '.$bctag[$var].' name="'.$modulename.'" action="'.$_SERVER['PHP_SELF'].'?action=add&id='.$object->id.'&module='.$modulename.'" method="POST" enctype="multipart/form-data">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<div class="oddeven tagtr">';
|
||||
print '<div '.$bctag[$var].'>';
|
||||
}
|
||||
|
||||
print '<div class="tagtd">';
|
||||
|
||||
@ -745,7 +745,16 @@ class AdvanceTargetingMailing extends CommonObject
|
||||
$sqlwhere[]= " (t.civility IN ('".$this->db->escape(implode("','",$arrayquery['contact_civility']))."'))";
|
||||
}
|
||||
if ($arrayquery['contact_no_email']!='') {
|
||||
$sqlwhere[]= " (t.no_email='".$this->db->escape($arrayquery['contact_no_email'])."')";
|
||||
$tmpwhere = '';
|
||||
if (! empty($arrayquery['contact_no_email']))
|
||||
{
|
||||
$tmpwhere.= "(t.email IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_unsubscribe WHERE t.entity IN (".getEntity('mailing').") AND email = '".$this->db->escape($arrayquery['contact_no_email'])."'))";
|
||||
}
|
||||
else
|
||||
{
|
||||
$tmpwhere.= "(t.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_unsubscribe WHERE t.entity IN (".getEntity('mailing').") AND email = '".$this->db->escape($arrayquery['contact_no_email'])."'))";
|
||||
}
|
||||
$sqlwhere[]= $tmpwhere;
|
||||
}
|
||||
if ($arrayquery['contact_update_st_dt']!='') {
|
||||
$sqlwhere[]= " (t.tms >= '".$this->db->idate($arrayquery['contact_update_st_dt'])."' AND t.tms <= '".$this->db->idate($arrayquery['contact_update_end_dt'])."')";
|
||||
|
||||
@ -2778,7 +2778,7 @@ class Propal extends CommonObject
|
||||
|
||||
if (count($linkedInvoices) > 0)
|
||||
{
|
||||
$sql= "SELECT rowid as facid, facnumber, total, datef as df, fk_user_author, fk_statut, paye";
|
||||
$sql= "SELECT rowid as facid, ref, total, datef as df, fk_user_author, fk_statut, paye";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture";
|
||||
$sql.= " WHERE rowid IN (".implode(',',$linkedInvoices).")";
|
||||
|
||||
|
||||
@ -415,7 +415,7 @@ if ($socid > 0)
|
||||
$sql.= " rc.datec as dc, rc.description,";
|
||||
$sql.= " rc.fk_facture_source,";
|
||||
$sql.= " u.login, u.rowid as user_id,";
|
||||
$sql.= " fa.facnumber as ref, fa.type as type";
|
||||
$sql.= " fa.ref as ref, fa.type as type";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."user as u, ".MAIN_DB_PREFIX."societe_remise_except as rc";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as fa ON rc.fk_facture_source = fa.rowid";
|
||||
$sql.= " WHERE rc.fk_soc = " . $object->id;
|
||||
@ -704,8 +704,8 @@ if ($socid > 0)
|
||||
$sql.= " rc.datec as dc, rc.description, rc.fk_facture_line, rc.fk_facture,";
|
||||
$sql.= " rc.fk_facture_source,";
|
||||
$sql.= " u.login, u.rowid as user_id,";
|
||||
$sql.= " f.rowid, f.facnumber,";
|
||||
$sql.= " fa.facnumber as ref, fa.type as type";
|
||||
$sql.= " f.rowid, f.ref,";
|
||||
$sql.= " fa.ref as ref, fa.type as type";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture as f";
|
||||
$sql.= " , ".MAIN_DB_PREFIX."user as u";
|
||||
$sql.= " , ".MAIN_DB_PREFIX."facturedet as fc";
|
||||
@ -723,8 +723,8 @@ if ($socid > 0)
|
||||
$sql2.= " rc.datec as dc, rc.description, rc.fk_facture_line, rc.fk_facture,";
|
||||
$sql2.= " rc.fk_facture_source,";
|
||||
$sql2.= " u.login, u.rowid as user_id,";
|
||||
$sql2.= " f.rowid, f.facnumber,";
|
||||
$sql2.= " fa.facnumber as ref, fa.type as type";
|
||||
$sql2.= " f.rowid, f.ref,";
|
||||
$sql2.= " fa.ref as ref, fa.type as type";
|
||||
$sql2.= " FROM ".MAIN_DB_PREFIX."facture as f";
|
||||
$sql2.= " , ".MAIN_DB_PREFIX."user as u";
|
||||
$sql2.= " , ".MAIN_DB_PREFIX."societe_remise_except as rc";
|
||||
@ -819,7 +819,7 @@ if ($socid > 0)
|
||||
print $obj->description;
|
||||
print '</td>';
|
||||
}
|
||||
print '<td align="left" class="nowrap"><a href="'.DOL_URL_ROOT.'/compta/facture/card.php?facid='.$obj->rowid.'">'.img_object($langs->trans("ShowBill"),'bill').' '.$obj->facnumber.'</a></td>';
|
||||
print '<td align="left" class="nowrap"><a href="'.DOL_URL_ROOT.'/compta/facture/card.php?facid='.$obj->rowid.'">'.img_object($langs->trans("ShowBill"),'bill').' '.$obj->ref.'</a></td>';
|
||||
print '<td align="right">'.price($obj->amount_ht).'</td>';
|
||||
print '<td align="right">'.price2num($obj->tva_tx,'MU').'%</td>';
|
||||
print '<td align="right">'.price($obj->amount_ttc).'</td>';
|
||||
@ -858,7 +858,7 @@ if ($socid > 0)
|
||||
$sql.= " rc.datec as dc, rc.description, rc.fk_invoice_supplier_line, rc.fk_invoice_supplier,";
|
||||
$sql.= " rc.fk_invoice_supplier_source,";
|
||||
$sql.= " u.login, u.rowid as user_id,";
|
||||
$sql.= " f.rowid, f.ref as facnumber,";
|
||||
$sql.= " f.rowid, f.ref as ref,";
|
||||
$sql.= " fa.ref, fa.type as type";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn as f";
|
||||
$sql.= " , ".MAIN_DB_PREFIX."user as u";
|
||||
@ -877,7 +877,7 @@ if ($socid > 0)
|
||||
$sql2.= " rc.datec as dc, rc.description, rc.fk_invoice_supplier_line, rc.fk_invoice_supplier,";
|
||||
$sql2.= " rc.fk_invoice_supplier_source,";
|
||||
$sql2.= " u.login, u.rowid as user_id,";
|
||||
$sql2.= " f.rowid, f.ref as facnumber,";
|
||||
$sql2.= " f.rowid, f.ref as ref,";
|
||||
$sql2.= " fa.ref, fa.type as type";
|
||||
$sql2.= " FROM ".MAIN_DB_PREFIX."facture_fourn as f";
|
||||
$sql2.= " , ".MAIN_DB_PREFIX."user as u";
|
||||
@ -973,7 +973,7 @@ if ($socid > 0)
|
||||
print $obj->description;
|
||||
print '</td>';
|
||||
}
|
||||
print '<td align="left" class="nowrap"><a href="'.DOL_URL_ROOT.'/fourn/facture/card.php?facid='.$obj->rowid.'">'.img_object($langs->trans("ShowBill"),'bill').' '.$obj->facnumber.'</a></td>';
|
||||
print '<td align="left" class="nowrap"><a href="'.DOL_URL_ROOT.'/fourn/facture/card.php?facid='.$obj->rowid.'">'.img_object($langs->trans("ShowBill"),'bill').' '.$obj->ref.'</a></td>';
|
||||
print '<td align="right">'.price($obj->amount_ht).'</td>';
|
||||
print '<td align="right">'.price2num($obj->tva_tx,'MU').'%</td>';
|
||||
print '<td align="right">'.price($obj->amount_ttc).'</td>';
|
||||
|
||||
@ -136,7 +136,7 @@ if (($action == 'create' || $action == 'add') && !$error)
|
||||
$closeOrders = GETPOST('autocloseorders') ? true : false;
|
||||
|
||||
// Security check
|
||||
$fieldid = GETPOST('ref','alpha')?'facnumber':'rowid';
|
||||
$fieldid = GETPOST('ref','alpha')?'ref':'rowid';
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result = restrictedArea($user, 'facture', $id,'','','fk_soc',$fieldid);
|
||||
|
||||
@ -163,7 +163,7 @@ if (($action == 'create' || $action == 'add') && !$error)
|
||||
// Si facture standard
|
||||
$object->socid = $_POST['socid'];
|
||||
$object->type = $_POST['type'];
|
||||
$object->number = $_POST['facnumber'];
|
||||
$object->number = $_POST['ref'];
|
||||
$object->date = $datefacture;
|
||||
$object->note_public = trim($_POST['note_public']);
|
||||
$object->note = trim($_POST['note']);
|
||||
@ -405,7 +405,7 @@ if ($action == 'create' && !$error)
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
print '<input type="hidden" name="socid" value="'.$soc->id.'">' ."\n";
|
||||
print '<input name="facnumber" type="hidden" value="provisoire">';
|
||||
print '<input name="ref" type="hidden" value="provisoire">';
|
||||
print '<input name="ref_client" type="hidden" value="'.$ref_client.'">';
|
||||
print '<input name="ref_int" type="hidden" value="'.$ref_int.'">';
|
||||
print '<input type="hidden" name="origin" value="'.GETPOST('origin').'">';
|
||||
|
||||
@ -136,7 +136,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
|
||||
$sqls = array();
|
||||
|
||||
// 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.ref as ref, f.total_ttc, f.type, f.date_lim_reglement as dlr,";
|
||||
$sql.= " s.rowid as socid, s.nom as name, s.fournisseur";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture as f";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON f.fk_soc = s.rowid";
|
||||
|
||||
@ -88,7 +88,7 @@ $filesarray=array();
|
||||
$result=false;
|
||||
if(($action=="searchfiles"||$action=="dl" ) && $date_start && $date_stop){
|
||||
$wheretail=" '".$db->idate($date_start)."' AND '".$db->idate($date_stop)."'";
|
||||
$sql="SELECT rowid as id, facnumber as ref,paye as paid,total_ttc,fk_soc,datef as date, 'Invoice' as item FROM ".MAIN_DB_PREFIX."facture";
|
||||
$sql="SELECT rowid as id, ref as ref,paye as paid,total_ttc,fk_soc,datef as date, 'Invoice' as item FROM ".MAIN_DB_PREFIX."facture";
|
||||
$sql.=" WHERE datef between ".$wheretail;
|
||||
$sql.=" UNION ALL";
|
||||
$sql.=" SELECT rowid as id,ref, paye as paid, total_ttc, fk_soc,datef as date, 'InvoiceSupplier' as item FROM ".MAIN_DB_PREFIX."facture_fourn";
|
||||
|
||||
@ -128,7 +128,7 @@ $permissiondellink = $usercancreate; // Used by the include of actions_dellink.i
|
||||
$permissiontoedit = $usercancreate; // Used by the include of actions_lineupdonw.inc.php
|
||||
|
||||
// Security check
|
||||
$fieldid = (! empty($ref) ? 'facnumber' : 'rowid');
|
||||
$fieldid = (! empty($ref) ? 'ref' : 'rowid');
|
||||
if ($user->societe_id) $socid = $user->societe_id;
|
||||
$isdraft = (($object->statut == Facture::STATUS_DRAFT) ? 1 : 0);
|
||||
$result = restrictedArea($user, 'facture', $id, '', '', 'fk_soc', $fieldid, $isdraft);
|
||||
@ -912,7 +912,7 @@ if (empty($reshook))
|
||||
if (! $error)
|
||||
{
|
||||
$object->socid = GETPOST('socid','int');
|
||||
$object->number = $_POST['facnumber'];
|
||||
$object->number = $_POST['ref'];
|
||||
$object->date = $dateinvoice;
|
||||
$object->date_pointoftax = $date_pointoftax;
|
||||
$object->note_public = trim(GETPOST('note_public','none'));
|
||||
@ -1093,7 +1093,7 @@ if (empty($reshook))
|
||||
{
|
||||
$object->socid = GETPOST('socid','int');
|
||||
$object->type = $_POST['type'];
|
||||
$object->number = $_POST['facnumber'];
|
||||
$object->number = $_POST['ref'];
|
||||
$object->date = $dateinvoice;
|
||||
$object->date_pointoftax = $date_pointoftax;
|
||||
$object->note_public = trim(GETPOST('note_public','none'));
|
||||
@ -1144,7 +1144,7 @@ if (empty($reshook))
|
||||
// Si facture standard
|
||||
$object->socid = GETPOST('socid','int');
|
||||
$object->type = GETPOST('type');
|
||||
$object->number = $_POST['facnumber'];
|
||||
$object->number = $_POST['ref'];
|
||||
$object->date = $dateinvoice;
|
||||
$object->date_pointoftax = $date_pointoftax;
|
||||
$object->note_public = trim(GETPOST('note_public','none'));
|
||||
@ -2718,7 +2718,7 @@ if ($action == 'create')
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
if ($soc->id > 0) print '<input type="hidden" name="socid" value="' . $soc->id . '">' . "\n";
|
||||
print '<input name="facnumber" type="hidden" value="provisoire">';
|
||||
print '<input name="ref" type="hidden" value="provisoire">';
|
||||
print '<input name="ref_client" type="hidden" value="' . $ref_client . '">';
|
||||
print '<input name="ref_int" type="hidden" value="' . $ref_int . '">';
|
||||
print '<input type="hidden" name="origin" value="' . $origin . '">';
|
||||
@ -3740,7 +3740,7 @@ else if ($id > 0 || ! empty($ref))
|
||||
|
||||
$object->totalpaye = $totalpaye; // To give a chance to dol_banner_tab to use already paid amount to show correct status
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'facnumber', 'ref', $morehtmlref, '', 0, '', '');
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '');
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="fichehalfleft">';
|
||||
|
||||
@ -93,7 +93,7 @@ class Facture extends CommonInvoice
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $table_ref_field = 'facnumber';
|
||||
protected $table_ref_field = 'ref';
|
||||
|
||||
public $socid;
|
||||
|
||||
@ -450,7 +450,7 @@ class Facture extends CommonInvoice
|
||||
$socid = $this->socid;
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."facture (";
|
||||
$sql.= " facnumber";
|
||||
$sql.= " ref";
|
||||
$sql.= ", entity";
|
||||
$sql.= ", ref_ext";
|
||||
$sql.= ", type";
|
||||
@ -514,7 +514,7 @@ class Facture extends CommonInvoice
|
||||
|
||||
// Update ref with new one
|
||||
$this->ref='(PROV'.$this->id.')';
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."facture SET facnumber='".$this->db->escape($this->ref)."' WHERE rowid=".$this->id;
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."facture SET ref='".$this->db->escape($this->ref)."' WHERE rowid=".$this->id;
|
||||
|
||||
$resql=$this->db->query($sql);
|
||||
if (! $resql) $error++;
|
||||
@ -1310,7 +1310,7 @@ class Facture extends CommonInvoice
|
||||
|
||||
if (empty($rowid) && empty($ref) && empty($ref_ext) && empty($ref_int)) return -1;
|
||||
|
||||
$sql = 'SELECT f.rowid,f.entity,f.facnumber,f.ref_client,f.ref_ext,f.ref_int,f.type,f.fk_soc,f.amount';
|
||||
$sql = 'SELECT f.rowid,f.entity,f.ref,f.ref_client,f.ref_ext,f.ref_int,f.type,f.fk_soc,f.amount';
|
||||
$sql.= ', f.tva, f.localtax1, f.localtax2, f.total, f.total_ttc, f.revenuestamp';
|
||||
$sql.= ', f.remise_percent, f.remise_absolue, f.remise';
|
||||
$sql.= ', f.datef as df, f.date_pointoftax';
|
||||
@ -1336,7 +1336,7 @@ class Facture extends CommonInvoice
|
||||
if ($rowid) $sql.= " WHERE f.rowid=".$rowid;
|
||||
else $sql.= ' WHERE f.entity IN ('.getEntity('facture').')'; // Dont't use entity if you use rowid
|
||||
|
||||
if ($ref) $sql.= " AND f.facnumber='".$this->db->escape($ref)."'";
|
||||
if ($ref) $sql.= " AND f.ref='".$this->db->escape($ref)."'";
|
||||
if ($ref_ext) $sql.= " AND f.ref_ext='".$this->db->escape($ref_ext)."'";
|
||||
if ($ref_int) $sql.= " AND f.ref_int='".$this->db->escape($ref_int)."'";
|
||||
|
||||
@ -1351,7 +1351,7 @@ class Facture extends CommonInvoice
|
||||
$this->id = $obj->rowid;
|
||||
$this->entity = $obj->entity;
|
||||
|
||||
$this->ref = $obj->facnumber;
|
||||
$this->ref = $obj->ref;
|
||||
$this->ref_client = $obj->ref_client;
|
||||
$this->ref_ext = $obj->ref_ext;
|
||||
$this->ref_int = $obj->ref_int;
|
||||
@ -1615,7 +1615,7 @@ class Facture extends CommonInvoice
|
||||
|
||||
// Clean parameters
|
||||
if (empty($this->type)) $this->type= self::TYPE_STANDARD;
|
||||
if (isset($this->facnumber)) $this->facnumber=trim($this->ref);
|
||||
if (isset($this->ref)) $this->ref=trim($this->ref);
|
||||
if (isset($this->ref_client)) $this->ref_client=trim($this->ref_client);
|
||||
if (isset($this->increment)) $this->increment=trim($this->increment);
|
||||
if (isset($this->close_code)) $this->close_code=trim($this->close_code);
|
||||
@ -1631,7 +1631,7 @@ class Facture extends CommonInvoice
|
||||
|
||||
// Update request
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."facture SET";
|
||||
$sql.= " facnumber=".(isset($this->ref)?"'".$this->db->escape($this->ref)."'":"null").",";
|
||||
$sql.= " ref=".(isset($this->ref)?"'".$this->db->escape($this->ref)."'":"null").",";
|
||||
$sql.= " type=".(isset($this->type)?$this->db->escape($this->type):"null").",";
|
||||
$sql.= " ref_client=".(isset($this->ref_client)?"'".$this->db->escape($this->ref_client)."'":"null").",";
|
||||
$sql.= " increment=".(isset($this->increment)?"'".$this->db->escape($this->increment)."'":"null").",";
|
||||
@ -2337,7 +2337,7 @@ class Facture extends CommonInvoice
|
||||
|
||||
// Validate
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.'facture';
|
||||
$sql.= " SET facnumber='".$num."', fk_statut = ".self::STATUS_VALIDATED.", fk_user_valid = ".($user->id > 0 ? $user->id : "null").", date_valid = '".$this->db->idate($now)."'";
|
||||
$sql.= " SET ref='".$num."', fk_statut = ".self::STATUS_VALIDATED.", fk_user_valid = ".($user->id > 0 ? $user->id : "null").", date_valid = '".$this->db->idate($now)."'";
|
||||
if (! empty($conf->global->FAC_FORCE_DATE_VALIDATION)) // If option enabled, we force invoice date
|
||||
{
|
||||
$sql.= ", datef='".$this->db->idate($this->date)."'";
|
||||
@ -2446,7 +2446,7 @@ class Facture extends CommonInvoice
|
||||
if (! $error)
|
||||
{
|
||||
$this->ref = $num;
|
||||
$this->facnumber=$num;
|
||||
$this->ref=$num;
|
||||
$this->statut= self::STATUS_VALIDATED;
|
||||
$this->brouillon=0;
|
||||
$this->date_validation=$now;
|
||||
@ -3481,7 +3481,7 @@ class Facture extends CommonInvoice
|
||||
$ga = array();
|
||||
|
||||
$sql = "SELECT s.rowid, s.nom as name, s.client,";
|
||||
$sql.= " f.rowid as fid, f.facnumber as ref, f.datef as df";
|
||||
$sql.= " f.rowid as fid, f.ref as ref, f.datef as df";
|
||||
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."facture as f";
|
||||
if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
@ -3551,7 +3551,7 @@ class Facture extends CommonInvoice
|
||||
|
||||
$return = array();
|
||||
|
||||
$sql = "SELECT f.rowid as rowid, f.facnumber, f.fk_statut,";
|
||||
$sql = "SELECT f.rowid as rowid, f.ref, f.fk_statut,";
|
||||
$sql.= " ff.rowid as rowidnext";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture as f";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON f.rowid = pf.fk_facture";
|
||||
@ -3562,7 +3562,7 @@ class Facture extends CommonInvoice
|
||||
$sql.= " AND pf.fk_paiement IS NULL"; // Aucun paiement deja fait
|
||||
$sql.= " AND ff.fk_statut IS NULL"; // Renvoi vrai si pas facture de remplacement
|
||||
if ($socid > 0) $sql.=" AND f.fk_soc = ".$socid;
|
||||
$sql.= " ORDER BY f.facnumber";
|
||||
$sql.= " ORDER BY f.ref";
|
||||
|
||||
dol_syslog(get_class($this)."::list_replacable_invoices", LOG_DEBUG);
|
||||
$resql=$this->db->query($sql);
|
||||
@ -3571,7 +3571,7 @@ class Facture extends CommonInvoice
|
||||
while ($obj=$this->db->fetch_object($resql))
|
||||
{
|
||||
$return[$obj->rowid]=array( 'id' => $obj->rowid,
|
||||
'ref' => $obj->facnumber,
|
||||
'ref' => $obj->ref,
|
||||
'status' => $obj->fk_statut);
|
||||
}
|
||||
//print_r($return);
|
||||
@ -3602,7 +3602,7 @@ class Facture extends CommonInvoice
|
||||
$return = array();
|
||||
|
||||
|
||||
$sql = "SELECT f.rowid as rowid, f.facnumber, f.fk_statut, f.type, f.paye, pf.fk_paiement";
|
||||
$sql = "SELECT f.rowid as rowid, f.ref, f.fk_statut, f.type, f.paye, pf.fk_paiement";
|
||||
$sql.= " FROM ".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."facture as ff ON (f.rowid = ff.fk_facture_source AND ff.type=".self::TYPE_REPLACEMENT.")";
|
||||
@ -3631,7 +3631,7 @@ class Facture extends CommonInvoice
|
||||
}
|
||||
|
||||
if ($socid > 0) $sql.=" AND f.fk_soc = ".$socid;
|
||||
$sql.= " ORDER BY f.facnumber";
|
||||
$sql.= " ORDER BY f.ref";
|
||||
|
||||
dol_syslog(get_class($this)."::list_qualified_avoir_invoices", LOG_DEBUG);
|
||||
$resql=$this->db->query($sql);
|
||||
@ -3644,9 +3644,9 @@ class Facture extends CommonInvoice
|
||||
if ($obj->fk_statut == self::STATUS_CLOSED) $qualified=1;
|
||||
if ($qualified)
|
||||
{
|
||||
//$ref=$obj->facnumber;
|
||||
//$ref=$obj->ref;
|
||||
$paymentornot=($obj->fk_paiement?1:0);
|
||||
$return[$obj->rowid]=array('ref'=>$obj->facnumber,'status'=>$obj->fk_statut,'type'=>$obj->type,'paye'=>$obj->paye,'paymentornot'=>$paymentornot);
|
||||
$return[$obj->rowid]=array('ref'=>$obj->ref,'status'=>$obj->fk_statut,'type'=>$obj->type,'paye'=>$obj->paye,'paymentornot'=>$paymentornot);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -193,7 +193,7 @@ if ($id > 0 || ! empty($ref))
|
||||
|
||||
$object->totalpaye = $totalpaye; // To give a chance to dol_banner_tab to use already paid amount to show correct status
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'facnumber', 'ref', $morehtmlref, '', 0, '', '', 1);
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1);
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
@ -160,7 +160,7 @@ if ($id > 0 || ! empty($ref))
|
||||
|
||||
$object->totalpaye = $totalpaye; // To give a chance to dol_banner_tab to use already paid amount to show correct status
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'facnumber', 'ref', $morehtmlref, '', 0);
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0);
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
@ -107,7 +107,7 @@ $morehtmlref.='</div>';
|
||||
|
||||
$object->totalpaye = $totalpaye; // To give a chance to dol_banner_tab to use already paid amount to show correct status
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'facnumber', 'ref', $morehtmlref, '', 0);
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0);
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
@ -117,7 +117,7 @@ $pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
|
||||
// Security check
|
||||
$fieldid = (! empty($ref)?'facnumber':'rowid');
|
||||
$fieldid = (! empty($ref)?'ref':'rowid');
|
||||
if (! empty($user->societe_id)) $socid=$user->societe_id;
|
||||
$result = restrictedArea($user, 'facture', $id,'','','fk_soc',$fieldid);
|
||||
|
||||
@ -138,7 +138,7 @@ $search_array_options=$extrafields->getOptionalsFromPost($object->table_element,
|
||||
|
||||
// List of fields to search into when doing a "search in all"
|
||||
$fieldstosearchall = array(
|
||||
'f.facnumber'=>'Ref',
|
||||
'f.ref'=>'Ref',
|
||||
'f.ref_client'=>'RefCustomer',
|
||||
'pd.description'=>'Description',
|
||||
's.nom'=>"ThirdParty",
|
||||
@ -148,7 +148,7 @@ if (empty($user->socid)) $fieldstosearchall["f.note_private"]="NotePrivate";
|
||||
|
||||
$checkedtypetiers=0;
|
||||
$arrayfields=array(
|
||||
'f.facnumber'=>array('label'=>"Ref", 'checked'=>1),
|
||||
'f.ref'=>array('label'=>"Ref", 'checked'=>1),
|
||||
'f.ref_client'=>array('label'=>"RefCustomer", 'checked'=>1),
|
||||
'f.type'=>array('label'=>"Type", 'checked'=>0),
|
||||
'f.date'=>array('label'=>"DateInvoice", 'checked'=>1),
|
||||
@ -358,7 +358,7 @@ $thirdpartystatic=new Societe($db);
|
||||
|
||||
$sql = 'SELECT';
|
||||
if ($sall || $search_product_category > 0) $sql = 'SELECT DISTINCT';
|
||||
$sql.= ' f.rowid as id, f.facnumber as ref, f.ref_client, f.type, f.note_private, f.note_public, f.increment, f.fk_mode_reglement, f.total as total_ht, f.tva as total_vat, f.total_ttc,';
|
||||
$sql.= ' f.rowid as id, f.ref as ref, f.ref_client, f.type, f.note_private, f.note_public, f.increment, f.fk_mode_reglement, f.total as total_ht, f.tva as total_vat, f.total_ttc,';
|
||||
$sql.= ' f.localtax1 as total_localtax1, f.localtax2 as total_localtax2,';
|
||||
$sql.= ' f.datef as df, f.date_lim_reglement as datelimite,';
|
||||
$sql.= ' f.paye as paye, f.fk_statut,';
|
||||
@ -417,7 +417,7 @@ if ($filtre)
|
||||
$sql .= ' AND ' . $db->escape(trim($filt[0])) . ' = ' . $db->escape(trim($filt[1]));
|
||||
}
|
||||
}
|
||||
if ($search_ref) $sql .= natural_search('f.facnumber', $search_ref);
|
||||
if ($search_ref) $sql .= natural_search('f.ref', $search_ref);
|
||||
if ($search_refcustomer) $sql .= natural_search('f.ref_client', $search_refcustomer);
|
||||
if ($search_type != '' && $search_type != '-1') $sql.=" AND f.type IN (".$db->escape($search_type).")";
|
||||
if ($search_project) $sql .= natural_search('p.ref', $search_project);
|
||||
@ -491,7 +491,7 @@ $sql.=$hookmanager->resPrint;
|
||||
|
||||
if (! $sall)
|
||||
{
|
||||
$sql.= ' GROUP BY f.rowid, f.facnumber, ref_client, f.type, f.note_private, f.note_public, f.increment, f.fk_mode_reglement, f.total, f.tva, f.total_ttc,';
|
||||
$sql.= ' GROUP BY f.rowid, f.ref, ref_client, f.type, f.note_private, f.note_public, f.increment, f.fk_mode_reglement, f.total, f.tva, f.total_ttc,';
|
||||
$sql.= ' f.localtax1, f.localtax2,';
|
||||
$sql.= ' f.datef, f.date_lim_reglement,';
|
||||
$sql.= ' f.paye, f.fk_statut,';
|
||||
@ -706,7 +706,7 @@ if ($resql)
|
||||
// Filters lines
|
||||
print '<tr class="liste_titre_filter">';
|
||||
// Ref
|
||||
if (! empty($arrayfields['f.facnumber']['checked']))
|
||||
if (! empty($arrayfields['f.ref']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" size="6" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).'">';
|
||||
@ -878,7 +878,7 @@ if ($resql)
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
if (! empty($arrayfields['f.facnumber']['checked'])) print_liste_field_titre($arrayfields['f.facnumber']['label'],$_SERVER['PHP_SELF'],'f.facnumber','',$param,'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['f.ref']['checked'])) print_liste_field_titre($arrayfields['f.ref']['label'],$_SERVER['PHP_SELF'],'f.ref','',$param,'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['f.ref_client']['checked'])) print_liste_field_titre($arrayfields['f.ref_client']['label'],$_SERVER["PHP_SELF"],'f.ref_client','',$param,'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['f.type']['checked'])) print_liste_field_titre($arrayfields['f.type']['label'],$_SERVER["PHP_SELF"],'f.type','',$param,'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['f.date']['checked'])) print_liste_field_titre($arrayfields['f.date']['label'],$_SERVER['PHP_SELF'],'f.datef','',$param,'align="center"',$sortfield,$sortorder);
|
||||
@ -960,7 +960,7 @@ if ($resql)
|
||||
}
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
if (! empty($arrayfields['f.facnumber']['checked']))
|
||||
if (! empty($arrayfields['f.ref']['checked']))
|
||||
{
|
||||
print '<td class="nowrap">';
|
||||
|
||||
|
||||
@ -130,7 +130,7 @@ if ($id > 0 || ! empty($ref))
|
||||
|
||||
$object->totalpaye = $totalpaye; // To give a chance to dol_banner_tab to use already paid amount to show correct status
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'facnumber', 'ref', $morehtmlref, '', 0);
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0);
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
@ -45,7 +45,7 @@ $ref=GETPOST('ref','alpha');
|
||||
$socid=GETPOST('socid','int');
|
||||
$action=GETPOST('action','alpha');
|
||||
|
||||
$fieldid = (! empty($ref)?'facnumber':'rowid');
|
||||
$fieldid = (! empty($ref)?'ref':'rowid');
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result = restrictedArea($user, 'facture', $id, '', '', 'fk_soc', $fieldid);
|
||||
|
||||
@ -208,7 +208,7 @@ if ($object->id > 0)
|
||||
|
||||
$object->totalpaye = $totalpaye; // To give a chance to dol_banner_tab to use already paid amount to show correct status
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'facnumber', 'ref', $morehtmlref, '', 0, '', '');
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '');
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="fichehalfleft">';
|
||||
|
||||
@ -136,7 +136,7 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele
|
||||
*/
|
||||
if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
||||
{
|
||||
$sql = "SELECT f.facnumber";
|
||||
$sql = "SELECT f.ref";
|
||||
$sql.= ", f.rowid, f.total as total_ht, f.tva as total_tva, f.total_ttc, f.ref_client";
|
||||
$sql.= ", f.type";
|
||||
$sql.= ", s.nom as name";
|
||||
@ -177,7 +177,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
$facturestatic->ref=$obj->facnumber;
|
||||
$facturestatic->ref=$obj->ref;
|
||||
$facturestatic->id=$obj->rowid;
|
||||
$facturestatic->total_ht=$obj->total_ht;
|
||||
$facturestatic->total_tva=$obj->total_tva;
|
||||
@ -320,7 +320,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
||||
$langs->load("boxes");
|
||||
$facstatic=new Facture($db);
|
||||
|
||||
$sql = "SELECT f.rowid, f.facnumber, f.fk_statut, f.type, f.total as total_ht, f.tva as total_tva, f.total_ttc, f.paye, f.tms";
|
||||
$sql = "SELECT f.rowid, f.ref, f.fk_statut, f.type, f.total as total_ht, f.tva as total_tva, f.total_ttc, f.paye, f.tms";
|
||||
$sql.= ", f.date_lim_reglement as datelimite";
|
||||
$sql.= ", s.nom as name";
|
||||
$sql.= ", s.rowid as socid";
|
||||
@ -339,7 +339,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
||||
$reshook=$hookmanager->executeHooks('printFieldListWhereCustomerLastModified',$parameters);
|
||||
$sql.=$hookmanager->resPrint;
|
||||
|
||||
$sql.= " GROUP BY f.rowid, f.facnumber, f.fk_statut, f.type, f.total, f.tva, f.total_ttc, f.paye, f.tms, f.date_lim_reglement,";
|
||||
$sql.= " GROUP BY f.rowid, f.ref, f.fk_statut, f.type, f.total, f.tva, f.total_ttc, f.paye, f.tms, f.date_lim_reglement,";
|
||||
$sql.= " s.nom, s.rowid, s.code_client, s.code_compta, s.email,";
|
||||
$sql.= " cc.rowid, cc.code";
|
||||
$sql.= " ORDER BY f.tms DESC ";
|
||||
@ -365,7 +365,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
$facturestatic->ref=$obj->facnumber;
|
||||
$facturestatic->ref=$obj->ref;
|
||||
$facturestatic->id=$obj->rowid;
|
||||
$facturestatic->total_ht=$obj->total_ht;
|
||||
$facturestatic->total_tva=$obj->total_tva;
|
||||
@ -399,8 +399,8 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
||||
}
|
||||
print '</td>';
|
||||
print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">';
|
||||
$filename=dol_sanitizeFileName($obj->facnumber);
|
||||
$filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($obj->facnumber);
|
||||
$filename=dol_sanitizeFileName($obj->ref);
|
||||
$filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
||||
$urlsource=$_SERVER['PHP_SELF'].'?facid='.$obj->rowid;
|
||||
print $formfile->getDocumentsLink($facturestatic->element, $filename, $filedir);
|
||||
print '</td></tr></table>';
|
||||
@ -812,7 +812,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
||||
{
|
||||
$facstatic=new Facture($db);
|
||||
|
||||
$sql = "SELECT f.rowid, f.facnumber, f.fk_statut, f.datef, f.type, f.total as total_ht, f.tva as total_tva, f.total_ttc, f.paye, f.tms";
|
||||
$sql = "SELECT f.rowid, f.ref, f.fk_statut, f.datef, f.type, f.total as total_ht, f.tva as total_tva, f.total_ttc, f.paye, f.tms";
|
||||
$sql.= ", f.date_lim_reglement as datelimite";
|
||||
$sql.= ", s.nom as name";
|
||||
$sql.= ", s.rowid as socid, s.email";
|
||||
@ -831,9 +831,9 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
||||
$reshook=$hookmanager->executeHooks('printFieldListWhereCustomerUnpaid',$parameters);
|
||||
$sql.=$hookmanager->resPrint;
|
||||
|
||||
$sql.= " GROUP BY f.rowid, f.facnumber, f.fk_statut, f.datef, f.type, f.total, f.tva, f.total_ttc, f.paye, f.tms, f.date_lim_reglement,";
|
||||
$sql.= " GROUP BY f.rowid, f.ref, f.fk_statut, f.datef, f.type, f.total, f.tva, f.total_ttc, f.paye, f.tms, f.date_lim_reglement,";
|
||||
$sql.= " s.nom, s.rowid, s.email, s.code_client, s.code_compta, cc.rowid, cc.code";
|
||||
$sql.= " ORDER BY f.datef ASC, f.facnumber ASC";
|
||||
$sql.= " ORDER BY f.datef ASC, f.ref ASC";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
@ -858,7 +858,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
$facturestatic->ref=$obj->facnumber;
|
||||
$facturestatic->ref=$obj->ref;
|
||||
$facturestatic->id=$obj->rowid;
|
||||
$facturestatic->total_ht=$obj->total_ht;
|
||||
$facturestatic->total_tva=$obj->total_tva;
|
||||
@ -891,8 +891,8 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
||||
}
|
||||
print '</td>';
|
||||
print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">';
|
||||
$filename=dol_sanitizeFileName($obj->facnumber);
|
||||
$filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($obj->facnumber);
|
||||
$filename=dol_sanitizeFileName($obj->ref);
|
||||
$filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
||||
$urlsource=$_SERVER['PHP_SELF'].'?facid='.$obj->rowid;
|
||||
print $formfile->getDocumentsLink($facturestatic->element, $filename, $filedir);
|
||||
print '</td></tr></table>';
|
||||
|
||||
@ -100,7 +100,7 @@ report_header($name,'',$period,$periodlink,$description,$builddate,$exportlink);
|
||||
$p = explode(":", $conf->global->MAIN_INFO_SOCIETE_COUNTRY);
|
||||
$idpays = $p[0];
|
||||
|
||||
$sql = "SELECT f.rowid, f.facnumber, f.type, f.datef, f.ref_client,";
|
||||
$sql = "SELECT f.rowid, f.ref, f.type, f.datef, f.ref_client,";
|
||||
$sql.= " fd.product_type, fd.total_ht, fd.total_tva, fd.tva_tx, fd.total_ttc, fd.localtax1_tx, fd.localtax2_tx, fd.total_localtax1, fd.total_localtax2, fd.rowid as id, fd.situation_percent,";
|
||||
$sql.= " s.rowid as socid, s.nom as name, s.code_compta, s.client,";
|
||||
$sql.= " p.rowid as pid, p.ref as pref, p.accountancy_code_sell,";
|
||||
@ -180,7 +180,7 @@ if ($result)
|
||||
|
||||
//la ligne facture
|
||||
$tabfac[$obj->rowid]["date"] = $obj->datef;
|
||||
$tabfac[$obj->rowid]["ref"] = $obj->facnumber;
|
||||
$tabfac[$obj->rowid]["ref"] = $obj->ref;
|
||||
$tabfac[$obj->rowid]["type"] = $obj->type;
|
||||
if (! isset($tabttc[$obj->rowid][$compta_soc])) $tabttc[$obj->rowid][$compta_soc]=0;
|
||||
if (! isset($tabht[$obj->rowid][$compta_prod])) $tabht[$obj->rowid][$compta_prod]=0;
|
||||
|
||||
@ -525,7 +525,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
* List of unpaid invoices
|
||||
*/
|
||||
|
||||
$sql = 'SELECT f.rowid as facid, f.facnumber, f.total_ttc, f.multicurrency_code, f.multicurrency_total_ttc, f.type,';
|
||||
$sql = 'SELECT f.rowid as facid, f.ref, f.total_ttc, f.multicurrency_code, f.multicurrency_total_ttc, f.type,';
|
||||
$sql.= ' f.datef as df, f.fk_soc as socid, f.date_lim_reglement as dlr';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'facture as f';
|
||||
$sql.= ' WHERE f.entity IN ('.getEntity('facture', $conf->entity).')';
|
||||
@ -550,7 +550,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
}
|
||||
|
||||
// Sort invoices by date and serial number: the older one comes first
|
||||
$sql.=' ORDER BY f.datef ASC, f.facnumber ASC';
|
||||
$sql.=' ORDER BY f.datef ASC, f.ref ASC';
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
@ -844,7 +844,7 @@ if (! GETPOST('action','aZ09'))
|
||||
if (! $sortorder) $sortorder='DESC';
|
||||
if (! $sortfield) $sortfield='p.datep';
|
||||
|
||||
$sql = 'SELECT p.datep as dp, p.amount, f.amount as fa_amount, f.facnumber';
|
||||
$sql = 'SELECT p.datep as dp, p.amount, f.amount as fa_amount, f.ref';
|
||||
$sql.=', f.rowid as facid, c.libelle as paiement_type, p.num_paiement';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'paiement as p LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as c ON p.fk_paiement = c.id';
|
||||
$sql.= ', '.MAIN_DB_PREFIX.'facture as f';
|
||||
@ -867,7 +867,7 @@ if (! GETPOST('action','aZ09'))
|
||||
print_barre_liste($langs->trans('Payments'), $page, $_SERVER["PHP_SELF"],'',$sortfield,$sortorder,'',$num);
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre('Invoice',$_SERVER["PHP_SELF"],'facnumber','','','',$sortfield,$sortorder);
|
||||
print_liste_field_titre('Invoice',$_SERVER["PHP_SELF"],'ref','','','',$sortfield,$sortorder);
|
||||
print_liste_field_titre('Date',$_SERVER["PHP_SELF"],'dp','','','',$sortfield,$sortorder);
|
||||
print_liste_field_titre('Type',$_SERVER["PHP_SELF"],'libelle','','','',$sortfield,$sortorder);
|
||||
print_liste_field_titre('Amount',$_SERVER["PHP_SELF"],'fa_amount','','','align="right"',$sortfield,$sortorder);
|
||||
@ -879,7 +879,7 @@ if (! GETPOST('action','aZ09'))
|
||||
$objp = $db->fetch_object($resql);
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/compta/facture/card.php?facid='.$objp->facid.'">'.$objp->facnumber."</a></td>\n";
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/compta/facture/card.php?facid='.$objp->facid.'">'.$objp->ref."</a></td>\n";
|
||||
print '<td>'.dol_print_date($db->jdate($objp->dp))."</td>\n";
|
||||
print '<td>'.$objp->paiement_type.' '.$objp->num_paiement."</td>\n";
|
||||
print '<td align="right">'.price($objp->amount).'</td><td> </td>';
|
||||
|
||||
@ -316,7 +316,7 @@ dol_fiche_end();
|
||||
* List of invoices
|
||||
*/
|
||||
|
||||
$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 = 'SELECT f.rowid as facid, f.ref, 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.= ' WHERE pf.fk_facture = f.rowid';
|
||||
$sql.= ' AND f.fk_soc = s.rowid';
|
||||
|
||||
@ -1349,7 +1349,7 @@ class BonPrelevement extends CommonObject
|
||||
|
||||
$sql = "SELECT soc.code_client as code, soc.address, soc.zip, soc.town, 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.= " f.facnumber as fac, pf.fk_facture as idfac, rib.datec, rib.iban_prefix as iban, rib.bic as bic, rib.rowid as drum";
|
||||
$sql.= " f.ref as fac, pf.fk_facture as idfac, rib.datec, rib.iban_prefix as iban, rib.bic as bic, rib.rowid as drum";
|
||||
$sql.= " FROM";
|
||||
$sql.= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,";
|
||||
$sql.= " ".MAIN_DB_PREFIX."facture as f,";
|
||||
@ -1488,12 +1488,12 @@ class BonPrelevement extends CommonObject
|
||||
* @param string $rib_guichet code of bank office
|
||||
* @param string $rib_number bank account
|
||||
* @param float $amount amount
|
||||
* @param string $facnumber ref of invoice
|
||||
* @param string $ref ref of invoice
|
||||
* @param int $facid id of invoice
|
||||
* @param string $rib_dom rib domiciliation
|
||||
* @return void
|
||||
*/
|
||||
function EnregDestinataire($rowid, $client_nom, $rib_banque, $rib_guichet, $rib_number, $amount, $facnumber, $facid, $rib_dom='')
|
||||
function EnregDestinataire($rowid, $client_nom, $rib_banque, $rib_guichet, $rib_number, $amount, $ref, $facid, $rib_dom='')
|
||||
{
|
||||
// phpcs:enable
|
||||
fputs($this->file, "06");
|
||||
@ -1537,7 +1537,7 @@ class BonPrelevement extends CommonObject
|
||||
|
||||
// Libelle F
|
||||
|
||||
fputs($this->file, substr("*_".$facnumber."_RDVnet".$rowid." ", 0, 31));
|
||||
fputs($this->file, substr("*_".$ref."_RDVnet".$rowid." ", 0, 31));
|
||||
|
||||
// Code etablissement G1
|
||||
|
||||
@ -1580,7 +1580,7 @@ class BonPrelevement extends CommonObject
|
||||
* @param string $row_cg pl.code_guichet AS cg, Not used for SEPA
|
||||
* @param string $row_cc pl.number AS cc, Not used for SEPA
|
||||
* @param string $row_somme pl.amount AS somme,
|
||||
* @param string $row_facnumber f.facnumber
|
||||
* @param string $row_ref f.ref
|
||||
* @param string $row_idfac pf.fk_facture AS idfac,
|
||||
* @param string $row_iban rib.iban_prefix AS iban,
|
||||
* @param string $row_bic rib.bic AS bic,
|
||||
@ -1588,7 +1588,7 @@ class BonPrelevement extends CommonObject
|
||||
* @param string $row_drum rib.rowid used to generate rum
|
||||
* @return string Return string with SEPA part DrctDbtTxInf
|
||||
*/
|
||||
function EnregDestinataireSEPA($row_code_client, $row_nom, $row_address, $row_zip, $row_town, $row_country_code, $row_cb, $row_cg, $row_cc, $row_somme, $row_facnumber, $row_idfac, $row_iban, $row_bic, $row_datec, $row_drum)
|
||||
function EnregDestinataireSEPA($row_code_client, $row_nom, $row_address, $row_zip, $row_town, $row_country_code, $row_cb, $row_cg, $row_cc, $row_somme, $row_ref, $row_idfac, $row_iban, $row_bic, $row_datec, $row_drum)
|
||||
{
|
||||
// phpcs:enable
|
||||
$CrLf = "\n";
|
||||
@ -1604,8 +1604,8 @@ class BonPrelevement extends CommonObject
|
||||
$XML_DEBITOR ='';
|
||||
$XML_DEBITOR .=' <DrctDbtTxInf>'.$CrLf;
|
||||
$XML_DEBITOR .=' <PmtId>'.$CrLf;
|
||||
// $XML_DEBITOR .=' <EndToEndId>'.('AS-'.dol_trunc($row_facnumber,20).'-'.$Rowing).'</EndToEndId>'.$CrLf; // ISO20022 states that EndToEndId has a MaxLength of 35 characters
|
||||
$XML_DEBITOR .=' <EndToEndId>'.(($conf->global->END_TO_END != "" ) ? $conf->global->END_TO_END : ('AS-'.dol_trunc($row_facnumber,20)).'-'.$Rowing).'</EndToEndId>'.$CrLf; // ISO20022 states that EndToEndId has a MaxLength of 35 characters
|
||||
// $XML_DEBITOR .=' <EndToEndId>'.('AS-'.dol_trunc($row_ref,20).'-'.$Rowing).'</EndToEndId>'.$CrLf; // ISO20022 states that EndToEndId has a MaxLength of 35 characters
|
||||
$XML_DEBITOR .=' <EndToEndId>'.(($conf->global->END_TO_END != "" ) ? $conf->global->END_TO_END : ('AS-'.dol_trunc($row_ref,20)).'-'.$Rowing).'</EndToEndId>'.$CrLf; // ISO20022 states that EndToEndId has a MaxLength of 35 characters
|
||||
$XML_DEBITOR .=' </PmtId>'.$CrLf;
|
||||
$XML_DEBITOR .=' <InstdAmt Ccy="EUR">'.round($row_somme, 2).'</InstdAmt>'.$CrLf;
|
||||
$XML_DEBITOR .=' <DrctDbtTx>'.$CrLf;
|
||||
@ -1636,9 +1636,9 @@ class BonPrelevement extends CommonObject
|
||||
$XML_DEBITOR .=' </Id>'.$CrLf;
|
||||
$XML_DEBITOR .=' </DbtrAcct>'.$CrLf;
|
||||
$XML_DEBITOR .=' <RmtInf>'.$CrLf;
|
||||
// $XML_DEBITOR .=' <Ustrd>'.($row_facnumber.'/'.$Rowing.'/'.$Rum).'</Ustrd>'.$CrLf;
|
||||
// $XML_DEBITOR .=' <Ustrd>'.dol_trunc($row_facnumber, 135).'</Ustrd>'.$CrLf; // 140 max
|
||||
$XML_DEBITOR .=' <Ustrd>'.(($conf->global->USTRD != "" ) ? $conf->global->USTRD : dol_trunc($row_facnumber, 135) ).'</Ustrd>'.$CrLf; // 140 max
|
||||
// $XML_DEBITOR .=' <Ustrd>'.($row_ref.'/'.$Rowing.'/'.$Rum).'</Ustrd>'.$CrLf;
|
||||
// $XML_DEBITOR .=' <Ustrd>'.dol_trunc($row_ref, 135).'</Ustrd>'.$CrLf; // 140 max
|
||||
$XML_DEBITOR .=' <Ustrd>'.(($conf->global->USTRD != "" ) ? $conf->global->USTRD : dol_trunc($row_ref, 135) ).'</Ustrd>'.$CrLf; // 140 max
|
||||
$XML_DEBITOR .=' </RmtInf>'.$CrLf;
|
||||
$XML_DEBITOR .=' </DrctDbtTxInf>'.$CrLf;
|
||||
return $XML_DEBITOR;
|
||||
|
||||
@ -188,7 +188,7 @@ print '<br>';
|
||||
* Invoices waiting for withdraw
|
||||
*/
|
||||
|
||||
$sql = "SELECT f.facnumber, f.rowid, f.total_ttc, s.nom as name, s.rowid as socid,";
|
||||
$sql = "SELECT f.ref, f.rowid, f.total_ttc, s.nom as name, s.rowid as socid,";
|
||||
$sql.= " pfd.date_demande, pfd.amount";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture as f,";
|
||||
$sql.= " ".MAIN_DB_PREFIX."societe as s,";
|
||||
@ -249,7 +249,7 @@ if ($resql)
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>';
|
||||
$invoicestatic->id=$obj->rowid;
|
||||
$invoicestatic->ref=$obj->facnumber;
|
||||
$invoicestatic->ref=$obj->ref;
|
||||
print $invoicestatic->getNomUrl(1,'withdraw');
|
||||
print '</td>';
|
||||
// Thirdparty
|
||||
|
||||
@ -52,7 +52,7 @@ $offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
if (! $sortorder) $sortorder="DESC";
|
||||
if (! $sortfield) $sortfield="f.facnumber";
|
||||
if (! $sortfield) $sortfield="f.ref";
|
||||
|
||||
|
||||
/*
|
||||
@ -66,7 +66,7 @@ $invoicestatic=new Facture($db);
|
||||
|
||||
// List of requests
|
||||
|
||||
$sql= "SELECT f.facnumber, f.rowid, f.total_ttc,";
|
||||
$sql= "SELECT f.ref, f.rowid, f.total_ttc,";
|
||||
$sql.= " s.nom as name, s.rowid as socid,";
|
||||
$sql.= " pfd.date_demande as date_demande,";
|
||||
$sql.= " pfd.fk_user_demande";
|
||||
@ -138,7 +138,7 @@ if ($resql)
|
||||
// Ref facture
|
||||
print '<td>';
|
||||
$invoicestatic->id=$obj->rowid;
|
||||
$invoicestatic->ref=$obj->facnumber;
|
||||
$invoicestatic->ref=$obj->ref;
|
||||
print $invoicestatic->getNomUrl(1,'withdraw');
|
||||
print '</td>';
|
||||
|
||||
|
||||
@ -144,7 +144,7 @@ if ($prev_id > 0 || $ref)
|
||||
|
||||
// List of invoices
|
||||
$sql = "SELECT pf.rowid,";
|
||||
$sql.= " f.rowid as facid, f.facnumber as ref, f.total_ttc,";
|
||||
$sql.= " f.rowid as facid, f.ref as ref, f.total_ttc,";
|
||||
$sql.= " s.rowid as socid, s.nom as name, pl.statut, pl.amount as amount_requested";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."prelevement_lignes as pl";
|
||||
|
||||
@ -91,7 +91,7 @@ print '</td></tr></table><br>';
|
||||
/*
|
||||
* Invoices waiting for withdraw
|
||||
*/
|
||||
$sql = "SELECT f.facnumber, f.rowid, f.total_ttc, f.fk_statut, f.paye, f.type,";
|
||||
$sql = "SELECT f.ref, f.rowid, f.total_ttc, f.fk_statut, f.paye, f.type,";
|
||||
$sql.= " pfd.date_demande, pfd.amount,";
|
||||
$sql.= " s.nom as name, s.rowid as socid";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture as f,";
|
||||
@ -120,7 +120,7 @@ if ($resql)
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
$invoicestatic->id=$obj->rowid;
|
||||
$invoicestatic->ref=$obj->facnumber;
|
||||
$invoicestatic->ref=$obj->ref;
|
||||
$invoicestatic->statut=$obj->fk_statut;
|
||||
$invoicestatic->paye=$obj->paye;
|
||||
$invoicestatic->type=$obj->type;
|
||||
|
||||
@ -261,7 +261,7 @@ if ($id)
|
||||
* List of invoices
|
||||
*/
|
||||
$sql = "SELECT pf.rowid";
|
||||
$sql.= " ,f.rowid as facid, f.facnumber as ref, f.total_ttc, f.paye, f.fk_statut";
|
||||
$sql.= " ,f.rowid as facid, f.ref as ref, f.total_ttc, f.paye, f.fk_statut";
|
||||
$sql.= " , s.rowid as socid, s.nom as name";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
|
||||
$sql.= " , ".MAIN_DB_PREFIX."prelevement_lignes as pl";
|
||||
|
||||
@ -82,7 +82,7 @@ $form=new Form($db);
|
||||
llxHeader('',$langs->trans("WithdrawalsLines"));
|
||||
|
||||
$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.ref, f.total_ttc";
|
||||
$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.= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
|
||||
@ -155,7 +155,7 @@ if ($result)
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("Line",$_SERVER["PHP_SELF"]);
|
||||
print_liste_field_titre("WithdrawalsReceipts",$_SERVER["PHP_SELF"],"p.ref");
|
||||
print_liste_field_titre("Bill",$_SERVER["PHP_SELF"],"f.facnumber",'',$urladd);
|
||||
print_liste_field_titre("Bill",$_SERVER["PHP_SELF"],"f.ref",'',$urladd);
|
||||
print_liste_field_titre("Company",$_SERVER["PHP_SELF"],"s.nom");
|
||||
print_liste_field_titre("CustomerCode",$_SERVER["PHP_SELF"],"s.code_client",'','','align="center"');
|
||||
print_liste_field_titre("Date",$_SERVER["PHP_SELF"],"p.datec","","",'align="center"');
|
||||
@ -185,7 +185,7 @@ if ($result)
|
||||
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/compta/facture/card.php?facid='.$obj->facid.'">';
|
||||
print img_object($langs->trans("ShowBill"),"bill");
|
||||
print ' <a href="'.DOL_URL_ROOT.'/compta/facture/card.php?facid='.$obj->facid.'">'.$obj->facnumber."</a></td>\n";
|
||||
print ' <a href="'.DOL_URL_ROOT.'/compta/facture/card.php?facid='.$obj->facid.'">'.$obj->ref."</a></td>\n";
|
||||
print '</a></td>';
|
||||
|
||||
print '<td><a href="card.php?id='.$obj->rowid.'">'.$obj->name."</a></td>\n";
|
||||
|
||||
@ -117,7 +117,7 @@ if ($id > 0)
|
||||
|
||||
$TData = array();
|
||||
|
||||
$sql = "SELECT s.nom, s.rowid as socid, f.facnumber, f.amount, f.datef as df,";
|
||||
$sql = "SELECT s.nom, s.rowid as socid, f.ref, f.amount, f.datef as df,";
|
||||
$sql.= " f.paye as paye, f.fk_statut as statut, f.rowid as facid,";
|
||||
$sql.= " u.login, u.rowid as userid";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f,".MAIN_DB_PREFIX."user as u";
|
||||
|
||||
@ -541,14 +541,14 @@ print '</div>';
|
||||
// Factures non reglees
|
||||
// Y a bug ici. Il faut prendre le reste a payer et non le total des factures non reglees !
|
||||
|
||||
$sql = "SELECT f.facnumber, f.rowid, s.nom, s.rowid as socid, f.total_ttc, sum(pf.amount) as am";
|
||||
$sql = "SELECT f.ref, f.rowid, s.nom, s.rowid as socid, f.total_ttc, sum(pf.amount) as am";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f left join ".MAIN_DB_PREFIX."paiement_facture as pf on f.rowid=pf.fk_facture";
|
||||
$sql .= " WHERE s.rowid = f.fk_soc AND f.paye = 0 AND f.fk_statut = 1";
|
||||
if ($socid)
|
||||
{
|
||||
$sql .= " AND f.fk_soc = $socid";
|
||||
}
|
||||
$sql .= " GROUP BY f.facnumber,f.rowid,s.nom, s.rowid, f.total_ttc";
|
||||
$sql .= " GROUP BY f.ref,f.rowid,s.nom, s.rowid, f.total_ttc";
|
||||
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
|
||||
@ -125,11 +125,6 @@ echo $this->control->tpl['ajax_selectcountry'];
|
||||
<?php } ?>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><?php echo $langs->trans("IM"); ?></td>
|
||||
<td colspan="3"><input name="jabberid" type="text" size="50" maxlength="80" value="<?php echo $this->control->tpl['jabberid']; ?>"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><?php echo $langs->trans("ContactVisibility"); ?></td>
|
||||
<td colspan="3"><?php echo $this->control->tpl['select_visibility']; ?></td>
|
||||
|
||||
@ -110,11 +110,6 @@ dol_htmloutput_errors($this->control->tpl['error'],$this->control->tpl['errors']
|
||||
<?php } ?>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><?php echo $langs->trans("IM"); ?></td>
|
||||
<td colspan="3"><?php echo $this->control->tpl['jabberid']; ?></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><?php echo $langs->trans("ContactVisibility"); ?></td>
|
||||
<td colspan="3"><?php echo $this->control->tpl['visibility']; ?></td>
|
||||
|
||||
@ -194,7 +194,6 @@ if (empty($reshook))
|
||||
$object->phone_mobile = GETPOST("phone_mobile",'alpha');
|
||||
$object->fax = GETPOST("fax",'alpha');
|
||||
$object->jabberid = GETPOST("jabberid",'alpha');
|
||||
$object->no_email = GETPOST("no_email",'int');
|
||||
$object->priv = GETPOST("priv",'int');
|
||||
$object->note_public = GETPOST("note_public",'none');
|
||||
$object->note_private = GETPOST("note_private",'none');
|
||||
@ -367,7 +366,6 @@ if (empty($reshook))
|
||||
$object->phone_mobile = GETPOST("phone_mobile",'alpha');
|
||||
$object->fax = GETPOST("fax",'alpha');
|
||||
$object->jabberid = GETPOST("jabberid",'alpha');
|
||||
$object->no_email = GETPOST("no_email",'int');
|
||||
$object->priv = GETPOST("priv",'int');
|
||||
$object->note_public = GETPOST("note_public",'none');
|
||||
$object->note_private = GETPOST("note_private",'none');
|
||||
@ -651,8 +649,21 @@ else
|
||||
print '<td><input name="email" id="email" type="text" class="maxwidth100onsmartphone" value="'.dol_escape_htmltag(GETPOST("email",'alpha')?GETPOST("email",'alpha'):$object->email).'"></td>';
|
||||
if (! empty($conf->mailing->enabled))
|
||||
{
|
||||
$noemail = '';
|
||||
if (empty($noemail) && ! empty($object->email))
|
||||
{
|
||||
$sql="SELECT COUNT(*) as nb FROM ".MAIN_DB_PREFIX."mailing_unsubscribe WHERE entity IN (".getEntity('mailing').") AND email = '".$db->escape($object->email)."'";
|
||||
//print $sql;
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$obj=$db->fetch_object($resql);
|
||||
$noemail = $obj->nb;
|
||||
}
|
||||
}
|
||||
|
||||
print '<td><label for="no_email">'.$langs->trans("No_Email").'</label></td>';
|
||||
print '<td>'.$form->selectyesno('no_email',(GETPOST("no_email",'alpha')?GETPOST("no_email",'alpha'):$object->no_email), 1).'</td>';
|
||||
print '<td>'.$form->selectyesno('no_email',(GETPOSTISSET("no_email")?GETPOST("no_email",'alpha'):$noemail), 1).'</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -660,12 +671,14 @@ else
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
// Instant message and no email
|
||||
print '<tr><td><label for="jabberid">'.$langs->trans("IM").'</label></td>';
|
||||
print '<td colspan="3"><input name="jabberid" id="jabberid" type="text" class="minwidth100" maxlength="80" value="'.dol_escape_htmltag(GETPOSTISSET("jabberid")?GETPOST("jabberid",'alpha'):$object->jabberid).'"></td></tr>';
|
||||
|
||||
if (! empty($conf->socialnetworks->enabled))
|
||||
{
|
||||
// Jabber
|
||||
if (! empty($conf->global->SOCIALNETWORKS_JABBER))
|
||||
{
|
||||
print '<tr><td><label for="skype">'.fieldLabel('Jabber','jabberid').'</label></td>';
|
||||
print '<td colspan="3"><input type="text" name="jabberid" id="jabberid" class="minwidth100" maxlength="80" value="'.dol_escape_htmltag(GETPOSTISSET("jabberid")?GETPOST("jabberid",'alpha'):$object->jabberid).'"></td></tr>';
|
||||
}
|
||||
// Skype
|
||||
if (! empty($conf->global->SOCIALNETWORKS_SKYPE))
|
||||
{
|
||||
@ -919,13 +932,25 @@ else
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
// Jabberid
|
||||
print '<tr><td><label for="jabberid">'.$langs->trans("IM").'</label></td>';
|
||||
print '<td><input name="jabberid" id="jabberid" type="text" class="minwidth100" maxlength="80" value="'.(isset($_POST["jabberid"])?$_POST["jabberid"]:$object->jabberid).'"></td>';
|
||||
// Unsubscribe
|
||||
print '<tr>';
|
||||
if (! empty($conf->mailing->enabled))
|
||||
{
|
||||
$noemail = '';
|
||||
if (empty($noemail) && ! empty($object->email))
|
||||
{
|
||||
$sql="SELECT COUNT(*) as nb FROM ".MAIN_DB_PREFIX."mailing_unsubscribe WHERE entity IN (".getEntity('mailing').") AND email = '".$db->escape($object->email)."'";
|
||||
//print $sql;
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$obj=$db->fetch_object($resql);
|
||||
$noemail = $obj->nb;
|
||||
}
|
||||
}
|
||||
|
||||
print '<td><label for="no_email">'.$langs->trans("No_Email").'</label></td>';
|
||||
print '<td>'.$form->selectyesno('no_email',(isset($_POST["no_email"])?$_POST["no_email"]:$object->no_email), 1).'</td>';
|
||||
print '<td>'.$form->selectyesno('no_email',(GETPOSTISSET("no_email")?GETPOST("no_email",'alpha'):$noemail), 1).'</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -935,6 +960,12 @@ else
|
||||
|
||||
if (! empty($conf->socialnetworks->enabled))
|
||||
{
|
||||
// Jabber ID
|
||||
if (! empty($conf->global->SOCIALNETWORKS_JABBER))
|
||||
{
|
||||
print '<tr><td><label for="jabberid">'.fieldLabel('Jabber','jabberid').'</label></td>';
|
||||
print '<td><input type="text" name="jabberid" id="jabberid" class="minwidth100" maxlength="80" value="'.dol_escape_htmltag(GETPOSTISSET("jabberid")?GETPOST("jabberid",'alpha'):$object->jabberid).'"></td></tr>';
|
||||
}
|
||||
// Skype
|
||||
if (! empty($conf->global->SOCIALNETWORKS_SKYPE))
|
||||
{
|
||||
@ -1153,11 +1184,23 @@ else
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/comm/mailing/list.php?filteremail='.urlencode($object->email).'">'.$object->getNbOfEMailings().'</a></td></tr>';
|
||||
}
|
||||
|
||||
// Instant message and no email
|
||||
print '<tr><td>'.$langs->trans("IM").'</td><td>'.$object->jabberid.'</td></tr>';
|
||||
// Unsubscribe opt-out
|
||||
if (!empty($conf->mailing->enabled))
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("No_Email").'</td><td>'.yn($object->no_email).'</td></tr>';
|
||||
//print 'eee'.$object->email;
|
||||
$noemail = $object->no_email;
|
||||
if (empty($noemail) && ! empty($object->email))
|
||||
{
|
||||
$sql="SELECT COUNT(*) as nb FROM ".MAIN_DB_PREFIX."mailing_unsubscribe WHERE entity IN (".getEntity('mailing').") AND email = '".$db->escape($object->email)."'";
|
||||
//print $sql;
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$obj=$db->fetch_object($resql);
|
||||
$noemail = $obj->nb;
|
||||
}
|
||||
}
|
||||
print '<tr><td>'.$langs->trans("No_Email").'</td><td>'.yn($noemail).'</td></tr>';
|
||||
}
|
||||
|
||||
print '<tr><td>'.$langs->trans("ContactVisibility").'</td><td>';
|
||||
|
||||
@ -123,7 +123,6 @@ class Contact extends CommonObject
|
||||
|
||||
public $birthday;
|
||||
public $default_lang;
|
||||
public $no_email; // 1=Don't send e-mail to this contact, 0=do
|
||||
|
||||
public $ref_facturation; // Reference number of invoice for which it is contact
|
||||
public $ref_contrat; // Nb de reference contrat pour lequel il est contact
|
||||
@ -372,7 +371,6 @@ class Contact extends CommonObject
|
||||
$sql .= ", statut = ".$this->db->escape($this->statut);
|
||||
$sql .= ", fk_user_modif=".($user->id > 0 ? "'".$this->db->escape($user->id)."'":"NULL");
|
||||
$sql .= ", default_lang=".($this->default_lang?"'".$this->db->escape($this->default_lang)."'":"NULL");
|
||||
$sql .= ", no_email=".($this->no_email?"'".$this->db->escape($this->no_email)."'":"0");
|
||||
$sql .= ", entity = " . $this->db->escape($this->entity);
|
||||
$sql .= " WHERE rowid=".$this->db->escape($id);
|
||||
|
||||
@ -709,7 +707,7 @@ class Contact extends CommonObject
|
||||
$sql.= " c.birthday,";
|
||||
$sql.= " c.poste, c.phone, c.phone_perso, c.phone_mobile, c.fax, c.email, c.jabberid, c.skype, c.twitter, c.facebook,";
|
||||
$sql.= " c.photo,";
|
||||
$sql.= " c.priv, c.note_private, c.note_public, c.default_lang, c.no_email, c.canvas,";
|
||||
$sql.= " c.priv, c.note_private, c.note_public, c.default_lang, c.canvas,";
|
||||
$sql.= " c.import_key,";
|
||||
$sql.= " c.datec as date_creation, c.tms as date_modification,";
|
||||
$sql.= " co.label as country, co.code as country_code,";
|
||||
@ -790,7 +788,6 @@ class Contact extends CommonObject
|
||||
$this->note_private = $obj->note_private;
|
||||
$this->note_public = $obj->note_public;
|
||||
$this->default_lang = $obj->default_lang;
|
||||
$this->no_email = $obj->no_email;
|
||||
$this->user_id = $obj->user_id;
|
||||
$this->user_login = $obj->user_login;
|
||||
$this->canvas = $obj->canvas;
|
||||
|
||||
@ -158,6 +158,7 @@ $arrayfields=array(
|
||||
'p.phone_mobile'=>array('label'=>"PhoneMobile", 'checked'=>1),
|
||||
'p.fax'=>array('label'=>"Fax", 'checked'=>0),
|
||||
'p.email'=>array('label'=>"EMail", 'checked'=>1),
|
||||
'p.jabberid'=>array('label'=>"Jabber", 'checked'=>1, 'enabled'=>(! empty($conf->socialnetworks->enabled))),
|
||||
'p.skype'=>array('label'=>"Skype", 'checked'=>1, 'enabled'=>(! empty($conf->socialnetworks->enabled))),
|
||||
'p.twitter'=>array('label'=>"Twitter", 'checked'=>1, 'enabled'=>(! empty($conf->socialnetworks->enabled))),
|
||||
'p.facebook'=>array('label'=>"Facebook", 'checked'=>1, 'enabled'=>(! empty($conf->socialnetworks->enabled))),
|
||||
@ -822,12 +823,19 @@ while ($i < min($num,$limit))
|
||||
print '<td>'.dol_print_email($obj->email,$obj->rowid,$obj->socid,'AC_EMAIL',18).'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
// Skype
|
||||
if (! empty($arrayfields['p.skype']['checked']))
|
||||
{
|
||||
if (! empty($conf->socialnetworks->enabled)) { print '<td>'.dol_print_socialnetworks($obj->skype,$obj->rowid,$obj->socid,'skype').'</td>'; }
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Jabber
|
||||
if (! empty($arrayfields['p.jabberid']['checked']))
|
||||
{
|
||||
if (! empty($conf->socialnetworks->enabled)) { print '<td>'.dol_print_socialnetworks($obj->jabberid,$obj->rowid,$obj->socid,'jabberid').'</td>'; }
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Twitter
|
||||
if (! empty($arrayfields['p.twitter']['checked']))
|
||||
{
|
||||
|
||||
@ -2063,10 +2063,6 @@ else
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table id="tablelines" class="noborder noshadow" width="100%">'; // Array with (n*2)+1 lines
|
||||
|
||||
// Trick to not show product entries
|
||||
$savproductenabled=$conf->product->enabled;
|
||||
if (empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) $conf->product->enabled = 0;
|
||||
|
||||
// Form to add new line
|
||||
if ($action != 'editline')
|
||||
{
|
||||
@ -2079,9 +2075,6 @@ else
|
||||
$reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
}
|
||||
|
||||
// Restore correct setup
|
||||
$conf->product->enabled = $savproductenabled;
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
print '</form>';
|
||||
|
||||
@ -89,7 +89,7 @@ class box_factures extends ModeleBoxes
|
||||
|
||||
if ($user->rights->facture->lire) {
|
||||
$sql = "SELECT f.rowid as facid";
|
||||
$sql.= ", f.facnumber, f.type, f.total as total_ht";
|
||||
$sql.= ", f.ref, f.type, f.total as total_ht";
|
||||
$sql.= ", f.tva as total_tva";
|
||||
$sql.= ", f.total_ttc";
|
||||
$sql.= ", f.datef as df";
|
||||
@ -103,8 +103,8 @@ class box_factures extends ModeleBoxes
|
||||
$sql.= " AND f.entity = ".$conf->entity;
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id;
|
||||
if ($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE) $sql.= " ORDER BY f.datef DESC, f.facnumber DESC ";
|
||||
else $sql.= " ORDER BY f.tms DESC, f.facnumber DESC ";
|
||||
if ($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE) $sql.= " ORDER BY f.datef DESC, f.ref DESC ";
|
||||
else $sql.= " ORDER BY f.tms DESC, f.ref DESC ";
|
||||
$sql.= $db->plimit($max, 0);
|
||||
|
||||
$result = $db->query($sql);
|
||||
@ -123,7 +123,7 @@ class box_factures extends ModeleBoxes
|
||||
$datem = $db->jdate($objp->tms);
|
||||
|
||||
$facturestatic->id = $objp->facid;
|
||||
$facturestatic->ref = $objp->facnumber;
|
||||
$facturestatic->ref = $objp->ref;
|
||||
$facturestatic->type = $objp->type;
|
||||
$facturestatic->total_ht = $objp->total_ht;
|
||||
$facturestatic->total_tva = $objp->total_tva;
|
||||
|
||||
@ -89,7 +89,7 @@ class box_factures_imp extends ModeleBoxes
|
||||
$sql = "SELECT s.nom as name, s.rowid as socid, s.email,";
|
||||
$sql.= " s.code_client,";
|
||||
$sql.= " s.logo,";
|
||||
$sql.= " f.facnumber, f.date_lim_reglement as datelimite,";
|
||||
$sql.= " f.ref, f.date_lim_reglement as datelimite,";
|
||||
$sql.= " f.type,";
|
||||
$sql.= " f.amount, f.datef as df,";
|
||||
$sql.= " f.total as total_ht,";
|
||||
@ -107,10 +107,10 @@ class box_factures_imp extends ModeleBoxes
|
||||
$sql.= " AND fk_statut = 1";
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id;
|
||||
$sql.= " GROUP BY s.nom, s.rowid, s.code_client, s.logo, f.facnumber, f.date_lim_reglement,";
|
||||
$sql.= " GROUP BY s.nom, s.rowid, s.code_client, s.logo, f.ref, f.date_lim_reglement,";
|
||||
$sql.= " f.type, f.amount, f.datef, f.total, f.tva, f.total_ttc, f.paye, f.fk_statut, f.rowid";
|
||||
//$sql.= " ORDER BY f.datef DESC, f.facnumber DESC ";
|
||||
$sql.= " ORDER BY datelimite ASC, f.facnumber ASC ";
|
||||
//$sql.= " ORDER BY f.datef DESC, f.ref DESC ";
|
||||
$sql.= " ORDER BY datelimite ASC, f.ref ASC ";
|
||||
$sql.= $db->plimit($max, 0);
|
||||
|
||||
$result = $db->query($sql);
|
||||
@ -127,7 +127,7 @@ class box_factures_imp extends ModeleBoxes
|
||||
$objp = $db->fetch_object($result);
|
||||
$datelimite=$db->jdate($objp->datelimite);
|
||||
$facturestatic->id = $objp->facid;
|
||||
$facturestatic->ref = $objp->facnumber;
|
||||
$facturestatic->ref = $objp->ref;
|
||||
$facturestatic->type = $objp->type;
|
||||
$facturestatic->total_ht = $objp->total_ht;
|
||||
$facturestatic->total_tva = $objp->total_tva;
|
||||
|
||||
@ -1028,7 +1028,7 @@ abstract class CommonDocGenerator
|
||||
if(empty($columnText)) return;
|
||||
$pdf->SetXY($this->getColumnContentXStart($colKey),$curY); // Set curent position
|
||||
$colDef = $this->cols[$colKey];
|
||||
$pdf->MultiCell( $this->getColumnContentWidth($colKey),2, $columnText,'',$colDef['content']['align']);
|
||||
$pdf->writeHTMLCell( $this->getColumnContentWidth($colKey),2,$this->getColumnContentXStart($colKey),$curY, $columnText,'',$colDef['content']['align']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -364,11 +364,11 @@ abstract class CommonInvoice extends CommonObject
|
||||
if ($this->element != 'invoice_supplier')
|
||||
{
|
||||
if (empty($this->thirdparty)) $this->fetch_thirdparty(); // We need to have this->thirdparty defined, in case of numbering rule use tags that depend on thirdparty (like {t} tag).
|
||||
$maxfacnumber = $this->getNextNumRef($this->thirdparty,'last');
|
||||
$maxref = $this->getNextNumRef($this->thirdparty,'last');
|
||||
|
||||
// If there is no invoice into the reset range and not already dispatched, we can delete
|
||||
// If invoice to delete is last one and not already dispatched, we can delete
|
||||
if (empty($conf->global->INVOICE_CAN_ALWAYS_BE_REMOVED) && $maxfacnumber != '' && $maxfacnumber != $this->ref) return -2;
|
||||
if (empty($conf->global->INVOICE_CAN_ALWAYS_BE_REMOVED) && $maxref != '' && $maxref != $this->ref) return -2;
|
||||
|
||||
// TODO If there is payment in bookkeeping, check payment is not dispatched in accounting
|
||||
// ...
|
||||
|
||||
@ -620,14 +620,10 @@ abstract class CommonObject
|
||||
{
|
||||
if ($this->skype) $out.=dol_print_socialnetworks($this->skype,$this->id,$object->id,'skype');
|
||||
$outdone++;
|
||||
}
|
||||
if (! empty($conf->socialnetworks->enabled))
|
||||
{
|
||||
if ($this->jabberid) $out.=dol_print_socialnetworks($this->jabberid,$this->id,$object->id,'jabber');
|
||||
$outdone++;
|
||||
if ($this->twitter) $out.=dol_print_socialnetworks($this->twitter,$this->id,$object->id,'twitter');
|
||||
$outdone++;
|
||||
}
|
||||
if (! empty($conf->socialnetworks->enabled))
|
||||
{
|
||||
if ($this->facebook) $out.=dol_print_socialnetworks($this->facebook,$this->id,$object->id,'facebook');
|
||||
$outdone++;
|
||||
}
|
||||
@ -5818,6 +5814,14 @@ abstract class CommonObject
|
||||
$param_list=array_keys($param['options']); // $param_list='ObjectName:classPath'
|
||||
$showempty=(($required && $default != '')?0:1);
|
||||
$out=$form->selectForForms($param_list[0], $keyprefix.$key.$keysuffix, $value, $showempty);
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
||||
{
|
||||
list($class,$classfile)=explode(':',$param_list[0]);
|
||||
if (file_exists(dol_buildpath(dirname(dirname($classfile)).'/card.php'))) $url_path=dol_buildpath(dirname(dirname($classfile)).'/card.php',1);
|
||||
else $url_path=dol_buildpath(dirname(dirname($classfile)).'/'.$class.'_card.php',1);
|
||||
$out.='<a class="butActionNew" href="'.$url_path.'?action=create&backtopage='.$_SERVER['PHP_SELF'].'"><span class="fa fa-plus-circle valignmiddle"></span></a>';
|
||||
// TODO Add Javascript code to add input fields contents to new elements urls
|
||||
}
|
||||
}
|
||||
elseif ($type == 'password')
|
||||
{
|
||||
|
||||
@ -126,7 +126,7 @@ class DiscountAbsolute
|
||||
$sql.= " sr.multicurrency_amount_ht, sr.multicurrency_amount_tva, sr.multicurrency_amount_ttc,";
|
||||
$sql.= " sr.fk_facture_line, sr.fk_facture, sr.fk_facture_source, sr.fk_invoice_supplier_line, sr.fk_invoice_supplier, sr.fk_invoice_supplier_source, sr.description,";
|
||||
$sql.= " sr.datec,";
|
||||
$sql.= " f.facnumber as ref_facture_source, fsup.facnumber as ref_invoice_supplier_source";
|
||||
$sql.= " f.ref as ref_facture_source, fsup.ref as ref_invoice_supplier_source";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe_remise_except as sr";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON sr.fk_facture_source = f.rowid";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as fsup ON sr.fk_invoice_supplier_source = fsup.rowid";
|
||||
|
||||
@ -76,9 +76,9 @@ class Events // extends CommonObject
|
||||
|
||||
// List of all Audit/Security events supported by triggers
|
||||
public $eventstolog=array(
|
||||
/*array('id'=>'USER_LOGIN', 'test'=>1),
|
||||
array('id'=>'USER_LOGIN', 'test'=>1),
|
||||
array('id'=>'USER_LOGIN_FAILED', 'test'=>1),
|
||||
array('id'=>'USER_LOGOUT', 'test'=>1),*/
|
||||
array('id'=>'USER_LOGOUT', 'test'=>1),
|
||||
array('id'=>'USER_CREATE', 'test'=>1),
|
||||
array('id'=>'USER_MODIFY', 'test'=>1),
|
||||
array('id'=>'USER_NEW_PASSWORD', 'test'=>1),
|
||||
|
||||
@ -18,7 +18,8 @@
|
||||
* Copyright (C) 2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
* Copyright (C) 2018 Josep Lluis Amador <joseplluis@lliuretic.cat>
|
||||
*
|
||||
* 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
|
||||
@ -878,7 +879,7 @@ class Form
|
||||
* @param string $htmlname Name of field in html form
|
||||
* @param int $showempty Add an empty field
|
||||
* @param int $hidetext Do not show label 'Type' before combo box (used only if there is at least 2 choices to select)
|
||||
* @param integer $forceall 1=Force to show products and services in combo list, whatever are activated modules, 0=No force, -1=Force none (and set hidden field to 'service')
|
||||
* @param integer $forceall 1=Force to show products and services in combo list, whatever are activated modules, 0=No force, 2=Force to show only Products, 3=Force to show only services, -1=Force none (and set hidden field to 'service')
|
||||
* @return void
|
||||
*/
|
||||
function select_type_of_lines($selected='',$htmlname='type',$showempty=0,$hidetext=0,$forceall=0)
|
||||
@ -887,7 +888,7 @@ class Form
|
||||
global $db,$langs,$user,$conf;
|
||||
|
||||
// If product & services are enabled or both disabled.
|
||||
if ($forceall > 0 || (empty($forceall) && ! empty($conf->product->enabled) && ! empty($conf->service->enabled))
|
||||
if ($forceall == 1 || (empty($forceall) && ! empty($conf->product->enabled) && ! empty($conf->service->enabled))
|
||||
|| (empty($forceall) && empty($conf->product->enabled) && empty($conf->service->enabled)) )
|
||||
{
|
||||
if (empty($hidetext)) print $langs->trans("Type").': ';
|
||||
@ -910,12 +911,12 @@ class Form
|
||||
print '</select>';
|
||||
//if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
|
||||
}
|
||||
if (empty($forceall) && empty($conf->product->enabled) && ! empty($conf->service->enabled))
|
||||
if ((empty($forceall) && empty($conf->product->enabled) && ! empty($conf->service->enabled)) || $forceall == 3)
|
||||
{
|
||||
print $langs->trans("Service");
|
||||
print '<input type="hidden" name="'.$htmlname.'" value="1">';
|
||||
}
|
||||
if (empty($forceall) && ! empty($conf->product->enabled) && empty($conf->service->enabled))
|
||||
if ((empty($forceall) && ! empty($conf->product->enabled) && empty($conf->service->enabled)) || $forceall == 2)
|
||||
{
|
||||
print $langs->trans("Product");
|
||||
print '<input type="hidden" name="'.$htmlname.'" value="0">';
|
||||
@ -993,7 +994,7 @@ class Form
|
||||
|
||||
$this->load_cache_types_fees();
|
||||
|
||||
print '<select class="flat" name="'.$htmlname.'">';
|
||||
print '<select id="select_'.$htmlname.'" class="flat" name="'.$htmlname.'">';
|
||||
if ($showempty)
|
||||
{
|
||||
print '<option value="-1"';
|
||||
@ -1310,7 +1311,7 @@ class Form
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
print '<select class="flat maxwidthonsmartphone" name="'.$htmlname.'">';
|
||||
print '<select id="select_'.$htmlname.'" class="flat maxwidthonsmartphone" name="'.$htmlname.'">';
|
||||
$num = $this->db->num_rows($resql);
|
||||
|
||||
$qualifiedlines=$num;
|
||||
@ -2036,9 +2037,20 @@ class Form
|
||||
|
||||
$selectFields = " p.rowid, p.label, p.ref, p.description, p.barcode, p.fk_product_type, p.price, p.price_ttc, p.price_base_type, p.tva_tx, p.duration, p.fk_price_expression";
|
||||
(count($warehouseStatusArray)) ? $selectFieldsGrouped = ", sum(ps.reel) as stock" : $selectFieldsGrouped = ", p.stock";
|
||||
|
||||
|
||||
$sql = "SELECT ";
|
||||
$sql.= $selectFields . $selectFieldsGrouped;
|
||||
|
||||
if (! empty($conf->global->PRODUCT_SORT_BY_CATEGORY))
|
||||
{
|
||||
//Product category
|
||||
$sql.= ", (SELECT ".MAIN_DB_PREFIX."categorie_product.fk_categorie
|
||||
FROM ".MAIN_DB_PREFIX."categorie_product
|
||||
WHERE ".MAIN_DB_PREFIX."categorie_product.fk_product=p.rowid
|
||||
LIMIT 1
|
||||
) AS categorie_product_id ";
|
||||
}
|
||||
|
||||
//Price by customer
|
||||
if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES) && !empty($socid))
|
||||
{
|
||||
@ -2143,9 +2155,21 @@ class Form
|
||||
{
|
||||
$sql.= ' GROUP BY'.$selectFields;
|
||||
}
|
||||
$sql.= $db->order("p.ref");
|
||||
$sql.= $db->plimit($limit, 0);
|
||||
|
||||
//Sort by category
|
||||
if(! empty($conf->global->PRODUCT_SORT_BY_CATEGORY))
|
||||
{
|
||||
$sql .= " ORDER BY categorie_product_id ";
|
||||
//ASC OR DESC order
|
||||
($conf->global->PRODUCT_SORT_BY_CATEGORY == 1) ? $sql .="ASC" : $sql .="DESC";
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql.= $db->order("p.ref");
|
||||
}
|
||||
|
||||
$sql.= $db->plimit($limit, 0);
|
||||
|
||||
// Build output string
|
||||
dol_syslog(get_class($this)."::select_produits_list search product", LOG_DEBUG);
|
||||
$result=$this->db->query($sql);
|
||||
@ -2788,7 +2812,7 @@ class Form
|
||||
{
|
||||
$num = $this->db->num_rows($result);
|
||||
|
||||
$form = '<select class="flat" name="'.$htmlname.'">';
|
||||
$form = '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">';
|
||||
|
||||
if (! $num)
|
||||
{
|
||||
@ -2889,7 +2913,7 @@ class Form
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
print '<select class="flat" name="'.$htmlname.'">';
|
||||
print '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">';
|
||||
if ($showempty) print '<option value="0"> </option>';
|
||||
$num = $this->db->num_rows($resql);
|
||||
$i = 0;
|
||||
@ -3119,7 +3143,7 @@ class Form
|
||||
|
||||
$this->loadCacheInputReason();
|
||||
|
||||
print '<select class="flat" name="'.$htmlname.'">';
|
||||
print '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">';
|
||||
if ($addempty) print '<option value="0"'.(empty($selected)?' selected':'').'> </option>';
|
||||
foreach($this->cache_demand_reason as $id => $arraydemandreason)
|
||||
{
|
||||
@ -3316,7 +3340,7 @@ class Form
|
||||
|
||||
$return='';
|
||||
|
||||
$return.= '<select class="flat" name="'.$htmlname.'">';
|
||||
$return.= '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">';
|
||||
$options = array(
|
||||
'HT'=>$langs->trans("HT"),
|
||||
'TTC'=>$langs->trans("TTC")
|
||||
@ -3439,7 +3463,7 @@ class Form
|
||||
$langs->load('bills');
|
||||
|
||||
$opt = '<option value ="" selected></option>';
|
||||
$sql = 'SELECT rowid, facnumber, situation_cycle_ref, situation_counter, situation_final, fk_soc FROM ' . MAIN_DB_PREFIX . 'facture WHERE situation_counter>=1';
|
||||
$sql = 'SELECT rowid, ref, situation_cycle_ref, situation_counter, situation_final, fk_soc FROM ' . MAIN_DB_PREFIX . 'facture WHERE situation_counter>=1';
|
||||
$sql.= ' ORDER by situation_cycle_ref, situation_counter desc';
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql && $this->db->num_rows($resql) > 0) {
|
||||
@ -3455,11 +3479,11 @@ class Form
|
||||
//not final ?
|
||||
if ($obj->situation_final != 1) {
|
||||
//Not prov?
|
||||
if (substr($obj->facnumber, 1, 4) != 'PROV') {
|
||||
if (substr($obj->ref, 1, 4) != 'PROV') {
|
||||
if ($selected == $obj->rowid) {
|
||||
$opt .= '<option value="' . $obj->rowid . '" selected>' . $obj->facnumber . '</option>';
|
||||
$opt .= '<option value="' . $obj->rowid . '" selected>' . $obj->ref . '</option>';
|
||||
} else {
|
||||
$opt .= '<option value="' . $obj->rowid . '">' . $obj->facnumber . '</option>';
|
||||
$opt .= '<option value="' . $obj->rowid . '">' . $obj->ref . '</option>';
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -4894,8 +4918,12 @@ class Form
|
||||
$disabled=false; $title='';
|
||||
if (is_object($societe_vendeuse) && $societe_vendeuse->id == $mysoc->id && $societe_vendeuse->tva_assuj == "0")
|
||||
{
|
||||
$title=' title="'.$langs->trans('VATIsNotUsed').'"';
|
||||
$disabled=true;
|
||||
// Override/enable VAT for expense report regardless of global setting - needed if expense report used for business expenses
|
||||
if (empty($conf->global->OVERRIDE_VAT_FOR_EXPENSE_REPORT))
|
||||
{
|
||||
$title=' title="'.$langs->trans('VATIsNotUsed').'"';
|
||||
$disabled=true;
|
||||
}
|
||||
}
|
||||
|
||||
if (! $options_only) $return.= '<select class="flat minwidth75imp" id="'.$htmlname.'" name="'.$htmlname.'"'.($disabled?' disabled':'').$title.'>';
|
||||
@ -5398,7 +5426,7 @@ class Form
|
||||
|
||||
if ($typehour=='select' )
|
||||
{
|
||||
$retstring.='<select class="flat" name="'.$prefix.'hour"'.($disabled?' disabled':'').'>';
|
||||
$retstring.='<select class="flat" id="select_'.$prefix.'hour" name="'.$prefix.'hour"'.($disabled?' disabled':'').'>';
|
||||
for ($hour = 0; $hour < 25; $hour++) // For a duration, we allow 24 hours
|
||||
{
|
||||
$retstring.='<option value="'.$hour.'"';
|
||||
@ -5425,7 +5453,7 @@ class Form
|
||||
|
||||
if ($typehour=='select' || $typehour=='textselect')
|
||||
{
|
||||
$retstring.='<select class="flat" name="'.$prefix.'min"'.($disabled?' disabled':'').'>';
|
||||
$retstring.='<select class="flat" id="select_'.$prefix.'min" name="'.$prefix.'min"'.($disabled?' disabled':'').'>';
|
||||
for ($min = 0; $min <= 55; $min=$min+5)
|
||||
{
|
||||
$retstring.='<option value="'.$min.'"';
|
||||
@ -6415,7 +6443,7 @@ class Form
|
||||
$possiblelinks=array(
|
||||
'propal'=>array('enabled'=>$conf->propal->enabled, 'perms'=>1, 'label'=>'LinkToProposal', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('propal').')'),
|
||||
'order'=>array('enabled'=>$conf->commande->enabled, 'perms'=>1, 'label'=>'LinkToOrder', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('commande').')'),
|
||||
'invoice'=>array('enabled'=>$conf->facture->enabled, 'perms'=>1, 'label'=>'LinkToInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.facnumber as ref, t.ref_client, t.total as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('facture').')'),
|
||||
'invoice'=>array('enabled'=>$conf->facture->enabled, 'perms'=>1, 'label'=>'LinkToInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref as ref, t.ref_client, t.total as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('facture').')'),
|
||||
'invoice_template'=>array('enabled'=>$conf->facture->enabled, 'perms'=>1, 'label'=>'LinkToTemplateInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.titre as ref, t.total as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_rec as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('facture').')'),
|
||||
'contrat'=>array('enabled'=>$conf->contrat->enabled , 'perms'=>1, 'label'=>'LinkToContract', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, '' as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('contract').')'),
|
||||
'fichinter'=>array('enabled'=>$conf->ficheinter->enabled, 'perms'=>1, 'label'=>'LinkToIntervention', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."fichinter as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('intervention').')'),
|
||||
@ -6605,7 +6633,7 @@ class Form
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
print '<select class="flat" name="'.$htmlname.'">';
|
||||
print '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">';
|
||||
if ($useempty)
|
||||
{
|
||||
print '<option value="-1"> </option>';
|
||||
@ -7170,7 +7198,7 @@ class Form
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$out = '<select name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">';
|
||||
$out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">';
|
||||
if ($useempty) $out.= '<option value="0"> </option>';
|
||||
|
||||
while ($obj = $db->fetch_object($resql))
|
||||
@ -7257,7 +7285,7 @@ class Form
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$out = '<select name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">';
|
||||
$out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">';
|
||||
if ($useempty) $out.= '<option value="0"></option>';
|
||||
|
||||
while ($obj = $db->fetch_object($resql))
|
||||
@ -7294,7 +7322,7 @@ class Form
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$out = '<select name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">';
|
||||
$out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">';
|
||||
if ($useempty) $out.= '<option value="0"></option>';
|
||||
if ($allchoice) $out.= '<option value="-1">'.$langs->trans('AllExpenseReport').'</option>';
|
||||
|
||||
|
||||
@ -334,7 +334,7 @@ class FormProjets
|
||||
$out='';
|
||||
|
||||
$hideunselectables = false;
|
||||
if (! empty($conf->global->CONTRACT_HIDE_UNSELECTABLES)) $hideunselectables = true;
|
||||
if (! empty($conf->global->PROJECT_HIDE_UNSELECTABLES)) $hideunselectables = true;
|
||||
|
||||
if (empty($projectsListId))
|
||||
{
|
||||
@ -346,11 +346,11 @@ class FormProjets
|
||||
}
|
||||
|
||||
// Search all projects
|
||||
$sql = 'SELECT t.rowid, t.ref as tref, t.label as tlabel, p.ref, p.title, p.fk_soc, p.fk_statut, p.public,';
|
||||
$sql = 'SELECT t.rowid, t.ref as tref, t.label as tlabel, p.rowid as pid, p.ref, p.title, p.fk_soc, p.fk_statut, p.public,';
|
||||
$sql.= ' s.nom as name';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX .'projet as p';
|
||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON s.rowid = p.fk_soc';
|
||||
$sql.= ', '.MAIN_DB_PREFIX.'projet_task as t';
|
||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON s.rowid = p.fk_soc,';
|
||||
$sql.= ' '.MAIN_DB_PREFIX.'projet_task as t';
|
||||
$sql.= " WHERE p.entity IN (".getEntity('project').")";
|
||||
$sql.= " AND t.fk_projet = p.rowid";
|
||||
if ($projectsListId) $sql.= " AND p.rowid IN (".$projectsListId.")";
|
||||
@ -393,7 +393,7 @@ class FormProjets
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($discard_closed == 1 && $obj->fk_statut == 2)
|
||||
if ($discard_closed == 1 && $obj->fk_statut == Project::STATUS_CLOSED)
|
||||
{
|
||||
$i++;
|
||||
continue;
|
||||
@ -411,12 +411,12 @@ class FormProjets
|
||||
if ($obj->name) $labeltoshow.=' ('.$obj->name.')';
|
||||
|
||||
$disabled=0;
|
||||
if ($obj->fk_statut == 0)
|
||||
if ($obj->fk_statut == Project::STATUS_DRAFT)
|
||||
{
|
||||
$disabled=1;
|
||||
$labeltoshow.=' - '.$langs->trans("Draft");
|
||||
}
|
||||
else if ($obj->fk_statut == 2)
|
||||
else if ($obj->fk_statut == Project::STATUS_CLOSED)
|
||||
{
|
||||
if ($discard_closed == 2) $disabled=1;
|
||||
$labeltoshow.=' - '.$langs->trans("Closed");
|
||||
@ -507,7 +507,7 @@ class FormProjets
|
||||
$sql = "SELECT t.rowid, t.label as ref";
|
||||
break;
|
||||
case "facture":
|
||||
$sql = "SELECT t.rowid, t.facnumber as ref";
|
||||
$sql = "SELECT t.rowid, t.ref as ref";
|
||||
break;
|
||||
case "facture_fourn":
|
||||
$sql = "SELECT t.rowid, t.ref, t.ref_supplier";
|
||||
|
||||
@ -589,7 +589,6 @@ class Menubase
|
||||
|
||||
$a = 0;
|
||||
$b = 0;
|
||||
$oldrowid=0;
|
||||
while ($a < $numa)
|
||||
{
|
||||
//$objm = $this->db->fetch_object($resql);
|
||||
|
||||
@ -3010,7 +3010,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
if (empty($srconly) && in_array($pictowithoutext, array(
|
||||
'bank', 'close_title', 'delete', 'edit', 'ellipsis-h', 'filter', 'grip', 'grip_title', 'list', 'listlight', 'off', 'on', 'play', 'playdisabled', 'printer', 'resize',
|
||||
'note','switch_off', 'switch_on', 'unlink', 'uparrow', '1downarrow', '1uparrow',
|
||||
'skype','twitter','facebook'
|
||||
'jabber','skype','twitter','facebook'
|
||||
)
|
||||
)) {
|
||||
$fakey = $pictowithoutext;
|
||||
@ -3093,10 +3093,14 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
elseif ($pictowithoutext == 'playdisabled') {
|
||||
$fakey = 'fa-play';
|
||||
$facolor = '#ccc';
|
||||
} elseif ($pictowithoutext == 'play') {
|
||||
}
|
||||
elseif ($pictowithoutext == 'play') {
|
||||
$fakey = 'fa-play';
|
||||
$facolor = '#444';
|
||||
}
|
||||
elseif ($pictowithoutext == 'jabber') {
|
||||
$fakey = 'fa-comment-o';
|
||||
}
|
||||
else {
|
||||
$fakey = 'fa-'.$pictowithoutext;
|
||||
$facolor = '#444';
|
||||
|
||||
@ -50,13 +50,13 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
|
||||
*/
|
||||
function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filter, $dateafterdate, $datebeforedate, $paymentdateafter, $paymentdatebefore, $usestdout, $regenerate=0, $filesuffix='', $paymentbankid='', $thirdpartiesid='', $fileprefix='mergedpdf')
|
||||
{
|
||||
$sql = "SELECT DISTINCT f.rowid, f.facnumber";
|
||||
$sql = "SELECT DISTINCT f.rowid, f.ref";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture as f";
|
||||
$sqlwhere='';
|
||||
$sqlorder='';
|
||||
if (in_array('all',$filter))
|
||||
{
|
||||
$sqlorder = " ORDER BY f.facnumber ASC";
|
||||
$sqlorder = " ORDER BY f.ref ASC";
|
||||
}
|
||||
if (in_array('date',$filter))
|
||||
{
|
||||
@ -175,11 +175,11 @@ function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filte
|
||||
$filename=$conf->facture->dir_output.'/'.$fac->ref.'/'.$fac->ref.'.pdf';
|
||||
if ($regenerate || ! dol_is_file($filename))
|
||||
{
|
||||
if ($usestdout) print "Build PDF for invoice ".$obj->facnumber." - Lang = ".$outputlangs->defaultlang."\n";
|
||||
if ($usestdout) print "Build PDF for invoice ".$obj->ref." - Lang = ".$outputlangs->defaultlang."\n";
|
||||
$result= $fac->generateDocument($regenerate?$regenerate:$fac->modelpdf, $outputlangs);
|
||||
}
|
||||
else {
|
||||
if ($usestdout) print "PDF for invoice ".$obj->facnumber." already exists\n";
|
||||
if ($usestdout) print "PDF for invoice ".$obj->ref." already exists\n";
|
||||
}
|
||||
|
||||
// Add file into files array
|
||||
|
||||
@ -40,6 +40,11 @@ function loan_prepare_head($object)
|
||||
$head[$tab][1] = $langs->trans('Card');
|
||||
$head[$tab][2] = 'card';
|
||||
$tab++;
|
||||
|
||||
$head[$tab][0] = DOL_URL_ROOT.'/loan/schedule.php?loanid='.$object->id;
|
||||
$head[$tab][1] = $langs->trans('FinancialCommitment');
|
||||
$head[$tab][2] = 'FinancialCommitment';
|
||||
$tab++;
|
||||
|
||||
// Show more tabs from modules
|
||||
// Entries must be declared in modules descriptor with line
|
||||
|
||||
@ -1347,6 +1347,7 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl
|
||||
if (! empty($libelleproduitservice) && ! empty($ref_prodserv)) $ref_prodserv .= " - ";
|
||||
}
|
||||
|
||||
if(!empty($ref_prodserv) && !empty($conf->global->ADD_HTML_FORMATING_INTO_DESC_DOC)){ $ref_prodserv = '<b>'.$ref_prodserv.'</b>'; }
|
||||
$libelleproduitservice=$prefix_prodserv.$ref_prodserv.$libelleproduitservice;
|
||||
|
||||
// Add an additional description for the category products
|
||||
@ -1382,7 +1383,11 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl
|
||||
$period='('.$outputlangs->transnoentitiesnoconv('DateUntil',dol_print_date($object->lines[$i]->date_end, $format, false, $outputlangs)).')';
|
||||
}
|
||||
//print '>'.$outputlangs->charset_output.','.$period;
|
||||
if(!empty($conf->global->ADD_HTML_FORMATING_INTO_DESC_DOC)){
|
||||
$libelleproduitservice.= '<b style="color:#333666;" ><em>'."__N__</b> ".$period.'</em>';
|
||||
}else{
|
||||
$libelleproduitservice.="__N__".$period;
|
||||
}
|
||||
//print $libelleproduitservice;
|
||||
}
|
||||
|
||||
|
||||
@ -52,9 +52,44 @@ function project_prepare_head($object)
|
||||
$head[$h][2] = 'contact';
|
||||
$h++;
|
||||
|
||||
if (empty($conf->global->PROJECT_HIDE_TASKS))
|
||||
{
|
||||
// Then tab for sub level of projet, i mean tasks
|
||||
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks.php?id='.$object->id;
|
||||
$head[$h][1] = $langs->trans("Tasks");
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
|
||||
$taskstatic=new Task($db);
|
||||
$nbTasks=count($taskstatic->getTasksArray(0, 0, $object->id, 0, 0));
|
||||
if ($nbTasks > 0) $head[$h][1].= ' <span class="badge">'.($nbTasks).'</span>';
|
||||
$head[$h][2] = 'tasks';
|
||||
$h++;
|
||||
|
||||
$nbTimeSpent=0;
|
||||
$sql = "SELECT t.rowid";
|
||||
//$sql .= " FROM ".MAIN_DB_PREFIX."projet_task_time as t, ".MAIN_DB_PREFIX."projet_task as pt, ".MAIN_DB_PREFIX."user as u";
|
||||
//$sql .= " WHERE t.fk_user = u.rowid AND t.fk_task = pt.rowid";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."projet_task_time as t, ".MAIN_DB_PREFIX."projet_task as pt";
|
||||
$sql .= " WHERE t.fk_task = pt.rowid";
|
||||
$sql .= " AND pt.fk_projet =".$object->id;
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
if ($obj) $nbTimeSpent=1;
|
||||
}
|
||||
else dol_print_error($db);
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/time.php?withproject=1&projectid='.$object->id;
|
||||
$head[$h][1] = $langs->trans("TimeSpent");
|
||||
if ($nbTimeSpent > 0) $head[$h][1].= ' <span class="badge">...</span>';
|
||||
$head[$h][2] = 'timespent';
|
||||
$h++;
|
||||
}
|
||||
|
||||
if (! empty($conf->fournisseur->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->commande->enabled)
|
||||
|| ! empty($conf->facture->enabled) || ! empty($conf->contrat->enabled)
|
||||
|| ! empty($conf->ficheinter->enabled) || ! empty($conf->agenda->enabled) || ! empty($conf->deplacement->enabled))
|
||||
|| ! empty($conf->facture->enabled) || ! empty($conf->contrat->enabled)
|
||||
|| ! empty($conf->ficheinter->enabled) || ! empty($conf->agenda->enabled) || ! empty($conf->deplacement->enabled))
|
||||
{
|
||||
$head[$h][0] = DOL_URL_ROOT.'/projet/element.php?id='.$object->id;
|
||||
$head[$h][1] = $langs->trans("ProjectOverview");
|
||||
@ -92,41 +127,6 @@ function project_prepare_head($object)
|
||||
$head[$h][2] = 'document';
|
||||
$h++;
|
||||
|
||||
if (empty($conf->global->PROJECT_HIDE_TASKS))
|
||||
{
|
||||
// Then tab for sub level of projet, i mean tasks
|
||||
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks.php?id='.$object->id;
|
||||
$head[$h][1] = $langs->trans("Tasks");
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
|
||||
$taskstatic=new Task($db);
|
||||
$nbTasks=count($taskstatic->getTasksArray(0, 0, $object->id, 0, 0));
|
||||
if ($nbTasks > 0) $head[$h][1].= ' <span class="badge">'.($nbTasks).'</span>';
|
||||
$head[$h][2] = 'tasks';
|
||||
$h++;
|
||||
|
||||
$nbTimeSpent=0;
|
||||
$sql = "SELECT t.rowid";
|
||||
//$sql .= " FROM ".MAIN_DB_PREFIX."projet_task_time as t, ".MAIN_DB_PREFIX."projet_task as pt, ".MAIN_DB_PREFIX."user as u";
|
||||
//$sql .= " WHERE t.fk_user = u.rowid AND t.fk_task = pt.rowid";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."projet_task_time as t, ".MAIN_DB_PREFIX."projet_task as pt";
|
||||
$sql .= " WHERE t.fk_task = pt.rowid";
|
||||
$sql .= " AND pt.fk_projet =".$object->id;
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
if ($obj) $nbTimeSpent=1;
|
||||
}
|
||||
else dol_print_error($db);
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/time.php?withproject=1&projectid='.$object->id;
|
||||
$head[$h][1] = $langs->trans("TimeSpent");
|
||||
if ($nbTimeSpent > 0) $head[$h][1].= ' <span class="badge">...</span>';
|
||||
$head[$h][2] = 'timespent';
|
||||
$h++;
|
||||
}
|
||||
|
||||
// Manage discussion
|
||||
if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT))
|
||||
{
|
||||
@ -1205,7 +1205,7 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
// Break on a new project
|
||||
if ($parent == 0 && $lines[$i]->fk_project != $lastprojectid)
|
||||
{
|
||||
|
||||
@ -109,7 +109,7 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di
|
||||
$total_tva='total_tva';
|
||||
$paymenttable='paiement';
|
||||
$paymentfacturetable='paiement_facture';
|
||||
$invoicefieldref='facnumber';
|
||||
$invoicefieldref='ref';
|
||||
}
|
||||
if ($direction == 'buy')
|
||||
{
|
||||
@ -578,7 +578,7 @@ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire
|
||||
$total_tva='total_tva';
|
||||
$paymenttable='paiement';
|
||||
$paymentfacturetable='paiement_facture';
|
||||
$invoicefieldref='facnumber';
|
||||
$invoicefieldref='ref';
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -468,6 +468,8 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
{
|
||||
global $user,$conf,$langs,$dolibarr_main_db_name,$mysoc;
|
||||
|
||||
//var_dump($tabMenu);
|
||||
|
||||
$newmenu = $menu;
|
||||
|
||||
$mainmenu=($forcemainmenu?$forcemainmenu:$_SESSION["mainmenu"]);
|
||||
@ -523,7 +525,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
* We update newmenu with entries found into database
|
||||
* --------------------------------------------------
|
||||
*/
|
||||
if ($mainmenu)
|
||||
if ($mainmenu) // If this is empty, loading hard coded menu and loading personalised menu will fail
|
||||
{
|
||||
/*
|
||||
* Menu HOME
|
||||
@ -1628,6 +1630,9 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
}
|
||||
}
|
||||
|
||||
//var_dump($tabMenu); //
|
||||
//var_dump($newmenu->liste);
|
||||
|
||||
// Build final $menu_array = $menu_array_before +$newmenu->liste + $menu_array_after
|
||||
//var_dump($menu_array_before);exit;
|
||||
//var_dump($menu_array_after);exit;
|
||||
|
||||
@ -31,7 +31,7 @@ class MenuManager
|
||||
* @var DoliDB Database handler.
|
||||
*/
|
||||
public $db;
|
||||
|
||||
|
||||
var $type_user; // Put 0 for internal users, 1 for external users
|
||||
var $atarget=""; // To store default target to use onto links
|
||||
var $name="eldy";
|
||||
@ -109,6 +109,7 @@ class MenuManager
|
||||
$menuArbo = new Menubase($this->db,'eldy');
|
||||
$menuArbo->menuLoad($mainmenu, $leftmenu, $this->type_user, 'eldy', $tabMenu);
|
||||
$this->tabMenu=$tabMenu;
|
||||
//var_dump($tabMenu);
|
||||
|
||||
//if ($forcemainmenu == 'all') { var_dump($this->tabMenu); exit; }
|
||||
}
|
||||
@ -116,7 +117,7 @@ class MenuManager
|
||||
|
||||
/**
|
||||
* Show menu.
|
||||
* Module defined in sql tables are stored into this->tabMenu BEFORE this is called.
|
||||
* Module defined in sql tables were stored into $this->tabMenu BEFORE this is called.
|
||||
*
|
||||
* @param string $mode 'top', 'topnb', 'left', 'jmobile' (used to get full xml ul/li menu)
|
||||
* @param array $moredata An array with more data to output
|
||||
@ -126,6 +127,8 @@ class MenuManager
|
||||
{
|
||||
global $conf, $langs, $user;
|
||||
|
||||
//var_dump($this->tabMenu);
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/menus/standard/eldy.lib.php';
|
||||
|
||||
if ($this->type_user == 1)
|
||||
|
||||
@ -99,9 +99,9 @@ class mod_facture_mars extends ModeleNumRefFactures
|
||||
$fayymm=''; $max='';
|
||||
|
||||
$posindice=8;
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(facnumber FROM ".$posindice.") AS SIGNED) as max"; // This is standard SQL
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED) as max"; // This is standard SQL
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture";
|
||||
$sql.= " WHERE facnumber LIKE '".$db->escape($this->prefixinvoice)."____-%'";
|
||||
$sql.= " WHERE ref LIKE '".$db->escape($this->prefixinvoice)."____-%'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
|
||||
$resql=$db->query($sql);
|
||||
@ -121,9 +121,9 @@ class mod_facture_mars extends ModeleNumRefFactures
|
||||
$fayymm='';
|
||||
|
||||
$posindice=8;
|
||||
$sql = "SELECT MAX(SUBSTRING(facnumber FROM ".$posindice.")) as max"; // This is standard SQL
|
||||
$sql = "SELECT MAX(SUBSTRING(ref FROM ".$posindice.")) as max"; // This is standard SQL
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture";
|
||||
$sql.= " WHERE facnumber LIKE '".$db->escape($this->prefixcreditnote)."____-%'";
|
||||
$sql.= " WHERE ref LIKE '".$db->escape($this->prefixcreditnote)."____-%'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
|
||||
$resql=$db->query($sql);
|
||||
@ -162,9 +162,9 @@ class mod_facture_mars extends ModeleNumRefFactures
|
||||
|
||||
// D'abord on recupere la valeur max
|
||||
$posindice=8;
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(facnumber FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture";
|
||||
$sql.= " WHERE facnumber LIKE '".$prefix."____-%'";
|
||||
$sql.= " WHERE ref LIKE '".$prefix."____-%'";
|
||||
$sql.= " AND entity IN (".getEntity('invoicenumber', 1, $invoice).")";
|
||||
|
||||
$resql=$db->query($sql);
|
||||
@ -186,9 +186,9 @@ class mod_facture_mars extends ModeleNumRefFactures
|
||||
else $num = sprintf("%04s",$max);
|
||||
|
||||
$ref='';
|
||||
$sql = "SELECT facnumber as ref";
|
||||
$sql = "SELECT ref as ref";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture";
|
||||
$sql.= " WHERE facnumber LIKE '".$prefix."____-".$num."'";
|
||||
$sql.= " WHERE ref LIKE '".$prefix."____-".$num."'";
|
||||
$sql.= " AND entity IN (".getEntity('invoicenumber', 1, $invoice).")";
|
||||
|
||||
dol_syslog(get_class($this)."::getNextValue", LOG_DEBUG);
|
||||
|
||||
@ -167,7 +167,7 @@ class mod_facture_mercure extends ModeleNumRefFactures
|
||||
// Get entities
|
||||
$entity = getEntity('invoicenumber', 1, $invoice);
|
||||
|
||||
$numFinal=get_next_value($db,$mask,'facture','facnumber',$where,$objsoc,$invoice->date,$mode,false,null,$entity);
|
||||
$numFinal=get_next_value($db,$mask,'facture','ref',$where,$objsoc,$invoice->date,$mode,false,null,$entity);
|
||||
if (! preg_match('/([0-9])+/',$numFinal)) $this->error = $numFinal;
|
||||
|
||||
return $numFinal;
|
||||
|
||||
@ -96,9 +96,9 @@ class mod_facture_terre extends ModeleNumRefFactures
|
||||
$fayymm=''; $max='';
|
||||
|
||||
$posindice=8;
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(facnumber FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture";
|
||||
$sql.= " WHERE facnumber LIKE '".$db->escape($this->prefixinvoice)."____-%'";
|
||||
$sql.= " WHERE ref LIKE '".$db->escape($this->prefixinvoice)."____-%'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
|
||||
$resql=$db->query($sql);
|
||||
@ -118,9 +118,9 @@ class mod_facture_terre extends ModeleNumRefFactures
|
||||
$fayymm='';
|
||||
|
||||
$posindice=8;
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(facnumber FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture";
|
||||
$sql.= " WHERE facnumber LIKE '".$db->escape($this->prefixcreditnote)."____-%'";
|
||||
$sql.= " WHERE ref LIKE '".$db->escape($this->prefixcreditnote)."____-%'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
|
||||
$resql=$db->query($sql);
|
||||
@ -139,9 +139,9 @@ class mod_facture_terre extends ModeleNumRefFactures
|
||||
$fayymm='';
|
||||
|
||||
$posindice=8;
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(facnumber FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture";
|
||||
$sql.= " WHERE facnumber LIKE '".$db->escape($this->prefixdeposit)."____-%'";
|
||||
$sql.= " WHERE ref LIKE '".$db->escape($this->prefixdeposit)."____-%'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
|
||||
$resql=$db->query($sql);
|
||||
@ -177,9 +177,9 @@ class mod_facture_terre extends ModeleNumRefFactures
|
||||
|
||||
// D'abord on recupere la valeur max
|
||||
$posindice=8;
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(facnumber FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture";
|
||||
$sql.= " WHERE facnumber LIKE '".$prefix."____-%'";
|
||||
$sql.= " WHERE ref LIKE '".$prefix."____-%'";
|
||||
$sql.= " AND entity IN (".getEntity('invoicenumber', 1, $invoice).")";
|
||||
|
||||
$resql=$db->query($sql);
|
||||
@ -201,9 +201,9 @@ class mod_facture_terre extends ModeleNumRefFactures
|
||||
else $num = sprintf("%04s",$max);
|
||||
|
||||
$ref='';
|
||||
$sql = "SELECT facnumber as ref";
|
||||
$sql = "SELECT ref as ref";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture";
|
||||
$sql.= " WHERE facnumber LIKE '".$prefix."____-".$num."'";
|
||||
$sql.= " WHERE ref LIKE '".$prefix."____-".$num."'";
|
||||
$sql.= " AND entity IN (".getEntity('invoicenumber', 1, $invoice).")";
|
||||
|
||||
dol_syslog(get_class($this)."::getNextValue", LOG_DEBUG);
|
||||
|
||||
@ -331,10 +331,9 @@ class mailing_contacts1 extends MailingTargets
|
||||
* Ajoute destinataires dans table des cibles
|
||||
*
|
||||
* @param int $mailing_id Id of emailing
|
||||
* @param array $filtersarray Optional filter data (deprecated)
|
||||
* @return int <0 si erreur, nb ajout si ok
|
||||
*/
|
||||
function add_to_target($mailing_id,$filtersarray=array())
|
||||
function add_to_target($mailing_id)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $langs;
|
||||
|
||||
@ -61,10 +61,9 @@ class mailing_example extends MailingTargets
|
||||
* This is the main function that returns the array of emails
|
||||
*
|
||||
* @param int $mailing_id Id of mailing. No need to use it.
|
||||
* @param array $filtersarray If you used the formFilter function. Empty otherwise.
|
||||
* @return int <0 if error, number of emails added if ok
|
||||
*/
|
||||
function add_to_target($mailing_id,$filtersarray=array())
|
||||
function add_to_target($mailing_id)
|
||||
{
|
||||
// phpcs:enable
|
||||
$target = array();
|
||||
|
||||
@ -225,17 +225,11 @@ class mailing_fraise extends MailingTargets
|
||||
* Ajoute destinataires dans table des cibles
|
||||
*
|
||||
* @param int $mailing_id Id of emailing
|
||||
* @param array $filtersarray Param to filter sql request. Deprecated. Should use $_POST instead.
|
||||
* @return int < 0 si erreur, nb ajout si ok
|
||||
*/
|
||||
function add_to_target($mailing_id,$filtersarray=array())
|
||||
function add_to_target($mailing_id)
|
||||
{
|
||||
// phpcs:enable
|
||||
// Deprecation warning
|
||||
if ($filtersarray) {
|
||||
dol_syslog(__METHOD__ . ": filtersarray parameter is deprecated", LOG_WARNING);
|
||||
}
|
||||
|
||||
global $langs,$_POST;
|
||||
|
||||
// Load translation files required by the page
|
||||
|
||||
@ -166,7 +166,7 @@ class MailingTargets // This can't be abstract as it is used for some method
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
// Insert emailing targest from array into database
|
||||
// Insert emailing targets from array into database
|
||||
$j = 0;
|
||||
$num = count($cibles);
|
||||
foreach ($cibles as $targetarray)
|
||||
@ -211,6 +211,7 @@ class MailingTargets // This can't be abstract as it is used for some method
|
||||
|
||||
dol_syslog(get_class($this)."::".__METHOD__.": mailing ".$j." targets added");
|
||||
|
||||
/*
|
||||
//Update the status to show thirdparty mail that don't want to be contacted anymore'
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."mailing_cibles";
|
||||
$sql .= " SET statut=3";
|
||||
@ -219,8 +220,6 @@ class MailingTargets // This can't be abstract as it is used for some method
|
||||
dol_syslog(get_class($this)."::".__METHOD__.": mailing update status to display thirdparty mail that do not want to be contacted");
|
||||
$result=$this->db->query($sql);
|
||||
|
||||
|
||||
|
||||
//Update the status to show contact mail that don't want to be contacted anymore'
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."mailing_cibles";
|
||||
$sql .= " SET statut=3";
|
||||
@ -228,11 +227,23 @@ class MailingTargets // This can't be abstract as it is used for some method
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe s ON s.rowid=sc.fk_soc WHERE s.fk_stcomm=-1 OR no_email=1))";
|
||||
dol_syslog(get_class($this)."::".__METHOD__.": mailing update status to display contact mail that do not want to be contacted",LOG_DEBUG);
|
||||
$result=$this->db->query($sql);
|
||||
*/
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."mailing_cibles";
|
||||
$sql .= " SET statut=3";
|
||||
$sql .= " WHERE fk_mailing=".$mailing_id." AND email IN (SELECT mu.email FROM ".MAIN_DB_PREFIX."mailing_unsubscribe AS mu WHERE mu.entity IN ('".getEntity('mailing')."'))";
|
||||
|
||||
dol_syslog(get_class($this)."::".__METHOD__.":mailing update status to display emails that do not want to be contacted anymore", LOG_DEBUG);
|
||||
$result=$this->db->query($sql);
|
||||
if (! $result)
|
||||
{
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
|
||||
$this->update_nb($mailing_id);
|
||||
|
||||
$this->db->commit();
|
||||
|
||||
return $j;
|
||||
}
|
||||
|
||||
|
||||
@ -151,17 +151,11 @@ class mailing_pomme extends MailingTargets
|
||||
* Ajoute destinataires dans table des cibles
|
||||
*
|
||||
* @param int $mailing_id Id of emailing
|
||||
* @param array $filtersarray Requete sql de selection des destinataires
|
||||
* @return int < 0 si erreur, nb ajout si ok
|
||||
*/
|
||||
function add_to_target($mailing_id, $filtersarray=array())
|
||||
function add_to_target($mailing_id)
|
||||
{
|
||||
// phpcs:enable
|
||||
// Deprecation warning
|
||||
if ($filtersarray) {
|
||||
dol_syslog(__METHOD__ . ": filtersarray parameter is deprecated", LOG_WARNING);
|
||||
}
|
||||
|
||||
global $conf, $langs;
|
||||
$langs->load("companies");
|
||||
|
||||
|
||||
@ -57,10 +57,9 @@ class mailing_thirdparties extends MailingTargets
|
||||
* This is the main function that returns the array of emails
|
||||
*
|
||||
* @param int $mailing_id Id of mailing. No need to use it.
|
||||
* @param array $filtersarray If you used the formFilter function. Empty otherwise.
|
||||
* @return int <0 if error, number of emails added if ok
|
||||
*/
|
||||
function add_to_target($mailing_id, $filtersarray=array())
|
||||
function add_to_target($mailing_id)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $langs;
|
||||
|
||||
@ -82,26 +82,26 @@ class mailing_thirdparties_services_expired extends MailingTargets
|
||||
* This is the main function that returns the array of emails
|
||||
*
|
||||
* @param int $mailing_id Id of mailing. No need to use it.
|
||||
* @param array $filtersarray If you used the formFilter function. Empty otherwise.
|
||||
* @return int <0 if error, number of emails added if ok
|
||||
*/
|
||||
function add_to_target($mailing_id,$filtersarray=array())
|
||||
function add_to_target($mailing_id)
|
||||
{
|
||||
// phpcs:enable
|
||||
$target = array();
|
||||
|
||||
// ----- Your code start here -----
|
||||
$key=GETPOST('filter','int');
|
||||
|
||||
$cibles = array();
|
||||
$j = 0;
|
||||
|
||||
$product='';
|
||||
foreach($filtersarray as $key)
|
||||
if ($key == '0')
|
||||
{
|
||||
if ($key == '0') return "Error: You must choose a filter";
|
||||
$product=$this->arrayofproducts[$key];
|
||||
$this->error = "Error: You must choose a filter";
|
||||
$this->errors[] = $this->error;
|
||||
return $this->error;
|
||||
}
|
||||
|
||||
$product=$this->arrayofproducts[$key];
|
||||
|
||||
$now=dol_now();
|
||||
|
||||
// La requete doit retourner: id, email, name
|
||||
|
||||
@ -115,10 +115,9 @@ class mailing_xinputfile extends MailingTargets
|
||||
* Ajoute destinataires dans table des cibles
|
||||
*
|
||||
* @param int $mailing_id Id of emailing
|
||||
* @param array $filtersarray Requete sql de selection des destinataires
|
||||
* @return int < 0 si erreur, nb ajout si ok
|
||||
*/
|
||||
function add_to_target($mailing_id,$filtersarray=array())
|
||||
function add_to_target($mailing_id)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$langs,$_FILES;
|
||||
|
||||
@ -113,10 +113,9 @@ class mailing_xinputuser extends MailingTargets
|
||||
* Ajoute destinataires dans table des cibles
|
||||
*
|
||||
* @param int $mailing_id Id of emailing
|
||||
* @param array $filtersarray Requete sql de selection des destinataires
|
||||
* @return int < 0 si erreur, nb ajout si ok
|
||||
*/
|
||||
function add_to_target($mailing_id,$filtersarray=array())
|
||||
function add_to_target($mailing_id)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$langs,$_FILES;
|
||||
|
||||
@ -194,7 +194,7 @@ class modApi extends DolibarrModules
|
||||
// $this->export_fields_array[$r]=array(
|
||||
// 's.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','s.fk_pays'=>'Country','s.phone'=>'Phone',
|
||||
// 's.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode',
|
||||
// 's.code_compta_fournisseur'=>'SupplierAccountancyCode','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",
|
||||
// 's.code_compta_fournisseur'=>'SupplierAccountancyCode','f.rowid'=>"InvoiceId",'f.ref'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",
|
||||
// 'f.datef'=>"DateInvoice",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus',
|
||||
// 'f.note'=>"InvoiceNote",'fd.rowid'=>'LineId','fd.description'=>"LineDescription",'fd.price'=>"LineUnitPrice",'fd.tva_tx'=>"LineVATRate",
|
||||
// 'fd.qty'=>"LineQty",'fd.total_ht'=>"LineTotalHT",'fd.total_tva'=>"LineTotalTVA",'fd.total_ttc'=>"LineTotalTTC",'fd.date_start'=>"DateStart",
|
||||
@ -203,7 +203,7 @@ class modApi extends DolibarrModules
|
||||
// $this->export_entities_array[$r]=array(
|
||||
// 's.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','s.fk_pays'=>'company','s.phone'=>'company',
|
||||
// 's.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company',
|
||||
// 'f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice",
|
||||
// 'f.rowid'=>"invoice",'f.ref'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice",
|
||||
// 'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note'=>"invoice",'fd.rowid'=>'invoice_line','fd.description'=>"invoice_line",'fd.price'=>"invoice_line",
|
||||
// 'fd.total_ht'=>"invoice_line",'fd.total_tva'=>"invoice_line",'fd.total_ttc'=>"invoice_line",'fd.tva_tx'=>"invoice_line",'fd.qty'=>"invoice_line",
|
||||
// 'fd.date_start'=>"invoice_line",'fd.date_end'=>"invoice_line",'fd.fk_product'=>'product','p.ref'=>'product'
|
||||
|
||||
@ -178,13 +178,13 @@ class modBanque extends DolibarrModules
|
||||
$this->export_label[$r]='Bordereaux remise Chq/Fact';
|
||||
$this->export_permission[$r]=array(array("banque","export"));
|
||||
$this->export_fields_array[$r]=array("bch.rowid"=>"DepositId","bch.ref"=>"Numero","bch.ref_ext"=>"RefExt",'ba.ref'=>'AccountRef','ba.label'=>'AccountLabel','b.datev'=>'DateValue','b.num_chq'=>'ChequeOrTransferNumber','b.amount'=>'Credit','b.num_releve'=>'AccountStatement','b.datec'=>"DateCreation",
|
||||
"bch.date_bordereau"=>"Date","bch.amount"=>"Total","bch.nbcheque"=>"NbCheque","bu.url_id"=>"IdThirdParty","s.nom"=>"ThirdParty","s.code_compta"=>"CustomerAccountancyCode","f.facnumber"=>"InvoiceRef"
|
||||
"bch.date_bordereau"=>"Date","bch.amount"=>"Total","bch.nbcheque"=>"NbCheque","bu.url_id"=>"IdThirdParty","s.nom"=>"ThirdParty","s.code_compta"=>"CustomerAccountancyCode","f.ref"=>"InvoiceRef"
|
||||
);
|
||||
$this->export_TypeFields_array[$r]=array('ba.ref'=>'Text','ba.label'=>'Text','b.datev'=>'Date','b.num_chq'=>'Text','b.amount'=>'Numeric','b.num_releve'=>'Text','b.datec'=>"Date",
|
||||
"bch.date_bordereau"=>"Date","bch.rowid"=>"Numeric","bch.ref"=>"Numeric","bch.ref_ext"=>"Text","bch.amount"=>"Numeric","bch.nbcheque"=>"Numeric","bu.url_id"=>"Text","s.nom"=>"Text","s.code_compta"=>"Text","f.facnumber"=>"Text"
|
||||
"bch.date_bordereau"=>"Date","bch.rowid"=>"Numeric","bch.ref"=>"Numeric","bch.ref_ext"=>"Text","bch.amount"=>"Numeric","bch.nbcheque"=>"Numeric","bu.url_id"=>"Text","s.nom"=>"Text","s.code_compta"=>"Text","f.ref"=>"Text"
|
||||
);
|
||||
$this->export_entities_array[$r]=array('ba.ref'=>'account','ba.label'=>'account','b.datev'=>'account','b.num_chq'=>'account','b.amount'=>'account','b.num_releve'=>'account','b.datec'=>"account",
|
||||
"bu.url_id"=>"company","s.nom"=>"company","s.code_compta"=>"company","s.code_compta_fournisseur"=>"company","f.facnumber"=>"invoice");
|
||||
"bu.url_id"=>"company","s.nom"=>"company","s.code_compta"=>"company","s.code_compta_fournisseur"=>"company","f.ref"=>"invoice");
|
||||
$this->export_special_array[$r]=array('b.amount'=>'NULLIFNEG');
|
||||
|
||||
$this->export_sql_start[$r]='SELECT DISTINCT ';
|
||||
|
||||
@ -284,6 +284,7 @@ class modCategorie extends DolibarrModules
|
||||
'p.email' => 'Email',
|
||||
'p.note_private' => 'NotePrivate',
|
||||
'p.note_public' => 'NotePublic',
|
||||
'p.statut' => 'Status',
|
||||
's.nom'=>"Name",
|
||||
's.client'=>"Customer",
|
||||
's.fournisseur'=>"Supplier",
|
||||
@ -301,6 +302,7 @@ class modCategorie extends DolibarrModules
|
||||
'u.description' => "Text",
|
||||
'p.lastname' => 'Text',
|
||||
'p.firstname' => 'Text',
|
||||
'p.statut'=>"Numeric",
|
||||
's.nom'=>"Text",
|
||||
's.status'=>"Text",
|
||||
's.address'=>"Text",
|
||||
@ -333,6 +335,7 @@ class modCategorie extends DolibarrModules
|
||||
'p.email' => 'contact',
|
||||
'p.note_private' => 'contact',
|
||||
'p.note_public' => 'contact',
|
||||
'p.statut' => 'contact',
|
||||
's.nom'=>"company",
|
||||
's.client'=>"company",
|
||||
's.fournisseur'=>"company",
|
||||
|
||||
@ -213,7 +213,7 @@ class modFacture extends DolibarrModules
|
||||
's.rowid'=>"IdCompany", 's.nom'=>'CompanyName', 's.code_client'=>'CustomerCode', 's.address'=>'Address', 's.zip'=>'Zip', 's.town'=>'Town', 'c.code'=>'CountryCode', 's.phone'=>'Phone',
|
||||
's.siren'=>'ProfId1', 's.siret'=>'ProfId2', 's.ape'=>'ProfId3', 's.idprof4'=>'ProfId4', 's.code_compta'=>'CustomerAccountancyCode',
|
||||
's.code_compta_fournisseur'=>'SupplierAccountancyCode', 's.tva_intra'=>'VATIntra',
|
||||
'f.rowid'=>"InvoiceId", 'f.facnumber'=>"InvoiceRef", 'f.ref_client'=>'RefCustomer',
|
||||
'f.rowid'=>"InvoiceId", 'f.ref'=>"InvoiceRef", 'f.ref_client'=>'RefCustomer',
|
||||
'f.type'=>"Type", 'f.datec'=>"InvoiceDateCreation", 'f.datef'=>"DateInvoice", 'f.date_lim_reglement'=>"DateDue", 'f.total'=>"TotalHT",
|
||||
'f.total_ttc'=>"TotalTTC", 'f.tva'=>"TotalVAT", 'none.rest'=>'Rest', 'f.paye'=>"InvoicePaid", 'f.fk_statut'=>'InvoiceStatus',
|
||||
'f.note_private'=>"NotePrivate", 'f.note_public'=>"NotePublic", 'f.fk_user_author'=>'CreatedById', 'uc.login'=>'CreatedByLogin',
|
||||
@ -226,7 +226,7 @@ class modFacture extends DolibarrModules
|
||||
$this->export_TypeFields_array[$r] = array(
|
||||
's.rowid'=>'Numeric', 's.nom'=>'Text', 's.code_client'=>'Text', 's.address'=>'Text', 's.zip'=>'Text', 's.town'=>'Text', 'c.code'=>'Text', 's.phone'=>'Text', 's.siren'=>'Text',
|
||||
's.siret'=>'Text', 's.ape'=>'Text', 's.idprof4'=>'Text', 's.code_compta'=>'Text', 's.code_compta_fournisseur'=>'Text', 's.tva_intra'=>'Text',
|
||||
'f.rowid'=>'Numeric', 'f.facnumber'=>"Text", 'f.ref_client'=>'Text', 'f.type'=>"Numeric", 'f.datec'=>"Date", 'f.datef'=>"Date", 'f.date_lim_reglement'=>"Date",
|
||||
'f.rowid'=>'Numeric', 'f.ref'=>"Text", 'f.ref_client'=>'Text', 'f.type'=>"Numeric", 'f.datec'=>"Date", 'f.datef'=>"Date", 'f.date_lim_reglement'=>"Date",
|
||||
'f.total'=>"Numeric", 'f.total_ttc'=>"Numeric", 'f.tva'=>"Numeric", 'none.rest'=>"NumericCompute", 'f.paye'=>"Boolean", 'f.fk_statut'=>'Numeric',
|
||||
'f.note_private'=>"Text", 'f.note_public'=>"Text", 'f.fk_user_author'=>'Numeric', 'uc.login'=>'Text', 'f.fk_user_valid'=>'Numeric', 'uv.login'=>'Text',
|
||||
'pj.ref'=>'Text', 'fd.rowid'=>'Numeric', 'fd.label'=>'Text', 'fd.description'=>"Text", 'fd.subprice'=>"Numeric", 'fd.tva_tx'=>"Numeric",
|
||||
@ -277,7 +277,7 @@ class modFacture extends DolibarrModules
|
||||
's.rowid'=>"IdCompany", 's.nom'=>'CompanyName', 's.code_client'=>'CustomerCode', 's.address'=>'Address', 's.zip'=>'Zip', 's.town'=>'Town', 'c.code'=>'CountryCode', 's.phone'=>'Phone',
|
||||
's.siren'=>'ProfId1', 's.siret'=>'ProfId2', 's.ape'=>'ProfId3', 's.idprof4'=>'ProfId4', 's.code_compta'=>'CustomerAccountancyCode',
|
||||
's.code_compta_fournisseur'=>'SupplierAccountancyCode', 's.tva_intra'=>'VATIntra',
|
||||
'f.rowid'=>"InvoiceId", 'f.facnumber'=>"InvoiceRef", 'f.ref_client'=>'RefCustomer',
|
||||
'f.rowid'=>"InvoiceId", 'f.ref'=>"InvoiceRef", 'f.ref_client'=>'RefCustomer',
|
||||
'f.type'=>"Type", 'f.datec'=>"InvoiceDateCreation", 'f.datef'=>"DateInvoice", 'f.date_lim_reglement'=>"DateDue", 'f.total'=>"TotalHT",
|
||||
'f.total_ttc'=>"TotalTTC", 'f.tva'=>"TotalVAT", 'none.rest'=>'Rest', 'f.paye'=>"InvoicePaid", 'f.fk_statut'=>'InvoiceStatus',
|
||||
'f.note_private'=>"NotePrivate", 'f.note_public'=>"NotePublic", 'f.fk_user_author'=>'CreatedById', 'uc.login'=>'CreatedByLogin',
|
||||
@ -288,7 +288,7 @@ class modFacture extends DolibarrModules
|
||||
$this->export_TypeFields_array[$r] = array(
|
||||
's.rowid'=>'Numeric', 's.nom'=>'Text', 's.code_client'=>'Text', 's.address'=>'Text', 's.zip'=>'Text', 's.town'=>'Text', 'c.code'=>'Text', 's.phone'=>'Text', 's.siren'=>'Text',
|
||||
's.siret'=>'Text', 's.ape'=>'Text', 's.idprof4'=>'Text', 's.code_compta'=>'Text', 's.code_compta_fournisseur'=>'Text', 's.tva_intra'=>'Text',
|
||||
'f.rowid'=>"Numeric", 'f.facnumber'=>"Text", 'f.ref_client'=>'Text', 'f.type'=>"Numeric", 'f.datec'=>"Date", 'f.datef'=>"Date", 'f.date_lim_reglement'=>"Date",
|
||||
'f.rowid'=>"Numeric", 'f.ref'=>"Text", 'f.ref_client'=>'Text', 'f.type'=>"Numeric", 'f.datec'=>"Date", 'f.datef'=>"Date", 'f.date_lim_reglement'=>"Date",
|
||||
'f.total'=>"Numeric", 'f.total_ttc'=>"Numeric", 'f.tva'=>"Numeric", 'none.rest'=>'NumericCompute', 'f.paye'=>"Boolean", 'f.fk_statut'=>'Status',
|
||||
'f.note_private'=>"Text", 'f.note_public'=>"Text", 'f.fk_user_author'=>'Numeric', 'uc.login'=>'Text', 'f.fk_user_valid'=>'Numeric', 'uv.login'=>'Text',
|
||||
'pj.ref'=>'Text', 'p.amount'=>'Numeric', 'pf.amount'=>'Numeric', 'p.rowid'=>'Numeric', 'p.ref'=>'Text', 'p.datep'=>'Date', 'p.num_paiement'=>'Numeric',
|
||||
|
||||
@ -173,7 +173,7 @@ class modGravatar extends DolibarrModules
|
||||
// $this->export_fields_array[$r]=array(
|
||||
// 's.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','s.fk_pays'=>'Country','s.phone'=>'Phone',
|
||||
// 's.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode',
|
||||
// 's.code_compta_fournisseur'=>'SupplierAccountancyCode','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",
|
||||
// 's.code_compta_fournisseur'=>'SupplierAccountancyCode','f.rowid'=>"InvoiceId",'f.ref'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",
|
||||
// 'f.datef'=>"DateInvoice",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus',
|
||||
// 'f.note'=>"InvoiceNote",'fd.rowid'=>'LineId','fd.description'=>"LineDescription",'fd.price'=>"LineUnitPrice",'fd.tva_tx'=>"LineVATRate",'fd.qty'=>"LineQty",
|
||||
// 'fd.total_ht'=>"LineTotalHT",'fd.total_tva'=>"LineTotalTVA",'fd.total_ttc'=>"LineTotalTTC",'fd.date_start'=>"DateStart",'fd.date_end'=>"DateEnd",
|
||||
@ -182,7 +182,7 @@ class modGravatar extends DolibarrModules
|
||||
// $this->export_entities_array[$r]=array(
|
||||
// 's.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','s.fk_pays'=>'company','s.phone'=>'company',
|
||||
// 's.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company',
|
||||
// 'f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice",
|
||||
// 'f.rowid'=>"invoice",'f.ref'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice",
|
||||
// 'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note'=>"invoice",'fd.rowid'=>'invoice_line','fd.description'=>"invoice_line",'fd.price'=>"invoice_line",
|
||||
// 'fd.total_ht'=>"invoice_line",'fd.total_tva'=>"invoice_line",'fd.total_ttc'=>"invoice_line",'fd.tva_tx'=>"invoice_line",'fd.qty'=>"invoice_line",
|
||||
// 'fd.date_start'=>"invoice_line",'fd.date_end'=>"invoice_line",'fd.fk_product'=>'product','p.ref'=>'product'
|
||||
|
||||
@ -227,7 +227,7 @@ class modHoliday extends DolibarrModules
|
||||
// $this->export_fields_array[$r]=array(
|
||||
// 's.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','s.fk_pays'=>'Country','s.phone'=>'Phone',
|
||||
// 's.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode',
|
||||
// 's.code_compta_fournisseur'=>'SupplierAccountancyCode','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",
|
||||
// 's.code_compta_fournisseur'=>'SupplierAccountancyCode','f.rowid'=>"InvoiceId",'f.ref'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",
|
||||
// 'f.datef'=>"DateInvoice",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus',
|
||||
// 'f.note'=>"InvoiceNote",'fd.rowid'=>'LineId','fd.description'=>"LineDescription",'fd.price'=>"LineUnitPrice",'fd.tva_tx'=>"LineVATRate",
|
||||
// 'fd.qty'=>"LineQty",'fd.total_ht'=>"LineTotalHT",'fd.total_tva'=>"LineTotalTVA",'fd.total_ttc'=>"LineTotalTTC",'fd.date_start'=>"DateStart",
|
||||
@ -236,7 +236,7 @@ class modHoliday extends DolibarrModules
|
||||
// $this->export_entities_array[$r]=array(
|
||||
// 's.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','s.fk_pays'=>'company','s.phone'=>'company',
|
||||
// 's.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company',
|
||||
// 'f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice",
|
||||
// 'f.rowid'=>"invoice",'f.ref'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice",
|
||||
// 'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note'=>"invoice",'fd.rowid'=>'invoice_line','fd.description'=>"invoice_line",'fd.price'=>"invoice_line",
|
||||
// 'fd.total_ht'=>"invoice_line",'fd.total_tva'=>"invoice_line",'fd.total_ttc'=>"invoice_line",'fd.tva_tx'=>"invoice_line",'fd.qty'=>"invoice_line",
|
||||
// 'fd.date_start'=>"invoice_line",'fd.date_end'=>"invoice_line",'fd.fk_product'=>'product','p.ref'=>'product'
|
||||
@ -244,7 +244,7 @@ class modHoliday extends DolibarrModules
|
||||
// $this->export_alias_array[$r]=array(
|
||||
// 's.rowid'=>"socid",'s.nom'=>'soc_name','s.address'=>'soc_adres','s.zip'=>'soc_zip','s.town'=>'soc_town','s.fk_pays'=>'soc_pays','s.phone'=>'soc_tel',
|
||||
// 's.siren'=>'soc_siren','s.siret'=>'soc_siret','s.ape'=>'soc_ape','s.idprof4'=>'soc_idprof4','s.code_compta'=>'soc_customer_accountancy',
|
||||
// 's.code_compta_fournisseur'=>'soc_supplier_accountancy','f.rowid'=>"invoiceid",'f.facnumber'=>"ref",'f.datec'=>"datecreation",'f.datef'=>"dateinvoice",
|
||||
// 's.code_compta_fournisseur'=>'soc_supplier_accountancy','f.rowid'=>"invoiceid",'f.ref'=>"ref",'f.datec'=>"datecreation",'f.datef'=>"dateinvoice",
|
||||
// 'f.total'=>"totalht",'f.total_ttc'=>"totalttc",'f.tva'=>"totalvat",'f.paye'=>"paid",'f.fk_statut'=>'status','f.note'=>"note",'fd.rowid'=>'lineid',
|
||||
// 'fd.description'=>"linedescription",'fd.price'=>"lineprice",'fd.total_ht'=>"linetotalht",'fd.total_tva'=>"linetotaltva",'fd.total_ttc'=>"linetotalttc",
|
||||
// 'fd.tva_tx'=>"linevatrate",'fd.qty'=>"lineqty",'fd.date_start'=>"linedatestart",'fd.date_end'=>"linedateend",'fd.fk_product'=>'productid',
|
||||
|
||||
@ -221,7 +221,7 @@ class modMultiCurrency extends DolibarrModules
|
||||
// $this->export_fields_array[$r]=array(
|
||||
// 's.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','s.fk_pays'=>'Country','s.phone'=>'Phone',
|
||||
// 's.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode',
|
||||
// 's.code_compta_fournisseur'=>'SupplierAccountancyCode','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",
|
||||
// 's.code_compta_fournisseur'=>'SupplierAccountancyCode','f.rowid'=>"InvoiceId",'f.ref'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",
|
||||
// 'f.datef'=>"DateInvoice",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus',
|
||||
// 'f.note'=>"InvoiceNote",'fd.rowid'=>'LineId','fd.description'=>"LineDescription",'fd.price'=>"LineUnitPrice",'fd.tva_tx'=>"LineVATRate",
|
||||
// 'fd.qty'=>"LineQty",'fd.total_ht'=>"LineTotalHT",'fd.total_tva'=>"LineTotalTVA",'fd.total_ttc'=>"LineTotalTTC",'fd.date_start'=>"DateStart",
|
||||
@ -231,7 +231,7 @@ class modMultiCurrency extends DolibarrModules
|
||||
// 't.date'=>'Date', 't.qte'=>'Numeric', 't.poids'=>'Numeric', 't.fad'=>'Numeric', 't.paq'=>'Numeric', 't.stockage'=>'Numeric', 't.fadparliv'=>'Numeric',
|
||||
// 't.livau100'=>'Numeric', 't.forfait'=>'Numeric', 's.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text',
|
||||
// 's.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text',
|
||||
// 'f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Numeric",'f.total_ttc'=>"Numeric",'f.tva'=>"Numeric",
|
||||
// 'f.ref'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Numeric",'f.total_ttc'=>"Numeric",'f.tva'=>"Numeric",
|
||||
// 'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_private'=>"Text",'f.note_public'=>"Text",'fd.description'=>"Text",'fd.subprice'=>"Numeric",
|
||||
// 'fd.tva_tx'=>"Numeric",'fd.qty'=>"Numeric",'fd.total_ht'=>"Numeric",'fd.total_tva'=>"Numeric",'fd.total_ttc'=>"Numeric",'fd.date_start'=>"Date",
|
||||
// 'fd.date_end'=>"Date",'fd.special_code'=>'Numeric','fd.product_type'=>"Numeric",'fd.fk_product'=>'List:product:label','p.ref'=>'Text','p.label'=>'Text',
|
||||
@ -240,7 +240,7 @@ class modMultiCurrency extends DolibarrModules
|
||||
// $this->export_entities_array[$r]=array(
|
||||
// 's.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','s.fk_pays'=>'company','s.phone'=>'company',
|
||||
// 's.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company',
|
||||
// 'f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",
|
||||
// 'f.rowid'=>"invoice",'f.ref'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",
|
||||
// 'f.tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note'=>"invoice",'fd.rowid'=>'invoice_line','fd.description'=>"invoice_line",
|
||||
// 'fd.price'=>"invoice_line",'fd.total_ht'=>"invoice_line",'fd.total_tva'=>"invoice_line",'fd.total_ttc'=>"invoice_line",'fd.tva_tx'=>"invoice_line",
|
||||
// 'fd.qty'=>"invoice_line",'fd.date_start'=>"invoice_line",'fd.date_end'=>"invoice_line",'fd.fk_product'=>'product','p.ref'=>'product'
|
||||
|
||||
@ -168,7 +168,7 @@ class modPayBox extends DolibarrModules
|
||||
// 's.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town',
|
||||
// 's.fk_pays'=>'Country','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3',
|
||||
// 's.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode',
|
||||
// 'f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.total'=>"TotalHT",
|
||||
// 'f.rowid'=>"InvoiceId",'f.ref'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.total'=>"TotalHT",
|
||||
// 'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note'=>"InvoiceNote",'fd.rowid'=>'LineId',
|
||||
// 'fd.description'=>"LineDescription",'fd.price'=>"LineUnitPrice",'fd.tva_tx'=>"LineVATRate",'fd.qty'=>"LineQty",'fd.total_ht'=>"LineTotalHT",
|
||||
// 'fd.total_tva'=>"LineTotalTVA",'fd.total_ttc'=>"LineTotalTTC",'fd.date_start'=>"DateStart",'fd.date_end'=>"DateEnd",'fd.fk_product'=>'ProductId','p.ref'=>'ProductRef',
|
||||
@ -176,7 +176,7 @@ class modPayBox extends DolibarrModules
|
||||
// $this->export_entities_array[$r]=array(
|
||||
// 's.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company',
|
||||
// 's.fk_pays'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company',
|
||||
// 's.code_compta'=>'company','s.code_compta_fournisseur'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",
|
||||
// 's.code_compta'=>'company','s.code_compta_fournisseur'=>'company','f.rowid'=>"invoice",'f.ref'=>"invoice",'f.datec'=>"invoice",
|
||||
// 'f.datef'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice',
|
||||
// 'f.note'=>"invoice",'fd.rowid'=>'invoice_line','fd.description'=>"invoice_line",'fd.price'=>"invoice_line",'fd.total_ht'=>"invoice_line",
|
||||
// 'fd.total_tva'=>"invoice_line",'fd.total_ttc'=>"invoice_line",'fd.tva_tx'=>"invoice_line",'fd.qty'=>"invoice_line",'fd.date_start'=>"invoice_line",
|
||||
|
||||
@ -174,7 +174,7 @@ class modPaypal extends DolibarrModules
|
||||
// $this->export_fields_array[$r]=array(
|
||||
// 's.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','s.fk_pays'=>'Country','s.phone'=>'Phone',
|
||||
// 's.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode',
|
||||
// 's.code_compta_fournisseur'=>'SupplierAccountancyCode','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",
|
||||
// 's.code_compta_fournisseur'=>'SupplierAccountancyCode','f.rowid'=>"InvoiceId",'f.ref'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",
|
||||
// 'f.datef'=>"DateInvoice",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus',
|
||||
// 'f.note'=>"InvoiceNote",'fd.rowid'=>'LineId','fd.description'=>"LineDescription",'fd.price'=>"LineUnitPrice",'fd.tva_tx'=>"LineVATRate",
|
||||
// 'fd.qty'=>"LineQty",'fd.total_ht'=>"LineTotalHT",'fd.total_tva'=>"LineTotalTVA",'fd.total_ttc'=>"LineTotalTTC",'fd.date_start'=>"DateStart",
|
||||
@ -183,7 +183,7 @@ class modPaypal extends DolibarrModules
|
||||
// $this->export_entities_array[$r]=array(
|
||||
// 's.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','s.fk_pays'=>'company','s.phone'=>'company',
|
||||
// 's.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company',
|
||||
// 'f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",
|
||||
// 'f.rowid'=>"invoice",'f.ref'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",
|
||||
// 'f.tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note'=>"invoice",'fd.rowid'=>'invoice_line','fd.description'=>"invoice_line",
|
||||
// 'fd.price'=>"invoice_line",'fd.total_ht'=>"invoice_line",'fd.total_tva'=>"invoice_line",'fd.total_ttc'=>"invoice_line",'fd.tva_tx'=>"invoice_line",
|
||||
// 'fd.qty'=>"invoice_line",'fd.date_start'=>"invoice_line",'fd.date_end'=>"invoice_line",'fd.fk_product'=>'product','p.ref'=>'product'
|
||||
|
||||
@ -180,7 +180,7 @@ class pdf_paiement
|
||||
// number of bill
|
||||
switch ($this->doc_type) {
|
||||
case "client":
|
||||
$sql = "SELECT p.datep as dp, f.facnumber";
|
||||
$sql = "SELECT p.datep as dp, f.ref";
|
||||
//$sql .= ", c.libelle as paiement_type, p.num_paiement";
|
||||
$sql.= ", c.code as paiement_code, p.num_paiement";
|
||||
$sql.= ", p.amount as paiement_amount, f.total_ttc as facture_amount";
|
||||
@ -211,7 +211,7 @@ class pdf_paiement
|
||||
$sql.= " ORDER BY p.datep ASC, pf.fk_paiement ASC";
|
||||
break;
|
||||
case "fourn":
|
||||
$sql = "SELECT p.datep as dp, f.ref as facnumber";
|
||||
$sql = "SELECT p.datep as dp, f.ref as ref";
|
||||
//$sql .= ", c.libelle as paiement_type, p.num_paiement";
|
||||
$sql.= ", c.code as paiement_code, p.num_paiement";
|
||||
$sql.= ", p.amount as paiement_amount, f.total_ttc as facture_amount";
|
||||
@ -254,7 +254,7 @@ class pdf_paiement
|
||||
{
|
||||
$objp = $this->db->fetch_object($result);
|
||||
|
||||
$lines[$i][0] = $objp->facnumber;
|
||||
$lines[$i][0] = $objp->ref;
|
||||
$lines[$i][1] = dol_print_date($this->db->jdate($objp->dp),"day",false,$outputlangs,true);
|
||||
$lines[$i][2] = $langs->transnoentities("PaymentTypeShort".$objp->paiement_code);
|
||||
$lines[$i][3] = $objp->num_paiement;
|
||||
|
||||
@ -7,6 +7,7 @@
|
||||
* Copyright (C) 2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2015-2016 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
|
||||
*
|
||||
* 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
|
||||
@ -184,7 +185,7 @@ else {
|
||||
if ($object->element == 'contrat')
|
||||
{
|
||||
if (empty($conf->product->enabled) && empty($conf->service->enabled) && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) $forceall=-1; // With contract, by default, no choice at all, except if CONTRACT_SUPPORT_PRODUCTS is set
|
||||
else $forceall=0;
|
||||
else if (empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) $forceall=3;
|
||||
}
|
||||
|
||||
// Free line
|
||||
@ -229,7 +230,7 @@ else {
|
||||
if (empty($senderissupplier))
|
||||
{
|
||||
if (! empty($conf->product->enabled) && empty($conf->service->enabled)) echo $langs->trans('PredefinedProductsToSell');
|
||||
else if (empty($conf->product->enabled) && ! empty($conf->service->enabled)) echo $langs->trans('PredefinedServicesToSell');
|
||||
else if ((empty($conf->product->enabled) && ! empty($conf->service->enabled)) || ($object->element == 'contrat' && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS))) echo $langs->trans('PredefinedServicesToSell');
|
||||
else echo $langs->trans('PredefinedProductsAndServicesToSell');
|
||||
}
|
||||
else
|
||||
|
||||
@ -70,7 +70,7 @@ class InterfaceLogevents extends DolibarrTriggers
|
||||
$date = dol_now();
|
||||
|
||||
// Actions
|
||||
/*if ($action == 'USER_LOGIN')
|
||||
if ($action == 'USER_LOGIN')
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
|
||||
@ -97,7 +97,7 @@ class InterfaceLogevents extends DolibarrTriggers
|
||||
// Initialisation donnees (date,duree,texte,desc)
|
||||
$text="(UserLogoff,".$object->login.")";
|
||||
$desc="(UserLogoff,".$object->login.")";
|
||||
}*/
|
||||
}
|
||||
if ($action == 'USER_CREATE')
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
|
||||
@ -1338,22 +1338,22 @@ class Cronjob extends CommonObject
|
||||
}
|
||||
elseif ($mode == 2)
|
||||
{
|
||||
if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4','class="pictostatus"').' '.$langs->trans('Enabled').$moretext;
|
||||
if ($status == 1) return img_picto($langs->trans('Enabled'),'statut'.($processing?'1':'4'),'class="pictostatus"').' '.$langs->trans('Enabled').$moretext;
|
||||
elseif ($status == 0) return img_picto($langs->trans('Disabled'),'statut5','class="pictostatus"').' '.$langs->trans('Disabled').$moretext;
|
||||
}
|
||||
elseif ($mode == 3)
|
||||
{
|
||||
if ($status == 1) return img_picto($langs->trans('Enabled').$moretext,'statut4','class="pictostatus"');
|
||||
if ($status == 1) return img_picto($langs->trans('Enabled').$moretext,'statut'.($processing?'1':'4'),'class="pictostatus"');
|
||||
elseif ($status == 0) return img_picto($langs->trans('Disabled').$moretext,'statut5','class="pictostatus"');
|
||||
}
|
||||
elseif ($mode == 4)
|
||||
{
|
||||
if ($status == 1) return img_picto($langs->trans('Enabled').$moretext,'statut4','class="pictostatus"').' '.$langs->trans('Enabled').$moretext;
|
||||
if ($status == 1) return img_picto($langs->trans('Enabled').$moretext,'statut'.($processing?'1':'4'),'class="pictostatus"').' '.$langs->trans('Enabled').$moretext;
|
||||
elseif ($status == 0) return img_picto($langs->trans('Disabled').$moretext,'statut5','class="pictostatus"').' '.$langs->trans('Disabled').$moretext;
|
||||
}
|
||||
elseif ($mode == 5)
|
||||
{
|
||||
if ($status == 1) return $langs->trans('Enabled').$moretext.' '.img_picto($langs->trans('Enabled').$moretext,'statut4','class="pictostatus"');
|
||||
if ($status == 1) return $langs->trans('Enabled').$moretext.' '.img_picto($langs->trans('Enabled').$moretext,'statut'.($processing?'1':'4'),'class="pictostatus"');
|
||||
elseif ($status == 0) return $langs->trans('Disabled').$moretext.' '.img_picto($langs->trans('Disabled').$moretext,'statut5','class="pictostatus"');
|
||||
}
|
||||
}
|
||||
|
||||
@ -230,6 +230,7 @@ $sql.= " t.params,";
|
||||
$sql.= " t.md5params,";
|
||||
$sql.= " t.module_name,";
|
||||
$sql.= " t.priority,";
|
||||
$sql.= " t.processing,";
|
||||
$sql.= " t.datelastrun,";
|
||||
$sql.= " t.datenextrun,";
|
||||
$sql.= " t.dateend,";
|
||||
@ -418,10 +419,9 @@ print "</tr>\n";
|
||||
if ($num > 0)
|
||||
{
|
||||
// Loop on each job
|
||||
$style='pair';
|
||||
$now = dol_now();
|
||||
$i=0;
|
||||
$totalarray=array();
|
||||
|
||||
while ($i < min($num,$limit))
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
@ -434,6 +434,7 @@ if ($num > 0)
|
||||
$object->label = $obj->label;
|
||||
$object->status = $obj->status;
|
||||
$object->priority = $obj->priority;
|
||||
$object->processing = $obj->processing;
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
|
||||
@ -623,11 +623,11 @@ if ($step == 2 && $datatoexport)
|
||||
}
|
||||
if (! empty($objexport->array_export_examplevalues[0][$code]))
|
||||
{
|
||||
$htmltext.=$langs->trans("SourceExample").': <b>'.$objexport->array_export_examplevalues[0][$code].'</b><br>';
|
||||
$htmltext.='<b>'.$langs->trans("SourceExample").':</b> '.$objexport->array_export_examplevalues[0][$code].'<br>';
|
||||
}
|
||||
if (! empty($objexport->array_export_TypeFields[0][$code]))
|
||||
{
|
||||
$htmltext.=$langs->trans("Type").': <b>'.$objexport->array_export_TypeFields[0][$code].'</b><br>';
|
||||
$htmltext.='<b>'.$langs->trans("Type").':</b> '.$objexport->array_export_TypeFields[0][$code].'<br>';
|
||||
}
|
||||
|
||||
if (isset($array_selected[$code]) && $array_selected[$code])
|
||||
|
||||
@ -21,8 +21,9 @@
|
||||
* \ingroup externalsite
|
||||
* \brief Page that build two frames: One for menu, the other for the target page to show
|
||||
* Usage:
|
||||
* mydomain.com/externalsite/frames.php to show URL set into setup
|
||||
* mydomain.com/externalsite/frames.php?keyforcontent to show content defined into conf->global->$keyforcontent
|
||||
* /externalsite/frames.php to show URL set into setup
|
||||
* /externalsite/frames.php?keyforcontent=EXTERNAL_SITE_CONTENT_abc to show html text defined into $conf->global->EXTERNAL_SITE_CONTENT_abc
|
||||
* /externalsite/frames.php?keyforcontent=EXTERNAL_SITE_URL_abc to show URL defined into $conf->global->EXTERNAL_SITE_URL_abc
|
||||
*/
|
||||
|
||||
require '../main.inc.php';
|
||||
@ -56,19 +57,58 @@ if (! empty($keyforcontent))
|
||||
|
||||
print '<div class="framecontent" style="height: '.($_SESSION['dol_screenheight']-90).'px">';
|
||||
|
||||
if (! preg_match('/EXTERNAL_SITE_CONTENT_/', $keyforcontent))
|
||||
if (! preg_match('/EXTERNAL_SITE_CONTENT_/', $keyforcontent)
|
||||
&& ! preg_match('/EXTERNAL_SITE_URL_/', $keyforcontent))
|
||||
{
|
||||
$langs->load("errors");
|
||||
print $langs->trans("Variablekeyforcontentmustbenamed", 'EXTERNAL_SITE_CONTENT_');
|
||||
print $langs->trans("ErrorBadSyntaxForParamKeyForContent", 'EXTERNAL_SITE_CONTENT_', 'EXTERNAL_SITE_URL_');
|
||||
}
|
||||
else if (empty($conf->global->$keyforcontent))
|
||||
{
|
||||
$langs->load("errors");
|
||||
print $langs->trans("ErrorNoContentDefinedIntoVar", $keyforcontent);
|
||||
print $langs->trans("ErrorVariableKeyForContentMustBeSet", 'EXTERNAL_SITE_CONTENT_'.$keyforcontent, 'EXTERNAL_SITE_URL_'.$keyforcontent);
|
||||
}
|
||||
else
|
||||
{
|
||||
print $conf->global->$keyforcontent;
|
||||
if (preg_match('/EXTERNAL_SITE_CONTENT_/', $keyforcontent))
|
||||
{
|
||||
print $conf->global->$keyforcontent;
|
||||
}
|
||||
elseif (preg_match('/EXTERNAL_SITE_URL_/', $keyforcontent))
|
||||
{
|
||||
/*print "
|
||||
<html>
|
||||
<head>
|
||||
<title>Dolibarr frame for external web site</title>
|
||||
</head>
|
||||
|
||||
<frameset ".(empty($conf->global->MAIN_MENU_INVERT)?"rows":"cols")."=\"".$heightforframes.",*\" border=0 framespacing=0 frameborder=0>
|
||||
<frame name=\"barre\" src=\"frametop.php?mainmenu=".$mainmenu."&leftmenu=".$leftmenu."&idmenu=".$idmenu.($theme?'&theme='.$theme:'').($codelang?'&lang='.$codelang:'')."&nobackground=1\" noresize scrolling=\"NO\" noborder>
|
||||
";
|
||||
print '<frame name="main" src="';
|
||||
print $conf->global->$keyforcontent;
|
||||
print '">';
|
||||
print "
|
||||
<noframes>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</noframes>
|
||||
</frameset>
|
||||
|
||||
<noframes>
|
||||
<body>
|
||||
<br><div class=\"center\">
|
||||
Sorry, your browser is too old or not correctly configured to view this area.<br>
|
||||
Your browser must support frames.<br>
|
||||
</div>
|
||||
</body>
|
||||
</noframes>
|
||||
|
||||
</html>
|
||||
";*/
|
||||
print '<iframe src="'.$conf->global->$keyforcontent.'"></iframe>';
|
||||
}
|
||||
}
|
||||
|
||||
print '<div>';
|
||||
|
||||
@ -307,7 +307,7 @@ if ($action == 'create' && !$error) {
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
print '<input type="hidden" name="socid" value="' . $soc->id . '">' . "\n";
|
||||
print '<input name="facnumber" type="hidden" value="provisoire">';
|
||||
print '<input name="ref" type="hidden" value="provisoire">';
|
||||
print '<input name="ref_client" type="hidden" value="' . $ref_client . '">';
|
||||
print '<input name="ref_int" type="hidden" value="' . $ref_int . '">';
|
||||
print '<input type="hidden" name="origin" value="' . GETPOST('origin') . '">';
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user