Merge branch 'develop' of git://github.com/Dolibarr/dolibarr into extrafields

Conflicts:
	htdocs/install/doctemplates/invoices/template_invoice.odt
	htdocs/install/doctemplates/proposals/template_proposal.odt
	htdocs/install/mysql/migration/3.3.0-3.4.0.sql
This commit is contained in:
jfefe 2013-03-11 05:21:35 +01:00
commit ba8525bd6a
226 changed files with 9786 additions and 2189 deletions

View File

@ -14,9 +14,16 @@ For users:
- New: Can expand/collapse menus, categories and users list. - New: Can expand/collapse menus, categories and users list.
- New: extra parameters are supported into ODT templates. - New: extra parameters are supported into ODT templates.
- New: total per vat rate are available as tags for ODT templates. - New: total per vat rate are available as tags for ODT templates.
- New: Add more types for extra parameters (lists, phone, emails, checkbox, prices) - New: Add more types for extra parameters (lists, phone, emails, checkbox, prices).
- New: Some part of interface use more CSS3 (ie: agenda) - New: Some part of interface use more CSS3 (ie: agenda)
- New: [ task #707 ] Create option ProfIdx are mandatory to validate a invoice - New: [ task #707 ] Create option ProfIdx are mandatory to validate a invoice.
- New: Can define if we want to use VAT or not for subscriptions (foundation module).
- New: Can define a default choice for choice "More action when recording
a subscription" (foundation module).
- New: Add link to check professional id for india.
For translators:
- Update language files.
For developers: For developers:
- System of menu managers has been rewritten to reduce code to do same things. - System of menu managers has been rewritten to reduce code to do same things.
@ -32,9 +39,14 @@ For developers:
into conf->liste_limit). into conf->liste_limit).
- New: Add option dol_hide_topmenu and dol_hide_leftmenu onto login page. - New: Add option dol_hide_topmenu and dol_hide_leftmenu onto login page.
- New: dol_syslog method accept a suffix to use different log files for log. - New: dol_syslog method accept a suffix to use different log files for log.
- New: Type of fields are received by export format handlers
- New: when adding an action, we can define a free code to tag it for a specific need.
For translators: WARNING: If you used external modules, some of them may need to be upgraded due to:
- Update language files. - fields of classes were renamed to be normalized (nom, prenom, cp, ville, adresse were
renamed into lastname, firstname, zip, town, address).
- if module use hook pdf_writelinedesc, module may have to add return 1 at end of
function to keep same behaviour.

View File

@ -1,7 +1,7 @@
#!/usr/bin/php #!/usr/bin/php
<?php <?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006-2010 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2006-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -41,8 +41,8 @@ include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
include_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; include_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
$villes = array("Auray","Baden","Vannes","Pirouville","Haguenau","Souffelweiersheim","Illkirch-Graffenstaden","Lauterbourg","Picauville","Sainte-Mère Eglise","Le Bono"); $listoftown = array("Auray","Baden","Vannes","Pirouville","Haguenau","Souffelweiersheim","Illkirch-Graffenstaden","Lauterbourg","Picauville","Sainte-Mère Eglise","Le Bono");
$prenoms = array("Joe","Marc","Steve","Laurent","Nico","Isabelle","Dorothee","Saby","Brigitte","Karine","Jose-Anne","Celine","Virginie"); $listoflastname = array("Joe","Marc","Steve","Laurent","Nico","Isabelle","Dorothee","Saby","Brigitte","Karine","Jose-Anne","Celine","Virginie");
/* /*
@ -90,7 +90,7 @@ for ($s = 0 ; $s < GEN_NUMBER_SOCIETE ; $s++)
print "Company $s\n"; print "Company $s\n";
$soc = new Societe($db); $soc = new Societe($db);
$soc->nom = "Company num ".time()."$s"; $soc->nom = "Company num ".time()."$s";
$soc->ville = $villes[rand(0, count($villes)-1)]; $soc->town = $listoftown[rand(0, count($listoftown)-1)];
$soc->client = rand(1,2); // Une societe sur 2 est prospect, l'autre client $soc->client = rand(1,2); // Une societe sur 2 est prospect, l'autre client
$soc->fournisseur = rand(0,1); // Une societe sur 2 est fournisseur $soc->fournisseur = rand(0,1); // Une societe sur 2 est fournisseur
$soc->code_client='CU'.time()."$s"; $soc->code_client='CU'.time()."$s";
@ -112,8 +112,8 @@ for ($s = 0 ; $s < GEN_NUMBER_SOCIETE ; $s++)
{ {
$contact = new Contact($db); $contact = new Contact($db);
$contact->socid = $soc->id; $contact->socid = $soc->id;
$contact->name = "Lastname".$c; $contact->lastname = "Lastname".$c;
$contact->firstname = $prenoms[rand(0, count($prenoms)-1)]; $contact->firstname = $listoflastname[rand(0, count($listoflastname)-1)];
if ( $contact->create($user) ) if ( $contact->create($user) )
{ {

View File

@ -4,6 +4,11 @@
# Use by piping the output of a findutf8bom script # Use by piping the output of a findutf8bom script
# #
# Raphaël Doursenaud - rdoursenaud@gpcsolutions.fr # Raphaël Doursenaud - rdoursenaud@gpcsolutions.fr
#
# Example:
# cd dirwithfiles
# ls | /path/dev/removeutf8bom.sh
while read f; do while read f; do
echo "Fixing $f" echo "Fixing $f"
sed -i '1s/^\xEF\xBB\xBF//' $f sed -i '1s/^\xEF\xBB\xBF//' $f

View File

@ -222,8 +222,8 @@ class modMyModule extends DolibarrModules
// $this->export_label[$r]='CustomersInvoicesAndInvoiceLines'; // Translation key (used only if key ExportDataset_xxx_z not found) // $this->export_label[$r]='CustomersInvoicesAndInvoiceLines'; // Translation key (used only if key ExportDataset_xxx_z not found)
// $this->export_enabled[$r]='1'; // Condition to show export in list (ie: '$user->id==3'). Set to 1 to always show when module is enabled. // $this->export_enabled[$r]='1'; // Condition to show export in list (ie: '$user->id==3'). Set to 1 to always show when module is enabled.
// $this->export_permission[$r]=array(array("facture","facture","export")); // $this->export_permission[$r]=array(array("facture","facture","export"));
// $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.cp'=>'Zip','s.ville'=>'Town','s.fk_pays'=>'Country','s.tel'=>'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.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'); // $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",'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');
// $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.cp'=>'company','s.ville'=>'company','s.fk_pays'=>'company','s.tel'=>'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.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'); // $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.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');
// $this->export_sql_start[$r]='SELECT DISTINCT '; // $this->export_sql_start[$r]='SELECT DISTINCT ';
// $this->export_sql_end[$r] =' FROM ('.MAIN_DB_PREFIX.'facture as f, '.MAIN_DB_PREFIX.'facturedet as fd, '.MAIN_DB_PREFIX.'societe as s)'; // $this->export_sql_end[$r] =' FROM ('.MAIN_DB_PREFIX.'facture as f, '.MAIN_DB_PREFIX.'facturedet as fd, '.MAIN_DB_PREFIX.'societe as s)';
// $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)'; // $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)';

View File

@ -24,7 +24,7 @@
*/ */
// Put here all includes required by your class file // Put here all includes required by your class file
//require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"); require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php");
//require_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"); //require_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php");
//require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php"); //require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php");
@ -32,13 +32,13 @@
/** /**
* Put here description of your class * Put here description of your class
*/ */
class Skeleton_Class // extends CommonObject class Skeleton_Class extends CommonObject
{ {
var $db; //!< To store db handler var $db; //!< To store db handler
var $error; //!< To return error code (or message) var $error; //!< To return error code (or message)
var $errors=array(); //!< To return several error codes (or messages) var $errors=array(); //!< To return several error codes (or messages)
//var $element='skeleton'; //!< Id that identify managed objects var $element='skeleton'; //!< Id that identify managed objects
//var $table_element='skeleton'; //!< Name of table without prefix where object is stored var $table_element='skeleton'; //!< Name of table without prefix where object is stored
var $id; var $id;
var $prop1; var $prop1;

View File

@ -171,29 +171,52 @@ print '<input type="submit" class="button" value="'.$langs->trans("Update").'" n
print "</td></tr>\n"; print "</td></tr>\n";
print '</form>'; print '</form>';
// Insertion cotisations dans compte financier // Insert subscription into bank account
$var=!$var; $var=!$var;
print '<form action="adherent.php" method="POST">'; print '<form action="adherent.php" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="update">'; print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="constname" value="ADHERENT_BANK_USE">'; print '<input type="hidden" name="constname" value="ADHERENT_BANK_USE">';
print '<tr '.$bc[$var].'><td>'.$langs->trans("AddSubscriptionIntoAccount").'</td>'; print '<tr '.$bc[$var].'><td>'.$langs->trans("MoreActionsOnSubscription").'</td>';
if (! empty($conf->banque->enabled)) $arraychoices=array('0'=>$langs->trans("None"));
{ if (! empty($conf->banque->enabled)) $arraychoices['bankdirect']=$langs->trans("MoreActionBankDirect");
print '<td>'; if (! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled)) $arraychoices['invoiceonly']=$langs->trans("MoreActionInvoiceOnly");
print $form->selectyesno('constvalue',$conf->global->ADHERENT_BANK_USE,1); if (! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled)) $arraychoices['bankviainvoice']=$langs->trans("MoreActionBankViaInvoice");
print '</td><td align="center" width="80">'; print '<td>';
print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">'; print $form->selectarray('constvalue',$arraychoices,$conf->global->ADHERENT_BANK_USE,0);
print '</td>'; print '</td><td align="center" width="80">';
} print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">';
else print '</td>';
{
print '<td align="right" colspan="2">';
print $langs->trans("WarningModuleNotActive",$langs->transnoentities("Module85Name"));
print '</td>';
}
print "</tr>\n"; print "</tr>\n";
print '</form>'; print '</form>';
// Use vat for invoice creation
if ($conf->facture->enabled)
{
$var=!$var;
print '<form action="adherent.php" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="constname" value="ADHERENT_VAT_FOR_SUBSCRIPTIONS">';
print '<tr '.$bc[$var].'><td>'.$langs->trans("VATToUseForSubscriptions").'</td>';
if (! empty($conf->banque->enabled))
{
print '<td>';
print $form->selectarray('constvalue', array('0'=>$langs->trans("NoVatOnSubscription"),'defaultforfoundationcountry'=>$langs->trans("Default")), (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS)?'0':$conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS), 0);
print '</td><td align="center" width="80">';
print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">';
print '</td>';
}
else
{
print '<td align="right" colspan="2">';
print $langs->trans("WarningModuleNotActive",$langs->transnoentities("Module85Name"));
print '</td>';
}
print "</tr>\n";
print '</form>';
}
print '</table>'; print '</table>';
print '<br>'; print '<br>';

View File

@ -394,7 +394,7 @@ abstract class ActionsAdherentCardCommon
$this->object->old_firstname = $_POST["old_firstname"]; $this->object->old_firstname = $_POST["old_firstname"];
$this->object->fk_soc = $_POST["fk_soc"]; $this->object->fk_soc = $_POST["fk_soc"];
$this->object->name = $_POST["name"]; $this->object->lastname = $_POST["lastname"];
$this->object->firstname = $_POST["firstname"]; $this->object->firstname = $_POST["firstname"];
$this->object->civilite_id = $_POST["civilite_id"]; $this->object->civilite_id = $_POST["civilite_id"];
$this->object->address = $_POST["address"]; $this->object->address = $_POST["address"];

View File

@ -362,7 +362,11 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $
// Add line to draft invoice // Add line to draft invoice
$idprodsubscription=0; $idprodsubscription=0;
$vattouse=get_default_tva($mysoc, $customer, $idprodsubscription); $vattouse=0;
if (isset($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) && $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS == 'defaultforfoundationcountry')
{
$vattouse=get_default_tva($mysoc, $mysoc, $idprodsubscription);
}
//print xx".$vattouse." - ".$mysoc." - ".$customer;exit; //print xx".$vattouse." - ".$mysoc." - ".$customer;exit;
$result=$invoice->addline($invoice->id,$label,0,1,$vattouse,0,0,$idprodsubscription,0,$datecotisation,$datesubend,0,0,'','TTC',$cotisation,1); $result=$invoice->addline($invoice->id,$label,0,1,$vattouse,0,0,$idprodsubscription,0,$datecotisation,$datesubend,0,0,'','TTC',$cotisation,1);
if ($result <= 0) if ($result <= 0)
@ -756,9 +760,9 @@ if ($rowid)
} }
else else
{ {
if (! empty($conf->global->ADHERENT_BANK_USE) && ! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled) && $object->fk_soc) $bankviainvoice=1; if (! empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankviainvoice' && ! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled) && $object->fk_soc) $bankviainvoice=1;
else if (! empty($conf->global->ADHERENT_BANK_USE) && ! empty($conf->banque->enabled)) $bankdirect=1; else if (! empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankdirect' && ! empty($conf->banque->enabled)) $bankdirect=1;
else if (empty($conf->global->ADHERENT_BANK_USE) && ! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled) && $object->fk_soc) $invoiceonly=1; else if (! empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'invoiceonly' && ! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled) && $object->fk_soc) $invoiceonly=1;
} }
print "\n\n<!-- Form add subscription -->\n"; print "\n\n<!-- Form add subscription -->\n";
@ -825,7 +829,7 @@ if ($rowid)
print '<input type="hidden" name="action" value="cotisation">'; print '<input type="hidden" name="action" value="cotisation">';
print '<input type="hidden" name="rowid" value="'.$rowid.'">'; print '<input type="hidden" name="rowid" value="'.$rowid.'">';
print '<input type="hidden" name="memberlabel" id="memberlabel" value="'.dol_escape_htmltag($object->getFullName($langs)).'">'; print '<input type="hidden" name="memberlabel" id="memberlabel" value="'.dol_escape_htmltag($object->getFullName($langs)).'">';
print '<input type="hidden" name="thirdpartylabel" id="thirdpartylabel" value="'.dol_escape_htmltag($object->name).'">'; print '<input type="hidden" name="thirdpartylabel" id="thirdpartylabel" value="'.dol_escape_htmltag($object->societe).'">';
print "<table class=\"border\" width=\"100%\">\n"; print "<table class=\"border\" width=\"100%\">\n";
$today=dol_now(); $today=dol_now();

View File

@ -107,13 +107,8 @@ if ((! empty($foruserid) || ! empty($foruserlogin) || ! empty($mode)) && ! $mesg
'%MONTH%'=>$month, '%MONTH%'=>$month,
'%DAY%'=>$day, '%DAY%'=>$day,
'%DOL_MAIN_URL_ROOT%'=>DOL_MAIN_URL_ROOT, '%DOL_MAIN_URL_ROOT%'=>DOL_MAIN_URL_ROOT,
'%SERVER%'=>"http://".$_SERVER["SERVER_NAME"]."/", // deprecated '%SERVER%'=>"http://".$_SERVER["SERVER_NAME"]."/",
// For backward compatibility '%SOCIETE%'=>$objp->company
'%SOCIETE%'=>$objp->company,
'%ZIP%'=>$objp->zip,
'%COUNTRY%'=>$objp->country,
'%ANNEE%'=>$year,
'%SERVEUR%'=>"http://".$_SERVER["SERVER_NAME"]."/" // deprecated
); );
complete_substitutions_array($substitutionarray, $langs); complete_substitutions_array($substitutionarray, $langs);

View File

@ -49,6 +49,7 @@ class Adherent extends CommonObject
var $login; var $login;
var $pass; var $pass;
var $societe; var $societe;
var $company;
var $address; var $address;
var $zip; var $zip;
var $town; var $town;
@ -220,8 +221,11 @@ class Adherent extends CommonObject
// For backward compatibility // For backward compatibility
'%INFOS%'=>$msgishtml?dol_htmlentitiesbr($infos):$infos, '%INFOS%'=>$msgishtml?dol_htmlentitiesbr($infos):$infos,
'%SOCIETE%'=>$msgishtml?dol_htmlentitiesbr($this->societe):$this->societe, '%SOCIETE%'=>$msgishtml?dol_htmlentitiesbr($this->societe):$this->societe,
'%ZIP%'=>$msgishtml?dol_htmlentitiesbr($this->zip):$this->zip, '%PRENOM%'=>$msgishtml?dol_htmlentitiesbr($this->firstname):$this->firstname,
'%COUNTRY%'=>$msgishtml?dol_htmlentitiesbr($this->country):$this->country, '%NOM%'=>$msgishtml?dol_htmlentitiesbr($this->lastname):$this->lastname,
'%CP%'=>$msgishtml?dol_htmlentitiesbr($this->zip):$this->zip,
'%VILLE%'=>$msgishtml?dol_htmlentitiesbr($this->town):$this->town,
'%PAYS%'=>$msgishtml?dol_htmlentitiesbr($this->country):$this->country,
); );
complete_substitutions_array($substitutionarray, $langs); complete_substitutions_array($substitutionarray, $langs);
@ -1002,7 +1006,7 @@ class Adherent extends CommonObject
{ {
global $langs; global $langs;
$sql = "SELECT d.rowid, d.civilite, d.firstname, d.lastname, d.societe, d.fk_soc, d.statut, d.public, d.address, d.zip, d.town, d.note,"; $sql = "SELECT d.rowid, d.civilite, d.firstname, d.lastname, d.societe as company, d.fk_soc, d.statut, d.public, d.address, d.zip, d.town, d.note,";
$sql.= " d.email, d.phone, d.phone_perso, d.phone_mobile, d.login, d.pass,"; $sql.= " d.email, d.phone, d.phone_perso, d.phone_mobile, d.login, d.pass,";
$sql.= " d.photo, d.fk_adherent_type, d.morphy, d.entity,"; $sql.= " d.photo, d.fk_adherent_type, d.morphy, d.entity,";
$sql.= " d.datec as datec,"; $sql.= " d.datec as datec,";
@ -1044,7 +1048,8 @@ class Adherent extends CommonObject
$this->lastname = $obj->lastname; $this->lastname = $obj->lastname;
$this->login = $obj->login; $this->login = $obj->login;
$this->pass = $obj->pass; $this->pass = $obj->pass;
$this->societe = $obj->societe; $this->societe = $obj->company;
$this->company = $obj->company;
$this->fk_soc = $obj->fk_soc; $this->fk_soc = $obj->fk_soc;
$this->address = $obj->address; $this->address = $obj->address;
$this->zip = $obj->zip; $this->zip = $obj->zip;

View File

@ -212,26 +212,6 @@ $list=array('COMPTA_PRODUCT_BUY_ACCOUNT','COMPTA_PRODUCT_SOLD_ACCOUNT','COMPTA_S
'COMPTA_VAT_ACCOUNT','COMPTA_ACCOUNT_CUSTOMER','COMPTA_ACCOUNT_SUPPLIER' 'COMPTA_VAT_ACCOUNT','COMPTA_ACCOUNT_CUSTOMER','COMPTA_ACCOUNT_SUPPLIER'
); );
/*$sql = "SELECT rowid, name, value, type, note";
$sql.= " FROM ".MAIN_DB_PREFIX."const";
$sql.= " WHERE name LIKE 'COMPTA_%'";
$sql.= " AND name NOT IN ('COMPTA_MODE')";
$sql.= " AND entity = ".$conf->entity;
$result = $db->query($sql);
if ($result)
{
$num = $db->num_rows($result);
$i = 0;
while ($i < $num)
{
$obj = $db->fetch_object($result);
$var=!$var;
$list[$obj->name]=$obj->value;
$i++;
}
}*/
$num=count($list); $num=count($list);
if ($num) if ($num)
{ {

View File

@ -71,6 +71,7 @@ $hookmanager->initHooks(array('admin'));
// Sort order to show dictionnary (0 is space). All other dictionnaries (added by modules) will be at end of this. // Sort order to show dictionnary (0 is space). All other dictionnaries (added by modules) will be at end of this.
$taborder=array(9,0,4,3,2,0,1,8,19,16,0,5,11,0,6,0,10,12,13,0,14,0,7,17,0,22,20,18,21,0,15,0,24,23); $taborder=array(9,0,4,3,2,0,1,8,19,16,0,5,11,0,6,0,10,12,13,0,14,0,7,17,0,22,20,18,21,0,15,0,24,23);
if (! empty($conf->global->MAIN_USE_REVENUESTAMP)) $taborder=array(9,0,4,3,2,0,1,8,19,16,0,5,11,0,6,0,10,25,12,13,0,14,0,7,17,0,22,20,18,21,0,15,0,24,23);
// Name of SQL tables of dictionnaries // Name of SQL tables of dictionnaries
$tabname=array(); $tabname=array();
@ -98,6 +99,7 @@ $tabname[21]= MAIN_DB_PREFIX."c_availability";
$tabname[22]= MAIN_DB_PREFIX."c_input_reason"; $tabname[22]= MAIN_DB_PREFIX."c_input_reason";
$tabname[23]= MAIN_DB_PREFIX."accountingaccount"; $tabname[23]= MAIN_DB_PREFIX."accountingaccount";
$tabname[24]= MAIN_DB_PREFIX."accounting_system"; $tabname[24]= MAIN_DB_PREFIX."accounting_system";
$tabname[25]= MAIN_DB_PREFIX."c_revenuestamp";
// Dictionary labels // Dictionary labels
$tablib=array(); $tablib=array();
@ -125,6 +127,7 @@ $tablib[21]= "DictionnaryAvailability";
$tablib[22]= "DictionnarySource"; $tablib[22]= "DictionnarySource";
$tablib[23]= "DictionnaryAccountancyplan"; $tablib[23]= "DictionnaryAccountancyplan";
$tablib[24]= "DictionnaryAccountancysystem"; $tablib[24]= "DictionnaryAccountancysystem";
$tablib[25]= "DictionnaryRevenueStamp";
// Requete pour extraction des donnees des dictionnaires // Requete pour extraction des donnees des dictionnaires
$tabsql=array(); $tabsql=array();
@ -152,6 +155,7 @@ $tabsql[21]= "SELECT c.rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX
$tabsql[22]= "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_input_reason"; $tabsql[22]= "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_input_reason";
$tabsql[23]= "SELECT rowid as rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number as accountancy_code, account_parent, label, active FROM ".MAIN_DB_PREFIX."accountingaccount"; $tabsql[23]= "SELECT rowid as rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number as accountancy_code, account_parent, label, active FROM ".MAIN_DB_PREFIX."accountingaccount";
$tabsql[24]= "SELECT s.rowid as rowid, pcg_version, s.fk_pays as country_id, p.code as country_code, p.libelle as pays, s.label, s.active FROM ".MAIN_DB_PREFIX."accounting_system as s, ".MAIN_DB_PREFIX."c_pays as p WHERE s.fk_pays=p.rowid and p.active=1"; $tabsql[24]= "SELECT s.rowid as rowid, pcg_version, s.fk_pays as country_id, p.code as country_code, p.libelle as pays, s.label, s.active FROM ".MAIN_DB_PREFIX."accounting_system as s, ".MAIN_DB_PREFIX."c_pays as p WHERE s.fk_pays=p.rowid and p.active=1";
$tabsql[25]= "SELECT t.rowid, t.taux, p.libelle as country, p.code as country_code, t.fk_pays as country_id, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_revenuestamp as t, llx_c_pays as p WHERE t.fk_pays=p.rowid";
// Critere de tri du dictionnaire // Critere de tri du dictionnaire
$tabsqlsort=array(); $tabsqlsort=array();
@ -179,6 +183,7 @@ $tabsqlsort[21]="code ASC, label ASC";
$tabsqlsort[22]="code ASC, label ASC"; $tabsqlsort[22]="code ASC, label ASC";
$tabsqlsort[23]="fk_pcg_version ASC, accountancy_code ASC"; $tabsqlsort[23]="fk_pcg_version ASC, accountancy_code ASC";
$tabsqlsort[24]="pcg_version ASC"; $tabsqlsort[24]="pcg_version ASC";
$tabsqlsort[25]="country ASC, taux ASC";
// Nom des champs en resultat de select pour affichage du dictionnaire // Nom des champs en resultat de select pour affichage du dictionnaire
$tabfield=array(); $tabfield=array();
@ -206,6 +211,7 @@ $tabfield[21]= "code,label";
$tabfield[22]= "code,label"; $tabfield[22]= "code,label";
$tabfield[23]= "fk_pcg_version,accountancy_code,account_parent,pcg_type,pcg_subtype,label"; $tabfield[23]= "fk_pcg_version,accountancy_code,account_parent,pcg_type,pcg_subtype,label";
$tabfield[24]= "pcg_version,country_id,country,label"; $tabfield[24]= "pcg_version,country_id,country,label";
$tabfield[25]= "country_id,country,taux,accountancy_code_sell,accountancy_code_buy,note";
// Nom des champs d'edition pour modification d'un enregistrement // Nom des champs d'edition pour modification d'un enregistrement
$tabfieldvalue=array(); $tabfieldvalue=array();
@ -233,6 +239,7 @@ $tabfieldvalue[21]= "code,label";
$tabfieldvalue[22]= "code,label"; $tabfieldvalue[22]= "code,label";
$tabfieldvalue[23]= "fk_pcg_version,accountancy_code,account_parent,pcg_type,pcg_subtype,label"; $tabfieldvalue[23]= "fk_pcg_version,accountancy_code,account_parent,pcg_type,pcg_subtype,label";
$tabfieldvalue[24]= "pcg_version,country,label"; $tabfieldvalue[24]= "pcg_version,country,label";
$tabfieldvalue[25]= "country,taux,accountancy_code_sell,accountancy_code_buy,note";
// Nom des champs dans la table pour insertion d'un enregistrement // Nom des champs dans la table pour insertion d'un enregistrement
$tabfieldinsert=array(); $tabfieldinsert=array();
@ -260,6 +267,7 @@ $tabfieldinsert[21]= "code,label";
$tabfieldinsert[22]= "code,label"; $tabfieldinsert[22]= "code,label";
$tabfieldinsert[23]= "fk_pcg_version,account_number,account_parent,pcg_type,pcg_subtype,label"; $tabfieldinsert[23]= "fk_pcg_version,account_number,account_parent,pcg_type,pcg_subtype,label";
$tabfieldinsert[24]= "pcg_version,fk_pays,label"; $tabfieldinsert[24]= "pcg_version,fk_pays,label";
$tabfieldinsert[25]= "fk_pays,taux,accountancy_code_sell,accountancy_code_buy,note";
// Nom du rowid si le champ n'est pas de type autoincrement // Nom du rowid si le champ n'est pas de type autoincrement
// Example: "" if id field is "rowid" and has autoincrement on // Example: "" if id field is "rowid" and has autoincrement on
@ -289,6 +297,7 @@ $tabrowid[21]= "rowid";
$tabrowid[22]= "rowid"; $tabrowid[22]= "rowid";
$tabrowid[23]= ""; $tabrowid[23]= "";
$tabrowid[24]= ""; $tabrowid[24]= "";
$tabrowid[25]= "";
// Condition to show dictionnary in setup page // Condition to show dictionnary in setup page
$tabcond=array(); $tabcond=array();
@ -316,6 +325,7 @@ $tabcond[21]= ! empty($conf->propal->enabled);
$tabcond[22]= (! empty($conf->commande->enabled) || ! empty($conf->propal->enabled)); $tabcond[22]= (! empty($conf->commande->enabled) || ! empty($conf->propal->enabled));
$tabcond[23]= (! empty($conf->global->ACCOUNTING_USEDICTTOEDIT) && ! empty($conf->accounting->enabled)); // The accountancy plan should be edited with specific pages. You can set ACCOUNTING_USEDICTTOEDIT to 1 if you want to use dictionnary editor. $tabcond[23]= (! empty($conf->global->ACCOUNTING_USEDICTTOEDIT) && ! empty($conf->accounting->enabled)); // The accountancy plan should be edited with specific pages. You can set ACCOUNTING_USEDICTTOEDIT to 1 if you want to use dictionnary editor.
$tabcond[24]= (! empty($conf->global->ACCOUNTING_USEDICTTOEDIT) && ! empty($conf->accounting->enabled)); // The accountancy system should be edited with specific pages. You can set ACCOUNTING_USEDICTTOEDIT to 1 if you want to use dictionnary editor. $tabcond[24]= (! empty($conf->global->ACCOUNTING_USEDICTTOEDIT) && ! empty($conf->accounting->enabled)); // The accountancy system should be edited with specific pages. You can set ACCOUNTING_USEDICTTOEDIT to 1 if you want to use dictionnary editor.
$tabcond[25]= (! empty($conf->global->MAIN_USE_REVENUESTAMP)); // The accountancy system should be edited with specific pages. You can set ACCOUNTING_USEDICTTOEDIT to 1 if you want to use dictionnary editor.
// List of help for fields // List of help for fields
$tabhelp=array(); $tabhelp=array();
@ -343,6 +353,7 @@ $tabhelp[21] = array();
$tabhelp[22] = array(); $tabhelp[22] = array();
$tabhelp[23] = array(); $tabhelp[23] = array();
$tabhelp[24] = array(); $tabhelp[24] = array();
$tabhelp[25] = array();
// Complete all arrays with entries found into modules // Complete all arrays with entries found into modules
complete_dictionnary_with_modules($taborder,$tabname,$tablib,$tabsql,$tabsqlsort,$tabfield,$tabfieldvalue,$tabfieldinsert,$tabrowid,$tabcond,$tabhelp); complete_dictionnary_with_modules($taborder,$tabname,$tablib,$tabsql,$tabsqlsort,$tabfield,$tabfieldvalue,$tabfieldinsert,$tabrowid,$tabcond,$tabhelp);
@ -717,7 +728,11 @@ if ($id)
$align="left"; $align="left";
if ($fieldlist[$field]=='source') { $valuetoshow=$langs->trans("Contact"); } if ($fieldlist[$field]=='source') { $valuetoshow=$langs->trans("Contact"); }
if ($fieldlist[$field]=='price') { $valuetoshow=$langs->trans("PriceUHT"); } if ($fieldlist[$field]=='price') { $valuetoshow=$langs->trans("PriceUHT"); }
if ($fieldlist[$field]=='taux') { $valuetoshow=$langs->trans("Rate"); } if ($fieldlist[$field]=='taux') {
if ($tabname[$id] != MAIN_DB_PREFIX."c_revenuestamp") $valuetoshow=$langs->trans("Rate");
else $valuetoshow=$langs->trans("Amount");
$align='right';
}
if ($fieldlist[$field]=='localtax1_type') { $valuetoshow=$form->textwithtooltip($langs->trans("UseLocalTax")." 2",$langs->trans("LocalTaxDesc"),2,1,img_help(1,'')); $align="center"; $sortable=0; } if ($fieldlist[$field]=='localtax1_type') { $valuetoshow=$form->textwithtooltip($langs->trans("UseLocalTax")." 2",$langs->trans("LocalTaxDesc"),2,1,img_help(1,'')); $align="center"; $sortable=0; }
if ($fieldlist[$field]=='localtax1') { $valuetoshow=$langs->trans("Rate")." 2";} if ($fieldlist[$field]=='localtax1') { $valuetoshow=$langs->trans("Rate")." 2";}
if ($fieldlist[$field]=='localtax2_type') { $valuetoshow=$form->textwithtooltip($langs->trans("UseLocalTax")." 3",$langs->trans("LocalTaxDesc"),2,1,img_help(1,'')); $align="center"; $sortable=0; } if ($fieldlist[$field]=='localtax2_type') { $valuetoshow=$form->textwithtooltip($langs->trans("UseLocalTax")." 3",$langs->trans("LocalTaxDesc"),2,1,img_help(1,'')); $align="center"; $sortable=0; }
@ -834,7 +849,11 @@ if ($id)
$valuetoshow=$langs->trans($valuetoshow); // try to translate $valuetoshow=$langs->trans($valuetoshow); // try to translate
if ($fieldlist[$field]=='source') { $valuetoshow=$langs->trans("Contact"); } if ($fieldlist[$field]=='source') { $valuetoshow=$langs->trans("Contact"); }
if ($fieldlist[$field]=='price') { $valuetoshow=$langs->trans("PriceUHT"); } if ($fieldlist[$field]=='price') { $valuetoshow=$langs->trans("PriceUHT"); }
if ($fieldlist[$field]=='taux') { $valuetoshow=$langs->trans("Rate"); } if ($fieldlist[$field]=='taux') {
if ($tabname[$id] != MAIN_DB_PREFIX."c_revenuestamp") $valuetoshow=$langs->trans("Rate");
else $valuetoshow=$langs->trans("Amount");
$align='right';
}
if ($fieldlist[$field]=='localtax1_type') { $valuetoshow=$form->textwithtooltip($langs->trans("UseLocalTax")." 2",$langs->trans("LocalTaxDesc"),2,1,img_help(1,'')); $align="center"; $sortable=0; } if ($fieldlist[$field]=='localtax1_type') { $valuetoshow=$form->textwithtooltip($langs->trans("UseLocalTax")." 2",$langs->trans("LocalTaxDesc"),2,1,img_help(1,'')); $align="center"; $sortable=0; }
if ($fieldlist[$field]=='localtax1') { $valuetoshow=$langs->trans("Rate")." 2"; $sortable=0; } if ($fieldlist[$field]=='localtax1') { $valuetoshow=$langs->trans("Rate")." 2"; $sortable=0; }
if ($fieldlist[$field]=='localtax2_type') { $valuetoshow=$form->textwithtooltip($langs->trans("UseLocalTax")." 3",$langs->trans("LocalTaxDesc"),2,1,img_help(1,'')); $align="center"; $sortable=0; } if ($fieldlist[$field]=='localtax2_type') { $valuetoshow=$form->textwithtooltip($langs->trans("UseLocalTax")." 3",$langs->trans("LocalTaxDesc"),2,1,img_help(1,'')); $align="center"; $sortable=0; }

View File

@ -165,8 +165,8 @@ if (! empty($conf->global->MAIN_MODULE_NOTIFICATION))
$langs->load("mails"); $langs->load("mails");
print_titre($langs->trans("Notifications")); print_titre($langs->trans("Notifications"));
$sql = "SELECT rowid, name, firstname, fk_societe, email"; $sql = "SELECT u.rowid, u.lastname, u.firstname, u.fk_societe, u.email";
$sql.= " FROM ".MAIN_DB_PREFIX."user"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u";
$sql.= " WHERE entity IN (0,".$conf->entity.")"; $sql.= " WHERE entity IN (0,".$conf->entity.")";
$resql=$db->query($sql); $resql=$db->query($sql);
@ -181,7 +181,7 @@ if (! empty($conf->global->MAIN_MODULE_NOTIFICATION))
$var=!$var; $var=!$var;
if (!$obj->fk_societe) if (!$obj->fk_societe)
{ {
$username= $obj->firstname.' '.$obj->name; $username= $obj->firstname.' '.$obj->lastname;
$internalusers[$obj->rowid] = $username; $internalusers[$obj->rowid] = $username;
} }
@ -233,11 +233,11 @@ if (! empty($conf->global->MAIN_MODULE_NOTIFICATION))
print '<td align="right"><input type="submit" class="button" value="'.$langs->trans("Add").'"></td></tr>'; print '<td align="right"><input type="submit" class="button" value="'.$langs->trans("Add").'"></td></tr>';
} }
// List of current notifications for objet_type='withdraw' // List of current notifications for objet_type='withdraw'
$sql = "SELECT u.lastname, u.firstname"; $sql = "SELECT u.lastname, u.firstname,";
$sql.= ", nd.rowid, ad.code, ad.label"; $sql.= " nd.rowid, ad.code, ad.label";
$sql.= " FROM ".MAIN_DB_PREFIX."user as u"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u,";
$sql.= ", ".MAIN_DB_PREFIX."notify_def as nd"; $sql.= " ".MAIN_DB_PREFIX."notify_def as nd,";
$sql.= ", ".MAIN_DB_PREFIX."c_action_trigger as ad"; $sql.= " ".MAIN_DB_PREFIX."c_action_trigger as ad";
$sql.= " WHERE u.rowid = nd.fk_user"; $sql.= " WHERE u.rowid = nd.fk_user";
$sql.= " AND nd.fk_action = ad.rowid"; $sql.= " AND nd.fk_action = ad.rowid";
$sql.= " AND u.entity IN (0,".$conf->entity.")"; $sql.= " AND u.entity IN (0,".$conf->entity.")";
@ -253,8 +253,8 @@ if ($resql)
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
$var=!$var; $var=!$var;
print "<tr $bc[$var]>"; print "<tr ".$bc[$var].">";
print '<td>'.$obj->firstname." ".$obj->name.'</td>'; print '<td>'.$obj->firstname." ".$obj->lastname.'</td>';
$label=($langs->trans("Notify_".$obj->code)!="Notify_".$obj->code?$langs->trans("Notify_".$obj->code):$obj->label); $label=($langs->trans("Notify_".$obj->code)!="Notify_".$obj->code?$langs->trans("Notify_".$obj->code):$obj->label);
print '<td>'.$label.'</td>'; print '<td>'.$label.'</td>';
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=deletenotif&amp;notif='.$obj->rowid.'">'.img_delete().'</a></td>'; print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=deletenotif&amp;notif='.$obj->rowid.'">'.img_delete().'</a></td>';

View File

@ -40,10 +40,10 @@ if (empty($phone))
exit; exit;
} }
$sql = "SELECT nom as name FROM ".MAIN_DB_PREFIX."societe as s"; $sql = "SELECT s.nom as name FROM ".MAIN_DB_PREFIX."societe as s";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON sp.fk_soc = s.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON sp.fk_soc = s.rowid";
$sql.= " WHERE s.entity IN (".getEntity('societe', 1).")"; $sql.= " WHERE s.entity IN (".getEntity('societe', 1).")";
$sql.= " AND (s.tel='".$db->escape($phone)."'"; $sql.= " AND (s.phone='".$db->escape($phone)."'";
$sql.= " OR sp.phone='".$db->escape($phone)."'"; $sql.= " OR sp.phone='".$db->escape($phone)."'";
$sql.= " OR sp.phone_perso='".$db->escape($phone)."'"; $sql.= " OR sp.phone_perso='".$db->escape($phone)."'";
$sql.= " OR sp.phone_mobile='".$db->escape($phone)."')"; $sql.= " OR sp.phone_mobile='".$db->escape($phone)."')";

View File

@ -75,24 +75,24 @@ class BoutiqueCommande
$array = $this->db->fetch_array($result); $array = $this->db->fetch_array($result);
$this->id = $array["orders_id"]; $this->id = $array["orders_id"];
$this->client_id = stripslashes($array["customers_id"]); $this->client_id = $array["customers_id"];
$this->client_name = stripslashes($array["customers_name"]); $this->client_name = $array["customers_name"];
$this->payment_method = stripslashes($array["payment_method"]); $this->payment_method = $array["payment_method"];
$this->date = $this->db->jdate($array["date_purchased"]); $this->date = $this->db->jdate($array["date_purchased"]);
$this->delivery_adr->name = stripslashes($array["delivery_name"]); $this->delivery_adr->name = $array["delivery_name"];
$this->delivery_adr->street = stripslashes($array["delivery_street_address"]); $this->delivery_adr->street = $array["delivery_street_address"];
$this->delivery_adr->zip = stripslashes($array["delivery_zipcode"]); $this->delivery_adr->zip = $array["delivery_zipcode"];
$this->delivery_adr->city = stripslashes($array["delivery_city"]); $this->delivery_adr->city = $array["delivery_city"];
$this->delivery_adr->country = stripslashes($array["delivery_country"]); $this->delivery_adr->country = $array["delivery_country"];
$this->billing_adr->name = stripslashes($array["billing_name"]); $this->billing_adr->name = $array["billing_name"];
$this->billing_adr->street = stripslashes($array["billing_street_address"]); $this->billing_adr->street = $array["billing_street_address"];
$this->billing_adr->zip = stripslashes($array["billing_zipcode"]); $this->billing_adr->zip = $array["billing_zipcode"];
$this->billing_adr->city = stripslashes($array["billing_city"]); $this->billing_adr->city = $array["billing_city"];
$this->billing_adr->country = stripslashes($array["billing_country"]); $this->billing_adr->country = $array["billing_country"];
$this->db->free(); $this->db->free();

View File

@ -118,7 +118,7 @@ class Facturation
} }
// Define part of HT, VAT, TTC // Define part of HT, VAT, TTC
$resultarray=calcul_price_total($this->qte,$this->prix(),$this->remisePercent(),$vat_rate,0,0,0,'HT',$product->type); $resultarray=calcul_price_total($this->qte,$this->prix(),$this->remisePercent(),$vat_rate,0,0,0,'HT',$product->type,0);
// Calcul du total ht sans remise // Calcul du total ht sans remise
$total_ht = $resultarray[0]; $total_ht = $resultarray[0];

View File

@ -38,9 +38,11 @@ class ActionComm extends CommonObject
protected $ismultientitymanaged = 2; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe protected $ismultientitymanaged = 2; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
var $id; var $id;
var $type_id;
var $type_code; var $type_id; // id into parent table llx_c_actioncomm (will be deprecated into future, link should not be required)
var $type; var $type_code; // code into parent table llx_c_actioncomm (will be deprecated into future, link should not be required)
var $type; // label into parent table llx_c_actioncomm (will be deprecated into future, link should not be required)
var $code;
var $label; var $label;
var $date; var $date;
@ -165,11 +167,9 @@ class ActionComm extends CommonObject
$sql.= "(datec,"; $sql.= "(datec,";
$sql.= "datep,"; $sql.= "datep,";
$sql.= "datep2,"; $sql.= "datep2,";
//$sql.= "datea,";
//$sql.= "datea2,";
$sql.= "durationp,"; $sql.= "durationp,";
//$sql.= "durationa,";
$sql.= "fk_action,"; $sql.= "fk_action,";
$sql.= "code,";
$sql.= "fk_soc,"; $sql.= "fk_soc,";
$sql.= "fk_project,"; $sql.= "fk_project,";
$sql.= "note,"; $sql.= "note,";
@ -185,11 +185,9 @@ class ActionComm extends CommonObject
$sql.= "'".$this->db->idate($now)."',"; $sql.= "'".$this->db->idate($now)."',";
$sql.= (strval($this->datep)!=''?"'".$this->db->idate($this->datep)."'":"null").","; $sql.= (strval($this->datep)!=''?"'".$this->db->idate($this->datep)."'":"null").",";
$sql.= (strval($this->datef)!=''?"'".$this->db->idate($this->datef)."'":"null").","; $sql.= (strval($this->datef)!=''?"'".$this->db->idate($this->datef)."'":"null").",";
//$sql.= (strval($this->date)!=''?"'".$this->db->idate($this->date)."'":"null").",";
//$sql.= (strval($this->dateend)!=''?"'".$this->db->idate($this->dateend)."'":"null").",";
$sql.= (isset($this->durationp) && $this->durationp >= 0 && $this->durationp != ''?"'".$this->durationp."'":"null").","; $sql.= (isset($this->durationp) && $this->durationp >= 0 && $this->durationp != ''?"'".$this->durationp."'":"null").",";
//$sql.= ($this->durationa >= 0 && $this->durationa != ''?"'".$this->durationa."'":"null").",";
$sql.= " '".$this->type_id."',"; $sql.= " '".$this->type_id."',";
$sql.= " '".$this->code."',";
$sql.= (isset($this->societe->id) && $this->societe->id > 0?" '".$this->societe->id."'":"null").","; $sql.= (isset($this->societe->id) && $this->societe->id > 0?" '".$this->societe->id."'":"null").",";
$sql.= (isset($this->fk_project) && $this->fk_project > 0?" '".$this->fk_project."'":"null").","; $sql.= (isset($this->fk_project) && $this->fk_project > 0?" '".$this->fk_project."'":"null").",";
$sql.= " '".$this->db->escape($this->note)."',"; $sql.= " '".$this->db->escape($this->note)."',";
@ -277,7 +275,7 @@ class ActionComm extends CommonObject
$sql.= " a.datec,"; $sql.= " a.datec,";
$sql.= " a.durationp,"; $sql.= " a.durationp,";
$sql.= " a.tms as datem,"; $sql.= " a.tms as datem,";
$sql.= " a.note, a.label,"; $sql.= " a.code, a.label, a.note,";
$sql.= " a.fk_soc,"; $sql.= " a.fk_soc,";
$sql.= " a.fk_project,"; $sql.= " a.fk_project,";
$sql.= " a.fk_user_author, a.fk_user_mod,"; $sql.= " a.fk_user_author, a.fk_user_mod,";
@ -305,12 +303,14 @@ class ActionComm extends CommonObject
$this->ref = $obj->ref; $this->ref = $obj->ref;
$this->ref_ext = $obj->ref_ext; $this->ref_ext = $obj->ref_ext;
// Properties of parent table llx_c_actioncomm (will be deprecated in future)
$this->type_id = $obj->type_id; $this->type_id = $obj->type_id;
$this->type_code = $obj->type_code; $this->type_code = $obj->type_code;
$transcode=$langs->trans("Action".$obj->type_code); $transcode=$langs->trans("Action".$obj->type_code);
$type_libelle=($transcode!="Action".$obj->type_code?$transcode:$obj->libelle); $type_libelle=($transcode!="Action".$obj->type_code?$transcode:$obj->libelle);
$this->type = $type_libelle; $this->type = $type_libelle;
$this->code = $obj->code;
$this->label = $obj->label; $this->label = $obj->label;
$this->datep = $this->db->jdate($obj->datep); $this->datep = $this->db->jdate($obj->datep);
$this->datef = $this->db->jdate($obj->datep2); $this->datef = $this->db->jdate($obj->datep2);
@ -868,7 +868,7 @@ class ActionComm extends CommonObject
$sql.= " a.datep2,"; // End $sql.= " a.datep2,"; // End
$sql.= " a.durationp,"; $sql.= " a.durationp,";
$sql.= " a.datec, a.tms as datem,"; $sql.= " a.datec, a.tms as datem,";
$sql.= " a.note, a.label, a.fk_action as type_id,"; $sql.= " a.label, a.code, a.note, a.fk_action as type_id,";
$sql.= " a.fk_soc,"; $sql.= " a.fk_soc,";
$sql.= " a.fk_user_author, a.fk_user_mod,"; $sql.= " a.fk_user_author, a.fk_user_mod,";
$sql.= " a.fk_user_action, a.fk_user_done,"; $sql.= " a.fk_user_action, a.fk_user_done,";
@ -940,11 +940,7 @@ class ActionComm extends CommonObject
$event=array(); $event=array();
$event['uid']='dolibarragenda-'.$this->db->database_name.'-'.$obj->id."@".$_SERVER["SERVER_NAME"]; $event['uid']='dolibarragenda-'.$this->db->database_name.'-'.$obj->id."@".$_SERVER["SERVER_NAME"];
$event['type']=$type; $event['type']=$type;
//$datestart=$obj->datea?$obj->datea:$obj->datep;
//$dateend=$obj->datea2?$obj->datea2:$obj->datep2;
//$duration=$obj->durationa?$obj->durationa:$obj->durationp;
$datestart=$this->db->jdate($obj->datep); $datestart=$this->db->jdate($obj->datep);
//print $datestart.'x'; exit;
$dateend=$this->db->jdate($obj->datep2); $dateend=$this->db->jdate($obj->datep2);
$duration=$obj->durationp; $duration=$obj->durationp;
$event['summary']=$obj->label.($obj->socname?" (".$obj->socname.")":""); $event['summary']=$obj->label.($obj->socname?" (".$obj->socname.")":"");
@ -952,7 +948,7 @@ class ActionComm extends CommonObject
$event['startdate']=$datestart; $event['startdate']=$datestart;
$event['duration']=$duration; // Not required with type 'journal' $event['duration']=$duration; // Not required with type 'journal'
$event['enddate']=$dateend; // Not required with type 'journal' $event['enddate']=$dateend; // Not required with type 'journal'
$event['author']=$obj->firstname.($obj->name?" ".$obj->name:""); $event['author']=$obj->firstname.($obj->lastname?" ".$obj->lastname:"");
$event['priority']=$obj->priority; $event['priority']=$obj->priority;
$event['fulldayevent']=$obj->fulldayevent; $event['fulldayevent']=$obj->fulldayevent;
$event['location']=$obj->location; $event['location']=$obj->location;
@ -1050,6 +1046,7 @@ class ActionComm extends CommonObject
$this->specimen=1; $this->specimen=1;
$this->type_code='AC_OTH'; $this->type_code='AC_OTH';
$this->code='AC_SPECIMEN_CODE';
$this->label='Label of event Specimen'; $this->label='Label of event Specimen';
$this->datec=$now; $this->datec=$now;
$this->datem=$now; $this->datem=$now;

View File

@ -486,7 +486,7 @@ if ($showbirthday)
$event->datep=dol_mktime(0,0,0,$datearray['mon'],$datearray['mday'],$year,true); // For full day events, date are also GMT but they wont but converted during output $event->datep=dol_mktime(0,0,0,$datearray['mon'],$datearray['mday'],$year,true); // For full day events, date are also GMT but they wont but converted during output
$event->datef=$event->datep; $event->datef=$event->datep;
$event->type_code='BIRTHDAY'; $event->type_code='BIRTHDAY';
$event->libelle=$langs->trans("Birthday").' '.$obj->firstname.' '.$obj->name; $event->libelle=$langs->trans("Birthday").' '.$obj->firstname.' '.$obj->lastname;
$event->percentage=100; $event->percentage=100;
$event->fulldayevent=true; $event->fulldayevent=true;

View File

@ -306,7 +306,7 @@ if ($resql)
print '<td>'; print '<td>';
if ($obj->fk_contact > 0) if ($obj->fk_contact > 0)
{ {
$contactstatic->name=$obj->name; $contactstatic->lastname=$obj->lastname;
$contactstatic->firstname=$obj->firstname; $contactstatic->firstname=$obj->firstname;
$contactstatic->id=$obj->fk_contact; $contactstatic->id=$obj->fk_contact;
print $contactstatic->getNomUrl(1,'',10); print $contactstatic->getNomUrl(1,'',10);

View File

@ -87,7 +87,7 @@ if ($_GET["action"] == 'delete')
print_fiche_titre($langs->trans("Bookmarks")); print_fiche_titre($langs->trans("Bookmarks"));
$sql = "SELECT s.rowid, s.nom, b.dateb as dateb, b.rowid as bid, b.fk_user, b.url, b.target, u.lastname, u.firstname"; $sql = "SELECT s.rowid, s.nom as name, b.dateb as dateb, b.rowid as bid, b.fk_user, b.url, b.target, u.lastname, u.firstname";
$sql.= " FROM ".MAIN_DB_PREFIX."bookmark as b, ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."user as u"; $sql.= " FROM ".MAIN_DB_PREFIX."bookmark as b, ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."user as u";
$sql.= " WHERE b.fk_soc = s.rowid AND b.fk_user=u.rowid"; $sql.= " WHERE b.fk_soc = s.rowid AND b.fk_user=u.rowid";
if (! $user->admin) $sql.= " AND b.fk_user = ".$user->id; if (! $user->admin) $sql.= " AND b.fk_user = ".$user->id;
@ -125,9 +125,9 @@ if ($resql)
print "<tr $bc[$var]>"; print "<tr $bc[$var]>";
//print "<td>" . ($i + 1 + ($limit * $page)) . "</td>"; //print "<td>" . ($i + 1 + ($limit * $page)) . "</td>";
print "<td align=\"center\"><b>".$obj->bid."</b></td>"; print "<td align=\"center\"><b>".$obj->bid."</b></td>";
print "<td><a href='".DOL_URL_ROOT."/user/fiche.php?id=".$obj->fk_user."'>".img_object($langs->trans("ShowUser"),"user").' '.$obj->name." ".$obj->firstname."</a></td>\n"; print "<td><a href='".DOL_URL_ROOT."/user/fiche.php?id=".$obj->fk_user."'>".img_object($langs->trans("ShowUser"),"user").' '.$obj->lastname." ".$obj->firstname."</a></td>\n";
print '<td align="center">'.dol_print_date($db->jdate($obj->dateb))."</td>"; print '<td align="center">'.dol_print_date($db->jdate($obj->dateb))."</td>";
print "<td><a href=\"index.php?socid=".$obj->rowid."\">".img_object($langs->trans("ShowCompany"),"company").' '.$obj->nom."</a></td>\n"; print "<td><a href=\"index.php?socid=".$obj->rowid."\">".img_object($langs->trans("ShowCompany"),"company").' '.$obj->name."</a></td>\n";
print '<td align="center">'.$obj->url."</td>"; print '<td align="center">'.$obj->url."</td>";
print '<td align="center">'.$obj->target."</td>"; print '<td align="center">'.$obj->target."</td>";
print "<td><a href=\"bookmark.php?action=delete&bid=".$obj->bid."\">".img_delete()."</a></td>\n"; print "<td><a href=\"bookmark.php?action=delete&bid=".$obj->bid."\">".img_delete()."</a></td>\n";

View File

@ -646,7 +646,7 @@ else if ($action == "addline" && $user->rights->propal->creer)
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")), 'errors'); setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")), 'errors');
$error++; $error++;
} }
if ((empty($idprod) || GETPOST('usenewaddlineform')) && (!($price_ht >= 0) || $price_ht == '')) // Unit price can be 0 but not '' if ((empty($idprod) || GETPOST('usenewaddlineform')) && (!($price_ht != 0) || $price_ht == '')) // Unit price can be 0 but not ''. Also price can be negative for proposal.
{ {
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("UnitPriceHT")), 'errors'); setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("UnitPriceHT")), 'errors');
$error++; $error++;

View File

@ -212,8 +212,7 @@ $head[$h][1] = $langs->trans("ByMonthYear");
$head[$h][2] = 'byyear'; $head[$h][2] = 'byyear';
$h++; $h++;
$object=new stdClass(); // TODO $object not defined ? complete_head_from_modules($conf,$langs,null,$head,$h,'propal_stats');
complete_head_from_modules($conf,$langs,$object,$head,$h,'propal_stats');
dol_fiche_head($head,'byyear',$langs->trans("Statistics")); dol_fiche_head($head,'byyear',$langs->trans("Statistics"));

View File

@ -730,6 +730,8 @@ else if ($action == 'addline' && $user->rights->commande->creer)
if ($result > 0) if ($result > 0)
{ {
$ret=$object->fetch($object->id); // Reload to get new records
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
{ {
// Define output language // Define output language
@ -742,7 +744,6 @@ else if ($action == 'addline' && $user->rights->commande->creer)
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
$ret=$object->fetch($object->id); // Reload to get new records
commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
} }
@ -1101,6 +1102,14 @@ else if ($action == 'remove_file')
} }
} }
// Print file
else if ($action == 'print_file' AND $user->rights->printipp->use)
{
require_once DOL_DOCUMENT_ROOT.'/core/class/dolprintipp.class.php';
$printer = new dolPrintIPP($db,$conf->global->PRINTIPP_HOST,$conf->global->PRINTIPP_PORT,$user->login,$conf->global->PRINTIPP_USER,$conf->global->PRINTIPP_PASSWORD);
$printer->print_file(GETPOST('file',alpha),GETPOST('printer',alpha));
}
/* /*
* Add file in email form * Add file in email form
*/ */
@ -2353,8 +2362,9 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
$urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id; $urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id;
$genallowed=$user->rights->commande->creer; $genallowed=$user->rights->commande->creer;
$delallowed=$user->rights->commande->supprimer; $delallowed=$user->rights->commande->supprimer;
$printer = false;
$somethingshown=$formfile->show_documents('commande',$comref,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'','','',$soc->default_lang); if ($user->rights->printipp->use AND $conf->printipp->enabled) $printer = true;
$somethingshown=$formfile->show_documents('commande',$comref,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'','','',$soc->default_lang,$printer);
/* /*
* Linked object block * Linked object block

View File

@ -233,8 +233,7 @@ $h++;
if ($mode == 'customer') $type='order_stats'; if ($mode == 'customer') $type='order_stats';
if ($mode == 'supplier') $type='supplier_order_stats'; if ($mode == 'supplier') $type='supplier_order_stats';
$object=new stdClass(); // TODO $object not defined ? complete_head_from_modules($conf,$langs,null,$head,$h,$type);
complete_head_from_modules($conf,$langs,$object,$head,$h,$type);
dol_fiche_head($head,'byyear',$langs->trans("Statistics")); dol_fiche_head($head,'byyear',$langs->trans("Statistics"));

View File

@ -51,6 +51,7 @@ function llxHeader($head = '', $title='', $help_url='', $target='', $disablejs=0
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers
top_menu($head, $title, $target, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers top_menu($head, $title, $target, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers
require_once DOL_DOCUMENT_ROOT.'/core/class/menu.class.php';
$menu = new Menu(); $menu = new Menu();
// Entry for each bank account // Entry for each bank account

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -47,6 +47,8 @@ $id=GETPOST('account', 'int');
// Conciliation // Conciliation
if ($action == 'rappro' && $user->rights->banque->consolidate) if ($action == 'rappro' && $user->rights->banque->consolidate)
{ {
$error=0;
// Definition, nettoyage parametres // Definition, nettoyage parametres
$num_releve=trim($_POST["num_releve"]); $num_releve=trim($_POST["num_releve"]);
@ -54,25 +56,37 @@ if ($action == 'rappro' && $user->rights->banque->consolidate)
{ {
$bankline=new AccountLine($db); $bankline=new AccountLine($db);
if (isset($_POST["rowid"]) && is_array($_POST["rowid"])) if (isset($_POST['rowid']) && is_array($_POST['rowid']))
{ {
foreach($_POST["rowid"] as $row) foreach($_POST['rowid'] as $row)
{ {
if($row > 0) if($row > 0)
{ {
$result=$bankline->fetch($row); $result=$bankline->fetch($row);
$bankline->num_releve=$num_releve; //$_POST["num_releve"]; $bankline->num_releve=$num_releve; //$_POST["num_releve"];
$result=$bankline->update_conciliation($user,$_POST["cat"]); $result=$bankline->update_conciliation($user,$_POST["cat"]);
if ($result < 0) $mesg.=$bankline->error; if ($result < 0)
{
$mesg.=$bankline->error;
$error++;
break;
}
} }
} }
} }
} }
else else
{ {
$error++;
$langs->load("errors"); $langs->load("errors");
$mesg='<div class="error">'.$langs->trans("ErrorPleaseTypeBankTransactionReportName").'</div>'; $mesg='<div class="error">'.$langs->trans("ErrorPleaseTypeBankTransactionReportName").'</div>';
} }
if (! $error)
{
header('Location: '.DOL_URL_ROOT.'/compta/bank/rappro?account='.$id); // To avoid to submit twice and allow back
exit;
}
} }
/* /*
@ -80,12 +94,12 @@ if ($action == 'rappro' && $user->rights->banque->consolidate)
*/ */
if ($action == 'del') if ($action == 'del')
{ {
$accline=new AccountLine($db); $bankline=new AccountLine($db);
$accline->fetch($_GET["rowid"]); $bankline->fetch($_GET["rowid"]);
$result=$accline->delete(); $result=$bankline->delete($user);
if ($result < 0) if ($result < 0)
{ {
dol_print_error($db,$accline->error); dol_print_error($db,$bankline->error);
} }
} }
@ -200,7 +214,7 @@ if ($resql)
} }
print '<form method="post" action="rappro.php?account='.$acct->id.'">'; print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'?account='.$acct->id.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print "<input type=\"hidden\" name=\"action\" value=\"rappro\">"; print "<input type=\"hidden\" name=\"action\" value=\"rappro\">";
print "<input type=\"hidden\" name=\"account\" value=\"".$acct->id."\">"; print "<input type=\"hidden\" name=\"account\" value=\"".$acct->id."\">";
@ -212,8 +226,7 @@ if ($resql)
{ {
print $langs->trans("EventualyAddCategory").': <select class="flat" name="cat">'.$options.'</select><br>'; print $langs->trans("EventualyAddCategory").': <select class="flat" name="cat">'.$options.'</select><br>';
} }
print $langs->trans("ThenCheckLinesAndConciliate").' '; print '<br>'.$langs->trans("ThenCheckLinesAndConciliate").' "'.$langs->trans("Conciliate").'"<br>';
print "<input class=\"button\" type=\"submit\" value=\"".$langs->trans("Conciliate")."\"><br>";
print '<br>'; print '<br>';
@ -230,7 +243,6 @@ if ($resql)
print "</tr>\n"; print "</tr>\n";
$i = 0; $i = 0;
while ($i < $num) while ($i < $num)
{ {
@ -265,7 +277,7 @@ if ($resql)
print '</td>'; print '</td>';
} }
// Number // Type + Number
$label=($langs->trans("PaymentType".$objp->type)!="PaymentType".$objp->type)?$langs->trans("PaymentType".$objp->type):$objp->type; // $objp->type is a code $label=($langs->trans("PaymentType".$objp->type)!="PaymentType".$objp->type)?$langs->trans("PaymentType".$objp->type):$objp->type; // $objp->type is a code
if ($label=='SOLD') $label=''; if ($label=='SOLD') $label='';
print '<td nowrap="nowrap">'.$label.($objp->num_chq?' '.$objp->num_chq:'').'</td>'; print '<td nowrap="nowrap">'.$label.($objp->num_chq?' '.$objp->num_chq:'').'</td>';
@ -400,12 +412,12 @@ if ($resql)
} }
// Affiche zone saisie releve + bouton "Rapprocher" // Show checkbox for conciliation
if ($db->jdate($objp->do) <= $now) if ($db->jdate($objp->do) <= $now)
{ {
print '<td align="center" nowrap="nowrap">'; print '<td align="center" nowrap="nowrap">';
print '<input class="flat" name="rowid[]" type="checkbox" value="'.$objp->rowid.'" size="1">'; print '<input class="flat" name="rowid['.$objp->rowid.']" type="checkbox" value="'.$objp->rowid.'" size="1"'.(! empty($_POST['rowid'][$objp->rowid])?' checked="checked"':'').'>';
// print '<input class="flat" name="num_releve" type="text" value="'.$objp->num_releve.'" size="8">'; // print '<input class="flat" name="num_releve" type="text" value="'.$objp->num_releve.'" size="8">';
// print ' &nbsp; '; // print ' &nbsp; ';
// print "<input class=\"button\" type=\"submit\" value=\"".$langs->trans("Conciliate")."\">"; // print "<input class=\"button\" type=\"submit\" value=\"".$langs->trans("Conciliate")."\">";
@ -429,13 +441,12 @@ if ($resql)
} }
$db->free($resql); $db->free($resql);
print "</table><br>\n";
print "</form>\n"; print '<div align="right"><input class="button" type="submit" value="'.$langs->trans("Conciliate").'"></div><br>';
print "</form>\n";
if ($num != 0)
{
print "</table><br>\n";
}
} }
else else
{ {

View File

@ -168,7 +168,7 @@ if ($result)
$deplacementstatic->ref=$obj->rowid; $deplacementstatic->ref=$obj->rowid;
$deplacementstatic->id=$obj->rowid; $deplacementstatic->id=$obj->rowid;
$userstatic->id=$obj->uid; $userstatic->id=$obj->uid;
$userstatic->lastname=$obj->name; $userstatic->lastname=$obj->lastname;
$userstatic->firstname=$obj->firstname; $userstatic->firstname=$obj->firstname;
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
print '<td>'.$deplacementstatic->getNomUrl(1).'</td>'; print '<td>'.$deplacementstatic->getNomUrl(1).'</td>';

View File

@ -200,7 +200,7 @@ $head[$h][1] = $langs->trans("ByMonthYear");
$head[$h][2] = 'byyear'; $head[$h][2] = 'byyear';
$h++; $h++;
complete_head_from_modules($conf,$langs,$object,$head,$h,'trip_stats'); complete_head_from_modules($conf,$langs,null,$head,$h,'trip_stats');
dol_fiche_head($head,'byyear',$langs->trans("Statistics")); dol_fiche_head($head,'byyear',$langs->trans("Statistics"));

View File

@ -375,7 +375,8 @@ else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->factu
{ {
$idprof_mandatory ='SOCIETE_IDPROF'.($i).'_INVOICE_MANDATORY'; $idprof_mandatory ='SOCIETE_IDPROF'.($i).'_INVOICE_MANDATORY';
if (! $object->thirdparty->idprof.$i && ! empty($conf->global->$idprof_mandatory)) $idprof='idprof'.$i;
if (! $object->thirdparty->$idprof && ! empty($conf->global->$idprof_mandatory))
{ {
if (! $error) $langs->load("errors"); if (! $error) $langs->load("errors");
$error++; $error++;

View File

@ -10,6 +10,7 @@
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr> * Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2013 Cedric Gross <c.gross@kreiz-it.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -1860,10 +1861,29 @@ class Facture extends CommonInvoice
} }
} }
if ($error == 0) if ($error == 0)
{ {
$old_statut=$this->statut;
$this->brouillon = 1; $this->brouillon = 1;
$this->statut = 0; $this->statut = 0;
// Appel des triggers
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
$interface=new Interfaces($this->db);
$result=$interface->run_triggers('BILL_UNVALIDATE',$this,$user,$langs,$conf);
if ($result < 0) {
$error++;
$this->errors=$interface->errors;
$this->statut=$old_statut;
$this->brouillon=0;
}
// Fin appel triggers
} else {
$this->db->rollback();
return -1;
}
if ($error == 0)
{
$this->db->commit(); $this->db->commit();
return 1; return 1;
} }

View File

@ -210,7 +210,7 @@ $h++;
if ($mode == 'customer') $type='invoice_stats'; if ($mode == 'customer') $type='invoice_stats';
if ($mode == 'supplier') $type='supplier_invoice_stats'; if ($mode == 'supplier') $type='supplier_invoice_stats';
complete_head_from_modules($conf,$langs,$object,$head,$h,$type); complete_head_from_modules($conf,$langs,null,$head,$h,$type);
dol_fiche_head($head,'byyear',$langs->trans("Statistics")); dol_fiche_head($head,'byyear',$langs->trans("Statistics"));

View File

@ -613,7 +613,7 @@ if (! empty($conf->deplacement->enabled) && $user->rights->deplacement->lire)
$deplacementstatic->ref=$objp->rowid; $deplacementstatic->ref=$objp->rowid;
$deplacementstatic->id=$objp->rowid; $deplacementstatic->id=$objp->rowid;
$userstatic->id=$objp->uid; $userstatic->id=$objp->uid;
$userstatic->lastname=$objp->name; $userstatic->lastname=$objp->lastname;
$userstatic->firstname=$objp->firstname; $userstatic->firstname=$objp->firstname;
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
print '<td>'.$deplacementstatic->getNomUrl(1).'</td>'; print '<td>'.$deplacementstatic->getNomUrl(1).'</td>';

View File

@ -50,6 +50,7 @@ function llxHeader($head = '', $title='', $help_url='', $target='', $disablejs=0
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers
top_menu($head, $title, $target, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers top_menu($head, $title, $target, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers
require_once DOL_DOCUMENT_ROOT.'/core/class/menu.class.php';
$menu = new Menu(); $menu = new Menu();
// Entry for each bank account // Entry for each bank account

View File

@ -171,7 +171,7 @@ if ($result)
{ {
$obj = $db->fetch_object($result); $obj = $db->fetch_object($result);
$amount[$obj->rowid] = $obj->amount_ttc; $amount[$obj->rowid] = $obj->amount_ttc;
$name[$obj->rowid] = $obj->name.' '.$obj->firstname; $name[$obj->rowid] = $obj->lastname.' '.$obj->firstname;
$catotal+=$obj->amount_ttc; $catotal+=$obj->amount_ttc;
$i++; $i++;
} }
@ -183,7 +183,7 @@ else {
// On ajoute les paiements ancienne version, non lies par paiement_facture donc sans user // On ajoute les paiements ancienne version, non lies par paiement_facture donc sans user
if ($modecompta != 'CREANCES-DETTES') if ($modecompta != 'CREANCES-DETTES')
{ {
$sql = "SELECT -1 as rowidx, '' as name, '' as firstname, sum(p.amount) as amount_ttc"; $sql = "SELECT -1 as rowidx, '' as lastname, '' as firstname, sum(p.amount) as amount_ttc";
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b"; $sql.= " FROM ".MAIN_DB_PREFIX."bank as b";
$sql.= ", ".MAIN_DB_PREFIX."bank_account as ba"; $sql.= ", ".MAIN_DB_PREFIX."bank_account as ba";
$sql.= ", ".MAIN_DB_PREFIX."paiement as p"; $sql.= ", ".MAIN_DB_PREFIX."paiement as p";
@ -205,7 +205,7 @@ if ($modecompta != 'CREANCES-DETTES')
{ {
$obj = $db->fetch_object($result); $obj = $db->fetch_object($result);
$amount[$obj->rowidx] = $obj->amount_ttc; $amount[$obj->rowidx] = $obj->amount_ttc;
$name[$obj->rowidx] = $obj->name.' '.$obj->firstname; $name[$obj->rowidx] = $obj->lastname.' '.$obj->firstname;
$catotal+=$obj->amount_ttc; $catotal+=$obj->amount_ttc;
$i++; $i++;
} }

View File

@ -425,7 +425,7 @@ abstract class ActionsContactCardCommon
$this->object->old_firstname = $_POST["old_firstname"]; $this->object->old_firstname = $_POST["old_firstname"];
$this->object->socid = $_POST["socid"]; $this->object->socid = $_POST["socid"];
$this->object->name = $_POST["name"]; $this->object->lastname = $_POST["name"];
$this->object->firstname = $_POST["firstname"]; $this->object->firstname = $_POST["firstname"];
$this->object->civilite_id = $_POST["civilite_id"]; $this->object->civilite_id = $_POST["civilite_id"];
$this->object->poste = $_POST["poste"]; $this->object->poste = $_POST["poste"];

View File

@ -37,10 +37,8 @@ class Contact extends CommonObject
public $table_element='socpeople'; public $table_element='socpeople';
var $id; var $id;
var $civilite_id; // In fact we stor civility_code var $civilite_id; // In fact we store civility_code
var $lastname; var $lastname;
var $name; // TODO deprecated
var $nom; // TODO deprecated
var $firstname; var $firstname;
var $address; var $address;
var $zip; var $zip;
@ -247,7 +245,7 @@ class Contact extends CommonObject
$sql .= ", priv = '".$this->priv."'"; $sql .= ", priv = '".$this->priv."'";
$sql .= ", fk_user_modif=".($user->id > 0 ? "'".$user->id."'":"null"); $sql .= ", fk_user_modif=".($user->id > 0 ? "'".$user->id."'":"null");
$sql .= ", default_lang=".($this->default_lang?"'".$this->default_lang."'":"null"); $sql .= ", default_lang=".($this->default_lang?"'".$this->default_lang."'":"null");
$sql .= ", no_email=".($this->no_email?"'".$this->no_email."'":"null"); $sql .= ", no_email=".($this->no_email?"'".$this->no_email."'":"0");
$sql .= " WHERE rowid=".$id; $sql .= " WHERE rowid=".$id;
dol_syslog(get_class($this)."::update sql=".$sql,LOG_DEBUG); dol_syslog(get_class($this)."::update sql=".$sql,LOG_DEBUG);

View File

@ -64,7 +64,7 @@ print $form->showrefnav($contact, 'id', $linkback);
print '</td></tr>'; print '</td></tr>';
// Name // Name
print '<tr><td width="20%">'.$langs->trans("Lastname").' / '.$langs->trans("Label").'</td><td>'.$contact->name.'</td>'; print '<tr><td width="20%">'.$langs->trans("Lastname").' / '.$langs->trans("Label").'</td><td>'.$contact->lastname.'</td>';
print '<td width="20%">'.$langs->trans("Firstname").'</td><td width="25%">'.$contact->firstname.'</td></tr>'; print '<td width="20%">'.$langs->trans("Firstname").'</td><td width="25%">'.$contact->firstname.'</td></tr>';
// Company // Company

View File

@ -140,7 +140,7 @@ if (empty($reshook))
$object->zip = $_POST["zipcode"]; $object->zip = $_POST["zipcode"];
$object->town = $_POST["town"]; $object->town = $_POST["town"];
$object->country_id = $_POST["country_id"]; $object->country_id = $_POST["country_id"];
$object->state_id = $_POST["departement_id"]; $object->state_id = $_POST["state_id"];
$object->email = $_POST["email"]; $object->email = $_POST["email"];
$object->phone_pro = $_POST["phone_pro"]; $object->phone_pro = $_POST["phone_pro"];
$object->phone_perso = $_POST["phone_perso"]; $object->phone_perso = $_POST["phone_perso"];
@ -198,7 +198,7 @@ if (empty($reshook))
{ {
$result=$object->fetch($_GET["id"]); $result=$object->fetch($_GET["id"]);
$object->old_name = $_POST["old_name"]; $object->old_lastname = $_POST["old_lastname"];
$object->old_firstname = $_POST["old_firstname"]; $object->old_firstname = $_POST["old_firstname"];
$result = $object->delete(); $result = $object->delete();
@ -227,7 +227,7 @@ if (empty($reshook))
$object->oldcopy=dol_clone($object); $object->oldcopy=dol_clone($object);
$object->old_name = $_POST["old_name"]; $object->old_lastname = $_POST["old_lastname"];
$object->old_firstname = $_POST["old_firstname"]; $object->old_firstname = $_POST["old_firstname"];
$object->socid = $_POST["socid"]; $object->socid = $_POST["socid"];
@ -239,7 +239,7 @@ if (empty($reshook))
$object->address = $_POST["address"]; $object->address = $_POST["address"];
$object->zip = $_POST["zipcode"]; $object->zip = $_POST["zipcode"];
$object->town = $_POST["town"]; $object->town = $_POST["town"];
$object->state_id = $_POST["departement_id"]; $object->state_id = $_POST["state_id"];
$object->country_id = $_POST["country_id"]; $object->country_id = $_POST["country_id"];
$object->email = $_POST["email"]; $object->email = $_POST["email"];
@ -265,7 +265,7 @@ if (empty($reshook))
if ($result > 0) if ($result > 0)
{ {
$object->old_name=''; $object->old_lastname='';
$object->old_firstname=''; $object->old_firstname='';
$action = 'view'; $action = 'view';
} }
@ -620,7 +620,7 @@ else
print '<input type="hidden" name="id" value="'.$id.'">'; print '<input type="hidden" name="id" value="'.$id.'">';
print '<input type="hidden" name="action" value="update">'; print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="contactid" value="'.$object->id.'">'; print '<input type="hidden" name="contactid" value="'.$object->id.'">';
print '<input type="hidden" name="old_name" value="'.$object->name.'">'; print '<input type="hidden" name="old_lastname" value="'.$object->lastname.'">';
print '<input type="hidden" name="old_firstname" value="'.$object->firstname.'">'; print '<input type="hidden" name="old_firstname" value="'.$object->firstname.'">';
if (! empty($backtopage)) print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; if (! empty($backtopage)) print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
@ -889,7 +889,7 @@ else
print '<tr><td>'.$langs->trans("Country").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("Country").'</td><td colspan="3">';
$img=picto_from_langcode($object->country_code); $img=picto_from_langcode($object->country_code);
if ($img) print $img.' '; if ($img) print $img.' ';
print $object->country_id; print $object->country;
print '</td></tr>'; print '</td></tr>';
// State // State

View File

@ -96,7 +96,7 @@ print $form->showrefnav($contact,'id');
print '</td></tr>'; print '</td></tr>';
// Name // Name
print '<tr><td>'.$langs->trans("Lastname").' / '.$langs->trans("Label").'</td><td>'.$contact->name.'</td>'; print '<tr><td>'.$langs->trans("Lastname").' / '.$langs->trans("Label").'</td><td>'.$contact->lastname.'</td>';
print '<td>'.$langs->trans("Firstname").'</td><td width="25%">'.$contact->firstname.'</td></tr>'; print '<td>'.$langs->trans("Firstname").'</td><td width="25%">'.$contact->firstname.'</td></tr>';
// Company // Company

View File

@ -142,11 +142,11 @@ else
if ($search_priv == '1') $sql .= " AND (p.priv='1' AND p.fk_user_creat=".$user->id.")"; if ($search_priv == '1') $sql .= " AND (p.priv='1' AND p.fk_user_creat=".$user->id.")";
} }
if ($search_lastname) // filtre sur le nom if ($search_lastname) // filter on lastname
{ {
$sql .= " AND p.lastname LIKE '%".$db->escape($search_lastname)."%'"; $sql .= " AND p.lastname LIKE '%".$db->escape($search_lastname)."%'";
} }
if ($search_firstname) // filtre sur le prenom if ($search_firstname) // filter on firstname
{ {
$sql .= " AND p.firstname LIKE '%".$db->escape($search_firstname)."%'"; $sql .= " AND p.firstname LIKE '%".$db->escape($search_firstname)."%'";
} }

View File

@ -46,7 +46,7 @@ $v = new vCard();
$v->setProdId('Dolibarr '.DOL_VERSION); $v->setProdId('Dolibarr '.DOL_VERSION);
$v->setUid('DOLIBARR-CONTACTID-'.$contact->id); $v->setUid('DOLIBARR-CONTACTID-'.$contact->id);
$v->setName($contact->name, $contact->firstname, "", "", ""); $v->setName($contact->lastname, $contact->firstname, "", "", "");
$v->setFormattedName($contact->getFullName($langs)); $v->setFormattedName($contact->getFullName($langs));
// By default, all informations are for work (except phone_perso and phone_mobile) // By default, all informations are for work (except phone_perso and phone_mobile)

View File

@ -306,7 +306,7 @@ else if ($action == 'addline' && $user->rights->contrat->creer)
{ {
$pu_ht=GETPOST('price_ht'); $pu_ht=GETPOST('price_ht');
$price_base_type = 'HT'; $price_base_type = 'HT';
$tva_tx=str_replace('*','',GETPOST('tva_tx')); $tva_tx=GETPOST('tva_tx')?str_replace('*','',GETPOST('tva_tx')):0; // tva_tx field may be disabled, so we use vat rate 0
$tva_npr=preg_match('/\*/',GETPOST('tva_tx'))?1:0; $tva_npr=preg_match('/\*/',GETPOST('tva_tx'))?1:0;
$desc=GETPOST('dp_desc'); $desc=GETPOST('dp_desc');
} }
@ -424,7 +424,7 @@ else if ($action == 'updateligne' && $user->rights->contrat->creer && ! GETPOST(
$objectline->subprice=GETPOST('elprice'); $objectline->subprice=GETPOST('elprice');
$objectline->qty=GETPOST('elqty'); $objectline->qty=GETPOST('elqty');
$objectline->remise_percent=GETPOST('elremise_percent'); $objectline->remise_percent=GETPOST('elremise_percent');
$objectline->tva_tx=GETPOST('eltva_tx'); $objectline->tva_tx=GETPOST('eltva_tx')?GETPOST('eltva_tx'):0; // Field may be disabled, so we use vat rate 0
$objectline->localtax1_tx=$localtax1_tx; $objectline->localtax1_tx=$localtax1_tx;
$objectline->localtax2_tx=$localtax2_tx; $objectline->localtax2_tx=$localtax2_tx;
$objectline->date_ouverture_prevue=$date_start_update; $objectline->date_ouverture_prevue=$date_start_update;

View File

@ -331,7 +331,7 @@ if ($result)
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
print '<td width="100" nowrap="nowrap">'; print '<td width="110" nowrap="nowrap">';
$staticcontrat->ref=($obj->ref?$obj->ref:$obj->cid); $staticcontrat->ref=($obj->ref?$obj->ref:$obj->cid);
$staticcontrat->id=$obj->cid; $staticcontrat->id=$obj->cid;
print $staticcontrat->getNomUrl(1,16); print $staticcontrat->getNomUrl(1,16);
@ -397,7 +397,7 @@ if ($resql)
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
print '<td width="100" nowrap="nowrap">'; print '<td width="110" nowrap="nowrap">';
$staticcontrat->ref=($obj->ref?$obj->ref:$obj->fk_contrat); $staticcontrat->ref=($obj->ref?$obj->ref:$obj->fk_contrat);
$staticcontrat->id=$obj->fk_contrat; $staticcontrat->id=$obj->fk_contrat;
print $staticcontrat->getNomUrl(1,16); print $staticcontrat->getNomUrl(1,16);
@ -478,7 +478,7 @@ if ($resql)
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
print '<td width="100" nowrap="nowrap">'; print '<td width="110" nowrap="nowrap">';
$staticcontrat->ref=($obj->ref?$obj->ref:$obj->fk_contrat); $staticcontrat->ref=($obj->ref?$obj->ref:$obj->fk_contrat);
$staticcontrat->id=$obj->fk_contrat; $staticcontrat->id=$obj->fk_contrat;
print $staticcontrat->getNomUrl(1,16); print $staticcontrat->getNomUrl(1,16);
@ -558,7 +558,7 @@ if ($resql)
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
print '<td width="100" nowrap="nowrap">'; print '<td width="110" nowrap="nowrap">';
$staticcontrat->ref=($obj->ref?$obj->ref:$obj->fk_contrat); $staticcontrat->ref=($obj->ref?$obj->ref:$obj->fk_contrat);
$staticcontrat->id=$obj->fk_contrat; $staticcontrat->id=$obj->fk_contrat;
print $staticcontrat->getNomUrl(1,16); print $staticcontrat->getNomUrl(1,16);

View File

@ -87,7 +87,7 @@ class box_contacts extends ModeleBoxes
$datec=$db->jdate($objp->datec); $datec=$db->jdate($objp->datec);
$datem=$db->jdate($objp->tms); $datem=$db->jdate($objp->tms);
$contactstatic->name=$objp->name; $contactstatic->lastname=$objp->lastname;
$contactstatic->firstname=$objp->firstname; $contactstatic->firstname=$objp->firstname;
$contactstatic->civilite_id=$objp->civilite; $contactstatic->civilite_id=$objp->civilite;

View File

@ -63,7 +63,7 @@ abstract class CommonObject
$lastname=$this->lastname; $lastname=$this->lastname;
$firstname=$this->firstname; $firstname=$this->firstname;
if (empty($lastname)) $lastname=($this->name?$this->name:$this->nom); if (empty($lastname)) $lastname=($this->lastname?$this->lastname:($this->name?$this->name:$this->nom));
if (empty($firstname)) $firstname=$this->firstname; if (empty($firstname)) $firstname=$this->firstname;
$ret=''; $ret='';

View File

@ -0,0 +1,147 @@
<?php
/*
*
* 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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* or see http://www.gnu.org/
*/
/**
* \file htdocs/core/class/dolprintipp.class.php
* \brief A set of functions for using printIPP
*/
/**
* Class to manage printIPP
*/
class dolprintIPP
{
var $host;
var $port;
var $userid;
var $user;
var $password;
var $error;
var $db;
/**
* Constructor
*
* @param DoliDB $db database
* @param string $host host of Cups
* @param string $port port
* @return printIPP
*/
function __construct($db,$host,$port,$userid,$user,$password)
{
$this->db=$db;
$this->host=$host;
$this->port=$port;
$this->userid=$userid;
$this->user=$user;
$this->password=$password;
}
/**
* Return list of available printers
*
* @return array list of printers
*/
function getlist_available_printers()
{
global $conf,$db;
include_once DOL_DOCUMENT_ROOT.'/includes/printipp/CupsPrintIPP.php';
$ipp = new CupsPrintIPP();
$ipp->setLog(DOL_DATA_ROOT.'/printipp.log','file',3); // logging very verbose
$ipp->setHost($this->host);
$ipp->setPort($this->port);
$ipp->setUserName($this->userid);
//$ipp->setAuthentication($this->user,$this->password);
$ipp->getPrinters();
return $ipp->available_printers;
}
/**
* Print selected file
*
*/
function print_file($file,$module)
{
global $conf,$db;
include_once DOL_DOCUMENT_ROOT.'/includes/printipp/CupsPrintIPP.php';
$ipp = new CupsPrintIPP();
$ipp->setLog(DOL_DATA_ROOT.'/printipp.log','file',3); // logging very verbose
$ipp->setHost($this->host);
$ipp->setPort($this->port);
$ipp->setJobName($file,true);
$ipp->setUserName($this->userid);
//$ipp->setAuthentication($this->user,$this->password);
// select printer uri for module order, propal,...
$sql = 'SELECT rowid,printer_uri,copy FROM '.MAIN_DB_PREFIX.'printer_ipp WHERE module="'.$module.'"';
$result = $this->db->query($sql);
if ($result)
{
$obj = $this->db->fetch_object($result);
if ($obj)
{
$ipp->setPrinterURI($obj->printer_uri);
}
else
{
$ipp->setPrinterURI($conf->global->PRINTIPP_URI_DEFAULT);
}
}
$ipp->setCopies($obj->copy);
$ipp->setData(DOL_DATA_ROOT.'/'.$module.'/'.$file);
$ipp->printJob();
}
/**
* List jobs print
*
*/
function list_jobs($module)
{
global $conf,$db;
include_once DOL_DOCUMENT_ROOT.'/includes/printipp/CupsPrintIPP.php';
$ipp = new CupsPrintIPP();
$ipp->setLog(DOL_DATA_ROOT.'/printipp.log','file',3); // logging very verbose
$ipp->setHost($this->host);
$ipp->setPort($this->port);
$ipp->setUserName($this->userid);
// select printer uri for module order, propal,...
$sql = 'SELECT rowid,printer_uri,printer_name FROM '.MAIN_DB_PREFIX.'printer_ipp WHERE module="'.$module.'"';
$result = $this->db->query($sql);
if ($result)
{
$obj = $this->db->fetch_object($result);
if ($obj)
{
$ipp->setPrinterURI($obj->printer_uri);
}
else
{
// All printers
$ipp->setPrinterURI("ipp://localhost:631/printers/");
}
}
echo 'Jobs for : '.$this->userid.' module : '.$module.' Printer : '.$obj->printer_name.'<br />';
echo "Getting Jobs: ".$ipp->getJobs(true,3,"completed",true)."<br />";
echo "<pre>";print_r($ipp->jobs_attributes); echo "</pre>";
}
}
?>

View File

@ -116,7 +116,7 @@ class HookManager
* @param array $parameters Array of parameters * @param array $parameters Array of parameters
* @param Object &$object Object to use hooks on * @param Object &$object Object to use hooks on
* @param string &$action Action code on calling page ('create', 'edit', 'view', 'add', 'update', 'delete'...) * @param string &$action Action code on calling page ('create', 'edit', 'view', 'add', 'update', 'delete'...)
* @return mixed For doActions,formObjectOptions: Return 0 if we want to keep standard actions, >0 if if want to stop standard actions, <0 means KO. * @return mixed For doActions,formObjectOptions,pdf_xxx: Return 0 if we want to keep standard actions, >0 if if want to stop standard actions, <0 means KO.
* For printSearchForm,printLeftBlock,printTopRightMenu,formAddObjectLine,...: Return HTML string. TODO Must always return an int and things to print into ->resprints. * For printSearchForm,printLeftBlock,printTopRightMenu,formAddObjectLine,...: Return HTML string. TODO Must always return an int and things to print into ->resprints.
* Can also return some values into an array ->results. * Can also return some values into an array ->results.
* $this->error or this->errors are also defined by class called by this function if error. * $this->error or this->errors are also defined by class called by this function if error.
@ -128,6 +128,11 @@ class HookManager
$parameters['context']=join(':',$this->contextarray); $parameters['context']=join(':',$this->contextarray);
dol_syslog(get_class($this).'::executeHooks method='.$method." action=".$action." context=".$parameters['context']); dol_syslog(get_class($this).'::executeHooks method='.$method." action=".$action." context=".$parameters['context']);
// Define type of hook ('output', 'returnvalue' or 'addreplace')
$hooktype='output';
if (preg_match('/^pdf_/',$method)) $hooktype='returnvalue'; // pdf_xxx except pdf_writelinedesc are returnvalue hooks. When there is 2 hooks of this type, only last one win.
if ($method == 'doActions' || $method == 'formObjectOptions' || $method == 'pdf_writelinedesc') $hooktype='addreplace';
// Loop on each hook to qualify modules that declared context // Loop on each hook to qualify modules that declared context
$modulealreadyexecuted=array(); $modulealreadyexecuted=array();
$resaction=0; $error=0; $resaction=0; $error=0;
@ -145,15 +150,15 @@ class HookManager
// test to avoid to run twice a hook, when a module implements several active contexts // test to avoid to run twice a hook, when a module implements several active contexts
if (in_array($module,$modulealreadyexecuted)) continue; if (in_array($module,$modulealreadyexecuted)) continue;
$modulealreadyexecuted[$module]=$module; $modulealreadyexecuted[$module]=$module;
// Hooks that return int // Hooks that return int
if (($method == 'doActions' || $method == 'formObjectOptions')) if ($hooktype == 'addreplace')
{ {
$resaction+=$actionclassinstance->$method($parameters, $object, $action, $this); // $object and $action can be changed by method ($object->id during creation for example or $action to go back to other action for example) $resaction += $actionclassinstance->$method($parameters, $object, $action, $this); // $object and $action can be changed by method ($object->id during creation for example or $action to go back to other action for example)
if ($resaction < 0 || ! empty($actionclassinstance->error) || (! empty($actionclassinstance->errors) && count($actionclassinstance->errors) > 0)) if ($resaction < 0 || ! empty($actionclassinstance->error) || (! empty($actionclassinstance->errors) && count($actionclassinstance->errors) > 0))
{ {
$error++; $error++;
$this->error=$actionclassinstance->error; $this->errors=array_merge($this->errors, (array) $actionclassinstance->errors); $this->error=$actionclassinstance->error; $this->errors=array_merge($this->errors, (array) $actionclassinstance->errors);
// TODO remove this. Change must be inside the method if required // TODO remove this. Change must be inside the method if required
if ($method == 'doActions') if ($method == 'doActions')
{ {
@ -164,11 +169,11 @@ class HookManager
} }
// Generic hooks that return a string (printSearchForm, printLeftBlock, printTopRightMenu, formAddObjectLine, formBuilddocOptions, ...) // Generic hooks that return a string (printSearchForm, printLeftBlock, printTopRightMenu, formAddObjectLine, formBuilddocOptions, ...)
else else
{ {
// TODO. this should be done into the method by returning nothing // TODO. this should be done into the method by returning nothing
if (is_array($parameters) && ! empty($parameters['special_code']) && $parameters['special_code'] > 3 && $parameters['special_code'] != $actionclassinstance->module_number) continue; if (is_array($parameters) && ! empty($parameters['special_code']) && $parameters['special_code'] > 3 && $parameters['special_code'] != $actionclassinstance->module_number) continue;
$result = $actionclassinstance->$method($parameters, $object, $action, $this); $result = $actionclassinstance->$method($parameters, $object, $action, $this); // $object and $action can be changed by method ($object->id during creation for example or $action to go back to other action for example)
if (is_array($actionclassinstance->results)) $this->resArray =array_merge($this->resArray, $actionclassinstance->results); if (is_array($actionclassinstance->results)) $this->resArray =array_merge($this->resArray, $actionclassinstance->results);
if (! empty($actionclassinstance->resprints)) $this->resPrint.=$actionclassinstance->resprints; if (! empty($actionclassinstance->resprints)) $this->resPrint.=$actionclassinstance->resprints;
@ -184,7 +189,9 @@ class HookManager
} }
} }
if ($method != 'doActions' && $method != 'formObjectOptions') return $this->resPrint; // TODO remove this. When there is something to print, ->resPrint is filled. // TODO remove this. When there is something to print for an output hook, ->resPrint is filled.
if ($hooktype == 'output') return $this->resPrint;
if ($hooktype == 'returnvalue') return $result;
return ($error?-1:$resaction); return ($error?-1:$resaction);
} }

View File

@ -898,8 +898,7 @@ class Form
$obj = $this->db->fetch_object($resql); $obj = $this->db->fetch_object($resql);
$contactstatic->id=$obj->rowid; $contactstatic->id=$obj->rowid;
$contactstatic->name=$obj->name; $contactstatic->lastname=$obj->lastname;
$contactstatic->lastname=$obj->name;
$contactstatic->firstname=$obj->firstname; $contactstatic->firstname=$obj->firstname;
if ($htmlname != 'none') if ($htmlname != 'none')

View File

@ -161,12 +161,13 @@ class FormFile
* @param string $title Title to show on top of form * @param string $title Title to show on top of form
* @param string $buttonlabel Label on submit button * @param string $buttonlabel Label on submit button
* @param string $codelang Default language code to use on lang combo box if multilang is enabled * @param string $codelang Default language code to use on lang combo box if multilang is enabled
* @param boolean $printer Printer Icon
* @return int <0 if KO, number of shown files if OK * @return int <0 if KO, number of shown files if OK
*/ */
function show_documents($modulepart,$filename,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$allowgenifempty=1,$forcenomultilang=0,$iconPDF=0,$maxfilenamelength=28,$noform=0,$param='',$title='',$buttonlabel='',$codelang='') function show_documents($modulepart,$filename,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$allowgenifempty=1,$forcenomultilang=0,$iconPDF=0,$maxfilenamelength=28,$noform=0,$param='',$title='',$buttonlabel='',$codelang='',$printer=false)
{ {
$this->numoffiles=0; $this->numoffiles=0;
print $this->showdocuments($modulepart,$filename,$filedir,$urlsource,$genallowed,$delallowed,$modelselected,$allowgenifempty,$forcenomultilang,$iconPDF,$maxfilenamelength,$noform,$param,$title,$buttonlabel,$codelang); print $this->showdocuments($modulepart,$filename,$filedir,$urlsource,$genallowed,$delallowed,$modelselected,$allowgenifempty,$forcenomultilang,$iconPDF,$maxfilenamelength,$noform,$param,$title,$buttonlabel,$codelang,$printer);
return $this->numoffiles; return $this->numoffiles;
} }
@ -190,9 +191,10 @@ class FormFile
* @param string $title Title to show on top of form * @param string $title Title to show on top of form
* @param string $buttonlabel Label on submit button * @param string $buttonlabel Label on submit button
* @param string $codelang Default language code to use on lang combo box if multilang is enabled * @param string $codelang Default language code to use on lang combo box if multilang is enabled
* @param boolean $printer Printer Icon
* @return string Output string with HTML array of documents (might be empty string) * @return string Output string with HTML array of documents (might be empty string)
*/ */
function showdocuments($modulepart,$filename,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$allowgenifempty=1,$forcenomultilang=0,$iconPDF=0,$maxfilenamelength=28,$noform=0,$param='',$title='',$buttonlabel='',$codelang='') function showdocuments($modulepart,$filename,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$allowgenifempty=1,$forcenomultilang=0,$iconPDF=0,$maxfilenamelength=28,$noform=0,$param='',$title='',$buttonlabel='',$codelang='',$printer)
{ {
// filedir = conf->...dir_ouput."/".get_exdir(id) // filedir = conf->...dir_ouput."/".get_exdir(id)
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
@ -436,6 +438,8 @@ class FormFile
} }
$out.= '</th>'; $out.= '</th>';
if ($printer) $out.= '<th></th>';
$out.= '</tr>'; $out.= '</tr>';
// Execute hooks // Execute hooks
@ -499,6 +503,14 @@ class FormFile
//$out.= '&urlsource='.urlencode($urlsource); // TODO obsolete ? //$out.= '&urlsource='.urlencode($urlsource); // TODO obsolete ?
$out.= '">'.img_delete().'</a></td>'; $out.= '">'.img_delete().'</a></td>';
} }
// Printer Icon
if ($printer)
{
$out.= '<td align="right">';
$out.= '&nbsp;<a href="'.$urlsource.'&action=print_file&amp;printer='.$modulepart.'&amp;file='.urlencode($relativepath);
$out.= ($param?'&'.$param:'');
$out.= '">'.img_printer().'</a></td>';
}
} }
$out.= '</tr>'; $out.= '</tr>';

View File

@ -135,7 +135,7 @@ class Notify
dol_syslog("Notify::send action=$action, socid=$socid, texte=$texte, objet_type=$objet_type, objet_id=$objet_id, file=$file"); dol_syslog("Notify::send action=$action, socid=$socid, texte=$texte, objet_type=$objet_type, objet_id=$objet_id, file=$file");
$sql = "SELECT s.nom, c.email, c.rowid as cid, c.name, c.firstname,"; $sql = "SELECT s.nom, c.email, c.rowid as cid, c.lastname, c.firstname,";
$sql.= " a.rowid as adid, a.label, a.code, n.rowid"; $sql.= " a.rowid as adid, a.label, a.code, n.rowid";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c,"; $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c,";
$sql.= " ".MAIN_DB_PREFIX."c_action_trigger as a,"; $sql.= " ".MAIN_DB_PREFIX."c_action_trigger as a,";
@ -157,7 +157,7 @@ class Notify
{ {
$obj = $this->db->fetch_object($result); $obj = $this->db->fetch_object($result);
$sendto = $obj->firstname . " " . $obj->name . " <".$obj->email.">"; $sendto = $obj->firstname . " " . $obj->lastname . " <".$obj->email.">";
$actiondefid = $obj->adid; $actiondefid = $obj->adid;
if (dol_strlen($sendto)) if (dol_strlen($sendto))

View File

@ -622,7 +622,7 @@ class Translate
$newdir=dol_osencode($dir); $newdir=dol_osencode($dir);
// Check if directory exists // Check if directory exists
if (! dol_is_dir($dir)) continue; if (! is_dir($newdir)) continue; // We must not use dol_is_dir here, function may not be loaded
$fonc='numberwords'; $fonc='numberwords';
if (file_exists($newdir.'/functions_'.$fonc.'.lib.php')) if (file_exists($newdir.'/functions_'.$fonc.'.lib.php'))

View File

@ -1147,19 +1147,21 @@ function showModulesExludedForExternal($modules)
$text=$langs->trans("OnlyFollowingModulesAreOpenedToExternalUsers"); $text=$langs->trans("OnlyFollowingModulesAreOpenedToExternalUsers");
$listofmodules=explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL); $listofmodules=explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL);
$i=0; $i=0;
foreach($modules as $module) if (!empty($modules)) {
{ foreach($modules as $module)
$moduleconst=$module->const_name; {
$modulename=strtolower($module->name); $moduleconst=$module->const_name;
//print 'modulename='.$modulename; $modulename=strtolower($module->name);
//print 'modulename='.$modulename;
//if (empty($conf->global->$moduleconst)) continue; //if (empty($conf->global->$moduleconst)) continue;
if (! in_array($modulename,$listofmodules)) continue; if (! in_array($modulename,$listofmodules)) continue;
if ($i > 0) $text.=', '; if ($i > 0) $text.=', ';
else $text.=' '; else $text.=' ';
$i++; $i++;
$text .= $langs->trans('Module'.$module->numero.'Name'); $text .= $langs->trans('Module'.$module->numero.'Name');
}
} }
return img_picto($langs->trans('InfoAdmin'), 'star').' '.$text; return img_picto($langs->trans('InfoAdmin'), 'star').' '.$text;
} }

View File

@ -562,29 +562,31 @@ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename='
/** /**
* Show tab header of a card * Show tab header of a card
* *
* @param array $links Array of tabs * @param array $links Array of tabs
* @param string $active Active tab name (document', 'info', 'ldap', ....) * @param string $active Active tab name (document', 'info', 'ldap', ....)
* @param string $title Title * @param string $title Title
* @param int $notab 0=Add tab header, 1=no tab header * @param int $notab 0=Add tab header, 1=no tab header
* @param string $picto Add a picto on tab title * @param string $picto Add a picto on tab title
* @param int $pictoisfullpath If 1, image path is a full path. If you set this to 1, you can use url returned by dol_build_path('/mymodyle/img/myimg.png',1) for $picto.
* @return void * @return void
*/ */
function dol_fiche_head($links=array(), $active='0', $title='', $notab=0, $picto='') function dol_fiche_head($links=array(), $active='0', $title='', $notab=0, $picto='', $pictoisfullpath=0)
{ {
print dol_get_fiche_head($links, $active, $title, $notab, $picto); print dol_get_fiche_head($links, $active, $title, $notab, $picto, $pictoisfullpath);
} }
/** /**
* Show tab header of a card * Show tab header of a card
* *
* @param array $links Array of tabs * @param array $links Array of tabs
* @param int $active Active tab name * @param int $active Active tab name
* @param string $title Title * @param string $title Title
* @param int $notab 0=Add tab header, 1=no tab header * @param int $notab 0=Add tab header, 1=no tab header
* @param string $picto Add a picto on tab title * @param string $picto Add a picto on tab title
* @param int $pictoisfullpath If 1, image path is a full path. If you set this to 1, you can use url returned by dol_build_path('/mymodyle/img/myimg.png',1) for $picto.
* @return void * @return void
*/ */
function dol_get_fiche_head($links=array(), $active='0', $title='', $notab=0, $picto='') function dol_get_fiche_head($links=array(), $active='0', $title='', $notab=0, $picto='', $pictoisfullpath=0)
{ {
$out="\n".'<div class="tabs">'."\n"; $out="\n".'<div class="tabs">'."\n";
@ -593,7 +595,7 @@ function dol_get_fiche_head($links=array(), $active='0', $title='', $notab=0, $p
{ {
$limittitle=30; $limittitle=30;
$out.='<a class="tabTitle">'; $out.='<a class="tabTitle">';
if ($picto) $out.=img_object('',$picto).' '; if ($picto) $out.=img_picto('',($pictoisfullpath?'':'object_').$picto,'',$pictoisfullpath).' ';
$out.=dol_trunc($title,$limittitle); $out.=dol_trunc($title,$limittitle);
$out.='</a>'; $out.='</a>';
} }
@ -1847,6 +1849,20 @@ function img_delete($alt = 'default', $other = '')
return img_picto($alt, 'delete.png', $other); return img_picto($alt, 'delete.png', $other);
} }
/**
* Show printer logo
*
* @param string $alt Text on alt image
* @param string $other Add more attributes on img
* @return string Retourne tag img
*/
function img_printer($alt = "default", $other='')
{
global $conf,$langs;
if ($alt=="default") $alt=$langs->trans("Print");
return img_picto($alt,'printer.png',$other);
}
/** /**
* Show help logo with cursor "?" * Show help logo with cursor "?"
* *
@ -4095,7 +4111,7 @@ function complete_head_from_modules($conf,$langs,$object,&$head,&$h,$type,$mode=
if (verifCond($values[4])) if (verifCond($values[4]))
{ {
if ($values[3]) $langs->load($values[3]); if ($values[3]) $langs->load($values[3]);
$head[$h][0] = dol_buildpath(preg_replace('/__ID__/i', (! empty($object->id)?$object->id:''), $values[5]), 1); $head[$h][0] = dol_buildpath(preg_replace('/__ID__/i', ((is_object($object) && ! empty($object->id))?$object->id:''), $values[5]), 1);
$head[$h][1] = $langs->trans($values[2]); $head[$h][1] = $langs->trans($values[2]);
$head[$h][2] = str_replace('+','',$values[1]); $head[$h][2] = str_replace('+','',$values[1]);
$h++; $h++;
@ -4105,7 +4121,7 @@ function complete_head_from_modules($conf,$langs,$object,&$head,&$h,$type,$mode=
{ {
if ($values[0] != $type) continue; if ($values[0] != $type) continue;
if ($values[3]) $langs->load($values[3]); if ($values[3]) $langs->load($values[3]);
$head[$h][0] = dol_buildpath(preg_replace('/__ID__/i', (! empty($object->id)?$object->id:''), $values[4]), 1); $head[$h][0] = dol_buildpath(preg_replace('/__ID__/i', ((is_object($object) && ! empty($object->id))?$object->id:''), $values[4]), 1);
$head[$h][1] = $langs->trans($values[2]); $head[$h][1] = $langs->trans($values[2]);
$head[$h][2] = str_replace('+','',$values[1]); $head[$h][2] = str_replace('+','',$values[1]);
$h++; $h++;
@ -4114,7 +4130,7 @@ function complete_head_from_modules($conf,$langs,$object,&$head,&$h,$type,$mode=
{ {
if ($values[0] != $type) continue; if ($values[0] != $type) continue;
if ($values[2]) $langs->load($values[2]); if ($values[2]) $langs->load($values[2]);
$head[$h][0] = dol_buildpath(preg_replace('/__ID__/i', (! empty($object->id)?$object->id:''), $values[3]), 1); $head[$h][0] = dol_buildpath(preg_replace('/__ID__/i', ((is_object($object) && ! empty($object->id))?$object->id:''), $values[3]), 1);
$head[$h][1] = $langs->trans($values[1]); $head[$h][1] = $langs->trans($values[1]);
$head[$h][2] = 'tab'.$values[1]; $head[$h][2] = 'tab'.$values[1];
$h++; $h++;

View File

@ -839,6 +839,7 @@ function pdf_writelinedesc(&$pdf,$object,$i,$outputlangs,$w,$h,$posx,$posy,$hide
{ {
global $db, $conf, $langs, $hookmanager; global $db, $conf, $langs, $hookmanager;
$reshook=0;
if (is_object($hookmanager) && ( ($object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code) ) || ! empty($object->lines[$i]->fk_parent_line) ) ) if (is_object($hookmanager) && ( ($object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code) ) || ! empty($object->lines[$i]->fk_parent_line) ) )
{ {
$special_code = $object->lines[$i]->special_code; $special_code = $object->lines[$i]->special_code;
@ -847,7 +848,7 @@ function pdf_writelinedesc(&$pdf,$object,$i,$outputlangs,$w,$h,$posx,$posy,$hide
$action=''; $action='';
$reshook=$hookmanager->executeHooks('pdf_writelinedesc',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks $reshook=$hookmanager->executeHooks('pdf_writelinedesc',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
} }
else if (empty($reshook))
{ {
$labelproductservice=pdf_getlinedesc($object,$i,$outputlangs,$hideref,$hidedesc,$issupplierline); $labelproductservice=pdf_getlinedesc($object,$i,$outputlangs,$hideref,$hidedesc,$issupplierline);
// Description // Description

View File

@ -74,9 +74,9 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt
if (! is_object($mysoc)) // mysoc may be not defined (during migration process) if (! is_object($mysoc)) // mysoc may be not defined (during migration process)
{ {
$mysoc=new Societe($db); $mysoc=new Societe($db);
$mysoc->getMysoc($conf); $mysoc->setMysoc($conf);
} }
$seller=$mysoc; // If seller is a customer, $seller is not provided, we use $mysoc $seller=$mysoc; // If sell is done to a customer, $seller is not provided, we use $mysoc
//var_dump($seller->country_id);exit; //var_dump($seller->country_id);exit;
} }

View File

@ -1 +0,0 @@
Url not available

View File

@ -1,215 +0,0 @@
<?php
/* Copyright (C) 2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2010 Regis Houssin <regis.houssin@capnetworks.com>
*
* 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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* or see http://www.gnu.org/
*/
/**
* \file htdocs/core/menus/smartphone/smartphone.lib.php
* \brief Library for file smartphone menus
*/
/**
* Core function to output top menu smartphone
*
* @param DoliDB $db Database handler
* @param string $atarget Target
* @param int $type_user 0=Internal,1=External,2=All
* @param string $limitmenuto To limit menu to a top or left menu value
* @param array &$tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty)
* @return void
*/
function print_smartphone_menu($db,$atarget,$type_user,$limitmenuto,&$tabMenu,&$menu)
{
require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php';
global $user,$conf,$langs,$dolibarr_main_db_name;
$mainmenu=$_SESSION["mainmenu"];
$leftmenu=$_SESSION["leftmenu"];
$submenus='';
//$tabMenu=array();
$menutop = new Menubase($db,'smartphone');
$menuleft = new Menubase($db,'smartphone');
$newTabMenu = $menutop->menuTopCharger('', '', $type_user, 'smartphone',$tabMenu);
$numTabMenu = count($newTabMenu);
print_start_menu_array();
for($i=0; $i<$numTabMenu; $i++)
{
if ($newTabMenu[$i]['enabled'] == true)
{
if ($newTabMenu[$i]['perms'] == true) // Is allowed
{
// Define url
if (preg_match("/^(http:\/\/|https:\/\/)/i",$newTabMenu[$i]['url']))
{
$url = dol_buildpath($newTabMenu[$i]['url'],1);
$url=preg_replace('/&amp.*/i','',$url);
}
else
{
$menus='';
if ($limitmenuto > 0)
{
$newmenu = new Menu();
$leftmenu = $menuleft->menuLeftCharger($newmenu,$newTabMenu[$i]['mainmenu'],'',($user->societe_id?1:0),'smartphone',$tabMenu);
$menus = $leftmenu->liste;
//var_dump($menus);
}
print_start_menu_entry();
if (is_array($menus) && !empty($menus) && $limitmenuto > 0)
{
$title=$newTabMenu[$i]['titre'];
// To remove & and special chars: $title=dol_string_unaccent(dol_string_nospecial(dol_html_entity_decode($newTabMenu[$i]['titre'],ENT_QUOTES,'UTF-8'),'',array('&')));
print_text_menu_entry($title);
$num = count($menus);
//var_dump($menus);
if ($num > 0) print_start_submenu_array();
for($j=0; $j<$num; $j++)
{
$url=dol_buildpath($menus[$j]['url'],1);
$url=preg_replace('/&amp.*/i','',$url);
if ($menus[$j]['level'] == 0)
{
print_start_menu_entry();
if (empty($menus[$j+1]['level'])) print '<a href="'.$url.'"'.($menus[$j]['target']?" target='".$menus[$j]['target']."'":($atarget?" target=$atarget":'')).'>';
$title=$menus[$j]['titre'];
// To remove & and special chars: $title=dol_string_unaccent(dol_string_nospecial(dol_html_entity_decode($menus[$j]['titre'],ENT_QUOTES,'UTF-8'),'',array('&')));
print_text_menu_entry($title);
if (empty($menus[$j+1]['level'])) print '</a>';
}
if ($menus[$j]['level'] > 0)
{
if ($menus[$j-1]['level'] == 0) print_start_submenu_array();
print_start_menu_entry();
print '<a href="'.$url.'"'.($menus[$j]['target']?" target='".$menus[$j]['target']."'":($atarget?" target=$atarget":'')).'>';
$title=$menus[$j]['titre'];
// To remove & and special chars: $title=dol_string_unaccent(dol_string_nospecial(dol_html_entity_decode($menus[$j]['titre'],ENT_QUOTES,'UTF-8'),'',array('&')));
print_text_menu_entry($title);
print '</a>';
print_end_menu_entry();
if (empty($menus[$j+1]['level'])) print_end_menu();
}
if (empty($menus[$j+1]['level'])) print_end_menu_entry();
}
if ($num > 0) print_end_menu();
}
else
{
$url=dol_buildpath($newTabMenu[$i]['url'],1);
$url=preg_replace('/&amp.*/i','',$url);
print '<a href="'.$url.'"'.($newTabMenu[$i]['target']?" target='".$newTabMenu[$i]['target']."'":($atarget?" target=$atarget":'')).'>';
$title=$newTabMenu[$i]['titre'];
// To remove & and special chars: $title=dol_string_unaccent(dol_string_nospecial(dol_html_entity_decode($newTabMenu[$i]['titre'],ENT_QUOTES,'UTF-8'),'',array('&')));
print_text_menu_entry($title);
print '</a>';
}
print_end_menu_entry();
}
}
}
}
print_end_menu();
print "\n";
}
/**
* Output menu entry
*
* @param string $theme Theme
* @return void
*/
function print_start_menu_array($theme='c')
{
print '<ul data-role="listview" data-theme="'.$theme.'">';
print "\n";
}
/**
* Output start submenu entry
*
* @return void
*/
function print_start_submenu_array()
{
print '<ul>';
print "\n";
}
/**
* Output start menu entry
*
* @return void
*/
function print_start_menu_entry()
{
print '<li>';
}
/**
* Output menu entry
*
* @param string $text Text
* @return void
*/
function print_text_menu_entry($text)
{
print $text;
}
/**
* Output end menu entry
*
* @return void
*/
function print_end_menu_entry()
{
print '</li>';
print "\n";
}
/**
* Output end menu
*
* @return void
*/
function print_end_menu()
{
print '</ul>';
print "\n";
}
?>

View File

@ -1,132 +0,0 @@
<?php
/* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007-2010 Regis Houssin <regis.houssin@capnetworks.com>
*
* 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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/core/menus/smartphone/smartphone_menu.php
* \brief Menu smartphone manager
*/
/**
* Class to manage smartphone menu smartphone
*/
class MenuSmart
{
var $hideifnotallowed=1; // Put 0 for back office menu, 1 for front office menu
var $atarget=""; // Valeur du target a utiliser dans les liens
var $name="smartphone";
var $tabMenu;
/**
* Constructor
*
* @param DoliDB $db Database handler
* @param int $type_user Type of user
*/
function __construct($db, $type_user)
{
$this->type_user=$type_user;
$this->db=$db;
}
/**
* Load this->tabMenu
*
* @return void
*/
function loadMenu()
{
// On sauve en session le menu principal choisi
if (isset($_GET["mainmenu"])) $_SESSION["mainmenu"]=$_GET["mainmenu"];
if (isset($_GET["idmenu"])) $_SESSION["idmenu"]=$_GET["idmenu"];
// Read mainmenu and leftmenu that define which menu to show
if (isset($_GET["mainmenu"]))
{
// On sauve en session le menu principal choisi
$mainmenu=$_GET["mainmenu"];
$_SESSION["mainmenu"]=$mainmenu;
$_SESSION["leftmenuopened"]="";
}
else
{
// On va le chercher en session si non defini par le lien
$mainmenu=isset($_SESSION["mainmenu"])?$_SESSION["mainmenu"]:'';
}
if (isset($_GET["leftmenu"]))
{
// On sauve en session le menu principal choisi
$leftmenu=$_GET["leftmenu"];
$_SESSION["leftmenu"]=$leftmenu;
if ($_SESSION["leftmenuopened"]==$leftmenu) // To collapse
{
//$leftmenu="";
$_SESSION["leftmenuopened"]="";
}
else
{
$_SESSION["leftmenuopened"]=$leftmenu;
}
} else {
// On va le chercher en session si non defini par le lien
$leftmenu=isset($_SESSION["leftmenu"])?$_SESSION["leftmenu"]:'';
}
require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php';
$tabMenu=array();
$menuArbo = new Menubase($this->db,'smartphone');
$menuArbo->menuLoad($mainmenu, $leftmenu, $this->type_user, 'smartphone', $tabMenu);
$this->tabMenu=$tabMenu;
}
/**
* Show menu
*
* @param string $mode 'top' or 'left'
* @return int Number of menu entries shown
*/
function showmenu($mode)
{
global $conf;
require_once DOL_DOCUMENT_ROOT.'/core/menus/smartphone/smartphone.lib.php';
if ($this->type_user == 1)
{
$conf->global->MAIN_SEARCHFORM_SOCIETE=0;
$conf->global->MAIN_SEARCHFORM_CONTACT=0;
}
$this->menu=new Menu();
print_smartphone_menu($this->db,$this->atarget,$this->hideifnotallowed,$mode,$this->tabMenu,$this->menu);
unset($this->menu);
return 1;
}
}
?>

View File

@ -335,9 +335,10 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM
*/ */
function dol_auguria_showmenu($type_user, &$menuentry, &$listofmodulesforexternal) function dol_auguria_showmenu($type_user, &$menuentry, &$listofmodulesforexternal)
{ {
global $conf;
//print 'type_user='.$type_user.' module='.$menuentry['module'].' enabled='.$menuentry['enabled'].' perms='.$menuentry['perms']; //print 'type_user='.$type_user.' module='.$menuentry['module'].' enabled='.$menuentry['enabled'].' perms='.$menuentry['perms'];
//print 'ok='.in_array($menuentry['module'], $listofmodulesforexternal); //print 'ok='.in_array($menuentry['module'], $listofmodulesforexternal);
if (empty($menuentry['enabled'])) return 0; // Entry disabled by condition if (empty($menuentry['enabled'])) return 0; // Entry disabled by condition
if ($type_user && $menuentry['module']) if ($type_user && $menuentry['module'])
{ {

View File

@ -168,6 +168,7 @@ class MenuManager
$res='ErrorBadParameterForMode'; $res='ErrorBadParameterForMode';
require_once DOL_DOCUMENT_ROOT.'/core/class/menu.class.php';
$this->menu=new Menu(); $this->menu=new Menu();
if ($mode == 'top') $res=print_auguria_menu($this->db,$this->atarget,$this->type_user,$this->tabMenu,$this->menu); if ($mode == 'top') $res=print_auguria_menu($this->db,$this->atarget,$this->type_user,$this->tabMenu,$this->menu);

View File

@ -1160,9 +1160,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
for ($i = 0; $i < $num; $i++) for ($i = 0; $i < $num; $i++)
{ {
$showmenu=true; $showmenu=true;
if (! empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED) && empty($menu_array[$i]['enabled'])) { if (! empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED) && empty($menu_array[$i]['enabled'])) $showmenu=false;
$showmenu=false;
}
$alt++; $alt++;
if (empty($menu_array[$i]['level']) && $showmenu) if (empty($menu_array[$i]['level']) && $showmenu)
@ -1268,6 +1266,8 @@ function print_jmobile_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu)
*/ */
function dol_eldy_showmenu($type_user, &$menuentry, &$listofmodulesforexternal) function dol_eldy_showmenu($type_user, &$menuentry, &$listofmodulesforexternal)
{ {
global $conf;
//print 'type_user='.$type_user.' module='.$menuentry['module'].' enabled='.$menuentry['enabled'].' perms='.$menuentry['perms']; //print 'type_user='.$type_user.' module='.$menuentry['module'].' enabled='.$menuentry['enabled'].' perms='.$menuentry['perms'];
//print 'ok='.in_array($menuentry['module'], $listofmodulesforexternal); //print 'ok='.in_array($menuentry['module'], $listofmodulesforexternal);
if (empty($menuentry['enabled'])) return 0; // Entry disabled by condition if (empty($menuentry['enabled'])) return 0; // Entry disabled by condition

View File

@ -124,6 +124,7 @@ class MenuManager
$res='ErrorBadParameterForMode'; $res='ErrorBadParameterForMode';
require_once DOL_DOCUMENT_ROOT.'/core/class/menu.class.php';
$this->menu=new Menu(); $this->menu=new Menu();
if ($mode == 'top') $res=print_eldy_menu($this->db,$this->atarget,$this->type_user,$this->tabMenu,$this->menu); if ($mode == 'top') $res=print_eldy_menu($this->db,$this->atarget,$this->type_user,$this->tabMenu,$this->menu);

View File

@ -69,6 +69,7 @@ class MenuManager
$id='mainmenu'; $id='mainmenu';
require_once DOL_DOCUMENT_ROOT.'/core/class/menu.class.php';
$this->menu=new Menu(); $this->menu=new Menu();
if ($mode == 'top') if ($mode == 'top')

View File

@ -719,12 +719,11 @@ class pdf_einstein extends ModelePDFCommandes
else else
{ {
//Local tax 1 before VAT //Local tax 1 before VAT
if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
{ //{
foreach( $this->localtax1 as $localtax_type => $localtax_rate ) foreach( $this->localtax1 as $localtax_type => $localtax_rate )
{ {
// TODO: Place into a function to control showing by country or study better option if (in_array((string) $localtax_type, array('1','3','5','7'))) continue;
if (in_array((string) $localtax_type, array('1','3','5','7')) && $mysoc->country_code != 'ES') continue;
foreach( $localtax_rate as $tvakey => $tvaval ) foreach( $localtax_rate as $tvakey => $tvaval )
{ {
if ($tvakey!=0) // On affiche pas taux 0 if ($tvakey!=0) // On affiche pas taux 0
@ -740,8 +739,8 @@ class pdf_einstein extends ModelePDFCommandes
$tvakey=str_replace('*','',$tvakey); $tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
} }
$totalvat = $outputlangs->transnoentities("TotalLT1".$mysoc->country_code).' '; $totalvat = $outputlangs->transcountrynoentities("TotalLT1",$mysoc->country_code).' ';
$totalvat.=vatrate($tvakey,1).$tvacompl; $totalvat.=vatrate(abs($tvakey),1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
@ -749,14 +748,13 @@ class pdf_einstein extends ModelePDFCommandes
} }
} }
} }
} //}
//Local tax 2 before VAT //Local tax 2 before VAT
if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
{ //{
foreach( $this->localtax2 as $localtax_type => $localtax_rate ) foreach( $this->localtax2 as $localtax_type => $localtax_rate )
{ {
// TODO: Place into a function to control showing by country or study better option if (in_array((string) $localtax_type, array('1','3','5','7'))) continue;
if (in_array((string) $localtax_type, array('1','3','5','7')) && $mysoc->country_code != 'ES') continue;
foreach( $localtax_rate as $tvakey => $tvaval ) foreach( $localtax_rate as $tvakey => $tvaval )
{ {
if ($tvakey!=0) // On affiche pas taux 0 if ($tvakey!=0) // On affiche pas taux 0
@ -774,8 +772,8 @@ class pdf_einstein extends ModelePDFCommandes
$tvakey=str_replace('*','',$tvakey); $tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
} }
$totalvat = $outputlangs->transnoentities("TotalLT2".$mysoc->country_code).' '; $totalvat = $outputlangs->transcountrynoentities("TotalLT2",$mysoc->country_code).' ';
$totalvat.=vatrate($tvakey,1).$tvacompl; $totalvat.=vatrate(abs($tvakey),1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
@ -784,7 +782,7 @@ class pdf_einstein extends ModelePDFCommandes
} }
} }
} }
} //}
// VAT // VAT
foreach($this->tva as $tvakey => $tvaval) foreach($this->tva as $tvakey => $tvaval)
{ {
@ -811,15 +809,15 @@ class pdf_einstein extends ModelePDFCommandes
} }
//Local tax 1 after VAT //Local tax 1 after VAT
if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
{ //{
foreach( $this->localtax1 as $localtax_type => $localtax_rate ) foreach( $this->localtax1 as $localtax_type => $localtax_rate )
{ {
if (in_array((string) $localtax_type, array('2','4','6'))) continue; if (in_array((string) $localtax_type, array('2','4','6'))) continue;
foreach( $localtax_rate as $tvakey => $tvaval ) foreach( $localtax_rate as $tvakey => $tvaval )
{ {
if ($tvakey>0) // On affiche pas taux 0 if ($tvakey != 0) // On affiche pas taux 0
{ {
//$this->atleastoneratenotnull++; //$this->atleastoneratenotnull++;
@ -832,7 +830,7 @@ class pdf_einstein extends ModelePDFCommandes
$tvakey=str_replace('*','',$tvakey); $tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
} }
$totalvat = $outputlangs->transnoentities("TotalLT1".$mysoc->country_code).' '; $totalvat = $outputlangs->transcountrynoentities("TotalLT1",$mysoc->country_code).' ';
if ($localtax_type == '7') { // amount on order if ($localtax_type == '7') { // amount on order
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
@ -841,7 +839,7 @@ class pdf_einstein extends ModelePDFCommandes
} }
else else
{ {
$totalvat.=vatrate($tvakey,1).$tvacompl; $totalvat.=vatrate(abs($tvakey),1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
@ -849,17 +847,17 @@ class pdf_einstein extends ModelePDFCommandes
} }
} }
} }
} //}
//Local tax 2 after VAT //Local tax 2 after VAT
if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
{ //{
foreach( $this->localtax2 as $localtax_type => $localtax_rate ) foreach( $this->localtax2 as $localtax_type => $localtax_rate )
{ {
if (in_array((string) $localtax_type, array('2','4','6'))) continue; if (in_array((string) $localtax_type, array('2','4','6'))) continue;
foreach( $localtax_rate as $tvakey => $tvaval ) foreach( $localtax_rate as $tvakey => $tvaval )
{ {
if ($tvakey>0) // On affiche pas taux 0 if ($tvakey != 0) // On affiche pas taux 0
{ {
//$this->atleastoneratenotnull++; //$this->atleastoneratenotnull++;
@ -872,7 +870,7 @@ class pdf_einstein extends ModelePDFCommandes
$tvakey=str_replace('*','',$tvakey); $tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
} }
$totalvat = $outputlangs->transnoentities("TotalLT2".$mysoc->country_code).' '; $totalvat = $outputlangs->transcountrynoentities("TotalLT2",$mysoc->country_code).' ';
if ($localtax_type == '7') { // amount on order if ($localtax_type == '7') { // amount on order
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
@ -881,7 +879,7 @@ class pdf_einstein extends ModelePDFCommandes
} }
else else
{ {
$totalvat.=vatrate($tvakey,1).$tvacompl; $totalvat.=vatrate(abs($tvakey),1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
@ -890,7 +888,7 @@ class pdf_einstein extends ModelePDFCommandes
} }
} }
} }
} //}
// Total TTC // Total TTC
$index++; $index++;

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2006-2009 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2006-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -220,9 +220,10 @@ class ExportCsv extends ModeleExports
* @param array $array_selected_sorted Array with list of field to export * @param array $array_selected_sorted Array with list of field to export
* @param resource $objp A record from a fetch with all fields from select * @param resource $objp A record from a fetch with all fields from select
* @param Translate $outputlangs Object lang to translate values * @param Translate $outputlangs Object lang to translate values
* @param array $array_types Array with types of fields
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function write_record($array_selected_sorted,$objp,$outputlangs) function write_record($array_selected_sorted,$objp,$outputlangs,$array_types)
{ {
global $conf; global $conf;
@ -241,7 +242,9 @@ class ExportCsv extends ModeleExports
if (strpos($code,' as ') == 0) $alias=str_replace(array('.','-'),'_',$code); if (strpos($code,' as ') == 0) $alias=str_replace(array('.','-'),'_',$code);
else $alias=substr($code, strpos($code, ' as ') + 4); else $alias=substr($code, strpos($code, ' as ') + 4);
if (empty($alias)) dol_print_error('','Bad value for field with key='.$code.'. Try to redefine export.'); if (empty($alias)) dol_print_error('','Bad value for field with key='.$code.'. Try to redefine export.');
$newvalue=$outputlangs->convToOutputCharset($objp->$alias); $newvalue=$outputlangs->convToOutputCharset($objp->$alias);
$typefield=isset($array_types[$code])?$array_types[$code]:'';
// Translation newvalue // Translation newvalue
if (preg_match('/^\((.*)\)$/i',$newvalue,$reg)) if (preg_match('/^\((.*)\)$/i',$newvalue,$reg))

View File

@ -260,9 +260,10 @@ class ExportExcel extends ModeleExports
* @param array $array_selected_sorted Array with list of field to export * @param array $array_selected_sorted Array with list of field to export
* @param resource $objp A record from a fetch with all fields from select * @param resource $objp A record from a fetch with all fields from select
* @param Translate $outputlangs Object lang to translate values * @param Translate $outputlangs Object lang to translate values
* @param array $array_types Array with types of fields
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function write_record($array_selected_sorted,$objp,$outputlangs) function write_record($array_selected_sorted,$objp,$outputlangs,$array_types)
{ {
// Create a format for the column headings // Create a format for the column headings
if (! empty($conf->global->MAIN_USE_PHP_WRITEEXCEL)) if (! empty($conf->global->MAIN_USE_PHP_WRITEEXCEL))
@ -281,6 +282,7 @@ class ExportExcel extends ModeleExports
$newvalue=$objp->$alias; $newvalue=$objp->$alias;
$newvalue=$this->excel_clean($newvalue); $newvalue=$this->excel_clean($newvalue);
$typefield=isset($array_types[$code])?$array_types[$code]:'';
// Traduction newvalue // Traduction newvalue
if (preg_match('/^\((.*)\)$/i',$newvalue,$reg)) if (preg_match('/^\((.*)\)$/i',$newvalue,$reg))
@ -340,7 +342,19 @@ class ExportExcel extends ModeleExports
} }
else else
{ {
$this->workbook->getActiveSheet()->SetCellValueByColumnAndRow($this->col, $this->row+1, $newvalue); if ($typefield == 'Text')
{
//$this->workbook->getActiveSheet()->getCellByColumnAndRow($this->col, $this->row+1)->setValueExplicit($newvalue, PHPExcel_Cell_DataType::TYPE_STRING);
$this->workbook->getActiveSheet()->SetCellValueByColumnAndRow($this->col, $this->row+1, (string) $newvalue);
$coord=$this->workbook->getActiveSheet()->getCellByColumnAndRow($this->col, $this->row+1)->getCoordinate();
$this->workbook->getActiveSheet()->getStyle($coord)->getNumberFormat()->setFormatCode('@');
}
else
{
//$coord=$this->workbook->getActiveSheet()->getCellByColumnAndRow($this->col, $this->row+1)->getCoordinate();
//if ($typefield == 'Text') $this->workbook->getActiveSheet()->getStyle($coord)->getNumberFormat()->setFormatCode('@');
$this->workbook->getActiveSheet()->SetCellValueByColumnAndRow($this->col, $this->row+1, $newvalue);
}
} }
} }
$this->col++; $this->col++;

View File

@ -261,9 +261,10 @@ class ExportExcel2007 extends ExportExcel
* @param array $array_selected_sorted Array with list of field to export * @param array $array_selected_sorted Array with list of field to export
* @param resource $objp A record from a fetch with all fields from select * @param resource $objp A record from a fetch with all fields from select
* @param Translate $outputlangs Object lang to translate values * @param Translate $outputlangs Object lang to translate values
* @param array $array_types Array with types of fields
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function write_record($array_selected_sorted,$objp,$outputlangs) function write_record($array_selected_sorted,$objp,$outputlangs,$array_types)
{ {
// Create a format for the column headings // Create a format for the column headings
if (! empty($conf->global->MAIN_USE_PHP_WRITEEXCEL)) if (! empty($conf->global->MAIN_USE_PHP_WRITEEXCEL))
@ -282,6 +283,7 @@ class ExportExcel2007 extends ExportExcel
$newvalue=$objp->$alias; $newvalue=$objp->$alias;
$newvalue=$this->excel_clean($newvalue); $newvalue=$this->excel_clean($newvalue);
$typefield=isset($array_types[$code])?$array_types[$code]:'';
// Traduction newvalue // Traduction newvalue
if (preg_match('/^\((.*)\)$/i',$newvalue,$reg)) if (preg_match('/^\((.*)\)$/i',$newvalue,$reg))
@ -293,6 +295,8 @@ class ExportExcel2007 extends ExportExcel
$newvalue=$outputlangs->convToOutputCharset($newvalue); $newvalue=$outputlangs->convToOutputCharset($newvalue);
} }
//var_dump($code.' '.$alias.' '.$newvalue.' '.$typefield);
if (preg_match('/^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$/i',$newvalue)) if (preg_match('/^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$/i',$newvalue))
{ {
if (! empty($conf->global->MAIN_USE_PHP_WRITEEXCEL)) if (! empty($conf->global->MAIN_USE_PHP_WRITEEXCEL))
@ -341,7 +345,17 @@ class ExportExcel2007 extends ExportExcel
} }
else else
{ {
$this->workbook->getActiveSheet()->SetCellValueByColumnAndRow($this->col, $this->row+1, $newvalue); if ($typefield == 'Text')
{
//$this->workbook->getActiveSheet()->getCellByColumnAndRow($this->col, $this->row+1)->setValueExplicit($newvalue, PHPExcel_Cell_DataType::TYPE_STRING);
$this->workbook->getActiveSheet()->SetCellValueByColumnAndRow($this->col, $this->row+1, (string) $newvalue);
$coord=$this->workbook->getActiveSheet()->getCellByColumnAndRow($this->col, $this->row+1)->getCoordinate();
$this->workbook->getActiveSheet()->getStyle($coord)->getNumberFormat()->setFormatCode('@');
}
else
{
$this->workbook->getActiveSheet()->SetCellValueByColumnAndRow($this->col, $this->row+1, $newvalue);
}
} }
} }
$this->col++; $this->col++;

View File

@ -189,7 +189,7 @@ class ExportTsv extends ModeleExports
foreach($array_selected_sorted as $code => $value) foreach($array_selected_sorted as $code => $value)
{ {
$newvalue=$outputlangs->transnoentities($array_export_fields_label[$code]); $newvalue=$outputlangs->transnoentities($array_export_fields_label[$code]);
$newvalue=$this->tsv_clean($newvalue); $newvalue=$this->tsv_clean($newvalue,$outputlangs->charset_output);
fwrite($this->handle,$newvalue.$this->separator); fwrite($this->handle,$newvalue.$this->separator);
} }
@ -204,17 +204,22 @@ class ExportTsv extends ModeleExports
* @param array $array_selected_sorted Array with list of field to export * @param array $array_selected_sorted Array with list of field to export
* @param resource $objp A record from a fetch with all fields from select * @param resource $objp A record from a fetch with all fields from select
* @param Translate $outputlangs Object lang to translate values * @param Translate $outputlangs Object lang to translate values
* @param array $array_types Array with types of fields
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function write_record($array_selected_sorted,$objp,$outputlangs) function write_record($array_selected_sorted,$objp,$outputlangs,$array_types)
{ {
global $conf;
$this->col=0; $this->col=0;
foreach($array_selected_sorted as $code => $value) foreach($array_selected_sorted as $code => $value)
{ {
if (strpos($code,' as ') == 0) $alias=str_replace(array('.','-'),'_',$code); if (strpos($code,' as ') == 0) $alias=str_replace(array('.','-'),'_',$code);
else $alias=substr($code, strpos($code, ' as ') + 4); else $alias=substr($code, strpos($code, ' as ') + 4);
if (empty($alias)) dol_print_error('','Bad value for field with code='.$code.'. Try to redefine export.'); if (empty($alias)) dol_print_error('','Bad value for field with code='.$code.'. Try to redefine export.');
$newvalue=$objp->$alias;
$newvalue=$outputlangs->convToOutputCharset($objp->$alias);
$typefield=isset($array_types[$code])?$array_types[$code]:'';
// Translation newvalue // Translation newvalue
if (preg_match('/^\((.*)\)$/i',$newvalue,$reg)) if (preg_match('/^\((.*)\)$/i',$newvalue,$reg))
@ -222,7 +227,7 @@ class ExportTsv extends ModeleExports
$newvalue=$outputlangs->transnoentities($reg[1]); $newvalue=$outputlangs->transnoentities($reg[1]);
} }
$newvalue=$this->tsv_clean($newvalue); $newvalue=$this->tsv_clean($newvalue,$outputlangs->charset_output);
fwrite($this->handle,$newvalue.$this->separator); fwrite($this->handle,$newvalue.$this->separator);
$this->col++; $this->col++;
@ -257,12 +262,13 @@ class ExportTsv extends ModeleExports
* Clean a cell to respect rules of TSV file cells * Clean a cell to respect rules of TSV file cells
* *
* @param string $newvalue String to clean * @param string $newvalue String to clean
* @param string $charset Output character set
* @return string Value cleaned * @return string Value cleaned
*/ */
function tsv_clean($newvalue) function tsv_clean($newvalue, $charset)
{ {
// Rule Dolibarr: No HTML // Rule Dolibarr: No HTML
$newvalue=dol_string_nohtmltag($newvalue); $newvalue=dol_string_nohtmltag($newvalue, 1, $charset);
// Rule 1 TSV: No CR, LF in cells // Rule 1 TSV: No CR, LF in cells
$newvalue=str_replace("\r",'',$newvalue); $newvalue=str_replace("\r",'',$newvalue);

View File

@ -850,12 +850,11 @@ class pdf_crabe extends ModelePDFFactures
else else
{ {
//Local tax 1 before VAT //Local tax 1 before VAT
if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
{ //{
foreach( $this->localtax1 as $localtax_type => $localtax_rate ) foreach( $this->localtax1 as $localtax_type => $localtax_rate )
{ {
// TODO: Place into a function to control showing by country or study better option if (in_array((string) $localtax_type, array('1','3','5','7'))) continue;
if (in_array((string) $localtax_type, array('1','3','5','7')) && $mysoc->country_code != 'ES') continue;
foreach( $localtax_rate as $tvakey => $tvaval ) foreach( $localtax_rate as $tvakey => $tvaval )
{ {
@ -872,8 +871,9 @@ class pdf_crabe extends ModelePDFFactures
$tvakey=str_replace('*','',$tvakey); $tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
} }
$totalvat = $outputlangs->transnoentities("TotalLT1".$mysoc->country_code).' ';
$totalvat.=vatrate($tvakey,1).$tvacompl; $totalvat = $outputlangs->transcountrynoentities("TotalLT1",$mysoc->country_code).' ';
$totalvat.=vatrate(abs($tvakey),1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
@ -881,14 +881,13 @@ class pdf_crabe extends ModelePDFFactures
} }
} }
} }
} //}
//Local tax 2 before VAT //Local tax 2 before VAT
if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
{ //{
foreach( $this->localtax2 as $localtax_type => $localtax_rate ) foreach( $this->localtax2 as $localtax_type => $localtax_rate )
{ {
// TODO: Place into a function to control showing by country or study better option if (in_array((string) $localtax_type, array('1','3','5','7'))) continue;
if (in_array((string) $localtax_type, array('1','3','5','7')) && $mysoc->country_code != 'ES') continue;
foreach( $localtax_rate as $tvakey => $tvaval ) foreach( $localtax_rate as $tvakey => $tvaval )
{ {
@ -907,8 +906,8 @@ class pdf_crabe extends ModelePDFFactures
$tvakey=str_replace('*','',$tvakey); $tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
} }
$totalvat = $outputlangs->transnoentities("TotalLT2".$mysoc->country_code).' '; $totalvat = $outputlangs->transcountrynoentities("TotalLT2",$mysoc->country_code).' ';
$totalvat.=vatrate($tvakey,1).$tvacompl; $totalvat.=vatrate(abs($tvakey),1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
@ -917,7 +916,7 @@ class pdf_crabe extends ModelePDFFactures
} }
} }
} }
} //}
// VAT // VAT
foreach($this->tva as $tvakey => $tvaval) foreach($this->tva as $tvakey => $tvaval)
{ {
@ -944,15 +943,15 @@ class pdf_crabe extends ModelePDFFactures
} }
//Local tax 1 after VAT //Local tax 1 after VAT
if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
{ //{
foreach( $this->localtax1 as $localtax_type => $localtax_rate ) foreach( $this->localtax1 as $localtax_type => $localtax_rate )
{ {
if (in_array((string) $localtax_type, array('2','4','6'))) continue; if (in_array((string) $localtax_type, array('2','4','6'))) continue;
foreach( $localtax_rate as $tvakey => $tvaval ) foreach( $localtax_rate as $tvakey => $tvaval )
{ {
if ($tvakey>0) // On affiche pas taux 0 if ($tvakey != 0) // On affiche pas taux 0
{ {
//$this->atleastoneratenotnull++; //$this->atleastoneratenotnull++;
@ -965,7 +964,7 @@ class pdf_crabe extends ModelePDFFactures
$tvakey=str_replace('*','',$tvakey); $tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
} }
$totalvat = $outputlangs->transnoentities("TotalLT1".$mysoc->country_code).' '; $totalvat = $outputlangs->transcountrynoentities("TotalLT1",$mysoc->country_code).' ';
if ($localtax_type == '7') { // amount on order if ($localtax_type == '7') { // amount on order
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
@ -974,7 +973,7 @@ class pdf_crabe extends ModelePDFFactures
} }
else else
{ {
$totalvat.=vatrate($tvakey,1).$tvacompl; $totalvat.=vatrate(abs($tvakey),1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
@ -982,10 +981,10 @@ class pdf_crabe extends ModelePDFFactures
} }
} }
} }
} //}
//Local tax 2 after VAT //Local tax 2 after VAT
if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
{ //{
foreach( $this->localtax2 as $localtax_type => $localtax_rate ) foreach( $this->localtax2 as $localtax_type => $localtax_rate )
{ {
if (in_array((string) $localtax_type, array('2','4','6'))) continue; if (in_array((string) $localtax_type, array('2','4','6'))) continue;
@ -993,7 +992,7 @@ class pdf_crabe extends ModelePDFFactures
foreach( $localtax_rate as $tvakey => $tvaval ) foreach( $localtax_rate as $tvakey => $tvaval )
{ {
// retrieve global local tax // retrieve global local tax
if ($tvakey>0) // On affiche pas taux 0 if ($tvakey != 0) // On affiche pas taux 0
{ {
//$this->atleastoneratenotnull++; //$this->atleastoneratenotnull++;
@ -1006,7 +1005,7 @@ class pdf_crabe extends ModelePDFFactures
$tvakey=str_replace('*','',$tvakey); $tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
} }
$totalvat = $outputlangs->transnoentities("TotalLT2".$mysoc->country_code).' '; $totalvat = $outputlangs->transcountrynoentities("TotalLT2",$mysoc->country_code).' ';
if ($localtax_type == '7') { // amount on order if ($localtax_type == '7') { // amount on order
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
@ -1015,7 +1014,7 @@ class pdf_crabe extends ModelePDFFactures
} }
else else
{ {
$totalvat.=vatrate($tvakey,1).$tvacompl; $totalvat.=vatrate(abs($tvakey),1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
@ -1023,7 +1022,7 @@ class pdf_crabe extends ModelePDFFactures
} }
} }
} }
} //}
} }
// Total TTC // Total TTC

View File

@ -200,7 +200,7 @@ class mailing_contacts1 extends MailingTargets
// La requete doit retourner: id, email, fk_contact, name, firstname, other // La requete doit retourner: id, email, fk_contact, name, firstname, other
$sql = "SELECT c.rowid as id, c.email as email, c.rowid as fk_contact,"; $sql = "SELECT c.rowid as id, c.email as email, c.rowid as fk_contact,";
$sql.= " c.name as name, c.firstname as firstname, c.civilite,"; $sql.= " c.lastname, c.firstname, c.civilite,";
$sql.= " s.nom as companyname"; $sql.= " s.nom as companyname";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c,"; $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c,";
$sql.= " ".MAIN_DB_PREFIX."societe as s"; $sql.= " ".MAIN_DB_PREFIX."societe as s";
@ -238,7 +238,7 @@ class mailing_contacts1 extends MailingTargets
$cibles[$j] = array( $cibles[$j] = array(
'email' => $obj->email, 'email' => $obj->email,
'fk_contact' => $obj->fk_contact, 'fk_contact' => $obj->fk_contact,
'name' => $obj->name, 'lastname' => $obj->lastname,
'firstname' => $obj->firstname, 'firstname' => $obj->firstname,
'other' => 'other' =>
($langs->transnoentities("ThirdParty").'='.$obj->companyname).';'. ($langs->transnoentities("ThirdParty").'='.$obj->companyname).';'.

View File

@ -104,7 +104,7 @@ class mailing_contacts3 extends MailingTargets
$target[] = array( $target[] = array(
'email' => $obj->email, 'email' => $obj->email,
'fk_contact' => $obj->fk_contact, 'fk_contact' => $obj->fk_contact,
'name' => $obj->name, 'lastname' => $obj->lastname,
'firstname' => $obj->firstname, 'firstname' => $obj->firstname,
'other' => 'other' =>
($langs->transnoentities("ThirdParty").'='.$obj->companyname).';'. ($langs->transnoentities("ThirdParty").'='.$obj->companyname).';'.

View File

@ -197,7 +197,7 @@ class mailing_fraise extends MailingTargets
$cibles[$j] = array( $cibles[$j] = array(
'email' => $obj->email, 'email' => $obj->email,
'fk_contact' => $obj->fk_contact, 'fk_contact' => $obj->fk_contact,
'name' => $obj->name, 'lastname' => $obj->lastname,
'firstname' => $obj->firstname, 'firstname' => $obj->firstname,
'other' => 'other' =>
($langs->transnoentities("Login").'='.$obj->login).';'. ($langs->transnoentities("Login").'='.$obj->login).';'.

View File

@ -95,7 +95,7 @@ class mailing_framboise extends MailingTargets
$cibles[$j] = array( $cibles[$j] = array(
'email' => $obj->email, 'email' => $obj->email,
'fk_contact' => $obj->fk_contact, 'fk_contact' => $obj->fk_contact,
'name' => $obj->name, 'lastname' => $obj->lastname,
'firstname' => $obj->firstname, 'firstname' => $obj->firstname,
'other' => ($obj->label?$langs->transnoentities("Category").'='.$obj->label:''), 'other' => ($obj->label?$langs->transnoentities("Category").'='.$obj->label:''),
'source_url' => $this->url($obj->id), 'source_url' => $this->url($obj->id),

View File

@ -176,7 +176,7 @@ class mailing_pomme extends MailingTargets
$cibles[$j] = array( $cibles[$j] = array(
'email' => $obj->email, 'email' => $obj->email,
'fk_contact' => $obj->fk_contact, 'fk_contact' => $obj->fk_contact,
'name' => $obj->name, 'lastname' => $obj->lastname,
'firstname' => $obj->firstname, 'firstname' => $obj->firstname,
'other' => 'other' =>
($langs->transnoentities("Login").'='.$obj->login).';'. ($langs->transnoentities("Login").'='.$obj->login).';'.

View File

@ -105,7 +105,7 @@ class mailing_thirdparties extends MailingTargets
$cibles[$j] = array( $cibles[$j] = array(
'email' => $obj->email, 'email' => $obj->email,
'fk_contact' => $obj->fk_contact, 'fk_contact' => $obj->fk_contact,
'name' => $obj->name, 'lastname' => $obj->lastname,
'firstname' => $obj->firstname, 'firstname' => $obj->firstname,
'other' => ($obj->label?$langs->transnoentities("Category").'='.$obj->label:''), 'other' => ($obj->label?$langs->transnoentities("Category").'='.$obj->label:''),
'source_url' => $this->url($obj->id), 'source_url' => $this->url($obj->id),

View File

@ -122,7 +122,7 @@ class mailing_thirdparties_services_expired extends MailingTargets
{ {
$cibles[$j] = array( $cibles[$j] = array(
'email' => $obj->email, 'email' => $obj->email,
'name' => $obj->name, 'lastname' => $obj->lastname,
'other' => 'other' =>
('StartDate='.dol_print_date($this->db->jdate($obj->date_ouverture),'day')).';'. ('StartDate='.dol_print_date($this->db->jdate($obj->date_ouverture),'day')).';'.
('EndDate='.dol_print_date($this->db->jdate($obj->date_fin_validite),'day')).';'. ('EndDate='.dol_print_date($this->db->jdate($obj->date_fin_validite),'day')).';'.

View File

@ -5,6 +5,7 @@
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org> * Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be> * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2009-2011 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2009-2011 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Cedric Gross <c.gross@kreiz-it.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -85,6 +86,7 @@ class modAgenda extends DolibarrModules
$this->const[11] = array("MAIN_AGENDA_ACTIONAUTO_BILL_SUPPLIER_VALIDATE","chaine","1"); $this->const[11] = array("MAIN_AGENDA_ACTIONAUTO_BILL_SUPPLIER_VALIDATE","chaine","1");
$this->const[12] = array("MAIN_AGENDA_ACTIONAUTO_SHIPPING_VALIDATE","chaine","1"); $this->const[12] = array("MAIN_AGENDA_ACTIONAUTO_SHIPPING_VALIDATE","chaine","1");
$this->const[13] = array("MAIN_AGENDA_ACTIONAUTO_SHIPPING_SENTBYMAIL","chaine","1"); $this->const[13] = array("MAIN_AGENDA_ACTIONAUTO_SHIPPING_SENTBYMAIL","chaine","1");
$this->const[14] = array("MAIN_AGENDA_ACTIONAUTO_BILL_UNVALIDATE","chaine","1");
// New pages on tabs // New pages on tabs
// ----------------- // -----------------

View File

@ -109,9 +109,9 @@ class modCategorie extends DolibarrModules
$this->export_icon[$r]='category'; $this->export_icon[$r]='category';
$this->export_enabled[$r]='$conf->fournisseur->enabled'; $this->export_enabled[$r]='$conf->fournisseur->enabled';
$this->export_permission[$r]=array(array("categorie","lire"),array("fournisseur","lire")); $this->export_permission[$r]=array(array("categorie","lire"),array("fournisseur","lire"));
$this->export_fields_array[$r]=array('u.rowid'=>"CategId",'u.label'=>"Label",'u.description'=>"Description",'s.rowid'=>'IdThirdParty','s.nom'=>'Name','s.prefix_comm'=>"Prefix",'s.client'=>"Customer",'s.datec'=>"DateCreation",'s.tms'=>"DateLastModification",'s.code_client'=>"CustomerCode",'s.address'=>"Address",'s.zip'=>"Zip",'s.town'=>"Town",'p.libelle'=>"Country",'p.code'=>"CountryCode",'s.tel'=>"Phone",'s.fax'=>"Fax",'s.url'=>"Url",'s.email'=>"Email",'s.siret'=>"ProfId1",'s.siren'=>"ProfId2",'s.ape'=>"ProfId3",'s.idprof4'=>"ProfId4",'s.tva_intra'=>"VATIntraShort",'s.capital'=>"Capital",'s.note'=>"Note"); $this->export_fields_array[$r]=array('u.rowid'=>"CategId",'u.label'=>"Label",'u.description'=>"Description",'s.rowid'=>'IdThirdParty','s.nom'=>'Name','s.prefix_comm'=>"Prefix",'s.client'=>"Customer",'s.datec'=>"DateCreation",'s.tms'=>"DateLastModification",'s.code_client'=>"CustomerCode",'s.address'=>"Address",'s.zip'=>"Zip",'s.town'=>"Town",'p.libelle'=>"Country",'p.code'=>"CountryCode",'s.phone'=>"Phone",'s.fax'=>"Fax",'s.url'=>"Url",'s.email'=>"Email",'s.siret'=>"ProfId1",'s.siren'=>"ProfId2",'s.ape'=>"ProfId3",'s.idprof4'=>"ProfId4",'s.tva_intra'=>"VATIntraShort",'s.capital'=>"Capital",'s.note'=>"Note");
$this->export_TypeFields_array[$r]=array('u.label'=>"Text",'u.description'=>"Text",'s.rowid'=>'List:societe:nom','s.nom'=>'Text','s.prefix_comm'=>"Text",'s.client'=>"Text",'s.datec'=>"Date",'s.tms'=>"Date",'s.code_client'=>"Text",'s.address'=>"Text",'s.zip'=>"Text",'s.town'=>"Text",'p.libelle'=>"List:c_pays:libelle:rowid",'p.code'=>"Text",'s.tel'=>"Text",'s.fax'=>"Text",'s.url'=>"Text",'s.email'=>"Text",'s.siret'=>"Text",'s.siren'=>"Text",'s.ape'=>"Text",'s.idprof4'=>"Text",'s.tva_intra'=>"Text",'s.capital'=>"Numeric",'s.note'=>"Text"); $this->export_TypeFields_array[$r]=array('u.label'=>"Text",'u.description'=>"Text",'s.rowid'=>'List:societe:nom','s.nom'=>'Text','s.prefix_comm'=>"Text",'s.client'=>"Text",'s.datec'=>"Date",'s.tms'=>"Date",'s.code_client'=>"Text",'s.address'=>"Text",'s.zip'=>"Text",'s.town'=>"Text",'p.libelle'=>"List:c_pays:libelle:rowid",'p.code'=>"Text",'s.phone'=>"Text",'s.fax'=>"Text",'s.url'=>"Text",'s.email'=>"Text",'s.siret'=>"Text",'s.siren'=>"Text",'s.ape'=>"Text",'s.idprof4'=>"Text",'s.tva_intra'=>"Text",'s.capital'=>"Numeric",'s.note'=>"Text");
$this->export_entities_array[$r]=array('s.rowid'=>'company','s.nom'=>'company','s.prefix_comm'=>"company",'s.client'=>"company",'s.datec'=>"company",'s.tms'=>"company",'s.code_client'=>"company",'s.address'=>"company",'s.zip'=>"company",'s.town'=>"company",'p.libelle'=>"company",'p.code'=>"company",'s.tel'=>"company",'s.fax'=>"company",'s.url'=>"company",'s.email'=>"company",'s.siret'=>"company",'s.siren'=>"company",'s.ape'=>"company",'s.idprof4'=>"company",'s.tva_intra'=>"company",'s.capital'=>"company",'s.note'=>"company"); // We define here only fields that use another picto $this->export_entities_array[$r]=array('s.rowid'=>'company','s.nom'=>'company','s.prefix_comm'=>"company",'s.client'=>"company",'s.datec'=>"company",'s.tms'=>"company",'s.code_client'=>"company",'s.address'=>"company",'s.zip'=>"company",'s.town'=>"company",'p.libelle'=>"company",'p.code'=>"company",'s.phone'=>"company",'s.fax'=>"company",'s.url'=>"company",'s.email'=>"company",'s.siret'=>"company",'s.siren'=>"company",'s.ape'=>"company",'s.idprof4'=>"company",'s.tva_intra'=>"company",'s.capital'=>"company",'s.note'=>"company"); // We define here only fields that use another picto
$this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_start[$r]='SELECT DISTINCT ';
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'categorie as u, '.MAIN_DB_PREFIX.'categorie_fournisseur as cf, '.MAIN_DB_PREFIX.'societe as s LEFT JOIN '.MAIN_DB_PREFIX.'c_typent as t ON s.fk_typent = t.id LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as p ON s.fk_pays = p.rowid LEFT JOIN '.MAIN_DB_PREFIX.'c_effectif as ce ON s.fk_effectif = ce.id LEFT JOIN '.MAIN_DB_PREFIX.'c_forme_juridique as cfj ON s.fk_forme_juridique = cfj.code'; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'categorie as u, '.MAIN_DB_PREFIX.'categorie_fournisseur as cf, '.MAIN_DB_PREFIX.'societe as s LEFT JOIN '.MAIN_DB_PREFIX.'c_typent as t ON s.fk_typent = t.id LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as p ON s.fk_pays = p.rowid LEFT JOIN '.MAIN_DB_PREFIX.'c_effectif as ce ON s.fk_effectif = ce.id LEFT JOIN '.MAIN_DB_PREFIX.'c_forme_juridique as cfj ON s.fk_forme_juridique = cfj.code';
$this->export_sql_end[$r] .=' WHERE u.rowid = cf.fk_categorie AND cf.fk_societe = s.rowid'; $this->export_sql_end[$r] .=' WHERE u.rowid = cf.fk_categorie AND cf.fk_societe = s.rowid';
@ -124,9 +124,9 @@ class modCategorie extends DolibarrModules
$this->export_icon[$r]='category'; $this->export_icon[$r]='category';
$this->export_enabled[$r]='$conf->societe->enabled'; $this->export_enabled[$r]='$conf->societe->enabled';
$this->export_permission[$r]=array(array("categorie","lire"),array("societe","lire")); $this->export_permission[$r]=array(array("categorie","lire"),array("societe","lire"));
$this->export_fields_array[$r]=array('u.rowid'=>"CategId",'u.label'=>"Label",'u.description'=>"Description",'s.rowid'=>'IdThirdParty','s.nom'=>'Name','s.prefix_comm'=>"Prefix",'s.client'=>"Customer",'s.datec'=>"DateCreation",'s.tms'=>"DateLastModification",'s.code_client'=>"CustomerCode",'s.address'=>"Address",'s.zip'=>"Zip",'s.town'=>"Town",'p.libelle'=>"Country",'p.code'=>"CountryCode",'s.tel'=>"Phone",'s.fax'=>"Fax",'s.url'=>"Url",'s.email'=>"Email",'s.siret'=>"ProfId1",'s.siren'=>"ProfId2",'s.ape'=>"ProfId3",'s.idprof4'=>"ProfId4",'s.tva_intra'=>"VATIntraShort",'s.capital'=>"Capital",'s.note'=>"Note",'s.fk_prospectlevel'=>'ProspectLevel','s.fk_stcomm'=>'ProspectStatus'); $this->export_fields_array[$r]=array('u.rowid'=>"CategId",'u.label'=>"Label",'u.description'=>"Description",'s.rowid'=>'IdThirdParty','s.nom'=>'Name','s.prefix_comm'=>"Prefix",'s.client'=>"Customer",'s.datec'=>"DateCreation",'s.tms'=>"DateLastModification",'s.code_client'=>"CustomerCode",'s.address'=>"Address",'s.zip'=>"Zip",'s.town'=>"Town",'p.libelle'=>"Country",'p.code'=>"CountryCode",'s.phone'=>"Phone",'s.fax'=>"Fax",'s.url'=>"Url",'s.email'=>"Email",'s.siret'=>"ProfId1",'s.siren'=>"ProfId2",'s.ape'=>"ProfId3",'s.idprof4'=>"ProfId4",'s.tva_intra'=>"VATIntraShort",'s.capital'=>"Capital",'s.note'=>"Note",'s.fk_prospectlevel'=>'ProspectLevel','s.fk_stcomm'=>'ProspectStatus');
$this->export_TypeFields_array[$r]=array('u.label'=>"Text",'u.description'=>"Text",'s.rowid'=>'List:societe:nom','s.nom'=>'Text','s.prefix_comm'=>"Text",'s.client'=>"Text",'s.datec'=>"Date",'s.tms'=>"Date",'s.code_client'=>"Text",'s.address'=>"Text",'s.zip'=>"Text",'s.town'=>"Text",'p.libelle'=>"List:c_pays:libelle:rowid",'p.code'=>"Text",'s.tel'=>"Text",'s.fax'=>"Text",'s.url'=>"Text",'s.email'=>"Text",'s.siret'=>"Text",'s.siren'=>"Text",'s.ape'=>"Text",'s.idprof4'=>"Text",'s.tva_intra'=>"Text",'s.capital'=>"Numeric",'s.note'=>"Text",'s.fk_prospectlevel'=>'List:c_prospectlevel:label:code','s.fk_stcomm'=>'List:c_stcomm:libelle:code'); $this->export_TypeFields_array[$r]=array('u.label'=>"Text",'u.description'=>"Text",'s.rowid'=>'List:societe:nom','s.nom'=>'Text','s.prefix_comm'=>"Text",'s.client'=>"Text",'s.datec'=>"Date",'s.tms'=>"Date",'s.code_client'=>"Text",'s.address'=>"Text",'s.zip'=>"Text",'s.town'=>"Text",'p.libelle'=>"List:c_pays:libelle:rowid",'p.code'=>"Text",'s.phone'=>"Text",'s.fax'=>"Text",'s.url'=>"Text",'s.email'=>"Text",'s.siret'=>"Text",'s.siren'=>"Text",'s.ape'=>"Text",'s.idprof4'=>"Text",'s.tva_intra'=>"Text",'s.capital'=>"Numeric",'s.note'=>"Text",'s.fk_prospectlevel'=>'List:c_prospectlevel:label:code','s.fk_stcomm'=>'List:c_stcomm:libelle:code');
$this->export_entities_array[$r]=array('s.rowid'=>'company','s.nom'=>'company','s.prefix_comm'=>"company",'s.client'=>"company",'s.datec'=>"company",'s.tms'=>"company",'s.code_client'=>"company",'s.address'=>"company",'s.zip'=>"company",'s.town'=>"company",'p.libelle'=>"company",'p.code'=>"company",'s.tel'=>"company",'s.fax'=>"company",'s.url'=>"company",'s.email'=>"company",'s.siret'=>"company",'s.siren'=>"company",'s.ape'=>"company",'s.idprof4'=>"company",'s.tva_intra'=>"company",'s.capital'=>"company",'s.note'=>"company",'s.fk_prospectlevel'=>'company','s.fk_stcomm'=>'company'); // We define here only fields that use another picto $this->export_entities_array[$r]=array('s.rowid'=>'company','s.nom'=>'company','s.prefix_comm'=>"company",'s.client'=>"company",'s.datec'=>"company",'s.tms'=>"company",'s.code_client'=>"company",'s.address'=>"company",'s.zip'=>"company",'s.town'=>"company",'p.libelle'=>"company",'p.code'=>"company",'s.phone'=>"company",'s.fax'=>"company",'s.url'=>"company",'s.email'=>"company",'s.siret'=>"company",'s.siren'=>"company",'s.ape'=>"company",'s.idprof4'=>"company",'s.tva_intra'=>"company",'s.capital'=>"company",'s.note'=>"company",'s.fk_prospectlevel'=>'company','s.fk_stcomm'=>'company'); // We define here only fields that use another picto
$this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_start[$r]='SELECT DISTINCT ';
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'categorie as u, '.MAIN_DB_PREFIX.'categorie_societe as cf, '.MAIN_DB_PREFIX.'societe as s LEFT JOIN '.MAIN_DB_PREFIX.'c_typent as t ON s.fk_typent = t.id LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as p ON s.fk_pays = p.rowid LEFT JOIN '.MAIN_DB_PREFIX.'c_effectif as ce ON s.fk_effectif = ce.id LEFT JOIN '.MAIN_DB_PREFIX.'c_forme_juridique as cfj ON s.fk_forme_juridique = cfj.code'; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'categorie as u, '.MAIN_DB_PREFIX.'categorie_societe as cf, '.MAIN_DB_PREFIX.'societe as s LEFT JOIN '.MAIN_DB_PREFIX.'c_typent as t ON s.fk_typent = t.id LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as p ON s.fk_pays = p.rowid LEFT JOIN '.MAIN_DB_PREFIX.'c_effectif as ce ON s.fk_effectif = ce.id LEFT JOIN '.MAIN_DB_PREFIX.'c_forme_juridique as cfj ON s.fk_forme_juridique = cfj.code';
$this->export_sql_end[$r] .=' WHERE u.rowid = cf.fk_categorie AND cf.fk_societe = s.rowid'; $this->export_sql_end[$r] .=' WHERE u.rowid = cf.fk_categorie AND cf.fk_societe = s.rowid';

View File

@ -173,10 +173,10 @@ class modCommande extends DolibarrModules
$this->export_code[$r]=$this->rights_class.'_'.$r; $this->export_code[$r]=$this->rights_class.'_'.$r;
$this->export_label[$r]='CustomersOrdersAndOrdersLines'; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_label[$r]='CustomersOrdersAndOrdersLines'; // Translation key (used only if key ExportDataset_xxx_z not found)
$this->export_permission[$r]=array(array("commande","commande","export")); $this->export_permission[$r]=array(array("commande","commande","export"));
$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.tel'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','c.rowid'=>"Id",'c.ref'=>"Ref",'c.ref_client'=>"RefCustomer",'c.fk_soc'=>"IdCompany",'c.date_creation'=>"DateCreation",'c.date_commande'=>"OrderDate",'c.amount_ht'=>"Amount",'c.remise_percent'=>"GlobalDiscount",'c.total_ht'=>"TotalHT",'c.total_ttc'=>"TotalTTC",'c.facture'=>"Billed",'c.fk_statut'=>'Status','c.note'=>"Note",'c.date_livraison'=>'DeliveryDate','cd.rowid'=>'LineId','cd.label'=>"Label",'cd.description'=>"LineDescription",'cd.product_type'=>'TypeOfLineServiceOrProduct','cd.tva_tx'=>"LineVATRate",'cd.qty'=>"LineQty",'cd.total_ht'=>"LineTotalHT",'cd.total_tva'=>"LineTotalVAT",'cd.total_ttc'=>"LineTotalTTC",'p.rowid'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel'); $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','c.rowid'=>"Id",'c.ref'=>"Ref",'c.ref_client'=>"RefCustomer",'c.fk_soc'=>"IdCompany",'c.date_creation'=>"DateCreation",'c.date_commande'=>"OrderDate",'c.amount_ht'=>"Amount",'c.remise_percent'=>"GlobalDiscount",'c.total_ht'=>"TotalHT",'c.total_ttc'=>"TotalTTC",'c.facture'=>"Billed",'c.fk_statut'=>'Status','c.note'=>"Note",'c.date_livraison'=>'DeliveryDate','cd.rowid'=>'LineId','cd.label'=>"Label",'cd.description'=>"LineDescription",'cd.product_type'=>'TypeOfLineServiceOrProduct','cd.tva_tx'=>"LineVATRate",'cd.qty'=>"LineQty",'cd.total_ht'=>"LineTotalHT",'cd.total_tva'=>"LineTotalVAT",'cd.total_ttc'=>"LineTotalTTC",'p.rowid'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel');
//$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.libelle'=>'List:c_pays:libelle:rowid','s.tel'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_client'=>"Text",'c.date_creation'=>"Date",'c.date_commande'=>"Date",'c.amount_ht'=>"Number",'c.remise_percent'=>"Number",'c.total_ht'=>"Number",'c.total_ttc'=>"Number",'c.facture'=>"Boolean",'c.fk_statut'=>'Status','c.note'=>"Text",'c.date_livraison'=>'Date','cd.description'=>"Text",'cd.product_type'=>'Boolean','cd.tva_tx'=>"Number",'cd.qty'=>"Number",'cd.total_ht'=>"Number",'cd.total_tva'=>"Number",'cd.total_ttc'=>"Number",'p.rowid'=>'List:Product:ref','p.ref'=>'Text','p.label'=>'Text'); //$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.libelle'=>'List:c_pays:libelle:rowid','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_client'=>"Text",'c.date_creation'=>"Date",'c.date_commande'=>"Date",'c.amount_ht'=>"Number",'c.remise_percent'=>"Number",'c.total_ht'=>"Number",'c.total_ttc'=>"Number",'c.facture'=>"Boolean",'c.fk_statut'=>'Status','c.note'=>"Text",'c.date_livraison'=>'Date','cd.description'=>"Text",'cd.product_type'=>'Boolean','cd.tva_tx'=>"Number",'cd.qty'=>"Number",'cd.total_ht'=>"Number",'cd.total_tva'=>"Number",'cd.total_ttc'=>"Number",'p.rowid'=>'List:Product:ref','p.ref'=>'Text','p.label'=>'Text');
$this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.libelle'=>'List:c_pays:libelle:rowid','s.tel'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_client'=>"Text",'c.date_creation'=>"Date",'c.date_commande'=>"Date",'c.amount_ht'=>"Number",'c.remise_percent'=>"Number",'c.total_ht'=>"Number",'c.total_ttc'=>"Number",'c.facture'=>"Boolean",'c.fk_statut'=>'Status','c.note'=>"Text",'c.date_livraison'=>'Date','cd.description'=>"Text",'cd.product_type'=>'Boolean','cd.tva_tx'=>"Number",'cd.qty'=>"Number",'cd.total_ht'=>"Number",'cd.total_tva'=>"Number",'cd.total_ttc'=>"Number",'p.rowid'=>'List:Product:ref','p.ref'=>'Text','p.label'=>'Text'); $this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.libelle'=>'List:c_pays:libelle:rowid','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_client'=>"Text",'c.date_creation'=>"Date",'c.date_commande'=>"Date",'c.amount_ht'=>"Number",'c.remise_percent'=>"Number",'c.total_ht'=>"Number",'c.total_ttc'=>"Number",'c.facture'=>"Boolean",'c.fk_statut'=>'Status','c.note'=>"Text",'c.date_livraison'=>'Date','cd.description'=>"Text",'cd.product_type'=>'Boolean','cd.tva_tx'=>"Number",'cd.qty'=>"Number",'cd.total_ht'=>"Number",'cd.total_tva'=>"Number",'cd.total_ttc'=>"Number",'p.rowid'=>'List:Product:ref','p.ref'=>'Text','p.label'=>'Text');
$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.tel'=>'company','s.siren'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.siret'=>'company','c.rowid'=>"order",'c.ref'=>"order",'c.ref_client'=>"order",'c.fk_soc'=>"order",'c.date_creation'=>"order",'c.date_commande'=>"order",'c.amount_ht'=>"order",'c.remise_percent'=>"order",'c.total_ht'=>"order",'c.total_ttc'=>"order",'c.facture'=>"order",'c.fk_statut'=>"order",'c.note'=>"order",'c.date_livraison'=>"order",'cd.rowid'=>'order_line','cd.label'=>"order_line",'cd.description'=>"order_line",'cd.product_type'=>'order_line','cd.tva_tx'=>"order_line",'cd.qty'=>"order_line",'cd.total_ht'=>"order_line",'cd.total_tva'=>"order_line",'cd.total_ttc'=>"order_line",'p.rowid'=>'product','p.ref'=>'product','p.label'=>'product'); $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.ape'=>'company','s.idprof4'=>'company','s.siret'=>'company','c.rowid'=>"order",'c.ref'=>"order",'c.ref_client'=>"order",'c.fk_soc'=>"order",'c.date_creation'=>"order",'c.date_commande'=>"order",'c.amount_ht'=>"order",'c.remise_percent'=>"order",'c.total_ht'=>"order",'c.total_ttc'=>"order",'c.facture'=>"order",'c.fk_statut'=>"order",'c.note'=>"order",'c.date_livraison'=>"order",'cd.rowid'=>'order_line','cd.label'=>"order_line",'cd.description'=>"order_line",'cd.product_type'=>'order_line','cd.tva_tx'=>"order_line",'cd.qty'=>"order_line",'cd.total_ht'=>"order_line",'cd.total_tva'=>"order_line",'cd.total_ttc'=>"order_line",'p.rowid'=>'product','p.ref'=>'product','p.label'=>'product');
$this->export_dependencies_array[$r]=array('order_line'=>'cd.rowid','product'=>'cd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them $this->export_dependencies_array[$r]=array('order_line'=>'cd.rowid','product'=>'cd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them
$this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_start[$r]='SELECT DISTINCT ';

View File

@ -200,10 +200,10 @@ class modExpedition extends DolibarrModules
$this->export_code[$r]=$this->rights_class.'_'.$r; $this->export_code[$r]=$this->rights_class.'_'.$r;
$this->export_label[$r]='Shipments'; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_label[$r]='Shipments'; // Translation key (used only if key ExportDataset_xxx_z not found)
$this->export_permission[$r]=array(array("expedition","shipment","export")); $this->export_permission[$r]=array(array("expedition","shipment","export"));
$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.tel'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.idprof5'=>'ProfId5','s.idprof6'=>'ProfId6','c.rowid'=>"Id",'c.ref'=>"Ref",'c.ref_customer'=>"RefCustomer",'c.fk_soc'=>"IdCompany",'c.date_creation'=>"DateCreation",'c.date_delivery'=>"DateSending",'c.tracking_number'=>"TrackingNumber",'c.height'=>"Height",'c.width'=>"Width",'c.size'=>"Depth",'c.size_units'=>'SizeUnits','c.weight'=>"Weight",'c.weight_units'=>"WeightUnits",'c.fk_statut'=>'Status','c.note'=>"Note",'ed.rowid'=>'LineId','cd.description'=>'Description','ed.qty'=>"Qty",'p.rowid'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel'); $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.idprof5'=>'ProfId5','s.idprof6'=>'ProfId6','c.rowid'=>"Id",'c.ref'=>"Ref",'c.ref_customer'=>"RefCustomer",'c.fk_soc'=>"IdCompany",'c.date_creation'=>"DateCreation",'c.date_delivery'=>"DateSending",'c.tracking_number'=>"TrackingNumber",'c.height'=>"Height",'c.width'=>"Width",'c.size'=>"Depth",'c.size_units'=>'SizeUnits','c.weight'=>"Weight",'c.weight_units'=>"WeightUnits",'c.fk_statut'=>'Status','c.note'=>"Note",'ed.rowid'=>'LineId','cd.description'=>'Description','ed.qty'=>"Qty",'p.rowid'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel');
//$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.libelle'=>'List:c_pays:libelle:rowid','s.tel'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_client'=>"Text",'c.date_creation'=>"Date",'c.date_commande'=>"Date",'c.amount_ht'=>"Number",'c.remise_percent'=>"Number",'c.total_ht'=>"Number",'c.total_ttc'=>"Number",'c.facture'=>"Boolean",'c.fk_statut'=>'Status','c.note'=>"Text",'c.date_livraison'=>'Date','ed.qty'=>"Text"); //$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.libelle'=>'List:c_pays:libelle:rowid','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_client'=>"Text",'c.date_creation'=>"Date",'c.date_commande'=>"Date",'c.amount_ht'=>"Number",'c.remise_percent'=>"Number",'c.total_ht'=>"Number",'c.total_ttc'=>"Number",'c.facture'=>"Boolean",'c.fk_statut'=>'Status','c.note'=>"Text",'c.date_livraison'=>'Date','ed.qty'=>"Text");
$this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.libelle'=>'List:c_pays:libelle:rowid','s.tel'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_customer'=>"Text",'c.date_creation'=>"Date",'c.date_delivery'=>"Date",'c.tracking_number'=>"Number",'c.height'=>"Number",'c.width'=>"Number",'c.weight'=>"Number",'c.fk_statut'=>'Status','c.note'=>"Text",'ed.qty'=>"Number"); $this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.libelle'=>'List:c_pays:libelle:rowid','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_customer'=>"Text",'c.date_creation'=>"Date",'c.date_delivery'=>"Date",'c.tracking_number'=>"Number",'c.height'=>"Number",'c.width'=>"Number",'c.weight'=>"Number",'c.fk_statut'=>'Status','c.note'=>"Text",'ed.qty'=>"Number");
$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.tel'=>'company','s.siren'=>'company','s.ape'=>'company','s.siret'=>'company','s.idprof4'=>'company','s.idprof5'=>'company','s.idprof6'=>'company','c.rowid'=>"shipment",'c.ref'=>"shipment",'c.ref_customer'=>"shipment",'c.fk_soc'=>"shipment",'c.date_creation'=>"shipment",'c.date_delivery'=>"shipment",'c.tracking_number'=>'shipment','c.height'=>"shipment",'c.width'=>"shipment",'c.size'=>'shipment','c.size_units'=>'shipment','c.weight'=>"shipment",'c.weight_units'=>'shipment','c.fk_statut'=>"shipment",'c.note'=>"shipment",'ed.rowid'=>'shipment_line','cd.description'=>'shipment_line','ed.qty'=>"shipment_line",'p.rowid'=>'product','p.ref'=>'product','p.label'=>'product'); $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.ape'=>'company','s.siret'=>'company','s.idprof4'=>'company','s.idprof5'=>'company','s.idprof6'=>'company','c.rowid'=>"shipment",'c.ref'=>"shipment",'c.ref_customer'=>"shipment",'c.fk_soc'=>"shipment",'c.date_creation'=>"shipment",'c.date_delivery'=>"shipment",'c.tracking_number'=>'shipment','c.height'=>"shipment",'c.width'=>"shipment",'c.size'=>'shipment','c.size_units'=>'shipment','c.weight'=>"shipment",'c.weight_units'=>'shipment','c.fk_statut'=>"shipment",'c.note'=>"shipment",'ed.rowid'=>'shipment_line','cd.description'=>'shipment_line','ed.qty'=>"shipment_line",'p.rowid'=>'product','p.ref'=>'product','p.label'=>'product');
$this->export_dependencies_array[$r]=array('shipment_line'=>'ed.rowid','product'=>'ed.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them $this->export_dependencies_array[$r]=array('shipment_line'=>'ed.rowid','product'=>'ed.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them
$this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_start[$r]='SELECT DISTINCT ';

View File

@ -178,10 +178,10 @@ class modFacture extends DolibarrModules
$this->export_label[$r]='CustomersInvoicesAndInvoiceLines'; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_label[$r]='CustomersInvoicesAndInvoiceLines'; // Translation key (used only if key ExportDataset_xxx_z not found)
$this->export_icon[$r]='bill'; $this->export_icon[$r]='bill';
$this->export_permission[$r]=array(array("facture","facture","export")); $this->export_permission[$r]=array(array("facture","facture","export"));
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode','s.tel'=>'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.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.date_lim_reglement'=>"DateDue",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note'=>"NotePrivate",'f.note_public'=>"NotePublic",'fd.rowid'=>'LineId','fd.label'=>"Label",'fd.description'=>"LineDescription",'fd.price'=>"LineUnitPrice",'fd.tva_tx'=>"LineVATRate",'fd.qty'=>"LineQty",'fd.total_ht'=>"LineTotalHT",'fd.total_tva'=>"LineTotalVAT",'fd.total_ttc'=>"LineTotalTTC",'fd.date_start'=>"DateStart",'fd.date_end'=>"DateEnd",'fd.product_type'=>"TypeOfLineServiceOrProduct",'fd.fk_product'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel'); $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','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.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.date_lim_reglement'=>"DateDue",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note'=>"NotePrivate",'f.note_public'=>"NotePublic",'fd.rowid'=>'LineId','fd.label'=>"Label",'fd.description'=>"LineDescription",'fd.price'=>"LineUnitPrice",'fd.tva_tx'=>"LineVATRate",'fd.qty'=>"LineQty",'fd.total_ht'=>"LineTotalHT",'fd.total_tva'=>"LineTotalVAT",'fd.total_ttc'=>"LineTotalTTC",'fd.date_start'=>"DateStart",'fd.date_end'=>"DateEnd",'fd.product_type'=>"TypeOfLineServiceOrProduct",'fd.fk_product'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel');
//$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.tel'=>'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.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note'=>"Text",'f.note_public'=>"Text",'fd.description'=>"Text",'fd.price'=>"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.product_type'=>"Numeric",'fd.fk_product'=>'List:Product:label','p.ref'=>'Text','p.label'=>'Text'); //$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'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.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note'=>"Text",'f.note_public'=>"Text",'fd.description'=>"Text",'fd.price'=>"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.product_type'=>"Numeric",'fd.fk_product'=>'List:Product:label','p.ref'=>'Text','p.label'=>'Text');
$this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.tel'=>'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.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note'=>"Text",'f.note_public'=>"Text",'fd.description'=>"Text",'fd.price'=>"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.product_type'=>"Numeric",'fd.fk_product'=>'List:Product:label','p.ref'=>'Text','p.label'=>'Text'); $this->export_TypeFields_array[$r]=array('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.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note'=>"Text",'f.note_public'=>"Text",'fd.description'=>"Text",'fd.price'=>"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.product_type'=>"Numeric",'fd.fk_product'=>'List:Product:label','p.ref'=>'Text','p.label'=>'Text');
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','c.code'=>'company','s.tel'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.date_lim_reglement'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note'=>"invoice",'f.note_public'=>"invoice",'fd.rowid'=>'invoice_line','fd.label'=>"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.product_type'=>'invoice_line','fd.fk_product'=>'product','p.ref'=>'product','p.label'=>'product'); $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','c.code'=>'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','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.date_lim_reglement'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note'=>"invoice",'f.note_public'=>"invoice",'fd.rowid'=>'invoice_line','fd.label'=>"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.product_type'=>'invoice_line','fd.fk_product'=>'product','p.ref'=>'product','p.label'=>'product');
$this->export_dependencies_array[$r]=array('invoice_line'=>'fd.rowid','product'=>'fd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them $this->export_dependencies_array[$r]=array('invoice_line'=>'fd.rowid','product'=>'fd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them
$this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_start[$r]='SELECT DISTINCT ';
@ -198,10 +198,10 @@ class modFacture extends DolibarrModules
$this->export_label[$r]='CustomersInvoicesAndPayments'; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_label[$r]='CustomersInvoicesAndPayments'; // Translation key (used only if key ExportDataset_xxx_z not found)
$this->export_icon[$r]='bill'; $this->export_icon[$r]='bill';
$this->export_permission[$r]=array(array("facture","facture","export")); $this->export_permission[$r]=array(array("facture","facture","export"));
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode','s.tel'=>'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.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.date_lim_reglement'=>"DateDue",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note'=>"NotePrivate",'f.note_public'=>"NotePublic",'p.rowid'=>'PaymentId','pf.amount'=>'AmountPayment','p.datep'=>'DatePayment','p.num_paiement'=>'PaymentNumber'); $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','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.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.date_lim_reglement'=>"DateDue",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note'=>"NotePrivate",'f.note_public'=>"NotePublic",'p.rowid'=>'PaymentId','pf.amount'=>'AmountPayment','p.datep'=>'DatePayment','p.num_paiement'=>'PaymentNumber');
//$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.tel'=>'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'=>"List:facture:facnumber",'f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Number",'f.total_ttc'=>"Number",'f.tva'=>"Number",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note'=>"Text",'f.note_public'=>"Text",'pf.amount'=>'Number','p.datep'=>'Date','p.num_paiement'=>'Number'); //$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'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.rowid'=>"List:facture:facnumber",'f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Number",'f.total_ttc'=>"Number",'f.tva'=>"Number",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note'=>"Text",'f.note_public'=>"Text",'pf.amount'=>'Number','p.datep'=>'Date','p.num_paiement'=>'Number');
$this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.tel'=>'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'=>"List:facture:facnumber",'f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Number",'f.total_ttc'=>"Number",'f.tva'=>"Number",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note'=>"Text",'f.note_public'=>"Text",'pf.amount'=>'Number','p.datep'=>'Date','p.num_paiement'=>'Number'); $this->export_TypeFields_array[$r]=array('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.rowid'=>"List:facture:facnumber",'f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Number",'f.total_ttc'=>"Number",'f.tva'=>"Number",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note'=>"Text",'f.note_public'=>"Text",'pf.amount'=>'Number','p.datep'=>'Date','p.num_paiement'=>'Number');
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','c.code'=>'company','s.tel'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.date_lim_reglement'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note'=>"invoice",'f.note_public'=>"invoice",'p.rowid'=>'payment','pf.amount'=>'payment','p.datep'=>'payment','p.num_paiement'=>'payment'); $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','c.code'=>'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','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.date_lim_reglement'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note'=>"invoice",'f.note_public'=>"invoice",'p.rowid'=>'payment','pf.amount'=>'payment','p.datep'=>'payment','p.num_paiement'=>'payment');
$this->export_dependencies_array[$r]=array('payment'=>'p.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them $this->export_dependencies_array[$r]=array('payment'=>'p.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them
$this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_start[$r]='SELECT DISTINCT ';

View File

@ -138,10 +138,10 @@ class modFicheinter extends DolibarrModules
$this->export_code[$r]=$this->rights_class.'_'.$r; $this->export_code[$r]=$this->rights_class.'_'.$r;
$this->export_label[$r]='InterventionCardsAndInterventionLines'; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_label[$r]='InterventionCardsAndInterventionLines'; // Translation key (used only if key ExportDataset_xxx_z not found)
$this->export_permission[$r]=array(array("ficheinter","export")); $this->export_permission[$r]=array(array("ficheinter","export"));
$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.tel'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','f.rowid'=>"InterId",'f.ref'=>"InterRef",'f.datec'=>"InterDateCreation",'f.duree'=>"InterDuration",'f.fk_statut'=>'InterStatus','f.description'=>"InterNote",'fd.rowid'=>'InterLineId','fd.date'=>"InterLineDate",'fd.duree'=>"InterLineDuration",'fd.description'=>"InterLineDesc"); $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'=>"InterId",'f.ref'=>"InterRef",'f.datec'=>"InterDateCreation",'f.duree'=>"InterDuration",'f.fk_statut'=>'InterStatus','f.description'=>"InterNote",'fd.rowid'=>'InterLineId','fd.date'=>"InterLineDate",'fd.duree'=>"InterLineDuration",'fd.description'=>"InterLineDesc");
//$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.fk_pays'=>'List:c_pays:libelle','s.tel'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','f.ref'=>"Text",'f.datec'=>"Date",'f.duree'=>"Duree",'f.fk_statut'=>'Statut','f.description'=>"Text",'f.datee'=>"Date",'f.dateo'=>"Date",'f.fulldayevent'=>"Boolean",'fd.date'=>"Date",'fd.duree'=>"Duree",'fd.description'=>"Text",'fd.total_ht'=>"Numeric"); //$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.fk_pays'=>'List:c_pays:libelle','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','f.ref'=>"Text",'f.datec'=>"Date",'f.duree'=>"Duree",'f.fk_statut'=>'Statut','f.description'=>"Text",'f.datee'=>"Date",'f.dateo'=>"Date",'f.fulldayevent'=>"Boolean",'fd.date'=>"Date",'fd.duree'=>"Duree",'fd.description'=>"Text",'fd.total_ht'=>"Numeric");
$this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.fk_pays'=>'List:c_pays:libelle','s.tel'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','f.ref'=>"Text",'f.datec'=>"Date",'f.duree'=>"Duree",'f.fk_statut'=>'Statut','f.description'=>"Text",'f.datee'=>"Date",'f.dateo'=>"Date",'f.fulldayevent'=>"Boolean",'fd.date'=>"Date",'fd.duree'=>"Duree",'fd.description'=>"Text",'fd.total_ht'=>"Numeric"); $this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.fk_pays'=>'List:c_pays:libelle','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','f.ref'=>"Text",'f.datec'=>"Date",'f.duree'=>"Duree",'f.fk_statut'=>'Statut','f.description'=>"Text",'f.datee'=>"Date",'f.dateo'=>"Date",'f.fulldayevent'=>"Boolean",'fd.date'=>"Date",'fd.duree'=>"Duree",'fd.description'=>"Text",'fd.total_ht'=>"Numeric");
$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.tel'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','f.rowid'=>"intervention",'f.ref'=>"intervention",'f.datec'=>"intervention",'f.duree'=>"intervention",'f.fk_statut'=>"intervention",'f.description'=>"intervention",'fd.rowid'=>"inter_line",'fd.date'=>"inter_line",'fd.duree'=>'inter_line','fd.description'=>'inter_line'); $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'=>"intervention",'f.ref'=>"intervention",'f.datec'=>"intervention",'f.duree'=>"intervention",'f.fk_statut'=>"intervention",'f.description'=>"intervention",'fd.rowid'=>"inter_line",'fd.date'=>"inter_line",'fd.duree'=>'inter_line','fd.description'=>'inter_line');
$this->export_dependencies_array[$r]=array('inter_line'=>'fd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them $this->export_dependencies_array[$r]=array('inter_line'=>'fd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them
$this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_start[$r]='SELECT DISTINCT ';

View File

@ -242,10 +242,10 @@ class modFournisseur extends DolibarrModules
$this->export_label[$r]='Factures fournisseurs et lignes de facture'; $this->export_label[$r]='Factures fournisseurs et lignes de facture';
$this->export_icon[$r]='bill'; $this->export_icon[$r]='bill';
$this->export_permission[$r]=array(array("fournisseur","facture","export")); $this->export_permission[$r]=array(array("fournisseur","facture","export"));
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode','s.tel'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.idprof5'=>'ProfId5','s.idprof6'=>'ProfId6','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.total_ht'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.total_tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note'=>"InvoiceNote",'fd.rowid'=>'LineId','fd.description'=>"LineDescription",'fd.tva_tx'=>"LineVATRate",'fd.qty'=>"LineQty",'fd.remise_percent'=>"Discount",'fd.total_ht'=>"LineTotalHT",'fd.total_ttc'=>"LineTotalTTC",'fd.tva'=>"LineTotalVAT",'fd.product_type'=>'TypeOfLineServiceOrProduct','fd.fk_product'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel'); $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','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.idprof5'=>'ProfId5','s.idprof6'=>'ProfId6','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.total_ht'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.total_tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note'=>"InvoiceNote",'fd.rowid'=>'LineId','fd.description'=>"LineDescription",'fd.tva_tx'=>"LineVATRate",'fd.qty'=>"LineQty",'fd.remise_percent'=>"Discount",'fd.total_ht'=>"LineTotalHT",'fd.total_ttc'=>"LineTotalTTC",'fd.tva'=>"LineTotalVAT",'fd.product_type'=>'TypeOfLineServiceOrProduct','fd.fk_product'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel');
//$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:CompanyName",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.tel'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.tva_intra'=>'Text','f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.total_ht'=>"Number",'f.total_ttc'=>"Number",'f.total_tva'=>"Number",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note'=>"Text",'fd.description'=>"Text",'fd.tva_tx'=>"Text",'fd.qty'=>"Number",'fd.total_ht'=>"Number",'fd.total_ttc'=>"Number",'fd.tva'=>"Number",'fd.product_type'=>'Boolean','fd.fk_product'=>'List:Product:label','p.ref'=>'Text','p.label'=>'Text'); //$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:CompanyName",'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.tva_intra'=>'Text','f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.total_ht'=>"Number",'f.total_ttc'=>"Number",'f.total_tva'=>"Number",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note'=>"Text",'fd.description'=>"Text",'fd.tva_tx'=>"Text",'fd.qty'=>"Number",'fd.total_ht'=>"Number",'fd.total_ttc'=>"Number",'fd.tva'=>"Number",'fd.product_type'=>'Boolean','fd.fk_product'=>'List:Product:label','p.ref'=>'Text','p.label'=>'Text');
$this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.tel'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.tva_intra'=>'Text','f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.total_ht'=>"Number",'f.total_ttc'=>"Number",'f.total_tva'=>"Number",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note'=>"Text",'fd.description'=>"Text",'fd.tva_tx'=>"Text",'fd.qty'=>"Number",'fd.total_ht'=>"Number",'fd.total_ttc'=>"Number",'fd.tva'=>"Number",'fd.product_type'=>'Boolean','fd.fk_product'=>'List:Product:label','p.ref'=>'Text','p.label'=>'Text'); $this->export_TypeFields_array[$r]=array('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.tva_intra'=>'Text','f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.total_ht'=>"Number",'f.total_ttc'=>"Number",'f.total_tva'=>"Number",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note'=>"Text",'fd.description'=>"Text",'fd.tva_tx'=>"Text",'fd.qty'=>"Number",'fd.total_ht'=>"Number",'fd.total_ttc'=>"Number",'fd.tva'=>"Number",'fd.product_type'=>'Boolean','fd.fk_product'=>'List:Product:label','p.ref'=>'Text','p.label'=>'Text');
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','c.code'=>'company','s.tel'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.idprof5'=>'company','s.idprof6'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.total_ht'=>"invoice",'f.total_ttc'=>"invoice",'f.total_tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note'=>"invoice",'fd.rowid'=>'invoice_line','fd.description'=>"invoice_line",'fd.tva_tx'=>"invoice_line",'fd.qty'=>"invoice_line",'fd.remise_percent'=>"invoice_line",'fd.total_ht'=>"invoice_line",'fd.total_ttc'=>"invoice_line",'fd.tva'=>"invoice_line",'fd.product_type'=>'invoice_line','fd.fk_product'=>'product','p.ref'=>'product','p.label'=>'product'); $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','c.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.idprof5'=>'company','s.idprof6'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.total_ht'=>"invoice",'f.total_ttc'=>"invoice",'f.total_tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note'=>"invoice",'fd.rowid'=>'invoice_line','fd.description'=>"invoice_line",'fd.tva_tx'=>"invoice_line",'fd.qty'=>"invoice_line",'fd.remise_percent'=>"invoice_line",'fd.total_ht'=>"invoice_line",'fd.total_ttc'=>"invoice_line",'fd.tva'=>"invoice_line",'fd.product_type'=>'invoice_line','fd.fk_product'=>'product','p.ref'=>'product','p.label'=>'product');
$this->export_dependencies_array[$r]=array('invoice_line'=>'fd.rowid','product'=>'fd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them $this->export_dependencies_array[$r]=array('invoice_line'=>'fd.rowid','product'=>'fd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them
$this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_start[$r]='SELECT DISTINCT ';
@ -261,10 +261,10 @@ class modFournisseur extends DolibarrModules
$this->export_label[$r]='Factures fournisseurs et reglements'; $this->export_label[$r]='Factures fournisseurs et reglements';
$this->export_icon[$r]='bill'; $this->export_icon[$r]='bill';
$this->export_permission[$r]=array(array("fournisseur","facture","export")); $this->export_permission[$r]=array(array("fournisseur","facture","export"));
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode','s.tel'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.idprof5'=>'ProfId5','s.idprof6'=>'ProfId6','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.total_ht'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.total_tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note'=>"InvoiceNote",'p.rowid'=>'PaymentId','pf.amount'=>'AmountPayment','p.datep'=>'DatePayment','p.num_paiement'=>'PaymentNumber'); $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','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.idprof5'=>'ProfId5','s.idprof6'=>'ProfId6','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.total_ht'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.total_tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note'=>"InvoiceNote",'p.rowid'=>'PaymentId','pf.amount'=>'AmountPayment','p.datep'=>'DatePayment','p.num_paiement'=>'PaymentNumber');
//$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:CompanyName",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.tel'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.tva_intra'=>'Text','f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.total_ht'=>"Number",'f.total_ttc'=>"Number",'f.total_tva'=>"Number",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note'=>"Text",'pf.amount'=>'Number','p.datep'=>'Date','p.num_paiement'=>'Number'); //$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:CompanyName",'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.tva_intra'=>'Text','f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.total_ht'=>"Number",'f.total_ttc'=>"Number",'f.total_tva'=>"Number",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note'=>"Text",'pf.amount'=>'Number','p.datep'=>'Date','p.num_paiement'=>'Number');
$this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.tel'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.tva_intra'=>'Text','f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.total_ht'=>"Number",'f.total_ttc'=>"Number",'f.total_tva'=>"Number",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note'=>"Text",'pf.amount'=>'Number','p.datep'=>'Date','p.num_paiement'=>'Number'); $this->export_TypeFields_array[$r]=array('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.tva_intra'=>'Text','f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.total_ht'=>"Number",'f.total_ttc'=>"Number",'f.total_tva'=>"Number",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note'=>"Text",'pf.amount'=>'Number','p.datep'=>'Date','p.num_paiement'=>'Number');
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','c.code'=>'company','s.tel'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.idprof5'=>'company','s.idprof6'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.total_ht'=>"invoice",'f.total_ttc'=>"invoice",'f.total_tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note'=>"invoice",'p.rowid'=>'payment','pf.amount'=>'payment','p.datep'=>'payment','p.num_paiement'=>'payment'); $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','c.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.idprof5'=>'company','s.idprof6'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.total_ht'=>"invoice",'f.total_ttc'=>"invoice",'f.total_tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note'=>"invoice",'p.rowid'=>'payment','pf.amount'=>'payment','p.datep'=>'payment','p.num_paiement'=>'payment');
$this->export_dependencies_array[$r]=array('payment'=>'p.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them $this->export_dependencies_array[$r]=array('payment'=>'p.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them
$this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_start[$r]='SELECT DISTINCT ';
@ -281,9 +281,9 @@ class modFournisseur extends DolibarrModules
$this->export_label[$r]='Commandes fournisseurs et lignes de commandes'; $this->export_label[$r]='Commandes fournisseurs et lignes de commandes';
$this->export_icon[$r]='order'; $this->export_icon[$r]='order';
$this->export_permission[$r]=array(array("fournisseur","commande","export")); $this->export_permission[$r]=array(array("fournisseur","commande","export"));
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode','s.tel'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.idprof5'=>'ProfId5','s.idprof6'=>'ProfId6','s.tva_intra'=>'VATIntra','f.rowid'=>"OrderId",'f.ref'=>"Ref",'f.ref_supplier'=>"RefSupplier",'f.date_creation'=>"DateCreation",'f.date_commande'=>"OrderDate",'f.total_ht'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.fk_statut'=>'Status','f.note'=>"Note",'fd.rowid'=>'LineId','fd.description'=>"LineDescription",'fd.tva_tx'=>"LineVATRate",'fd.qty'=>"LineQty",'fd.remise_percent'=>"Discount",'fd.total_ht'=>"LineTotalHT",'fd.total_ttc'=>"LineTotalTTC",'fd.total_tva'=>"LineTotalVAT",'fd.product_type'=>'TypeOfLineServiceOrProduct','fd.fk_product'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel'); $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','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.idprof5'=>'ProfId5','s.idprof6'=>'ProfId6','s.tva_intra'=>'VATIntra','f.rowid'=>"OrderId",'f.ref'=>"Ref",'f.ref_supplier'=>"RefSupplier",'f.date_creation'=>"DateCreation",'f.date_commande'=>"OrderDate",'f.total_ht'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.fk_statut'=>'Status','f.note'=>"Note",'fd.rowid'=>'LineId','fd.description'=>"LineDescription",'fd.tva_tx'=>"LineVATRate",'fd.qty'=>"LineQty",'fd.remise_percent'=>"Discount",'fd.total_ht'=>"LineTotalHT",'fd.total_ttc'=>"LineTotalTTC",'fd.total_tva'=>"LineTotalVAT",'fd.product_type'=>'TypeOfLineServiceOrProduct','fd.fk_product'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel');
//$this->export_TypeFields_array[$r]=array(); // TODO add fields type //$this->export_TypeFields_array[$r]=array(); // TODO add fields type
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','c.code'=>'company','s.tel'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.idprof5'=>'company','s.idprof6'=>'company','s.tva_intra'=>'company','f.rowid'=>"order",'f.ref'=>"order",'f.ref_supplier'=>"order",'f.date_creation'=>"order",'f.date_commande'=>"order",'f.total_ht'=>"order",'f.total_ttc'=>"order",'f.tva'=>"order",'f.fk_statut'=>'order','f.note'=>"order",'fd.rowid'=>'order_line','fd.description'=>"order_line",'fd.tva_tx'=>"order_line",'fd.qty'=>"order_line",'fd.remise_percent'=>"order_line",'fd.total_ht'=>"order_line",'fd.total_ttc'=>"order_line",'fd.total_tva'=>"order_line",'fd.product_type'=>'order_line','fd.fk_product'=>'product','p.ref'=>'product','p.label'=>'product'); $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','c.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.idprof5'=>'company','s.idprof6'=>'company','s.tva_intra'=>'company','f.rowid'=>"order",'f.ref'=>"order",'f.ref_supplier'=>"order",'f.date_creation'=>"order",'f.date_commande'=>"order",'f.total_ht'=>"order",'f.total_ttc'=>"order",'f.tva'=>"order",'f.fk_statut'=>'order','f.note'=>"order",'fd.rowid'=>'order_line','fd.description'=>"order_line",'fd.tva_tx'=>"order_line",'fd.qty'=>"order_line",'fd.remise_percent'=>"order_line",'fd.total_ht'=>"order_line",'fd.total_ttc'=>"order_line",'fd.total_tva'=>"order_line",'fd.product_type'=>'order_line','fd.fk_product'=>'product','p.ref'=>'product','p.label'=>'product');
$this->export_dependencies_array[$r]=array('order_line'=>'fd.rowid','product'=>'fd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them $this->export_dependencies_array[$r]=array('order_line'=>'fd.rowid','product'=>'fd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them
$this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_start[$r]='SELECT DISTINCT ';

View File

@ -168,8 +168,8 @@ class modGravatar extends DolibarrModules
// $this->export_code[$r]=$this->rights_class.'_'.$r; // $this->export_code[$r]=$this->rights_class.'_'.$r;
// $this->export_label[$r]='CustomersInvoicesAndInvoiceLines'; // Translation key (used only if key ExportDataset_xxx_z not found) // $this->export_label[$r]='CustomersInvoicesAndInvoiceLines'; // Translation key (used only if key ExportDataset_xxx_z not found)
// $this->export_permission[$r]=array(array("facture","facture","export")); // $this->export_permission[$r]=array(array("facture","facture","export"));
// $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.cp'=>'Zip','s.town'=>'Town','s.fk_pays'=>'Country','s.tel'=>'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.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'); // $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",'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');
// $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.cp'=>'company','s.town'=>'company','s.fk_pays'=>'company','s.tel'=>'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.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'); // $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.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');
// $this->export_sql_start[$r]='SELECT DISTINCT '; // $this->export_sql_start[$r]='SELECT DISTINCT ';
// $this->export_sql_end[$r] =' FROM ('.MAIN_DB_PREFIX.'facture as f, '.MAIN_DB_PREFIX.'facturedet as fd, '.MAIN_DB_PREFIX.'societe as s)'; // $this->export_sql_end[$r] =' FROM ('.MAIN_DB_PREFIX.'facture as f, '.MAIN_DB_PREFIX.'facturedet as fd, '.MAIN_DB_PREFIX.'societe as s)';
// $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)'; // $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)';

View File

@ -265,9 +265,9 @@ class modHoliday extends DolibarrModules
// $this->export_code[$r]=$this->rights_class.'_'.$r; // $this->export_code[$r]=$this->rights_class.'_'.$r;
// $this->export_label[$r]='CustomersInvoicesAndInvoiceLines'; // Translation key (used only if key ExportDataset_xxx_z not found) // $this->export_label[$r]='CustomersInvoicesAndInvoiceLines'; // Translation key (used only if key ExportDataset_xxx_z not found)
// $this->export_permission[$r]=array(array("facture","facture","export")); // $this->export_permission[$r]=array(array("facture","facture","export"));
// $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.tel'=>'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.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'); // $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",'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');
// $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.tel'=>'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.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'); // $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.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');
// $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.tel'=>'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",'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','p.ref'=>'productref'); // $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",'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','p.ref'=>'productref');
// $this->export_sql_start[$r]='SELECT DISTINCT '; // $this->export_sql_start[$r]='SELECT DISTINCT ';
// $this->export_sql_end[$r] =' FROM ('.MAIN_DB_PREFIX.'facture as f, '.MAIN_DB_PREFIX.'facturedet as fd, '.MAIN_DB_PREFIX.'societe as s)'; // $this->export_sql_end[$r] =' FROM ('.MAIN_DB_PREFIX.'facture as f, '.MAIN_DB_PREFIX.'facturedet as fd, '.MAIN_DB_PREFIX.'societe as s)';
// $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)'; // $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)';

View File

@ -164,8 +164,8 @@ class modPayBox extends DolibarrModules
// $this->export_code[$r]=$this->rights_class.'_'.$r; // $this->export_code[$r]=$this->rights_class.'_'.$r;
// $this->export_label[$r]='CustomersInvoicesAndInvoiceLines'; // Translation key (used only if key ExportDataset_xxx_z not found) // $this->export_label[$r]='CustomersInvoicesAndInvoiceLines'; // Translation key (used only if key ExportDataset_xxx_z not found)
// $this->export_permission[$r]=array(array("facture","facture","export")); // $this->export_permission[$r]=array(array("facture","facture","export"));
// $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.tel'=>'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.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'); // $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",'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');
// $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.tel'=>'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.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'); // $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.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');
// $this->export_sql_start[$r]='SELECT DISTINCT '; // $this->export_sql_start[$r]='SELECT DISTINCT ';
// $this->export_sql_end[$r] =' FROM ('.MAIN_DB_PREFIX.'facture as f, '.MAIN_DB_PREFIX.'facturedet as fd, '.MAIN_DB_PREFIX.'societe as s)'; // $this->export_sql_end[$r] =' FROM ('.MAIN_DB_PREFIX.'facture as f, '.MAIN_DB_PREFIX.'facturedet as fd, '.MAIN_DB_PREFIX.'societe as s)';
// $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)'; // $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)';

View File

@ -156,8 +156,8 @@ class modPaypal extends DolibarrModules
// $this->export_code[$r]=$this->rights_class.'_'.$r; // $this->export_code[$r]=$this->rights_class.'_'.$r;
// $this->export_label[$r]='CustomersInvoicesAndInvoiceLines'; // Translation key (used only if key ExportDataset_xxx_z not found) // $this->export_label[$r]='CustomersInvoicesAndInvoiceLines'; // Translation key (used only if key ExportDataset_xxx_z not found)
// $this->export_permission[$r]=array(array("facture","facture","export")); // $this->export_permission[$r]=array(array("facture","facture","export"));
// $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.tel'=>'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.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'); // $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",'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');
// $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.tel'=>'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.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'); // $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.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');
// $this->export_sql_start[$r]='SELECT DISTINCT '; // $this->export_sql_start[$r]='SELECT DISTINCT ';
// $this->export_sql_end[$r] =' FROM ('.MAIN_DB_PREFIX.'facture as f, '.MAIN_DB_PREFIX.'facturedet as fd, '.MAIN_DB_PREFIX.'societe as s)'; // $this->export_sql_end[$r] =' FROM ('.MAIN_DB_PREFIX.'facture as f, '.MAIN_DB_PREFIX.'facturedet as fd, '.MAIN_DB_PREFIX.'societe as s)';
// $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)'; // $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)';

View File

@ -0,0 +1,145 @@
<?php
/*
*
* 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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/** \defgroup printipp Module printipp
* \brief Module pour imprimer via CUPS
*/
/**
* \file htdocs/core/modules/modPrintIPP.class.php
* \ingroup printipp
* \brief Fichier de description et activation du module OSCommerce2
*/
include_once(DOL_DOCUMENT_ROOT ."/core/modules/DolibarrModules.class.php");
/**
* \class modPrintIPP
* \brief Classe de description et activation du module PrintIPP
*/
class modPrintIPP extends DolibarrModules
{
/**
* \brief Constructeur. Definit les noms, constantes et boites
* \param DB handler d'acces base
*/
function __construct($db)
{
$this->db = $db ;
$this->numero = 54000;
// Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
// It is used to group modules in module setup page
$this->family = "other";
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Print via Cups IPP Printer.";
$this->version = 'experimental'; // 'development' or 'experimental' or 'dolibarr' or version
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
$this->special = 1;
// Name of image file used for this module.
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
// If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module'
$this->picto = 'technic';
// Data directories to create when module is enabled.
$this->dirs = array();
// Config pages
$this->config_page_url = array("printipp.php@printipp");
// Dependances
$this->depends = array();
$this->requiredby = array();
$this->phpmin = array(5,1); // Minimum version of PHP required by module
$this->need_dolibarr_version = array(3,2); // Minimum version of Dolibarr required by module
$this->conflictwith = array();
$this->langfiles = array("printipp");
// Constantes
$this->const = array();
// Boxes
$this->boxes = array();
// Permissions
$this->rights = array();
$this->rights_class = 'printipp';
$r=0;
// $this->rights[$r][0] Id permission (unique tous modules confondus)
// $this->rights[$r][1] Libelle par defaut si traduction de cle "PermissionXXX" non trouvee (XXX = Id permission)
// $this->rights[$r][2] Non utilise
// $this->rights[$r][3] 1=Permis par defaut, 0=Non permis par defaut
// $this->rights[$r][4] Niveau 1 pour nommer permission dans code
// $this->rights[$r][5] Niveau 2 pour nommer permission dans code
$r++;
$this->rights[$r][0] = 54001;
$this->rights[$r][1] = 'Printer';
$this->rights[$r][2] = 'r';
$this->rights[$r][3] = 1;
$this->rights[$r][4] = 'use';
// Main menu entries
$this->menus = array(); // List of menus to add
$r=0;
// This is to declare the Top Menu entry:
$this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=home', // Put 0 if this is a top menu
'type'=>'left', // This is a Top menu entry
'titre'=>'Printer',
'mainmenu'=>'printer',
'url'=>'/printipp/index.php',
'langs'=>'printipp', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>100,
'enabled'=>'$conf->printipp->enabled',
'perms'=>'$user->rights->printipp->use', // Use 'perms'=>'1' if you want your menu with no permission rules
'target'=>'',
'user'=>0); // 0=Menu for internal users, 1=external users, 2=both
$r++;
}
/**
* \brief Fonction appelee lors de l'activation du module. Insere en base les constantes, boites, permissions du module.
* Definit egalement les repertoires de donnees a creer pour ce module.
*/
function init()
{
$sql = array("CREATE TABLE IF NOT EXISTS llx_printer_ipp (rowid int(11) NOT NULL AUTO_INCREMENT,printer_name text NOT NULL, printer_location text NOT NULL,printer_uri varchar(256) NOT NULL,copy int(11) NOT NULL DEFAULT '1',module varchar(16) NOT NULL,login varchar(32) NOT NULL,PRIMARY KEY (rowid)) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;");
return $this->_init($sql);
}
/**
* \brief Fonction appelee lors de la desactivation d'un module.
* Supprime de la base les constantes, boites et permissions du module.
*/
function remove()
{
$sql = array();
return $this->_remove($sql);
}
}
?>

View File

@ -148,18 +148,18 @@ class modProjet extends DolibarrModules
$this->export_label[$r]='ProjectsAndTasksLines'; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_label[$r]='ProjectsAndTasksLines'; // Translation key (used only if key ExportDataset_xxx_z not found)
$this->export_permission[$r]=array(array("projet","export")); $this->export_permission[$r]=array(array("projet","export"));
$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', $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.tel'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode', 's.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode',
'p.rowid'=>"ProjectId",'p.ref'=>"ProjectRef",'p.datec'=>"DateCreation",'p.dateo'=>"DateDebutProjet",'p.datee'=>"DateFinProjet",'p.fk_statut'=>'ProjectStatus','p.description'=>"projectNote", 'p.rowid'=>"ProjectId",'p.ref'=>"ProjectRef",'p.datec'=>"DateCreation",'p.dateo'=>"DateDebutProjet",'p.datee'=>"DateFinProjet",'p.fk_statut'=>'ProjectStatus','p.description'=>"projectNote",
'pt.rowid'=>'RefTask','pt.dateo'=>"TaskDateo",'pt.datee'=>"TaskDatee",'pt.duration_effective'=>"DurationEffective",'pt.duration_planned'=>"DurationPlanned",'pt.progress'=>"Progress",'pt.description'=>"TaskDesc"); 'pt.rowid'=>'RefTask','pt.dateo'=>"TaskDateo",'pt.datee'=>"TaskDatee",'pt.duration_effective'=>"DurationEffective",'pt.duration_planned'=>"DurationPlanned",'pt.progress'=>"Progress",'pt.description'=>"TaskDesc");
//$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.fk_pays'=>'List:c_pays:libelle', //$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.fk_pays'=>'List:c_pays:libelle',
$this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.fk_pays'=>'List:c_pays:libelle', $this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.fk_pays'=>'List:c_pays:libelle',
's.tel'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'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',
'p.rowid'=>"List:projet:ref",'p.ref'=>"Text",'p.datec'=>"Date",'p.dateo'=>"Date",'p.datee'=>"Date",'p.fk_statut'=>'Status','p.description'=>"Text", 'p.rowid'=>"List:projet:ref",'p.ref'=>"Text",'p.datec'=>"Date",'p.dateo'=>"Date",'p.datee'=>"Date",'p.fk_statut'=>'Status','p.description'=>"Text",
'pt.dateo'=>"Date",'pt.datee'=>"Date",'pt.duration_effective'=>"Duree",'pt.duration_planned'=>"Duree",'pt.progress'=>"Number",'pt.description'=>"Text"); 'pt.dateo'=>"Date",'pt.datee'=>"Date",'pt.duration_effective'=>"Duree",'pt.duration_planned'=>"Duree",'pt.progress'=>"Number",'pt.description'=>"Text");
$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', $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.tel'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'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'=>"project",'f.ref'=>"project",'f.datec'=>"project",'f.duree'=>"project",'f.fk_statut'=>"project",'f.description'=>"project", 'f.rowid'=>"project",'f.ref'=>"project",'f.datec'=>"project",'f.duree'=>"project",'f.fk_statut'=>"project",'f.description'=>"project",
'pt.rowid'=>'task','pt.dateo'=>"task",'pt.datee'=>"task",'pt.duration_effective'=>"task",'pt.duration_planned'=>"task",'pt.progress'=>"task",'pt.description'=>"task"); 'pt.rowid'=>'task','pt.dateo'=>"task",'pt.datee'=>"task",'pt.duration_effective'=>"task",'pt.duration_planned'=>"task",'pt.progress'=>"task",'pt.description'=>"task");

View File

@ -167,10 +167,10 @@ class modPropale extends DolibarrModules
$this->export_code[$r]=$this->rights_class.'_'.$r; $this->export_code[$r]=$this->rights_class.'_'.$r;
$this->export_label[$r]='ProposalsAndProposalsLines'; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_label[$r]='ProposalsAndProposalsLines'; // Translation key (used only if key ExportDataset_xxx_z not found)
$this->export_permission[$r]=array(array("propale","export")); $this->export_permission[$r]=array(array("propale","export"));
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','cp.code'=>'Country','s.tel'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','c.rowid'=>"Id",'c.ref'=>"Ref",'c.ref_client'=>"RefCustomer",'c.fk_soc'=>"IdCompany",'c.datec'=>"DateCreation",'c.datep'=>"DatePropal",'c.fin_validite'=>"DateEndPropal",'c.remise_percent'=>"GlobalDiscount",'c.total_ht'=>"TotalHT",'c.total'=>"TotalTTC",'c.fk_statut'=>'Status','c.note'=>"Note",'c.date_livraison'=>'DeliveryDate','cd.rowid'=>'LineId','cd.label'=>"Label",'cd.description'=>"LineDescription",'cd.product_type'=>'TypeOfLineServiceOrProduct','cd.tva_tx'=>"LineVATRate",'cd.qty'=>"LineQty",'cd.total_ht'=>"LineTotalHT",'cd.total_tva'=>"LineTotalVAT",'cd.total_ttc'=>"LineTotalTTC",'p.rowid'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel'); $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','cp.code'=>'Country','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','c.rowid'=>"Id",'c.ref'=>"Ref",'c.ref_client'=>"RefCustomer",'c.fk_soc'=>"IdCompany",'c.datec'=>"DateCreation",'c.datep'=>"DatePropal",'c.fin_validite'=>"DateEndPropal",'c.remise_percent'=>"GlobalDiscount",'c.total_ht'=>"TotalHT",'c.total'=>"TotalTTC",'c.fk_statut'=>'Status','c.note'=>"Note",'c.date_livraison'=>'DeliveryDate','cd.rowid'=>'LineId','cd.label'=>"Label",'cd.description'=>"LineDescription",'cd.product_type'=>'TypeOfLineServiceOrProduct','cd.tva_tx'=>"LineVATRate",'cd.qty'=>"LineQty",'cd.total_ht'=>"LineTotalHT",'cd.total_tva'=>"LineTotalVAT",'cd.total_ttc'=>"LineTotalTTC",'p.rowid'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel');
//$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','cp.code'=>'Text','s.tel'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_client'=>"Text",'c.datec'=>"Date",'c.datep'=>"Date",'c.fin_validite'=>"Date",'c.remise_percent'=>"Numeric",'c.total_ht'=>"Numeric",'c.total'=>"Numeric",'c.fk_statut'=>'Status','c.note'=>"Text",'c.date_livraison'=>'Date','cd.description'=>"Text",'cd.product_type'=>'Boolean','cd.tva_tx'=>"Numeric",'cd.qty'=>"Numeric",'cd.total_ht'=>"Numeric",'cd.total_tva'=>"Numeric",'cd.total_ttc'=>"Numeric",'p.rowid'=>'List:Product:label','p.ref'=>'Text','p.label'=>'Text'); //$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','cp.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_client'=>"Text",'c.datec'=>"Date",'c.datep'=>"Date",'c.fin_validite'=>"Date",'c.remise_percent'=>"Numeric",'c.total_ht'=>"Numeric",'c.total'=>"Numeric",'c.fk_statut'=>'Status','c.note'=>"Text",'c.date_livraison'=>'Date','cd.description'=>"Text",'cd.product_type'=>'Boolean','cd.tva_tx'=>"Numeric",'cd.qty'=>"Numeric",'cd.total_ht'=>"Numeric",'cd.total_tva'=>"Numeric",'cd.total_ttc'=>"Numeric",'p.rowid'=>'List:Product:label','p.ref'=>'Text','p.label'=>'Text');
$this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','cp.code'=>'Text','s.tel'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_client'=>"Text",'c.datec'=>"Date",'c.datep'=>"Date",'c.fin_validite'=>"Date",'c.remise_percent'=>"Numeric",'c.total_ht'=>"Numeric",'c.total'=>"Numeric",'c.fk_statut'=>'Status','c.note'=>"Text",'c.date_livraison'=>'Date','cd.description'=>"Text",'cd.product_type'=>'Boolean','cd.tva_tx'=>"Numeric",'cd.qty'=>"Numeric",'cd.total_ht'=>"Numeric",'cd.total_tva'=>"Numeric",'cd.total_ttc'=>"Numeric",'p.ref'=>'Text','p.label'=>'Text'); $this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','cp.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_client'=>"Text",'c.datec'=>"Date",'c.datep'=>"Date",'c.fin_validite'=>"Date",'c.remise_percent'=>"Numeric",'c.total_ht'=>"Numeric",'c.total'=>"Numeric",'c.fk_statut'=>'Status','c.note'=>"Text",'c.date_livraison'=>'Date','cd.description'=>"Text",'cd.product_type'=>'Boolean','cd.tva_tx'=>"Numeric",'cd.qty'=>"Numeric",'cd.total_ht'=>"Numeric",'cd.total_tva'=>"Numeric",'cd.total_ttc'=>"Numeric",'p.ref'=>'Text','p.label'=>'Text');
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','cp.code'=>'company','s.tel'=>'company','s.siren'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.siret'=>'company','c.rowid'=>"propal",'c.ref'=>"propal",'c.ref_client'=>"propal",'c.fk_soc'=>"propal",'c.datec'=>"propal",'c.datep'=>"propal",'c.fin_validite'=>"propal",'c.remise_percent'=>"propal",'c.total_ht'=>"propal",'c.total'=>"propal",'c.fk_statut'=>"propal",'c.note'=>"propal",'c.date_livraison'=>"propal",'cd.rowid'=>'propal_line','cd.label'=>"propal_line",'cd.description'=>"propal_line",'cd.product_type'=>'propal_line','cd.tva_tx'=>"propal_line",'cd.qty'=>"propal_line",'cd.total_ht'=>"propal_line",'cd.total_tva'=>"propal_line",'cd.total_ttc'=>"propal_line",'p.rowid'=>'product','p.ref'=>'product','p.label'=>'product'); $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','cp.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.siret'=>'company','c.rowid'=>"propal",'c.ref'=>"propal",'c.ref_client'=>"propal",'c.fk_soc'=>"propal",'c.datec'=>"propal",'c.datep'=>"propal",'c.fin_validite'=>"propal",'c.remise_percent'=>"propal",'c.total_ht'=>"propal",'c.total'=>"propal",'c.fk_statut'=>"propal",'c.note'=>"propal",'c.date_livraison'=>"propal",'cd.rowid'=>'propal_line','cd.label'=>"propal_line",'cd.description'=>"propal_line",'cd.product_type'=>'propal_line','cd.tva_tx'=>"propal_line",'cd.qty'=>"propal_line",'cd.total_ht'=>"propal_line",'cd.total_tva'=>"propal_line",'cd.total_ttc'=>"propal_line",'p.rowid'=>'product','p.ref'=>'product','p.label'=>'product');
$this->export_dependencies_array[$r]=array('propal_line'=>'cd.rowid','product'=>'cd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them $this->export_dependencies_array[$r]=array('propal_line'=>'cd.rowid','product'=>'cd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them
$this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_start[$r]='SELECT DISTINCT ';

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org> * Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be> * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
@ -248,10 +248,10 @@ class modSociete extends DolibarrModules
$this->export_label[$r]='ExportDataset_company_1'; $this->export_label[$r]='ExportDataset_company_1';
$this->export_icon[$r]='company'; $this->export_icon[$r]='company';
$this->export_permission[$r]=array(array("societe","export")); $this->export_permission[$r]=array(array("societe","export"));
$this->export_fields_array[$r]=array('s.rowid'=>"Id",'s.nom'=>"Name",'s.status'=>"Status",'s.client'=>"Customer",'s.fournisseur'=>"Supplier",'s.datec'=>"DateCreation",'s.tms'=>"DateLastModification",'s.code_client'=>"CustomerCode",'s.code_fournisseur'=>"SupplierCode",'s.address'=>"Address",'s.zip'=>"Zip",'s.town'=>"Town",'p.libelle'=>"Country",'p.code'=>"CountryCode",'s.tel'=>"Phone",'s.fax'=>"Fax",'s.url'=>"Url",'s.email'=>"Email",'s.default_lang'=>"DefaultLang",'s.siren'=>"ProfId1",'s.siret'=>"ProfId2",'s.ape'=>"ProfId3",'s.idprof4'=>"ProfId4",'s.idprof5'=>"ProfId5",'s.idprof6'=>"ProfId6",'s.tva_intra'=>"VATIntraShort",'s.capital'=>"Capital",'s.note'=>"Note",'t.libelle'=>"ThirdPartyType",'ce.code'=>"Staff","cfj.libelle"=>"JuridicalStatus",'s.fk_prospectlevel'=>'ProspectLevel','s.fk_stcomm'=>'ProspectStatus','d.nom'=>'State'); $this->export_fields_array[$r]=array('s.rowid'=>"Id",'s.nom'=>"Name",'s.status'=>"Status",'s.client'=>"Customer",'s.fournisseur'=>"Supplier",'s.datec'=>"DateCreation",'s.tms'=>"DateLastModification",'s.code_client'=>"CustomerCode",'s.code_fournisseur'=>"SupplierCode",'s.code_compta'=>"AccountancyCode",'s.code_compta_fournisseur'=>"SupplierAccountancyCode",'s.address'=>"Address",'s.zip'=>"Zip",'s.town'=>"Town",'p.libelle'=>"Country",'p.code'=>"CountryCode",'s.phone'=>"Phone",'s.fax'=>"Fax",'s.url'=>"Url",'s.email'=>"Email",'s.default_lang'=>"DefaultLang",'s.siren'=>"ProfId1",'s.siret'=>"ProfId2",'s.ape'=>"ProfId3",'s.idprof4'=>"ProfId4",'s.idprof5'=>"ProfId5",'s.idprof6'=>"ProfId6",'s.tva_intra'=>"VATIntraShort",'s.capital'=>"Capital",'s.note'=>"Note",'t.libelle'=>"ThirdPartyType",'ce.code'=>"Staff","cfj.libelle"=>"JuridicalStatus",'s.fk_prospectlevel'=>'ProspectLevel','s.fk_stcomm'=>'ProspectStatus','d.nom'=>'State');
if (! empty($conf->global->SOCIETE_USEPREFIX)) $this->export_fields_array[$r]['s.prefix']='Prefix'; if (! empty($conf->global->SOCIETE_USEPREFIX)) $this->export_fields_array[$r]['s.prefix']='Prefix';
//$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>"Text",'s.status'=>"Text",'s.client'=>"Boolean",'s.fournisseur'=>"Boolean",'s.datec'=>"Date",'s.tms'=>"Date",'s.code_client'=>"Text",'s.code_fournisseur'=>"Text",'s.address'=>"Text",'s.zip'=>"Text",'s.town'=>"Text",'p.libelle'=>"List:c_pays:libelle:rowid",'p.code'=>"Text",'s.tel'=>"Text",'s.fax'=>"Text",'s.url'=>"Text",'s.email'=>"Text",'s.default_lang'=>"Text",'s.siret'=>"Text",'s.siren'=>"Text",'s.ape'=>"Text",'s.idprof4'=>"Text",'s.idprof5'=>"Text",'s.idprof6'=>"Text",'s.tva_intra'=>"Text",'s.capital'=>"Number",'s.note'=>"Text",'t.libelle'=>"Text",'ce.code'=>"List:c_effectif:libelle:code","cfj.libelle"=>"Text",'s.fk_prospectlevel'=>'List:c_prospectlevel:label:code','s.fk_stcomm'=>'List:c_stcomm:libelle:code','d.nom'=>'List:c_departements:nom:rowid'); //$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>"Text",'s.status'=>"Text",'s.client'=>"Boolean",'s.fournisseur'=>"Boolean",'s.datec'=>"Date",'s.tms'=>"Date",'s.code_client'=>"Text",'s.code_fournisseur'=>"Text",'s.address'=>"Text",'s.zip'=>"Text",'s.town'=>"Text",'p.libelle'=>"List:c_pays:libelle:rowid",'p.code'=>"Text",'s.phone'=>"Text",'s.fax'=>"Text",'s.url'=>"Text",'s.email'=>"Text",'s.default_lang'=>"Text",'s.siret'=>"Text",'s.siren'=>"Text",'s.ape'=>"Text",'s.idprof4'=>"Text",'s.idprof5'=>"Text",'s.idprof6'=>"Text",'s.tva_intra'=>"Text",'s.capital'=>"Number",'s.note'=>"Text",'t.libelle'=>"Text",'ce.code'=>"List:c_effectif:libelle:code","cfj.libelle"=>"Text",'s.fk_prospectlevel'=>'List:c_prospectlevel:label:code','s.fk_stcomm'=>'List:c_stcomm:libelle:code','d.nom'=>'List:c_departements:nom:rowid');
$this->export_TypeFields_array[$r]=array('s.nom'=>"Text",'s.status'=>"Text",'s.client'=>"Boolean",'s.fournisseur'=>"Boolean",'s.datec'=>"Date",'s.tms'=>"Date",'s.code_client'=>"Text",'s.code_fournisseur'=>"Text",'s.address'=>"Text",'s.zip'=>"Text",'s.town'=>"Text",'p.libelle'=>"List:c_pays:libelle:rowid",'p.code'=>"Text",'s.tel'=>"Text",'s.fax'=>"Text",'s.url'=>"Text",'s.email'=>"Text",'s.default_lang'=>"Text",'s.siret'=>"Text",'s.siren'=>"Text",'s.ape'=>"Text",'s.idprof4'=>"Text",'s.idprof5'=>"Text",'s.idprof6'=>"Text",'s.tva_intra'=>"Text",'s.capital'=>"Number",'s.note'=>"Text",'t.libelle'=>"Text",'ce.code'=>"List:c_effectif:libelle:code","cfj.libelle"=>"Text",'s.fk_prospectlevel'=>'List:c_prospectlevel:label:code','s.fk_stcomm'=>'List:c_stcomm:libelle:code','d.nom'=>'Text'); $this->export_TypeFields_array[$r]=array('s.nom'=>"Text",'s.status'=>"Number",'s.client'=>"Boolean",'s.fournisseur'=>"Boolean",'s.datec'=>"Date",'s.tms'=>"Date",'s.code_client'=>"Text",'s.code_fournisseur'=>"Text",'s.code_compta'=>"Text",'s.code_compta_fournisseur'=>"Text",'s.address'=>"Text",'s.zip'=>"Text",'s.town'=>"Text",'p.libelle'=>"List:c_pays:libelle:rowid",'p.code'=>"Text",'s.phone'=>"Text",'s.fax'=>"Text",'s.url'=>"Text",'s.email'=>"Text",'s.default_lang'=>"Text",'s.siret'=>"Text",'s.siren'=>"Text",'s.ape'=>"Text",'s.idprof4'=>"Text",'s.idprof5'=>"Text",'s.idprof6'=>"Text",'s.tva_intra'=>"Text",'s.capital'=>"Number",'s.note'=>"Text",'t.libelle'=>"Text",'ce.code'=>"List:c_effectif:libelle:code","cfj.libelle"=>"Text",'s.fk_prospectlevel'=>'List:c_prospectlevel:label:code','s.fk_stcomm'=>'List:c_stcomm:libelle:code','d.nom'=>'Text');
$this->export_entities_array[$r]=array(); // We define here only fields that use another picto $this->export_entities_array[$r]=array(); // We define here only fields that use another picto
// Add extra fields // Add extra fields
$sql="SELECT name, label FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'company'"; $sql="SELECT name, label FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'company'";
@ -283,7 +283,8 @@ class modSociete extends DolibarrModules
$this->export_label[$r]='ExportDataset_company_2'; $this->export_label[$r]='ExportDataset_company_2';
$this->export_icon[$r]='contact'; $this->export_icon[$r]='contact';
$this->export_permission[$r]=array(array("societe","contact","export")); $this->export_permission[$r]=array(array("societe","contact","export"));
$this->export_fields_array[$r]=array('c.rowid'=>"IdContact",'c.civilite'=>"CivilityCode",'c.name'=>'Lastname','c.firstname'=>'Firstname','c.datec'=>"DateCreation",'c.tms'=>"DateLastModification",'c.priv'=>"ContactPrivate",'c.address'=>"Address",'c.zip'=>"Zip",'c.town'=>"Town",'c.phone'=>"Phone",'c.fax'=>"Fax",'c.email'=>"EMail",'p.libelle'=>"Country",'p.code'=>"CountryCode",'s.rowid'=>"IdCompany",'s.nom'=>"CompanyName",'s.status'=>"Status",'s.code_client'=>"CustomerCode",'s.code_fournisseur'=>"SupplierCode"); $this->export_fields_array[$r]=array('c.rowid'=>"IdContact",'c.civilite'=>"CivilityCode",'c.lastname'=>'Lastname','c.firstname'=>'Firstname','c.datec'=>"DateCreation",'c.tms'=>"DateLastModification",'c.priv'=>"ContactPrivate",'c.address'=>"Address",'c.zip'=>"Zip",'c.town'=>"Town",'c.phone'=>"Phone",'c.fax'=>"Fax",'c.email'=>"EMail",'p.libelle'=>"Country",'p.code'=>"CountryCode",'s.rowid'=>"IdCompany",'s.nom'=>"CompanyName",'s.status'=>"Status",'s.code_client'=>"CustomerCode",'s.code_fournisseur'=>"SupplierCode");
$this->export_TypeFields_array[$r]=array('c.lastname'=>"Text",'c.firstname'=>"Text",'s.code_client'=>"Text",'s.code_fournisseur'=>"Text");
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>"company",'s.code_client'=>"company",'s.code_fournisseur'=>"company"); // We define here only fields that use another picto $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>"company",'s.code_client'=>"company",'s.code_fournisseur'=>"company"); // We define here only fields that use another picto
if (empty($conf->fournisseur->enabled)) if (empty($conf->fournisseur->enabled))
{ {
@ -322,7 +323,7 @@ class modSociete extends DolibarrModules
$this->import_icon[$r]='company'; $this->import_icon[$r]='company';
$this->import_entities_array[$r]=array(); // We define here only fields that use another icon that the one defined into import_icon $this->import_entities_array[$r]=array(); // We define here only fields that use another icon that the one defined into import_icon
$this->import_tables_array[$r]=array('s'=>MAIN_DB_PREFIX.'societe','extra'=>MAIN_DB_PREFIX.'societe_extrafields'); // List of tables to insert into (insert done in same order) $this->import_tables_array[$r]=array('s'=>MAIN_DB_PREFIX.'societe','extra'=>MAIN_DB_PREFIX.'societe_extrafields'); // List of tables to insert into (insert done in same order)
$this->import_fields_array[$r]=array('s.nom'=>"Name*",'s.status'=>"Status",'s.client'=>"Customer*",'s.fournisseur'=>"Supplier*",'s.code_client'=>"CustomerCode",'s.code_fournisseur'=>"SupplierCode",'s.code_compta'=>"CustomerAccountancyCode",'s.code_compta_fournisseur'=>"SupplierAccountancyCode",'s.address'=>"Address",'s.zip'=>"Zip",'s.town'=>"Town",'s.fk_pays'=>"CountryCode",'s.tel'=>"Phone",'s.fax'=>"Fax",'s.url'=>"Url",'s.email'=>"Email",'s.siret'=>"ProfId1",'s.siren'=>"ProfId2",'s.ape'=>"ProfId3",'s.idprof4'=>"ProfId4",'s.tva_intra'=>"VATIntraShort",'s.capital'=>"Capital",'s.note'=>"Note",'s.fk_typent'=>"ThirdPartyType",'s.fk_effectif'=>"Staff","s.fk_forme_juridique"=>"JuridicalStatus",'s.fk_prospectlevel'=>'ProspectLevel','s.fk_stcomm'=>'ProspectStatus','s.default_lang'=>'DefaultLanguage','s.barcode'=>'BarCode','s.datec'=>"DateCreation"); $this->import_fields_array[$r]=array('s.nom'=>"Name*",'s.status'=>"Status",'s.client'=>"Customer*",'s.fournisseur'=>"Supplier*",'s.code_client'=>"CustomerCode",'s.code_fournisseur'=>"SupplierCode",'s.code_compta'=>"CustomerAccountancyCode",'s.code_compta_fournisseur'=>"SupplierAccountancyCode",'s.address'=>"Address",'s.zip'=>"Zip",'s.town'=>"Town",'s.fk_pays'=>"CountryCode",'s.phone'=>"Phone",'s.fax'=>"Fax",'s.url'=>"Url",'s.email'=>"Email",'s.siret'=>"ProfId1",'s.siren'=>"ProfId2",'s.ape'=>"ProfId3",'s.idprof4'=>"ProfId4",'s.tva_intra'=>"VATIntraShort",'s.capital'=>"Capital",'s.note'=>"Note",'s.fk_typent'=>"ThirdPartyType",'s.fk_effectif'=>"Staff","s.fk_forme_juridique"=>"JuridicalStatus",'s.fk_prospectlevel'=>'ProspectLevel','s.fk_stcomm'=>'ProspectStatus','s.default_lang'=>'DefaultLanguage','s.barcode'=>'BarCode','s.datec'=>"DateCreation");
// Add extra fields // Add extra fields
$sql="SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'company'"; $sql="SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'company'";
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
@ -348,7 +349,7 @@ class modSociete extends DolibarrModules
); );
//$this->import_convertvalue_array[$r]=array('s.fk_soc'=>array('rule'=>'lastrowid',table='t'); //$this->import_convertvalue_array[$r]=array('s.fk_soc'=>array('rule'=>'lastrowid',table='t');
$this->import_regex_array[$r]=array('s.status'=>'^[0|1]','s.client'=>'^[0|1|2|3]','s.fournisseur'=>'^[0|1]','s.fk_typent'=>'id@'.MAIN_DB_PREFIX.'c_typent','s.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$'); $this->import_regex_array[$r]=array('s.status'=>'^[0|1]','s.client'=>'^[0|1|2|3]','s.fournisseur'=>'^[0|1]','s.fk_typent'=>'id@'.MAIN_DB_PREFIX.'c_typent','s.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$');
$this->import_examplevalues_array[$r]=array('s.nom'=>"MyBigCompany",'s.status'=>"0 (closed) or 1 (active)",'s.client'=>'0 (no customer no prospect)/1 (customer)/2 (prospect)/3 (customer and prospect)','s.fournisseur'=>'0 or 1','s.datec'=>dol_print_date(dol_now(),'%Y-%m-%d'),'s.code_client'=>"CU01-0001 or auto",'s.code_fournisseur'=>"SU01-0001 or auto",'s.address'=>"61 jump street",'s.zip'=>"123456",'s.town'=>"Big town",'s.fk_pays'=>'US, FR, DE...','s.tel'=>"0101010101",'s.fax'=>"0101010102",'s.url'=>"http://mycompany.com",'s.email'=>"test@mycompany.com",'s.siret'=>"",'s.siren'=>"",'s.ape'=>"",'s.idprof4'=>"",'s.tva_intra'=>"FR0123456789",'s.capital'=>"10000",'s.note'=>"This is an example of note for record",'s.fk_typent'=>"2",'s.fk_effectif'=>"3","s.fk_forme_juridique"=>"1",'s.fk_prospectlevel'=>'PL_MEDIUM','s.fk_stcomm'=>'0','s.default_lang'=>'en_US','s.barcode'=>'123456789'); $this->import_examplevalues_array[$r]=array('s.nom'=>"MyBigCompany",'s.status'=>"0 (closed) or 1 (active)",'s.client'=>'0 (no customer no prospect)/1 (customer)/2 (prospect)/3 (customer and prospect)','s.fournisseur'=>'0 or 1','s.datec'=>dol_print_date(dol_now(),'%Y-%m-%d'),'s.code_client'=>"CU01-0001 or auto",'s.code_fournisseur'=>"SU01-0001 or auto",'s.address'=>"61 jump street",'s.zip'=>"123456",'s.town'=>"Big town",'s.fk_pays'=>'US, FR, DE...','s.phone'=>"0101010101",'s.fax'=>"0101010102",'s.url'=>"http://mycompany.com",'s.email'=>"test@mycompany.com",'s.siret'=>"",'s.siren'=>"",'s.ape'=>"",'s.idprof4'=>"",'s.tva_intra'=>"FR0123456789",'s.capital'=>"10000",'s.note'=>"This is an example of note for record",'s.fk_typent'=>"2",'s.fk_effectif'=>"3","s.fk_forme_juridique"=>"1",'s.fk_prospectlevel'=>'PL_MEDIUM','s.fk_stcomm'=>'0','s.default_lang'=>'en_US','s.barcode'=>'123456789');
// Import list of contact and attributes // Import list of contact and attributes
$r++; $r++;

View File

@ -747,12 +747,11 @@ class pdf_azur extends ModelePDFPropales
else else
{ {
//Local tax 1 before VAT //Local tax 1 before VAT
if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
{ //{
foreach( $this->localtax1 as $localtax_type => $localtax_rate ) foreach( $this->localtax1 as $localtax_type => $localtax_rate )
{ {
// TODO: Place into a function to control showing by country or study better option if (in_array((string) $localtax_type, array('1','3','5','7'))) continue;
if (in_array((string) $localtax_type, array('1','3','5','7')) && $mysoc->country_code != 'ES') continue;
foreach( $localtax_rate as $tvakey => $tvaval ) foreach( $localtax_rate as $tvakey => $tvaval )
{ {
@ -769,8 +768,8 @@ class pdf_azur extends ModelePDFPropales
$tvakey=str_replace('*','',$tvakey); $tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
} }
$totalvat = $outputlangs->transnoentities("TotalLT1".$mysoc->country_code).' '; $totalvat = $outputlangs->transcountrynoentities("TotalLT1",$mysoc->country_code).' ';
$totalvat.=vatrate($tvakey,1).$tvacompl; $totalvat.=vatrate(abs($tvakey),1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
@ -778,14 +777,13 @@ class pdf_azur extends ModelePDFPropales
} }
} }
} }
} //}
//Local tax 2 before VAT //Local tax 2 before VAT
if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
{ //{
foreach( $this->localtax2 as $localtax_type => $localtax_rate ) foreach( $this->localtax2 as $localtax_type => $localtax_rate )
{ {
// TODO: Place into a function to control showing by country or study better option if (in_array((string) $localtax_type, array('1','3','5','7'))) continue;
if (in_array((string) $localtax_type, array('1','3','5','7')) && $mysoc->country_code != 'ES') continue;
foreach( $localtax_rate as $tvakey => $tvaval ) foreach( $localtax_rate as $tvakey => $tvaval )
{ {
@ -804,8 +802,8 @@ class pdf_azur extends ModelePDFPropales
$tvakey=str_replace('*','',$tvakey); $tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
} }
$totalvat = $outputlangs->transnoentities("TotalLT2".$mysoc->country_code).' '; $totalvat = $outputlangs->transcountrynoentities("TotalLT2".$mysoc->country_code).' ';
$totalvat.=vatrate($tvakey,1).$tvacompl; $totalvat.=vatrate(abs($tvakey),1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
@ -814,7 +812,7 @@ class pdf_azur extends ModelePDFPropales
} }
} }
} }
} //}
// VAT // VAT
foreach($this->tva as $tvakey => $tvaval) foreach($this->tva as $tvakey => $tvaval)
{ {
@ -841,15 +839,15 @@ class pdf_azur extends ModelePDFPropales
} }
//Local tax 1 after VAT //Local tax 1 after VAT
if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
{ //{
foreach( $this->localtax1 as $localtax_type => $localtax_rate ) foreach( $this->localtax1 as $localtax_type => $localtax_rate )
{ {
if (in_array((string) $localtax_type, array('2','4','6'))) continue; if (in_array((string) $localtax_type, array('2','4','6'))) continue;
foreach( $localtax_rate as $tvakey => $tvaval ) foreach( $localtax_rate as $tvakey => $tvaval )
{ {
if ($tvakey>0) // On affiche pas taux 0 if ($tvakey != 0) // On affiche pas taux 0
{ {
//$this->atleastoneratenotnull++; //$this->atleastoneratenotnull++;
@ -862,7 +860,7 @@ class pdf_azur extends ModelePDFPropales
$tvakey=str_replace('*','',$tvakey); $tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
} }
$totalvat = $outputlangs->transnoentities("TotalLT1".$mysoc->country_code).' '; $totalvat = $outputlangs->transcountrynoentities("TotalLT1",$mysoc->country_code).' ';
if ($localtax_type == '7') { // amount on order if ($localtax_type == '7') { // amount on order
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
@ -871,7 +869,7 @@ class pdf_azur extends ModelePDFPropales
} }
else else
{ {
$totalvat.=vatrate($tvakey,1).$tvacompl; $totalvat.=vatrate(abs($tvakey),1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
@ -879,17 +877,17 @@ class pdf_azur extends ModelePDFPropales
} }
} }
} }
} //}
//Local tax 2 after VAT //Local tax 2 after VAT
if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
{ //{
foreach( $this->localtax2 as $localtax_type => $localtax_rate ) foreach( $this->localtax2 as $localtax_type => $localtax_rate )
{ {
if (in_array((string) $localtax_type, array('2','4','6'))) continue; if (in_array((string) $localtax_type, array('2','4','6'))) continue;
foreach( $localtax_rate as $tvakey => $tvaval ) foreach( $localtax_rate as $tvakey => $tvaval )
{ {
if ($tvakey>0) // On affiche pas taux 0 if ($tvakey != 0) // On affiche pas taux 0
{ {
//$this->atleastoneratenotnull++; //$this->atleastoneratenotnull++;
@ -902,7 +900,7 @@ class pdf_azur extends ModelePDFPropales
$tvakey=str_replace('*','',$tvakey); $tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
} }
$totalvat = $outputlangs->transnoentities("TotalLT2".$mysoc->country_code).' '; $totalvat = $outputlangs->transcountrynoentities("TotalLT2",$mysoc->country_code).' ';
if ($localtax_type == '7') { // amount on order if ($localtax_type == '7') { // amount on order
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
@ -911,7 +909,7 @@ class pdf_azur extends ModelePDFPropales
} }
else else
{ {
$totalvat.=vatrate($tvakey,1).$tvacompl; $totalvat.=vatrate(abs($tvakey),1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
@ -920,7 +918,7 @@ class pdf_azur extends ModelePDFPropales
} }
} }
} }
} //}
// Total TTC // Total TTC
$index++; $index++;

View File

@ -523,7 +523,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
{ {
$index++; $index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalLT1".$mysoc->country_code), 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalLT1",$mysoc->country_code), 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax1), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax1), 0, 'R', 1);
} }
@ -533,19 +533,19 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
{ {
$index++; $index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalLT2".$mysoc->country_code), 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalLT2",$mysoc->country_code), 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax2), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax2), 0, 'R', 1);
} }
} }
else else
{ {
if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
{ //{
//Local tax 1 //Local tax 1
foreach( $this->localtax1 as $tvakey => $tvaval ) foreach( $this->localtax1 as $tvakey => $tvaval )
{ {
if ($tvakey>0) // On affiche pas taux 0 if ($tvakey != 0) // On affiche pas taux 0
{ {
//$this->atleastoneratenotnull++; //$this->atleastoneratenotnull++;
@ -558,22 +558,22 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$tvakey=str_replace('*','',$tvakey); $tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
} }
$totalvat =$outputlangs->transnoentities("TotalLT1".$mysoc->country_code).' '; $totalvat =$outputlangs->transnoentities("TotalLT1",$mysoc->country_code).' ';
$totalvat.=vatrate($tvakey,1).$tvacompl; $totalvat.=vatrate(abs($tvakey),1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
} }
} }
} //}
if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
{ //{
//Local tax 2 //Local tax 2
foreach( $this->localtax2 as $tvakey => $tvaval ) foreach( $this->localtax2 as $tvakey => $tvaval )
{ {
if ($tvakey>0) // On affiche pas taux 0 if ($tvakey != 0) // On affiche pas taux 0
{ {
//$this->atleastoneratenotnull++; //$this->atleastoneratenotnull++;
@ -586,15 +586,15 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$tvakey=str_replace('*','',$tvakey); $tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
} }
$totalvat =$outputlangs->transnoentities("TotalLT2".$mysoc->country_code).' '; $totalvat =$outputlangs->transnoentities("TotalLT2",$mysoc->country_code).' ';
$totalvat.=vatrate($tvakey,1).$tvacompl; $totalvat.=vatrate(abs($tvakey),1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
} }
} }
} //}
} }
$useborder=0; $useborder=0;

View File

@ -691,7 +691,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
{ {
$index++; $index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalLT1".$mysoc->country_code), 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalLT1",$mysoc->country_code), 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax1), $useborder, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax1), $useborder, 'R', 1);
} }
@ -701,19 +701,19 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
{ {
$index++; $index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalLT2".$mysoc->country_code), 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalLT2",$mysoc->country_code), 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax2), $useborder, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax2), $useborder, 'R', 1);
} }
} }
else else
{ {
if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
{ //{
//Local tax 1 //Local tax 1
foreach( $this->localtax1 as $tvakey => $tvaval ) foreach( $this->localtax1 as $tvakey => $tvaval )
{ {
if ($tvakey>0) // On affiche pas taux 0 if ($tvakey != 0) // On affiche pas taux 0
{ {
//$this->atleastoneratenotnull++; //$this->atleastoneratenotnull++;
@ -726,22 +726,22 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$tvakey=str_replace('*','',$tvakey); $tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
} }
$totalvat =$outputlangs->transnoentities("TotalLT1".$mysoc->country_code).' '; $totalvat =$outputlangs->transcountrynoentities("TotalLT1",$mysoc->country_code).' ';
$totalvat.=vatrate($tvakey,1).$tvacompl; $totalvat.=vatrate(abs($tvakey),1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
} }
} }
} //}
if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
{ //{
//Local tax 2 //Local tax 2
foreach( $this->localtax2 as $tvakey => $tvaval ) foreach( $this->localtax2 as $tvakey => $tvaval )
{ {
if ($tvakey>0) // On affiche pas taux 0 if ($tvakey != 0) // On affiche pas taux 0
{ {
//$this->atleastoneratenotnull++; //$this->atleastoneratenotnull++;
@ -754,15 +754,15 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$tvakey=str_replace('*','',$tvakey); $tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
} }
$totalvat =$outputlangs->transnoentities("TotalLT2".$mysoc->country_code).' '; $totalvat =$outputlangs->transcountrynoentities("TotalLT2",$mysoc->country_code).' ';
$totalvat.=vatrate($tvakey,1).$tvacompl; $totalvat.=vatrate(abs($tvakey),1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
} }
} }
} //}
} }
// Total TTC // Total TTC

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2009-2011 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2009-2011 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Cedric GROSS <c.gross@kreiz-it.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -256,6 +257,21 @@ class InterfaceActionsAuto
$object->actiontypecode='AC_OTH_AUTO'; $object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceValidatedInDolibarr",$object->ref); if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceValidatedInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("InvoiceValidatedInDolibarr",$object->ref); $object->actionmsg=$langs->transnoentities("InvoiceValidatedInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
$object->sendtoid=0;
$ok=1;
}
elseif ($action == 'BILL_UNVALIDATE')
{
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
$langs->load("other");
$langs->load("bills");
$langs->load("agenda");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceBackToDraftInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("InvoiceBackToDraftInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
$object->sendtoid=0; $object->sendtoid=0;
@ -563,7 +579,8 @@ class InterfaceActionsAuto
// Insertion action // Insertion action
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
$actioncomm = new ActionComm($this->db); $actioncomm = new ActionComm($this->db);
$actioncomm->type_code = $object->actiontypecode; $actioncomm->type_code = $object->actiontypecode; // code of parent table llx_c_actioncomm (will be deprecated)
$actioncomm->code='AC_'.$action;
$actioncomm->label = $object->actionmsg2; $actioncomm->label = $object->actionmsg2;
$actioncomm->note = $object->actionmsg; $actioncomm->note = $object->actionmsg;
$actioncomm->datep = $now; $actioncomm->datep = $now;

View File

@ -25,7 +25,6 @@
* ou: interface_99_all_Mytrigger.class.php * ou: interface_99_all_Mytrigger.class.php
* - Le fichier doit rester stocke dans core/triggers * - Le fichier doit rester stocke dans core/triggers
* - Le nom de la classe doit etre InterfaceMytrigger * - Le nom de la classe doit etre InterfaceMytrigger
* - Le nom de la methode constructeur doit etre InterfaceMytrigger
* - Le nom de la propriete name doit etre Mytrigger * - Le nom de la propriete name doit etre Mytrigger
*/ */
@ -353,6 +352,10 @@ class InterfaceDemo
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
} }
elseif ($action == 'BILL_VALIDATE') elseif ($action == 'BILL_VALIDATE')
{
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
}
elseif ($action == 'BILL_UNVALIDATE')
{ {
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
} }

View File

@ -200,8 +200,8 @@ class Export
* Arrays this->array_export_xxx are already loaded for required datatoexport * Arrays this->array_export_xxx are already loaded for required datatoexport
* *
* @param int $indice Indice of export * @param int $indice Indice of export
* @param array $array_selected Filter on array of fields to export * @param array $array_selected Filter fields on array of fields to export
* @param array $array_filterValue Filter on array of fields to export * @param array $array_filterValue Filter records on array of value for fields
* @return string SQL String. Example "select s.rowid as r_rowid, s.status as s_status from ..." * @return string SQL String. Example "select s.rowid as r_rowid, s.status as s_status from ..."
*/ */
function build_sql($indice, $array_selected, $array_filterValue) function build_sql($indice, $array_selected, $array_filterValue)
@ -230,7 +230,7 @@ class Export
// pour ne pas a gerer le nombre de condition // pour ne pas a gerer le nombre de condition
foreach ($array_filterValue as $key => $value) foreach ($array_filterValue as $key => $value)
{ {
$sqlWhere.=" and ".$this->build_filterQuery($this->array_export_TypeFields[0][$key], $key, $array_filterValue[$key]); $sqlWhere.=" and ".$this->build_filterQuery($this->array_export_TypeFields[$indice][$key], $key, $array_filterValue[$key]);
} }
$sql.=$sqlWhere; $sql.=$sqlWhere;
} }
@ -464,7 +464,7 @@ class Export
* @param string $datatoexport Name of dataset to export * @param string $datatoexport Name of dataset to export
* @param array $array_selected Filter on array of fields to export * @param array $array_selected Filter on array of fields to export
* @param array $array_filterValue Filter on array of fields with a filter * @param array $array_filterValue Filter on array of fields with a filter
* @param string $sqlquery If set, transmit a sql query instead of building it from arrays * @param string $sqlquery If set, transmit the sql request for select (otherwise, sql request is generated from arrays)
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function build_file($user, $model, $datatoexport, $array_selected, $array_filterValue, $sqlquery = '') function build_file($user, $model, $datatoexport, $array_selected, $array_filterValue, $sqlquery = '')
@ -547,8 +547,7 @@ class Export
} }
} }
// end of special operation processing // end of special operation processing
$objmodel->write_record($array_selected,$objp,$outputlangs,$this->array_export_TypeFields[$indice]);
$objmodel->write_record($array_selected,$objp,$outputlangs);
} }
// Genere en-tete // Genere en-tete

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -157,6 +157,15 @@ class Fichinter extends CommonObject
{ {
$this->id=$this->db->last_insert_id(MAIN_DB_PREFIX."fichinter"); $this->id=$this->db->last_insert_id(MAIN_DB_PREFIX."fichinter");
if ($this->id)
{
$this->ref='(PROV'.$this->id.')';
$sql = 'UPDATE '.MAIN_DB_PREFIX."fichinter SET ref='".$this->ref."' WHERE rowid=".$this->id;
dol_syslog(get_class($this)."::create sql=".$sql);
$resql=$this->db->query($sql);
if (! $resql) $error++;
}
// Add linked object // Add linked object
if (! $error && $this->origin && $this->origin_id) if (! $error && $this->origin && $this->origin_id)
{ {
@ -358,8 +367,19 @@ class Fichinter extends CommonObject
$now=dol_now(); $now=dol_now();
// Define new ref
if (! $error && (preg_match('/^[\(]?PROV/i', $this->ref)))
{
$num = $this->getNextNumRef($soc);
}
else
{
$num = $this->ref;
}
$sql = "UPDATE ".MAIN_DB_PREFIX."fichinter"; $sql = "UPDATE ".MAIN_DB_PREFIX."fichinter";
$sql.= " SET fk_statut = 1"; $sql.= " SET fk_statut = 1";
$sql.= ", ref = '".$num."'";
$sql.= ", date_valid = ".$this->db->idate($now); $sql.= ", date_valid = ".$this->db->idate($now);
$sql.= ", fk_user_valid = ".$user->id; $sql.= ", fk_user_valid = ".$user->id;
$sql.= " WHERE rowid = ".$this->id; $sql.= " WHERE rowid = ".$this->id;

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2002-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2002-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -917,8 +917,8 @@ if ($action == 'create')
$obj = $conf->global->FICHEINTER_ADDON; $obj = $conf->global->FICHEINTER_ADDON;
$obj = "mod_".$obj; $obj = "mod_".$obj;
$modFicheinter = new $obj; //$modFicheinter = new $obj;
$numpr = $modFicheinter->getNextValue($soc, $object); //$numpr = $modFicheinter->getNextValue($soc, $object);
if ($socid > 0) if ($socid > 0)
{ {
@ -935,8 +935,7 @@ if ($action == 'create')
print '<input type="hidden" name="action" value="add">'; print '<input type="hidden" name="action" value="add">';
// Ref // Ref
print '<tr><td class="fieldrequired">'.$langs->trans("Ref").'</td>'; print '<tr><td class="fieldrequired">'.$langs->trans('Ref').'</td><td colspan="2">'.$langs->trans("Draft").'</td></tr>';
print '<td><input name="ref" value="'.$numpr.'"></td></tr>'."\n";
// Description (must be a textarea and not html must be allowed (used in list view) // Description (must be a textarea and not html must be allowed (used in list view)
print '<tr><td valign="top">'.$langs->trans("Description").'</td>'; print '<tr><td valign="top">'.$langs->trans("Description").'</td>';
@ -1053,7 +1052,24 @@ else if ($id > 0 || ! empty($ref))
// Confirmation validation // Confirmation validation
if ($action == 'validate') if ($action == 'validate')
{ {
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateIntervention'), $langs->trans('ConfirmValidateIntervention'), 'confirm_validate','',0,1); // on verifie si l'objet est en numerotation provisoire
$ref = substr($object->ref, 1, 4);
if ($ref == 'PROV')
{
$numref = $object->getNextNumRef($soc);
if (empty($numref))
{
$error++;
dol_htmloutput_errors($object->error);
}
}
else
{
$numref = $object->ref;
}
$text=$langs->trans('ConfirmValidateIntervention',$numref);
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateIntervention'), $text, 'confirm_validate','',0,1);
if ($ret == 'html') print '<br>'; if ($ret == 'html') print '<br>';
} }

View File

@ -68,7 +68,8 @@ $conffiletoshow = "htdocs/conf/conf.php";
// Include configuration // Include configuration
$result=@include_once $conffile; $result=include_once $conffile;
if (! $result && ! empty($_SERVER["GATEWAY_INTERFACE"])) // If install not done and we are in a web session if (! $result && ! empty($_SERVER["GATEWAY_INTERFACE"])) // If install not done and we are in a web session
{ {
header("Location: install/index.php"); header("Location: install/index.php");
@ -234,6 +235,7 @@ if (! file_exists(DOL_DOCUMENT_ROOT ."/core/lib/functions.lib.php"))
exit; exit;
} }
// Included by default // Included by default
include_once DOL_DOCUMENT_ROOT .'/core/lib/functions.lib.php'; include_once DOL_DOCUMENT_ROOT .'/core/lib/functions.lib.php';
include_once DOL_DOCUMENT_ROOT .'/core/lib/security.lib.php'; include_once DOL_DOCUMENT_ROOT .'/core/lib/security.lib.php';

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