From 6c79247a4b2c15902cb927a83ccd4bc1fd1396b3 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sat, 13 Jul 2013 11:44:25 +0200 Subject: [PATCH 1/4] Merge --- dev/initdata/generate-commande.php | 0 dev/initdata/generate-facture.php | 0 dev/initdata/generate-produit.php | 0 dev/initdata/generate-propale.php | 0 dev/initdata/generate-societe.php | 0 htdocs/admin/pdf.php | 0 htdocs/admin/proxy.php | 0 htdocs/admin/sms.php | 0 htdocs/admin/system/perf.php | 13 ------------- htdocs/admin/translation.php | 0 htdocs/admin/workflow.php | 0 htdocs/core/class/CSMSFile.class.php | 0 htdocs/core/class/commondocgenerator.class.php | 0 htdocs/core/class/extrafields.class.php | 0 htdocs/core/class/genericobject.class.php | 0 htdocs/core/class/hookmanager.class.php | 0 htdocs/core/class/html.formsms.class.php | 0 htdocs/core/class/rssparser.class.php | 0 htdocs/core/class/smtps.class.php | 0 htdocs/core/class/vcard.class.php | 0 .../triggers/interface_20_all_Logevents.class.php | 0 .../interface_20_modPaypal_PaypalWorkflow.class.php | 0 ...terface_20_modWorkflow_WorkflowManager.class.php | 0 .../interface_50_modAgenda_ActionsAuto.class.php | 0 .../interface_50_modLdap_Ldapsynchro.class.php | 0 ...erface_50_modNotification_Notification.class.php | 0 .../triggers/interface_90_all_Demo.class.php-NORUN | 0 htdocs/filefunc.inc.php | 0 htdocs/fourn/commande/index.php | 0 29 files changed, 13 deletions(-) mode change 100644 => 100755 dev/initdata/generate-commande.php mode change 100644 => 100755 dev/initdata/generate-facture.php mode change 100644 => 100755 dev/initdata/generate-produit.php mode change 100644 => 100755 dev/initdata/generate-propale.php mode change 100644 => 100755 dev/initdata/generate-societe.php mode change 100755 => 100644 htdocs/admin/pdf.php mode change 100755 => 100644 htdocs/admin/proxy.php mode change 100755 => 100644 htdocs/admin/sms.php mode change 100755 => 100644 htdocs/admin/translation.php mode change 100755 => 100644 htdocs/admin/workflow.php mode change 100755 => 100644 htdocs/core/class/CSMSFile.class.php mode change 100755 => 100644 htdocs/core/class/commondocgenerator.class.php mode change 100755 => 100644 htdocs/core/class/extrafields.class.php mode change 100755 => 100644 htdocs/core/class/genericobject.class.php mode change 100755 => 100644 htdocs/core/class/hookmanager.class.php mode change 100755 => 100644 htdocs/core/class/html.formsms.class.php mode change 100755 => 100644 htdocs/core/class/rssparser.class.php mode change 100755 => 100644 htdocs/core/class/smtps.class.php mode change 100755 => 100644 htdocs/core/class/vcard.class.php mode change 100755 => 100644 htdocs/core/triggers/interface_20_all_Logevents.class.php mode change 100755 => 100644 htdocs/core/triggers/interface_20_modPaypal_PaypalWorkflow.class.php mode change 100755 => 100644 htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php mode change 100755 => 100644 htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php mode change 100755 => 100644 htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php mode change 100755 => 100644 htdocs/core/triggers/interface_50_modNotification_Notification.class.php mode change 100755 => 100644 htdocs/core/triggers/interface_90_all_Demo.class.php-NORUN mode change 100755 => 100644 htdocs/filefunc.inc.php mode change 100755 => 100644 htdocs/fourn/commande/index.php diff --git a/dev/initdata/generate-commande.php b/dev/initdata/generate-commande.php old mode 100644 new mode 100755 diff --git a/dev/initdata/generate-facture.php b/dev/initdata/generate-facture.php old mode 100644 new mode 100755 diff --git a/dev/initdata/generate-produit.php b/dev/initdata/generate-produit.php old mode 100644 new mode 100755 diff --git a/dev/initdata/generate-propale.php b/dev/initdata/generate-propale.php old mode 100644 new mode 100755 diff --git a/dev/initdata/generate-societe.php b/dev/initdata/generate-societe.php old mode 100644 new mode 100755 diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php old mode 100755 new mode 100644 diff --git a/htdocs/admin/proxy.php b/htdocs/admin/proxy.php old mode 100755 new mode 100644 diff --git a/htdocs/admin/sms.php b/htdocs/admin/sms.php old mode 100755 new mode 100644 diff --git a/htdocs/admin/system/perf.php b/htdocs/admin/system/perf.php index c5bb7993c18..4f24998227a 100644 --- a/htdocs/admin/system/perf.php +++ b/htdocs/admin/system/perf.php @@ -433,18 +433,6 @@ if ($resql) } // Browser -<<<<<<< HEAD -print '
'; -print ''.$langs->trans("Browser").': '; -var_dump($conf->browser); -print '
'; - -// Database statistics update -print '
'; -print ''.$langs->trans("DatabaseStatistics").': '; -print '
'; - -======= print '
'; print ''.$langs->trans("Browser").':
'; if (! in_array($conf->browser->name, array('chrome','opera','safari','firefox'))) @@ -463,7 +451,6 @@ print '
'; print ''.$langs->trans("DatabaseStatistics").': '; print '
'; */ ->>>>>>> 7485192cfbca23027d10cfdc41a33a14f332d23c llxFooter(); diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php old mode 100755 new mode 100644 diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php old mode 100755 new mode 100644 diff --git a/htdocs/core/class/CSMSFile.class.php b/htdocs/core/class/CSMSFile.class.php old mode 100755 new mode 100644 diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php old mode 100755 new mode 100644 diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php old mode 100755 new mode 100644 diff --git a/htdocs/core/class/genericobject.class.php b/htdocs/core/class/genericobject.class.php old mode 100755 new mode 100644 diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php old mode 100755 new mode 100644 diff --git a/htdocs/core/class/html.formsms.class.php b/htdocs/core/class/html.formsms.class.php old mode 100755 new mode 100644 diff --git a/htdocs/core/class/rssparser.class.php b/htdocs/core/class/rssparser.class.php old mode 100755 new mode 100644 diff --git a/htdocs/core/class/smtps.class.php b/htdocs/core/class/smtps.class.php old mode 100755 new mode 100644 diff --git a/htdocs/core/class/vcard.class.php b/htdocs/core/class/vcard.class.php old mode 100755 new mode 100644 diff --git a/htdocs/core/triggers/interface_20_all_Logevents.class.php b/htdocs/core/triggers/interface_20_all_Logevents.class.php old mode 100755 new mode 100644 diff --git a/htdocs/core/triggers/interface_20_modPaypal_PaypalWorkflow.class.php b/htdocs/core/triggers/interface_20_modPaypal_PaypalWorkflow.class.php old mode 100755 new mode 100644 diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php old mode 100755 new mode 100644 diff --git a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php old mode 100755 new mode 100644 diff --git a/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php b/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php old mode 100755 new mode 100644 diff --git a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php old mode 100755 new mode 100644 diff --git a/htdocs/core/triggers/interface_90_all_Demo.class.php-NORUN b/htdocs/core/triggers/interface_90_all_Demo.class.php-NORUN old mode 100755 new mode 100644 diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php old mode 100755 new mode 100644 diff --git a/htdocs/fourn/commande/index.php b/htdocs/fourn/commande/index.php old mode 100755 new mode 100644 From bc0a52fa711d312ca2cc2f022b8d38d0084310b4 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Tue, 16 Jul 2013 00:29:03 +0200 Subject: [PATCH 2/4] Fix : link to invoice list + SQL was bad when several invoices had the same amount on the same thirdparty --- htdocs/compta/stats/cabyprodserv.php | 2 +- htdocs/compta/stats/casoc.php | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php index 3ae699709af..ec9e0ea0a58 100644 --- a/htdocs/compta/stats/cabyprodserv.php +++ b/htdocs/compta/stats/cabyprodserv.php @@ -173,7 +173,7 @@ $catotal=0; if ($modecompta == 'CREANCES-DETTES') { $sql = "SELECT DISTINCT p.rowid as rowid, p.ref as ref, p.label as label,"; - $sql.= " sum(DISTINCT l.total_ht) as amount, sum(DISTINCT l.total_ttc) as amount_ttc"; + $sql.= " sum(l.total_ht) as amount, sum(l.total_ttc) as amount_ttc"; $sql.= " FROM ".MAIN_DB_PREFIX."product as p"; $sql.= " JOIN ".MAIN_DB_PREFIX."facturedet as l"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON l.fk_facture = f.rowid"; diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php index 63ca148e5c3..214ce25e625 100644 --- a/htdocs/compta/stats/casoc.php +++ b/htdocs/compta/stats/casoc.php @@ -177,7 +177,7 @@ report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportl $catotal=0; if ($modecompta == 'CREANCES-DETTES') { $sql = "SELECT DISTINCT s.rowid as socid, s.nom as name,"; - $sql.= " sum(DISTINCT f.total) as amount, sum(DISTINCT f.total_ttc) as amount_ttc"; + $sql.= " sum(f.total) as amount, sum(f.total_ttc) as amount_ttc"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= " JOIN ".MAIN_DB_PREFIX."facture as f"; if ($selected_cat === -2) { @@ -227,6 +227,7 @@ $sql.= " AND f.entity = ".$conf->entity; if ($socid) $sql.= " AND f.fk_soc = ".$socid; $sql.= " GROUP BY s.rowid, s.nom"; $sql.= " ORDER BY s.rowid"; +echo $sql; $result = $db->query($sql); if ($result) { @@ -406,13 +407,13 @@ if (count($amount)) { print ''; if ($modecompta != 'CREANCES-DETTES') { if ($key > 0) { - print ''; + print ''; } else { - print ''; + print ''; } } else { if ($key > 0) { - print ''; + print ''; } else { print ''; } From 7b5386692c9564a92df30d01137843cf8512d3ab Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Tue, 16 Jul 2013 00:30:44 +0200 Subject: [PATCH 3/4] Added w/o VAT on turnover report --- htdocs/compta/stats/index.php | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php index 209cdba9563..bf31220ddaf 100644 --- a/htdocs/compta/stats/index.php +++ b/htdocs/compta/stats/index.php @@ -118,6 +118,7 @@ if ($result) while ($i < $num) { $obj = $db->fetch_object($result); + $cum_ht[$obj->dm] = !empty($obj->amount) ? $obj->amount : 0; $cum[$obj->dm] = $obj->amount_ttc; if ($obj->amount_ttc) { @@ -180,7 +181,8 @@ print ' '; for ($annee = $year_start ; $annee <= $year_end ; $annee++) { - print ''; + if ($modecompta == 'CREANCES-DETTES') print ''; + else print ''; print ''; print $annee; if ($conf->global->SOCIETE_FISCAL_MONTH_START > 1) print '-'.($annee+1); @@ -192,6 +194,7 @@ print ''; print ''.$langs->trans("Month").''; for ($annee = $year_start ; $annee <= $year_end ; $annee++) { + if ($modecompta == 'CREANCES-DETTES') print ''.$langs->trans("AmountHT").''; print ''.$langs->trans("AmountTTC").''; print ''.$langs->trans("Delta").''; if ($annee != $year_end) print ' '; @@ -224,6 +227,22 @@ for ($mois = 1+$nb_mois_decalage ; $mois <= 12+$nb_mois_decalage ; $mois++) $case = dol_print_date(dol_mktime(1,1,1,$mois_modulo,1,$annee_decalage),"%Y-%m"); $caseprev = dol_print_date(dol_mktime(1,1,1,$mois_modulo,1,$annee_decalage-1),"%Y-%m"); + if ($modecompta == 'CREANCES-DETTES') { + // Valeur CA du mois w/o VAT + print ''; + if ($cum_ht[$case]) + { + $now_show_delta=1; // On a trouve le premier mois de la premiere annee generant du chiffre. + print ''.price($cum_ht[$case],1).''; + } + else + { + if ($minyearmonth < $case && $case <= max($maxyearmonth,$nowyearmonth)) { print '0'; } + else { print ' '; } + } + print ""; + } + // Valeur CA du mois print ''; if ($cum[$case]) @@ -273,6 +292,7 @@ for ($mois = 1+$nb_mois_decalage ; $mois <= 12+$nb_mois_decalage ; $mois++) print ''; } + $total_ht[$annee]+=!empty($cum_ht[$case]) ? $cum_ht[$case] : 0;; $total[$annee]+=$cum[$case]; if ($annee_decalage != $year_end) print ' '; } @@ -349,6 +369,18 @@ for ($mois = 1+$nb_mois_decalage ; $mois <= 12+$nb_mois_decalage ; $mois++) print ''.$langs->trans("Total").''; for ($annee = $year_start ; $annee <= $year_end ; $annee++) { + if ($modecompta == 'CREANCES-DETTES') { + // Montant total HT + if ($total_ht[$annee] || ($annee >= $minyear && $annee <= max($nowyear,$maxyear))) + { + print ''.($total_ht[$annee]?price($total_ht[$annee]):"0").""; + } + else + { + print ' '; + } + } + // Montant total if ($total[$annee] || ($annee >= $minyear && $annee <= max($nowyear,$maxyear))) { From 029394aa3f6fb873014f6473357cd226aa292176 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Tue, 16 Jul 2013 16:34:06 +0200 Subject: [PATCH 4/4] Fix : linked object not deleted when deleting a supplier invoice --- htdocs/fourn/class/fournisseur.facture.class.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 246c3231012..1d97c737188 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -617,6 +617,13 @@ class FactureFournisseur extends CommonInvoice else { $error++; } + + if (! $error) + { + // Delete linked object + $res = $this->deleteObjectLinked(); + if ($res < 0) $error++; + } if (! $error) {