Merge branch '3.7' of git@github.com:Dolibarr/dolibarr.git into 3.7

This commit is contained in:
Florian HENRY 2015-02-04 17:48:04 +01:00
commit e89a251e5f
20 changed files with 193 additions and 180 deletions

View File

@ -1,6 +1,6 @@
INSTALL INSTALL
------- -------
English: See README file. English: See README.md file.
French: Voir fichier README-FR. French: Voir fichier README-FR.md.

View File

@ -1,21 +1,16 @@
# DOLIBARR ERP & CRM # DOLIBARR ERP & CRM
## INTRODUCTION
Dolibarr ERP & CRM est un logiciel moderne pour gérer votre activité (société, association, auto-entrepreneurs, artisans). Dolibarr ERP & CRM est un logiciel moderne pour gérer votre activité (société, association, auto-entrepreneurs, artisans).
Il est simple d'utilisation et modulaire, vous permettant de n'activez que les fonctions dont vous avez besoin (contacts, fournisseurs, factures, commandes, stocks, agenda, ...). Il est simple d'utilisation et modulaire, vous permettant de n'activez que les fonctions dont vous avez besoin (contacts, fournisseurs, factures, commandes, stocks, agenda, ...).
![ScreenShot](http://www.dolibarr.org/images/dolibarr_screenshot1_640x480.png) ![ScreenShot](http://www.dolibarr.org/images/dolibarr_screenshot1_640x480.png)
--------------------------------
Documentation démarrage rapide
--------------------------------
1) Installer Dolibarr
2) Mettre à jour Dolibarr depuis une ancienne version ## LICENCE
3) Ce qui est nouveau dans cette version
4) Ce que peux faire Dolibarr Dolibarr est distribué sous les termes de la licence GNU General Public License v3+ ou supérieure.
5) Ce que ne peux pas faire Dolibarr (pas encore)
## INSTALLER DOLIBARR ## INSTALLER DOLIBARR

View File

@ -42,7 +42,7 @@ if (!$user->admin)
$action = GETPOST('action', 'alpha'); $action = GETPOST('action', 'alpha');
// Other parameters ACCOUNTING_* // Other parameters ACCOUNTING_EXPORT_*
$list = array ( $list = array (
'ACCOUNTING_EXPORT_SEPARATORCSV', 'ACCOUNTING_EXPORT_SEPARATORCSV',
'ACCOUNTING_EXPORT_DATE', 'ACCOUNTING_EXPORT_DATE',
@ -114,20 +114,24 @@ print '</tr>';
$var = ! $var; $var = ! $var;
print '<tr ' . $bc[$var] . '>'; print '<tr ' . $bc[$var] . '>';
print "<td>" . $langs->trans("Selectmodelcsv") . "</td>"; print '<td width="50%">' . $langs->trans("Selectmodelcsv") . '</td>';
print "<td>"; if (! $conf->use_javascript_ajax)
print '<select class="flat" name="modelcsv" id="modelcsv">'; {
print '<option value="0"'; print '<td class="nowrap">';
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 0) { print $langs->trans("NotAvailableWhenAjaxDisabled");
print ' selected="selected"'; print "</td>";
} }
print '>' . $langs->trans("Modelcsv_normal") . '</option>'; else
print '<option value="1"'; {
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 1) { print '<td>';
print ' selected="selected"'; $listmodelcsv=array(
'1'=>$langs->trans("Modelcsv_normal"),
'2'=>$langs->trans("Modelcsv_CEGID")
);
print $form->selectarray("modelcsv",$listmodelcsv,$conf->global->ACCOUNTING_EXPORT_MODELCSV,0);
print '</td>';
} }
print '>' . $langs->trans("Modelcsv_CEGID") . '</option>';
print "</select>";
print "</td></tr>"; print "</td></tr>";
print "</table>"; print "</table>";
@ -143,6 +147,7 @@ if ($num) {
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td colspan="3">' . $langs->trans('OtherOptions') . '</td>'; print '<td colspan="3">' . $langs->trans('OtherOptions') . '</td>';
print "</tr>\n"; print "</tr>\n";
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV > 1) print '<tr><td colspan="2" bgcolor="red"><b>' . $langs->trans('OptionsDeactivatedForThisExportModel') . '</b></td></tr>';
} }
foreach ( $list as $key ) { foreach ( $list as $key ) {
@ -152,7 +157,7 @@ foreach ( $list as $key ) {
// Param // Param
$label = $langs->trans($key); $label = $langs->trans($key);
print '<td>' . $label . '</td>'; print '<td width="50%">' . $label . '</td>';
// Value // Value
print '<td>'; print '<td>';
@ -163,7 +168,7 @@ foreach ( $list as $key ) {
print '</form>'; print '</form>';
print "</table>\n"; print "</table>\n";
print '<br /><div style="text-align:center"><input type="submit" class="button" value="' . $langs->trans('Modify') . '" name="button"></div>'; print '<br /><div align="center"><input type="submit" class="button" value="' . $langs->trans('Modify') . '" name="button"></div>';
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -75,7 +75,7 @@ if ($action == 'delbookkeeping') {
setEventMessage($object->errors, 'errors'); setEventMessage($object->errors, 'errors');
} }
} }
} // export csv } // Export
else if ($action == 'export_csv') { else if ($action == 'export_csv') {
header('Content-Type: text/csv'); header('Content-Type: text/csv');
@ -160,7 +160,7 @@ else {
print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '" method="POST">'; print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '" 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="export_csv">'; print '<input type="hidden" name="action" value="export_csv">';
print '<input type="submit" class="button" style="float: right;" value="Export CSV" />'; print '<input type="submit" class="button" style="float: right;" value="' . $langs->trans("Export") . '" onclick="launch_export();" />';
print '</form>'; print '</form>';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';

View File

@ -4,7 +4,7 @@
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr> * Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> * Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* *
@ -99,10 +99,10 @@ $idpays = $p[0];
$sql = "SELECT b.rowid , b.dateo as do, b.datev as dv, b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type, soc.code_compta, ba.courant,"; $sql = "SELECT b.rowid , b.dateo as do, b.datev as dv, b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type, soc.code_compta, ba.courant,";
$sql .= " soc.code_compta_fournisseur, soc.rowid as socid, soc.nom as name, ba.account_number, bu1.type as typeop"; $sql .= " soc.code_compta_fournisseur, soc.rowid as socid, soc.nom as name, ba.account_number, bu1.type as typeop";
$sql .= " FROM " . MAIN_DB_PREFIX . "bank b"; $sql .= " FROM " . MAIN_DB_PREFIX . "bank as b";
$sql .= " JOIN " . MAIN_DB_PREFIX . "bank_account ba on b.fk_account=ba.rowid"; $sql .= " JOIN " . MAIN_DB_PREFIX . "bank_account as ba on b.fk_account=ba.rowid";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "bank_url bu1 ON bu1.fk_bank = b.rowid AND bu1.type='company'"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "bank_url as bu1 ON bu1.fk_bank = b.rowid AND bu1.type='company'";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe soc on bu1.url_id=soc.rowid"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe as soc on bu1.url_id=soc.rowid";
// To isolate the cash of the other accounts // To isolate the cash of the other accounts
$sql .= " WHERE ba.courant <> 2"; $sql .= " WHERE ba.courant <> 2";
$sql .= " AND ba.rowid=".$id_accountancy_journal; $sql .= " AND ba.rowid=".$id_accountancy_journal;
@ -169,10 +169,12 @@ if ($result) {
} }
$links = $object->get_url($obj->rowid); $links = $object->get_url($obj->rowid);
foreach ( $links as $key => $val ) foreach ( $links as $key => $val )
{ {
$tabtype[$obj->rowid] = $links[$key]['type']; $tabtype[$obj->rowid] = $links[$key]['type'];
if ($links[$key]['type'] == 'payment') if ($links[$key]['type'] == 'payment')
{ {
$paymentstatic->id = $links[$key]['url_id']; $paymentstatic->id = $links[$key]['url_id'];
@ -401,18 +403,21 @@ if ($action == 'writeBookKeeping')
setEventMessage($langs->trans('Success'), 'mesgs'); setEventMessage($langs->trans('Success'), 'mesgs');
} }
} }
// export csv // Export
if ($action == 'export_csv') if ($action == 'export_csv')
{ {
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV; $sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
$bank_journal = $conf->global->ACCOUNTING_BANK_JOURNAL;
header('Content-Type: text/csv'); header('Content-Type: text/csv');
header('Content-Disposition: attachment;filename=journal_banque.csv'); header('Content-Disposition: attachment;filename=journal_banque.csv');
$companystatic = new Client($db); $companystatic = new Client($db);
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 1) // Modèle Export Cegid Expert if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 2) // Model Cegid Expert Export
{ {
$sep = ";";
foreach ( $tabpay as $key => $val ) { foreach ( $tabpay as $key => $val ) {
$date = dol_print_date($db->jdate($val["date"]), '%d%m%Y'); $date = dol_print_date($db->jdate($val["date"]), '%d%m%Y');
@ -420,23 +425,23 @@ if ($action == 'export_csv')
$companystatic->name = $tabcompany[$key]['name']; $companystatic->name = $tabcompany[$key]['name'];
// Bank // Bank
print $date . $sep;
print $conf->global->ACCOUNTING_BANK_JOURNAL . $sep;
foreach ( $tabbq[$key] as $k => $mt ) { foreach ( $tabbq[$key] as $k => $mt ) {
print $date . $sep;
print $bank_journal . $sep;
print length_accountg(html_entity_decode($k)) . $sep; print length_accountg(html_entity_decode($k)) . $sep;
print $sep; print $sep;
print ($mt < 0 ? 'C' : 'D') . $sep; print ($mt < 0 ? 'C' : 'D') . $sep;
print ($mt <= 0 ? price(- $mt) : $mt) . $sep; print ($mt <= 0 ? price(- $mt) : $mt) . $sep;
print $val["type_payment"] . $sep; print $val["type_payment"] . $sep;
print $sep; print $val["ref"] . $sep;
print "\n";
} }
print "\n";
// Third party // Third party
foreach ( $tabtp[$key] as $k => $mt ) { foreach ( $tabtp[$key] as $k => $mt ) {
if ($mt) { if ($mt) {
print $date . $sep; print $date . $sep;
print $conf->global->ACCOUNTING_BANK_JOURNAL . $sep; print $bank_journal . $sep;
if ($val["lib"] == '(SupplierInvoicePayment)') { if ($val["lib"] == '(SupplierInvoicePayment)') {
print length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER) . $sep; print length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER) . $sep;
} else { } else {
@ -446,12 +451,12 @@ if ($action == 'export_csv')
print ($mt < 0 ? 'D' : 'C') . $sep; print ($mt < 0 ? 'D' : 'C') . $sep;
print ($mt <= 0 ? price(- $mt) : $mt) . $sep; print ($mt <= 0 ? price(- $mt) : $mt) . $sep;
print $val["type_payment"] . $sep; print $val["type_payment"] . $sep;
print $sep; print $val["ref"] . $sep;
print "\n"; print "\n";
} }
} }
} }
} else // Modèle Export Classique } else // Model Classic Export
{ {
foreach ( $tabpay as $key => $val ) { foreach ( $tabpay as $key => $val ) {
$date = dol_print_date($db->jdate($val["date"]), 'day'); $date = dol_print_date($db->jdate($val["date"]), 'day');
@ -459,24 +464,22 @@ if ($action == 'export_csv')
$companystatic->id = $tabcompany[$key]['id']; $companystatic->id = $tabcompany[$key]['id'];
$companystatic->name = $tabcompany[$key]['name']; $companystatic->name = $tabcompany[$key]['name'];
print '"' . $date . '"' . $sep;
print '"' . $val["type_payment"] . '"' . $sep;
// Bank // Bank
foreach ( $tabbq[$key] as $k => $mt ) { foreach ( $tabbq[$key] as $k => $mt ) {
print '"' . $date . '"' . $sep;
print '"' . $val["type_payment"] . '"' . $sep;
print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep; print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep;
print '"' . $langs->trans("Bank") . '"' . $sep; print '"' . $langs->trans("Bank") . '"' . $sep;
print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep; print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep;
print '"' . ($mt < 0 ? price(- $mt) : '') . '"'; print '"' . ($mt < 0 ? price(- $mt) : '') . '"';
print "\n";
} }
print "\n";
// Third party // Third party
foreach ( $tabtp[$key] as $k => $mt ) { foreach ( $tabtp[$key] as $k => $mt ) {
if ($mt) { if ($mt) {
print '"' . $date . '"' . $sep; print '"' . $date . '"' . $sep;
print '"' . $val["type_payment"] . '"' . $sep; print '"' . $val["type_payment"] . '"' . $sep;
print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep; print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;
print '"' . $companystatic->name . '"' . $sep; print '"' . $companystatic->name . '"' . $sep;
print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep; print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep;
@ -503,7 +506,7 @@ else
$period = $form->select_date($date_start, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end, 'date_end', 0, 0, 0, '', 1, 0, 1); $period = $form->select_date($date_start, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end, 'date_end', 0, 0, 0, '', 1, 0, 1);
report_header($namereport, $namelink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => '')); report_header($namereport, $namelink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''));
print '<input type="button" class="button" style="float: right;" value="Export CSV" onclick="launch_export();" />'; print '<input type="button" class="button" style="float: right;" value="' . $langs->trans("Export") . '" onclick="launch_export();" />';
print '<input type="button" class="button" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writeBookKeeping();" />'; print '<input type="button" class="button" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writeBookKeeping();" />';
@ -586,5 +589,4 @@ else
// End of page // End of page
llxFooter(); llxFooter();
} }
$db->close(); $db->close();

View File

@ -4,7 +4,7 @@
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr> * Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> * Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* *
@ -91,10 +91,10 @@ $idpays = $p[0];
$sql = "SELECT b.rowid , b.dateo as do, b.datev as dv, b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type, soc.code_compta, ba.courant,"; $sql = "SELECT b.rowid , b.dateo as do, b.datev as dv, b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type, soc.code_compta, ba.courant,";
$sql .= " soc.code_compta_fournisseur, soc.rowid as socid, soc.nom as name, ba.account_number, bu1.type as typeop"; $sql .= " soc.code_compta_fournisseur, soc.rowid as socid, soc.nom as name, ba.account_number, bu1.type as typeop";
$sql .= " FROM " . MAIN_DB_PREFIX . "bank b"; $sql .= " FROM " . MAIN_DB_PREFIX . "bank as b";
$sql .= " JOIN " . MAIN_DB_PREFIX . "bank_account ba on b.fk_account=ba.rowid"; $sql .= " JOIN " . MAIN_DB_PREFIX . "bank_account as ba on b.fk_account=ba.rowid";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "bank_url bu1 ON bu1.fk_bank = b.rowid AND bu1.type='company'"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "bank_url as bu1 ON bu1.fk_bank = b.rowid AND bu1.type='company'";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe soc on bu1.url_id=soc.rowid"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe as soc on bu1.url_id=soc.rowid";
// Code opération type caisse // Code opération type caisse
$sql .= " WHERE ba.courant = 2"; $sql .= " WHERE ba.courant = 2";
@ -365,66 +365,68 @@ if ($action == 'writeBookKeeping') {
setEventMessage($langs->trans('Success'), 'mesgs'); setEventMessage($langs->trans('Success'), 'mesgs');
} }
} }
// export csv // Export
if ($action == 'export_csv') { if ($action == 'export_csv') {
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV; $sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
$cash_journal = $conf->global->ACCOUNTING_CASH_JOURNAL;
header('Content-Type: text/csv'); header('Content-Type: text/csv');
header('Content-Disposition:attachment;filename=journal_caisse.csv'); header('Content-Disposition:attachment;filename=journal_caisse.csv');
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 1) // Modèle Export Cegid Expert if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 2) // Model Cegid Expert Export
{ {
$sep = ";";
foreach ( $tabpay as $key => $val ) { foreach ( $tabpay as $key => $val ) {
$date = dol_print_date($db->jdate($val["date"]), '%d%m%Y'); $date = dol_print_date($db->jdate($val["date"]), '%d%m%Y');
// Cash // Cash
print $date . $sep;
print $conf->global->ACCOUNTING_CASH_JOURNAL . $sep;
foreach ( $tabbq[$key] as $k => $mt ) { foreach ( $tabbq[$key] as $k => $mt ) {
print $date . $sep;
print $cash_journal . $sep;
print length_accountg(html_entity_decode($k)) . $sep; print length_accountg(html_entity_decode($k)) . $sep;
print $sep; print $sep;
print ($mt < 0 ? 'C' : 'D') . $sep; print ($mt < 0 ? 'C' : 'D') . $sep;
print price($mt) . $sep; print ($mt <= 0 ? price(- $mt) : $mt) . $sep;
print $val["type_payment"] . $sep;
print $val["ref"] . $sep;
print "\n";
} }
print utf8_decode($langs->trans("CashPayment")) . $sep;
print $val["ref"] . $sep;
print "\n";
// Third party // Third party
foreach ( $tabtp[$key] as $k => $mt ) { foreach ( $tabtp[$key] as $k => $mt ) {
if ($mt) { if ($mt) {
print $date . $sep; print $date . $sep;
print $conf->global->ACCOUNTING_CASH_JOURNAL . $sep; print $cash_journal . $sep;
if ($obj->label == '(SupplierInvoicePayment)') { if ($val["lib"] == '(SupplierInvoicePayment)') {
print length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER) . $sep; print length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER) . $sep;
} else { } else {
print length_accountg($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER) . $sep; print length_accountg($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER) . $sep;
} }
print length_accounta(html_entity_decode($k)) . $sep; print length_accounta(html_entity_decode($k)) . $sep;
print ($mt < 0 ? 'D' : 'C') . $sep; print ($mt < 0 ? 'D' : 'C') . $sep;
print price($mt) . $sep; print ($mt <= 0 ? price(- $mt) : $mt) . $sep;
print $langs->trans("ThirdParty") . $sep; print $val["type_payment"] . $sep;
print $val["ref"] . $sep; print $val["ref"] . $sep;
print "\n"; print "\n";
} }
} }
} }
} else // Modèle Export Classique } else // Model Classic Export
{ {
foreach ( $tabpay as $key => $val ) { foreach ( $tabpay as $key => $val ) {
$date = dol_print_date($db->jdate($val["date"]), 'day'); $date = dol_print_date($db->jdate($val["date"]), 'day');
print '"' . $date . '"' . $sep;
print '"' . $val["ref"] . '"' . $sep;
// Cash // Cash
foreach ( $tabbq[$key] as $k => $mt ) { foreach ( $tabbq[$key] as $k => $mt ) {
print '"' . $date . '"' . $sep;
print '"' . $val["ref"] . '"' . $sep;
print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep; print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep;
print '"' . $langs->trans("Cash") . '"' . $sep; print '"' . $langs->trans("Cash") . '"' . $sep;
print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep; print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep;
print '"' . ($mt < 0 ? price(- $mt) : '') . '"'; print '"' . ($mt < 0 ? price(- $mt) : '') . '"';
print "\n";
} }
print "\n";
// Third party // Third party
foreach ( $tabtp[$key] as $k => $mt ) { foreach ( $tabtp[$key] as $k => $mt ) {
@ -455,7 +457,7 @@ if ($action == 'export_csv') {
$period = $form->select_date($date_start, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end, 'date_end', 0, 0, 0, '', 1, 0, 1); $period = $form->select_date($date_start, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end, 'date_end', 0, 0, 0, '', 1, 0, 1);
report_header($name, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => '')); report_header($name, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''));
print '<input type="button" class="button" style="float: right;" value="Export CSV" onclick="launch_export();" />'; print '<input type="button" class="button" style="float: right;" value="' . $langs->trans("Export") . '" onclick="launch_export();" />';
print '<input type="button" class="button" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writeBookKeeping();" />'; print '<input type="button" class="button" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writeBookKeeping();" />';

View File

@ -242,16 +242,19 @@ if ($action == 'writebookkeeping') {
$companystatic = new Societe($db); $companystatic = new Societe($db);
// export csv // Export
if ($action == 'export_csv') if ($action == 'export_csv')
{ {
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV; $sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
$purchase_journal = $conf->global->ACCOUNTING_PURCHASE_JOURNAL;
header('Content-Type: text/csv'); header('Content-Type: text/csv');
header('Content-Disposition: attachment;filename=journal_achats.csv'); header('Content-Disposition: attachment;filename=journal_achats.csv');
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 1) // Modèle Export Cegid Expert if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 2) // Model Cegid Expert Export
{ {
$sep = ";";
foreach ( $tabfac as $key => $val ) { foreach ( $tabfac as $key => $val ) {
$date = dol_print_date($db->jdate($val["date"]), '%d%m%Y'); $date = dol_print_date($db->jdate($val["date"]), '%d%m%Y');
@ -263,7 +266,7 @@ if ($action == 'export_csv')
if ($mt) { if ($mt) {
print $date . $sep; print $date . $sep;
print $conf->global->ACCOUNTING_PURCHASE_JOURNAL . $sep; print $purchase_journal . $sep;
print length_accountg(html_entity_decode($k)) . $sep; print length_accountg(html_entity_decode($k)) . $sep;
print $sep; print $sep;
print ($mt < 0 ? 'C' : 'D') . $sep; print ($mt < 0 ? 'C' : 'D') . $sep;
@ -275,11 +278,10 @@ if ($action == 'export_csv')
} }
// VAT // VAT
// var_dump($tabtva);
foreach ( $tabtva[$key] as $k => $mt ) { foreach ( $tabtva[$key] as $k => $mt ) {
if ($mt) { if ($mt) {
print $date . $sep; print $date . $sep;
print $conf->global->ACCOUNTING_PURCHASE_JOURNAL . $sep; print $purchase_journal . $sep;
print length_accountg(html_entity_decode($k)) . $sep; print length_accountg(html_entity_decode($k)) . $sep;
print $sep; print $sep;
print ($mt < 0 ? 'C' : 'D') . $sep; print ($mt < 0 ? 'C' : 'D') . $sep;
@ -289,20 +291,20 @@ if ($action == 'export_csv')
print "\n"; print "\n";
} }
} }
print $date . $sep;
print $conf->global->ACCOUNTING_PURCHASE_JOURNAL . $sep;
print length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER) . $sep;
foreach ( $tabttc[$key] as $k => $mt ) { foreach ( $tabttc[$key] as $k => $mt ) {
print $date . $sep;
print $purchase_journal . $sep;
print length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER) . $sep;
print length_accounta(html_entity_decode($k)) . $sep; print length_accounta(html_entity_decode($k)) . $sep;
print ($mt < 0 ? 'D' : 'C') . $sep; print ($mt < 0 ? 'D' : 'C') . $sep;
print ($mt <= 0 ? price(- $mt) : $mt) . $sep; print ($mt <= 0 ? price(- $mt) : $mt) . $sep;
print utf8_decode($companystatic->name) . $sep; print utf8_decode($companystatic->name) . $sep;
print $val["ref"]; print $val["ref"];
print "\n";
} }
print "\n";
} }
} else // Modèle Export Classique } else // Model Classic Export
{ {
foreach ( $tabfac as $key => $val ) { foreach ( $tabfac as $key => $val ) {
$date = dol_print_date($db->jdate($val["date"]), 'day'); $date = dol_print_date($db->jdate($val["date"]), 'day');
@ -326,7 +328,6 @@ if ($action == 'export_csv')
} }
} }
// VAT // VAT
// var_dump($tabtva);
foreach ( $tabtva[$key] as $k => $mt ) { foreach ( $tabtva[$key] as $k => $mt ) {
if ($mt) { if ($mt) {
print '"' . $date . '"' . $sep; print '"' . $date . '"' . $sep;
@ -340,9 +341,9 @@ if ($action == 'export_csv')
} }
// Third party // Third party
print '"' . $date . '"' . $sep;
print '"' . $val["ref"] . '"' . $sep;
foreach ( $tabttc[$key] as $k => $mt ) { foreach ( $tabttc[$key] as $k => $mt ) {
print '"' . $date . '"' . $sep;
print '"' . $val["ref"] . '"' . $sep;
print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep; print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;
print '"' . utf8_decode($companystatic->name) . '"' . $sep; print '"' . utf8_decode($companystatic->name) . '"' . $sep;
print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep; print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep;
@ -370,7 +371,7 @@ if ($action == 'export_csv')
$period = $form->select_date($date_start, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end, 'date_end', 0, 0, 0, '', 1, 0, 1); $period = $form->select_date($date_start, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end, 'date_end', 0, 0, 0, '', 1, 0, 1);
report_header($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => '')); report_header($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''));
print '<input type="button" class="button" style="float: right;" value="Export CSV" onclick="launch_export();" />'; print '<input type="button" class="button" style="float: right;" value="' . $langs->trans("Export") . '" onclick="launch_export();" />';
print '<input type="button" class="button" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writebookkeeping();" />'; print '<input type="button" class="button" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writebookkeeping();" />';
@ -434,7 +435,6 @@ if ($action == 'export_csv')
} }
} }
// VAT // VAT
// var_dump($tabtva);
foreach ( $tabtva[$key] as $k => $mt ) { foreach ( $tabtva[$key] as $k => $mt ) {
if ($mt) { if ($mt) {
print "<tr " . $bc[$var] . " >"; print "<tr " . $bc[$var] . " >";
@ -449,13 +449,11 @@ if ($action == 'export_csv')
print "<tr " . $bc[$var] . ">"; print "<tr " . $bc[$var] . ">";
// Third party // Third party
print "<td>" . $date . "</td>";
print "<td>" . $invoicestatic->getNomUrl(1) . "</td>";
foreach ( $tabttc[$key] as $k => $mt ) { foreach ( $tabttc[$key] as $k => $mt ) {
print "<td>" . $date . "</td>";
print "<td>" . $invoicestatic->getNomUrl(1) . "</td>";
$companystatic->id = $tabcompany[$key]['id']; $companystatic->id = $tabcompany[$key]['id'];
$companystatic->name = $tabcompany[$key]['name']; $companystatic->name = $tabcompany[$key]['name'];
print "<td>" . length_accounta($k); print "<td>" . length_accounta($k);
print "</td><td>" . $langs->trans("ThirdParty"); print "</td><td>" . $langs->trans("ThirdParty");
print ' (' . $companystatic->getNomUrl(0, 'supplier', 16) . ')'; print ' (' . $companystatic->getNomUrl(0, 'supplier', 16) . ')';

View File

@ -4,7 +4,7 @@
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr> * Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> * Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* *
@ -93,7 +93,7 @@ $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = fd.fk_produc
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON aa.rowid = fd.fk_code_ventilation"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON aa.rowid = fd.fk_code_ventilation";
$sql .= " JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture"; $sql .= " JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture";
$sql .= " JOIN " . MAIN_DB_PREFIX . "societe as s ON s.rowid = f.fk_soc"; $sql .= " JOIN " . MAIN_DB_PREFIX . "societe as s ON s.rowid = f.fk_soc";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_tva ct ON fd.tva_tx = ct.taux AND ct.fk_pays = '" . $idpays . "'"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_tva as ct ON fd.tva_tx = ct.taux AND ct.fk_pays = '" . $idpays . "'";
$sql .= " WHERE fd.fk_code_ventilation > 0 "; $sql .= " WHERE fd.fk_code_ventilation > 0 ";
if (! empty($conf->multicompany->enabled)) { if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity = " . $conf->entity; $sql .= " AND f.entity = " . $conf->entity;
@ -245,17 +245,20 @@ if ($action == 'writebookkeeping') {
} }
} }
} }
// export csv // Export
if ($action == 'export_csv') { if ($action == 'export_csv') {
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV; $sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
$sell_journal = $conf->global->ACCOUNTING_SELL_JOURNAL;
header('Content-Type: text/csv'); header('Content-Type: text/csv');
header('Content-Disposition: attachment;filename=journal_ventes.csv'); header('Content-Disposition: attachment;filename=journal_ventes.csv');
$companystatic = new Client($db); $companystatic = new Client($db);
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 1) // Modèle Export Cegid Expert if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 2) // Model Cegid Expert Export
{ {
$sep = ";";
foreach ( $tabfac as $key => $val ) { foreach ( $tabfac as $key => $val ) {
$companystatic->id = $tabcompany[$key]['id']; $companystatic->id = $tabcompany[$key]['id'];
$companystatic->name = $tabcompany[$key]['name']; $companystatic->name = $tabcompany[$key]['name'];
@ -263,23 +266,23 @@ if ($action == 'export_csv') {
$date = dol_print_date($db->jdate($val["date"]), '%d%m%Y'); $date = dol_print_date($db->jdate($val["date"]), '%d%m%Y');
print $date . $sep;
print $conf->global->ACCOUNTING_SELL_JOURNAL . $sep;
print length_accountg($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER) . $sep;
foreach ( $tabttc[$key] as $k => $mt ) { foreach ( $tabttc[$key] as $k => $mt ) {
print $date . $sep;
print $sell_journal . $sep;
print length_accountg($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER) . $sep;
print length_accounta(html_entity_decode($k)) . $sep; print length_accounta(html_entity_decode($k)) . $sep;
print ($mt < 0 ? 'C' : 'D') . $sep; print ($mt < 0 ? 'C' : 'D') . $sep;
print ($mt <= 0 ? price(- $mt) : $mt) . $sep; print ($mt <= 0 ? price(- $mt) : $mt) . $sep;
print utf8_decode($companystatic->name) . $sep; print utf8_decode($companystatic->name) . $sep;
print $val["ref"];
print "\n";
} }
print $val["ref"];
print "\n";
// Product / Service // Product / Service
foreach ( $tabht[$key] as $k => $mt ) { foreach ( $tabht[$key] as $k => $mt ) {
if ($mt) { if ($mt) {
print $date . $sep; print $date . $sep;
print $conf->global->ACCOUNTING_SELL_JOURNAL . $sep; print $sell_journal . $sep;
print length_accountg(html_entity_decode($k)) . $sep; print length_accountg(html_entity_decode($k)) . $sep;
print $sep; print $sep;
print ($mt < 0 ? 'D' : 'C') . $sep; print ($mt < 0 ? 'D' : 'C') . $sep;
@ -289,11 +292,12 @@ if ($action == 'export_csv') {
print "\n"; print "\n";
} }
} }
// TVA // TVA
foreach ( $tabtva[$key] as $k => $mt ) { foreach ( $tabtva[$key] as $k => $mt ) {
if ($mt) { if ($mt) {
print $date . $sep; print $date . $sep;
print $conf->global->ACCOUNTING_SELL_JOURNAL . $sep; print $sell_journal . $sep;
print length_accountg(html_entity_decode($k)) . $sep; print length_accountg(html_entity_decode($k)) . $sep;
print $sep; print $sep;
print ($mt < 0 ? 'D' : 'C') . $sep; print ($mt < 0 ? 'D' : 'C') . $sep;
@ -304,7 +308,7 @@ if ($action == 'export_csv') {
} }
} }
} }
} else // Modèle Export Classique } else // Model Classic Export
{ {
foreach ( $tabfac as $key => $val ) { foreach ( $tabfac as $key => $val ) {
$companystatic->id = $tabcompany[$key]['id']; $companystatic->id = $tabcompany[$key]['id'];
@ -312,15 +316,16 @@ if ($action == 'export_csv') {
$companystatic->client = $tabcompany[$key]['code_client']; $companystatic->client = $tabcompany[$key]['code_client'];
$date = dol_print_date($db->jdate($val["date"]), 'day'); $date = dol_print_date($db->jdate($val["date"]), 'day');
print '"' . $date . '"' . $sep;
print '"' . $val["ref"] . '"' . $sep;
foreach ( $tabttc[$key] as $k => $mt ) { foreach ( $tabttc[$key] as $k => $mt ) {
print '"' . $date . '"' . $sep;
print '"' . $val["ref"] . '"' . $sep;
print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep; print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;
print '"' . utf8_decode($companystatic->name) . '"' . $sep; print '"' . utf8_decode($companystatic->name) . '"' . $sep;
print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep; print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep;
print '"' . ($mt < 0 ? price(- $mt) : '') . '"'; print '"' . ($mt < 0 ? price(- $mt) : '') . '"';
print "\n";
} }
print "\n";
// Product / Service // Product / Service
foreach ( $tabht[$key] as $k => $mt ) { foreach ( $tabht[$key] as $k => $mt ) {
@ -339,7 +344,6 @@ if ($action == 'export_csv') {
} }
// VAT // VAT
// var_dump($tabtva);
foreach ( $tabtva[$key] as $k => $mt ) { foreach ( $tabtva[$key] as $k => $mt ) {
if ($mt) { if ($mt) {
print '"' . $date . '"' . $sep; print '"' . $date . '"' . $sep;
@ -372,7 +376,7 @@ if ($action == 'export_csv') {
$period = $form->select_date($date_start, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end, 'date_end', 0, 0, 0, '', 1, 0, 1); $period = $form->select_date($date_start, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end, 'date_end', 0, 0, 0, '', 1, 0, 1);
report_header($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => '')); report_header($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''));
print '<input type="button" class="button" style="float: right;" value="Export CSV" onclick="launch_export();" />'; print '<input type="button" class="button" style="float: right;" value="' . $langs->trans("Export") . '" onclick="launch_export();" />';
print '<input type="button" class="button" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writebookkeeping();" />'; print '<input type="button" class="button" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writebookkeeping();" />';
@ -420,12 +424,11 @@ if ($action == 'export_csv') {
$date = dol_print_date($db->jdate($val["date"]), 'day'); $date = dol_print_date($db->jdate($val["date"]), 'day');
print "<tr " . $bc[$var] . ">";
// Third party // Third party
print "<td>" . $date . "</td>";
print "<td>" . $invoicestatic->getNomUrl(1) . "</td>";
foreach ( $tabttc[$key] as $k => $mt ) { foreach ( $tabttc[$key] as $k => $mt ) {
print "<tr " . $bc[$var] . ">";
print "<td>" . $date . "</td>";
print "<td>" . $invoicestatic->getNomUrl(1) . "</td>";
$companystatic->id = $tabcompany[$key]['id']; $companystatic->id = $tabcompany[$key]['id'];
$companystatic->name = $tabcompany[$key]['name']; $companystatic->name = $tabcompany[$key]['name'];
$companystatic->client = $tabcompany[$key]['code_client']; $companystatic->client = $tabcompany[$key]['code_client'];
@ -455,7 +458,6 @@ if ($action == 'export_csv') {
} }
// VAT // VAT
// var_dump($tabtva);
foreach ( $tabtva[$key] as $k => $mt ) { foreach ( $tabtva[$key] as $k => $mt ) {
if ($mt) { if ($mt) {
print "<tr " . $bc[$var] . ">"; print "<tr " . $bc[$var] . ">";
@ -473,8 +475,8 @@ if ($action == 'export_csv') {
} }
print "</table>"; print "</table>";
}
// End of page
llxFooter();
// End of page
llxFooter();
}
$db->close(); $db->close();

View File

@ -480,10 +480,10 @@ function backup_tables($outputfile, $tables='*')
if ($row[$j] == null and !is_string($row[$j])) { if ($row[$j] == null and !is_string($row[$j])) {
// IMPORTANT: if the field is NULL we set it NULL // IMPORTANT: if the field is NULL we set it NULL
$row[$j] = 'NULL'; $row[$j] = 'NULL';
} elseif(is_string($row[$j]) and $row[$j] == '') { } elseif(is_string($row[$j]) && $row[$j] == '') {
// if it's an empty string, we set it as an empty string // if it's an empty string, we set it as an empty string
$row[$j] = "''"; $row[$j] = "''";
} elseif(is_numeric($row[$j]) and !strcmp($row[$j], $row[$j]+0) ) { // test if it's a numeric type and the numeric version ($nb+0) == string version (eg: if we have 01, it's probably not a number but rather a string, else it would not have any leading 0) } elseif(is_numeric($row[$j]) && !strcmp($row[$j], $row[$j]+0) ) { // test if it's a numeric type and the numeric version ($nb+0) == string version (eg: if we have 01, it's probably not a number but rather a string, else it would not have any leading 0)
// if it's a number, we return it as-is // if it's a number, we return it as-is
// $row[$j] = $row[$j]; // $row[$j] = $row[$j];
} else { // else for all other cases we escape the value and put quotes around } else { // else for all other cases we escape the value and put quotes around

View File

@ -550,7 +550,7 @@ class RssParser
// //
elseif ($this->_format == 'atom' and $el == 'link' ) elseif ($this->_format == 'atom' and $el == 'link' )
{ {
if ( isset($attrs['rel']) and $attrs['rel'] == 'alternate' ) if ( isset($attrs['rel']) && $attrs['rel'] == 'alternate' )
{ {
$link_el = 'link'; $link_el = 'link';
} }

View File

@ -26,13 +26,13 @@
* \brief File to manage popup date selector * \brief File to manage popup date selector
*/ */
//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // disabled
//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled cause need to load personalized language //if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled cause need to load personalized language
if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Not disabled cause need to do translations //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Not disabled cause need to do translations
if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK',1); if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK',1);
if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL',1); if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL',1);
if (! defined('NOLOGIN')) define('NOLOGIN',1); // Not disabled cause need to load personalized language if (! defined('NOLOGIN')) define('NOLOGIN',1); // disabled
if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1); if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1);
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1); if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1);
@ -188,26 +188,13 @@ function displayBox($selectedDate,$month,$year)
<tr class="dpDayNames"> <tr class="dpDayNames">
<?php <?php
$startday=isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:1; $startday=isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:1;
if($startday==1) $day_names = array('ShortSunday', 'ShortMonday', 'ShortTuesday', 'ShortWednesday', 'ShortThursday', 'ShortFriday', 'ShortSaturday');
{?> for( $i=0; $i < 7; $i++ )
<td width="14%"><?php echo $langs->trans("ShortMonday") ?></td> {
<td width="15%"><?php echo $langs->trans("ShortTuesday") ?></td> echo '<td width="', (int) (($i+1)*100/7) - (int) ($i*100/7), '%">', $langs->trans($day_names[($i + $startday) % 7]), '</td>', "\n";
<td width="14%"><?php echo $langs->trans("ShortWednesday") ?></td> }
<td width="15%"><?php echo $langs->trans("ShortThursday") ?></td> ?>
<td width="14%"><?php echo $langs->trans("ShortFriday") ?></td>
<td width="14%"><?php echo $langs->trans("ShortSaturday") ?></td>
<td width="14%"><?php echo $langs->trans("ShortSunday") ?></td>
<?php
}else {?>
<td width="14%"><?php echo $langs->trans("ShortSunday") ?></td>
<td width="14%"><?php echo $langs->trans("ShortMonday") ?></td>
<td width="15%"><?php echo $langs->trans("ShortTuesday") ?></td>
<td width="14%"><?php echo $langs->trans("ShortWednesday") ?></td>
<td width="15%"><?php echo $langs->trans("ShortThursday") ?></td>
<td width="14%"><?php echo $langs->trans("ShortFriday") ?></td>
<td width="14%"><?php echo $langs->trans("ShortSaturday") ?></td>
<?php
}?>
</tr> </tr>
<?php <?php
//print "x ".$thedate." y"; // $thedate = first day of month //print "x ".$thedate." y"; // $thedate = first day of month

View File

@ -174,7 +174,7 @@ function FileUpload($resourceType, $currentFolder, $sCommand, $CKEcallback = '')
if ( isset( $_FILES['NewFile'] ) && !is_null($_FILES['NewFile']['tmp_name']) if ( isset( $_FILES['NewFile'] ) && !is_null($_FILES['NewFile']['tmp_name'])
// This is for the QuickUpload tab box // This is for the QuickUpload tab box
or (isset($_FILES['upload']) and !is_null($_FILES['upload']['tmp_name']))) or (isset($_FILES['upload']) && !is_null($_FILES['upload']['tmp_name'])))
{ {
global $Config ; global $Config ;

View File

@ -154,6 +154,8 @@ class pdf_einstein extends ModelePDFCommandes
$outputlangs->load("orders"); $outputlangs->load("orders");
$outputlangs->load("deliveries"); $outputlangs->load("deliveries");
$nblignes = count($object->lines);
if ($conf->commande->dir_output) if ($conf->commande->dir_output)
{ {
$object->fetch_thirdparty(); $object->fetch_thirdparty();
@ -195,8 +197,6 @@ class pdf_einstein extends ModelePDFCommandes
global $action; global $action;
$reshook=$hookmanager->executeHooks('beforePDFCreation',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks $reshook=$hookmanager->executeHooks('beforePDFCreation',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
$nblignes = count($object->lines);
// Create pdf instance // Create pdf instance
$pdf=pdf_getInstance($this->format); $pdf=pdf_getInstance($this->format);
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
@ -328,6 +328,7 @@ class pdf_einstein extends ModelePDFCommandes
//print $pageposafter.'-'.$pageposbefore;exit; //print $pageposafter.'-'.$pageposbefore;exit;
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,4,$curX,$curY,$hideref,$hidedesc); pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,4,$curX,$curY,$hideref,$hidedesc);
$pageposafter=$pdf->getPage();
$posyafter=$pdf->GetY(); $posyafter=$pdf->GetY();
if ($posyafter > ($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))) // There is no space left for total+free text if ($posyafter > ($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))) // There is no space left for total+free text
{ {
@ -511,11 +512,6 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->Output($file,'F'); $pdf->Output($file,'F');
// Add pdfgeneration hook // Add pdfgeneration hook
if (! is_object($hookmanager))
{
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
$hookmanager=new HookManager($this->db);
}
$hookmanager->initHooks(array('pdfgeneration')); $hookmanager->initHooks(array('pdfgeneration'));
$parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs); $parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs);
global $action; global $action;
@ -797,7 +793,7 @@ class pdf_einstein extends ModelePDFCommandes
//{ //{
foreach( $this->localtax1 as $localtax_type => $localtax_rate ) foreach( $this->localtax1 as $localtax_type => $localtax_rate )
{ {
if (in_array((string) $localtax_type, array('1','3','5','7'))) continue; if (in_array((string) $localtax_type, array('1','3','5'))) 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
@ -828,7 +824,7 @@ class pdf_einstein extends ModelePDFCommandes
//{ //{
foreach( $this->localtax2 as $localtax_type => $localtax_rate ) foreach( $this->localtax2 as $localtax_type => $localtax_rate )
{ {
if (in_array((string) $localtax_type, array('1','3','5','7'))) continue; if (in_array((string) $localtax_type, array('1','3','5'))) 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

View File

@ -96,7 +96,7 @@ class pdf_soleil extends ModelePDFFicheinter
/** /**
* Function to build pdf onto disk * Function to build pdf onto disk
* *
* @param CommonObject $object Id of object to generate * @param Object $object Object to generate
* @param Translate $outputlangs Lang output object * @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file * @param string $srctemplatepath Full path of source filename for generator using a template file
* @param int $hidedetails Do not show line details * @param int $hidedetails Do not show line details
@ -106,7 +106,7 @@ class pdf_soleil extends ModelePDFFicheinter
*/ */
function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0) function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0)
{ {
global $user,$langs,$conf,$mysoc; global $user,$langs,$conf,$mysoc,$db,$hookmanager;
if (! is_object($outputlangs)) $outputlangs=$langs; if (! is_object($outputlangs)) $outputlangs=$langs;
// For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
@ -121,16 +121,24 @@ class pdf_soleil extends ModelePDFFicheinter
{ {
$object->fetch_thirdparty(); $object->fetch_thirdparty();
$objectref = dol_sanitizeFileName($object->ref); // Definition of $dir and $file
$dir = $conf->ficheinter->dir_output; if ($object->specimen)
if (! preg_match('/specimen/i',$objectref)) $dir.= "/" . $objectref; {
$file = $dir . "/" . $objectref . ".pdf"; $dir = $conf->ficheinter->dir_output;
$file = $dir . "/SPECIMEN.pdf";
}
else
{
$objectref = dol_sanitizeFileName($object->ref);
$dir = $conf->ficheinter->dir_output . "/" . $objectref;
$file = $dir . "/" . $objectref . ".pdf";
}
if (! file_exists($dir)) if (! file_exists($dir))
{ {
if (dol_mkdir($dir) < 0) if (dol_mkdir($dir) < 0)
{ {
$this->error=$outputlangs->trans("ErrorCanNotCreateDir",$dir); $this->error=$langs->transnoentities("ErrorCanNotCreateDir",$dir);
return 0; return 0;
} }
} }
@ -149,6 +157,9 @@ class pdf_soleil extends ModelePDFFicheinter
global $action; global $action;
$reshook=$hookmanager->executeHooks('beforePDFCreation',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks $reshook=$hookmanager->executeHooks('beforePDFCreation',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
$nblignes = count($object->lines);
// Create pdf instance
$pdf=pdf_getInstance($this->format); $pdf=pdf_getInstance($this->format);
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
$heightforinfotot = 50; // Height reserved to output the info and total part $heightforinfotot = 50; // Height reserved to output the info and total part
@ -196,12 +207,13 @@ class pdf_soleil extends ModelePDFFicheinter
$tab_height_newpage = 150; $tab_height_newpage = 150;
// Affiche notes // Affiche notes
if (! empty($object->note_public)) $notetoshow=empty($object->note_public)?'':$object->note_public;
if ($notetoshow)
{ {
$tab_top = 88; $tab_top = 88;
$pdf->SetFont('','', $default_font_size - 1); $pdf->SetFont('','', $default_font_size - 1);
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($object->note_public), 0, 1); $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1);
$nexY = $pdf->GetY(); $nexY = $pdf->GetY();
$height_note=$nexY-$tab_top; $height_note=$nexY-$tab_top;
@ -252,15 +264,17 @@ class pdf_soleil extends ModelePDFFicheinter
$valide = empty($objectligne->id) ? 0 : $objectligne->fetch($objectligne->id); $valide = empty($objectligne->id) ? 0 : $objectligne->fetch($objectligne->id);
if ($valide > 0 || $object->specimen) if ($valide > 0 || $object->specimen)
{ {
$curX = $this->posxdesc-1;
$curY = $nexY; $curY = $nexY;
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage $pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
$pdf->SetTextColor(0,0,0); $pdf->SetTextColor(0,0,0);
$pdf->setTopMargin($tab_top_newpage); $pdf->setTopMargin($tab_top_newpage);
$pdf->setPageOrientation('', 1, $heightforfooter+$heightforfreetext/*+$heightforinfotot*/); // The only function to edit the bottom margin of current page to set it. $pdf->setPageOrientation('', 1, $heightforfooter+$heightforfreetext+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
$pageposbefore=$pdf->getPage(); $pageposbefore=$pdf->getPage();
// Description of product line
$curX = $this->posxdesc-1;
// Description of product line // Description of product line
$txt=$outputlangs->transnoentities("Date")." : ".dol_print_date($objectligne->datei,'dayhour',false,$outputlangs,true); $txt=$outputlangs->transnoentities("Date")." : ".dol_print_date($objectligne->datei,'dayhour',false,$outputlangs,true);
if ($objectligne->duration > 0) if ($objectligne->duration > 0)
@ -288,6 +302,8 @@ class pdf_soleil extends ModelePDFFicheinter
if ($i == ($nblines-1)) // No more lines, and no space left to show total, so we create a new page if ($i == ($nblines-1)) // No more lines, and no space left to show total, so we create a new page
{ {
$pdf->AddPage('','',true); $pdf->AddPage('','',true);
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
$pdf->setPage($pageposafter+1); $pdf->setPage($pageposafter+1);
} }
} }
@ -316,33 +332,34 @@ class pdf_soleil extends ModelePDFFicheinter
$pdf->setPage($pagenb); $pdf->setPage($pagenb);
if ($pagenb == 1) if ($pagenb == 1)
{ {
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter - $heightforfreetext, 0, $outputlangs, 0, 1); $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
} }
else else
{ {
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter - $heightforfreetext, 0, $outputlangs, 1); $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
} }
$this->_pagefoot($pdf,$object,$outputlangs,1); $this->_pagefoot($pdf,$object,$outputlangs,1);
$pagenb++; $pagenb++;
$pdf->setPage($pagenb); $pdf->setPage($pagenb);
$this->_pagehead($pdf, $object, 0, $outputlangs);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
} }
if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak) if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak)
{ {
if ($pagenb == 1) if ($pagenb == 1)
{ {
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter - $heightforfreetext, 0, $outputlangs, 0, 1); $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
} }
else else
{ {
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter - $heightforfreetext, 0, $outputlangs, 1, 1); $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
} }
$this->_pagefoot($pdf,$object,$outputlangs,1); $this->_pagefoot($pdf,$object,$outputlangs,1);
// New page // New page
$pdf->AddPage(); $pdf->AddPage();
if (! empty($tplidx)) $pdf->useTemplate($tplidx); if (! empty($tplidx)) $pdf->useTemplate($tplidx);
$pagenb++; $pagenb++;
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
} }
} }
} }
@ -350,13 +367,13 @@ class pdf_soleil extends ModelePDFFicheinter
// Show square // Show square
if ($pagenb == 1) if ($pagenb == 1)
{ {
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfreetext - $heightforfooter - 50, 0, $outputlangs, 0, 0); $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0);
$bottomlasttab=$this->page_hauteur - $heightforfooter - $heightforfooter + 1; $bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
} }
else else
{ {
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfreetext - $heightforfooter - 50, 0, $outputlangs, 1, 0); $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0);
$bottomlasttab=$this->page_hauteur - $heightforfooter - $heightforfooter + 1; $bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
} }
$this->_pagefoot($pdf,$object,$outputlangs); $this->_pagefoot($pdf,$object,$outputlangs);
@ -364,6 +381,13 @@ class pdf_soleil extends ModelePDFFicheinter
$pdf->Close(); $pdf->Close();
$pdf->Output($file,'F'); $pdf->Output($file,'F');
// Add pdfgeneration hook
$hookmanager->initHooks(array('pdfgeneration'));
$parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs);
global $action;
$reshook=$hookmanager->executeHooks('afterPDFCreation',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
if (! empty($conf->global->MAIN_UMASK)) if (! empty($conf->global->MAIN_UMASK))
@chmod($file, octdec($conf->global->MAIN_UMASK)); @chmod($file, octdec($conf->global->MAIN_UMASK));

View File

@ -137,7 +137,7 @@ class pdf_standard
$imgscaleheight=(empty($forceimgscalewidth)?0.5:$forceimgscalewidth); // Scale of image for height (1=Full height of sticker) $imgscaleheight=(empty($forceimgscalewidth)?0.5:$forceimgscalewidth); // Scale of image for height (1=Full height of sticker)
// We are in a new page, then we must add a page // We are in a new page, then we must add a page
if (($this->_COUNTX ==0) and ($this->_COUNTY==0) and (!$this->_First==1)) { if (($this->_COUNTX ==0) && ($this->_COUNTY==0) and (!$this->_First==1)) {
$pdf->AddPage(); $pdf->AddPage();
} }
$this->_First=0; $this->_First=0;

View File

@ -129,7 +129,7 @@ class modAccounting extends DolibarrModules
$this->const[9] = array( $this->const[9] = array(
"ACCOUNTING_EXPORT_MODELCSV", "ACCOUNTING_EXPORT_MODELCSV",
"chaine", "chaine",
"0" "1"
); );
$this->const[10] = array( $this->const[10] = array(
"ACCOUNTING_LENGTH_GACCOUNT", "ACCOUNTING_LENGTH_GACCOUNT",

View File

@ -135,7 +135,7 @@ class pdf_standardlabel
$imgscaleheight=(empty($forceimgscalewidth)?0.5:$forceimgscalewidth); // Scale of image for height (1=Full height of sticker) $imgscaleheight=(empty($forceimgscalewidth)?0.5:$forceimgscalewidth); // Scale of image for height (1=Full height of sticker)
// We are in a new page, then we must add a page // We are in a new page, then we must add a page
if (($this->_COUNTX ==0) and ($this->_COUNTY==0) and (!$this->_First==1)) { if (($this->_COUNTX ==0) && ($this->_COUNTY==0) and (!$this->_First==1)) {
$pdf->AddPage(); $pdf->AddPage();
} }
$this->_First=0; $this->_First=0;

View File

@ -882,7 +882,7 @@ if ($action == 'create')
if (($line->product_type == 1 && empty($conf->global->STOCK_SUPPORTS_SERVICES)) || $defaultqty < 0) $defaultqty=0; if (($line->product_type == 1 && empty($conf->global->STOCK_SUPPORTS_SERVICES)) || $defaultqty < 0) $defaultqty=0;
} }
if (empty($conf->productbatch->enabled) || ! ($product->hasbatch() and is_object($product->stock_warehouse[$warehouse_id]))) if (empty($conf->productbatch->enabled) || ! ($product->hasbatch() && is_object($product->stock_warehouse[$warehouse_id])))
{ {
// Quantity to send // Quantity to send
print '<td align="center">'; print '<td align="center">';

View File

@ -960,7 +960,7 @@ class Fichinter extends CommonObject
$this->note_private='Private note'; $this->note_private='Private note';
$this->note_public='SPECIMEN'; $this->note_public='SPECIMEN';
$this->duree = 0; $this->duree = 0;
$nbp = 20; $nbp = 25;
$xnbp = 0; $xnbp = 0;
while ($xnbp < $nbp) while ($xnbp < $nbp)
{ {

View File

@ -13,7 +13,9 @@ ConfigAccountingExpert=Configuration of the module accounting expert
Journaux=Journals Journaux=Journals
JournalFinancial=Financial journals JournalFinancial=Financial journals
Exports=Exports Exports=Exports
Export=Export
Modelcsv=Model of export Modelcsv=Model of export
OptionsDeactivatedForThisExportModel=For this export model, options are deactivated
Selectmodelcsv=Select a model of export Selectmodelcsv=Select a model of export
Modelcsv_normal=Classic export Modelcsv_normal=Classic export
Modelcsv_CEGID=Export towards CEGID Expert Modelcsv_CEGID=Export towards CEGID Expert
@ -66,7 +68,7 @@ Lineofinvoice=Line of invoice
VentilatedinAccount=Ventilated successfully in the accounting account VentilatedinAccount=Ventilated successfully in the accounting account
NotVentilatedinAccount=Not ventilated in the accounting account NotVentilatedinAccount=Not ventilated in the accounting account
ACCOUNTING_SEPARATORCSV=Separator CSV ACCOUNTING_SEPARATORCSV=Column separator in export file
ACCOUNTING_LIMIT_LIST_VENTILATION=Number of elements to be breakdown shown by page (maximum recommended : 50) ACCOUNTING_LIMIT_LIST_VENTILATION=Number of elements to be breakdown shown by page (maximum recommended : 50)
ACCOUNTING_LIST_SORT_VENTILATION_TODO=Begin the sorting of the breakdown pages "Has to breakdown" by the most recent elements ACCOUNTING_LIST_SORT_VENTILATION_TODO=Begin the sorting of the breakdown pages "Has to breakdown" by the most recent elements