Compare commits

...

114 Commits
3.8.0 ... 3.7.2

Author SHA1 Message Date
Laurent Destailleur
c639e82062 FIX Add a protection to not make release if ChangeLog was not generated.
Conflicts:
	ChangeLog
2015-11-08 14:45:56 +01:00
Laurent Destailleur
e6ab6bdb8e Merge branch '3.7' of git@github.com:Dolibarr/dolibarr.git into 3.7 2015-11-08 14:38:01 +01:00
Laurent Destailleur
7a0206adce FIX Missing to set context into workflow actions, so triggers can't know
we are creating an invoice from order or an order from a proposal.
2015-11-08 14:37:50 +01:00
Juanjo Menent
0ce7cad48c Merge pull request #3946 from aspangaro/3.7-1
Fix: Accountancy compatibility with subtotal & jalon module
2015-11-08 11:26:06 +01:00
Juanjo Menent
7673a73a65 Merge pull request #3939 from marcosgdf/bug-3836
FIX #3836 Unable to upload a document to an invoice under some circunstances
2015-11-08 11:21:16 +01:00
Juanjo Menent
8377d6967a Merge pull request #3934 from marcosgdf/bug-3679
FIX #3679 Error when deleting a Localtax2 special payment
2015-11-08 11:16:07 +01:00
Juanjo Menent
0cab08b2f3 Merge pull request #3932 from marcosgdf/bug-3707
FIX #3707 Thirdparty bank account page table has a glitch
2015-11-08 11:14:39 +01:00
aspangaro
f0a3bca4c2 Fix: Accountancy compatibility with subtotal & jalon module 2015-11-08 04:22:49 +01:00
Marcos García de La Fuente
4a52d3c1b1 Removed unwanted change 2015-11-07 15:35:00 +01:00
Marcos García de La Fuente
84a152dc2e FIX #3836 Unable to upload a document to an invoice under some circunstances 2015-11-07 15:33:48 +01:00
Marcos García de La Fuente
01854b3259 FIX #3679 Error when deleting a Localtax2 special payment 2015-11-07 13:51:09 +01:00
Marcos García de La Fuente
3bbedf1795 FIX #3707 Thirdparty bank account page table has a glitch 2015-11-07 13:39:34 +01:00
Juanjo Menent
87a102f5c8 Merge pull request #3910 from FHenry/3.7
FIX : only active customer should be available into select list thirdparty on invoice creation
2015-11-06 10:14:44 +01:00
Florian HENRY
600dbced7e Merge branch '3.7' of git@github.com:Dolibarr/dolibarr.git into 3.7 2015-11-06 09:49:48 +01:00
Florian HENRY
8d829dca32 FIX : only active customer should be return into new invoice creation
select list
2015-11-06 09:49:02 +01:00
Laurent Destailleur
fe78996026 Merge remote-tracking branch 'origin/3.6' into 3.7
Conflicts:
	htdocs/commande/class/commande.class.php
	htdocs/product/stock/fiche.php
	htdocs/product/stock/valo.php
2015-11-05 22:04:18 +01:00
Laurent Destailleur
375e61de2e Merge 3.5 2015-11-05 22:01:05 +01:00
Laurent Destailleur
5777c16b72 Merge pull request #3902 from altatof/clonedorderdate
FIX: change order date on clone (as everywhere else)
2015-11-05 21:49:50 +01:00
Laurent Destailleur
fdf9617e42 Merge pull request #3900 from GPCsolutions/dolibarr-3864
Fix #3864 Really fixed invalid jQuery code
2015-11-05 21:47:40 +01:00
Laurent Destailleur
d499fafdb9 Merge pull request #3901 from altatof/3.6
FIX bad calculation for stock value
2015-11-05 21:44:21 +01:00
Laurent Destailleur
60debe31c4 Merge pull request #3894 from altatof/stockvalue
FIX bad calculation for stock value
2015-11-05 21:44:15 +01:00
Laurent Destailleur
cbff03ca08 Merge pull request #3892 from atm-alexis/3.7_FIX_data_lose_event_userassigned
FIX event's data lost on user assign update
2015-11-05 21:36:34 +01:00
Christophe Battarel
316b7453e4 FIX bad stock valo 2015-11-05 17:04:08 +01:00
Christophe Battarel
80d2445540 FIX: bad stock valorisation 2015-11-05 17:00:22 +01:00
Christophe Battarel
ad82135879 FIX: change order date on clone (as everywhere else) 2015-11-05 15:36:13 +01:00
Christophe Battarel
75bcb7e53f fix pmp 2015-11-05 15:32:56 +01:00
Christophe Battarel
f566b38296 FIX pmp 2015-11-05 15:29:51 +01:00
Christophe Battarel
fa088eb6cc FIX bad calculation for stock value 2015-11-05 14:57:58 +01:00
Raphaël Doursenaud
b0cf9bd0be Fix #3864 Really fixed invalid jQuery code 2015-11-05 14:38:11 +01:00
Christophe Battarel
9b797c1831 FIX bad calculation for stock value 2015-11-05 12:49:43 +01:00
Alexis Algoud
e1ea2215a3 FIX loss data also if update was cancel by error of ended state with no end date, try a generic patch 2015-11-05 11:25:04 +01:00
Alexis Algoud
0543a31920 FIX event's data lost on user assign update 2015-11-05 11:11:03 +01:00
Laurent Destailleur
fb34f25701 Merge pull request #3887 from GPCsolutions/dolibarr-3864
Fix #3864 Fixed invalid jQuery code
2015-11-05 02:34:24 +01:00
Raphaël Doursenaud
69ac75bef8 Fix #3864 Fixed invalid jQuery code 2015-11-04 22:55:14 +01:00
Laurent Destailleur
38ed83d05f Merge remote-tracking branch 'origin/3.6' into 3.7
Conflicts:
	htdocs/core/lib/company.lib.php
2015-11-02 19:19:05 +01:00
Laurent Destailleur
c06c2d0464 FIX #3841 creation of a task completed has not status set to finished by
default
2015-11-02 14:21:45 +01:00
Juanjo Menent
64ff12c009 Merge pull request #3835 from atm-maxime/fix_product_stats
Fix : stats were wrong if same product on several lines
2015-10-30 22:18:48 +01:00
Maxime Kohlhaas
c46f9350a5 Fix : stats were wrong if same product on several lines with same quantity because of distinct 2015-10-30 09:50:04 +01:00
Laurent Destailleur
bd69830cbd Merge pull request #3803 from atm-robin/3.7_fix_supplier_rights
FIX supplier rights for orderToInvoice
2015-10-26 22:46:12 +01:00
atm-robin
29b8919a40 FIX supplier rights for orderToInvoice 2015-10-26 14:34:46 +01:00
Juanjo Menent
d192ed9676 Merge pull request #3761 from frederic34/patch-18
Fix getFullName() on a non-object in notify.class.php
2015-10-18 11:50:04 +02:00
Frédéric FRANCE
6f4cfc86e8 Update notify.class.php
http://www.dolibarr.fr/forum/12-howto--aide/54061-probleme-sur-la-validation-des-commande-fournisseu
Fatal error: Call to a member function getFullName() on a non-object in /home/xxxx/public_html/xxxxx/htdocs/core/class/notify.class.php on line 374
2015-10-18 11:25:55 +02:00
Laurent Destailleur
9b85a70013 Merge remote-tracking branch 'origin/3.6' into 3.7
Conflicts:
	ChangeLog
	htdocs/comm/propal.php
	htdocs/comm/propal/class/propal.class.php
2015-10-16 09:52:38 +02:00
Laurent Destailleur
5d585fa04a Merge pull request #3729 from FHenry/3.7
FIX : #3724 Bug: Blank page after cloning proposal with changed client
2015-10-14 21:32:26 +02:00
Laurent Destailleur
f08d52b0e8 Merge pull request #3723 from atm-alexis/FIX_double_escape_entrepot
FIX double db escape add too quote
2015-10-14 21:27:39 +02:00
Florian HENRY
727db56576 FIX : #3724 Bug: Blank page after cloning proposal with changed client 2015-10-14 08:27:56 +02:00
Alexis Algoud
0251728e28 FIX double db escape add too quote 2015-10-12 17:36:24 +02:00
Laurent Destailleur
84f5b72d2b Merge pull request #3719 from Dolibarr/revert-3573-FIX_remove_file_from_mail_remove_file
Revert "FIX no need to remove file into mail form"
2015-10-11 20:43:16 +02:00
Laurent Destailleur
87fad70f4a Revert "FIX no need to remove file into mail form" 2015-10-11 20:42:49 +02:00
Laurent Destailleur
62dd936b08 Merge pull request #3573 from atm-alexis/FIX_remove_file_from_mail_remove_file
FIX no need to remove file into mail form
2015-10-11 20:42:42 +02:00
Laurent Destailleur
9fa2afb44b Merge branch '3.6' of github.com:Dolibarr/dolibarr into 3.6
Conflicts:
	ChangeLog
2015-10-11 19:55:50 +02:00
Laurent Destailleur
4e4efc97f0 Merge branch 'marcosgdf-bug-1776' into 3.6 2015-10-11 19:54:51 +02:00
Laurent Destailleur
c76af687ed Merge pull request #3715 from marcosgdf/clone-proposals
FIX 1794 Error when cloning Proposal gives error in a malformed page
2015-10-11 19:52:30 +02:00
Marcos García de La Fuente
fd9f51df88 Missing changelog 2015-10-11 12:39:42 +02:00
Marcos García de La Fuente
4e9a378f0d Merge branch '3.6' into bug-1776 2015-10-11 12:37:41 +02:00
Marcos García de La Fuente
9f1fa7e212 Missing changelog 2015-10-11 12:32:02 +02:00
Marcos García de La Fuente
252f00dfe7 Merge branch '3.6' into clone-proposals 2015-10-11 12:29:45 +02:00
Laurent Destailleur
3f8e9bd181 Remove warning 2015-10-10 19:24:31 +02:00
Laurent Destailleur
384c89dcef Merge pull request #3701 from altatof/fix_orderdateonclone
FIX: change order date on clone (as everywhere else)
2015-10-09 20:44:03 +02:00
Laurent Destailleur
279e7028fb Merge pull request #3686 from grandoc/3.7
3.7
2015-10-09 20:38:16 +02:00
Laurent Destailleur
f9485bd25b Merge remote-tracking branch 'origin/3.6' into 3.7
Conflicts:
	htdocs/core/class/extrafields.class.php
2015-10-09 20:35:17 +02:00
Laurent Destailleur
b27989d5d4 Merge pull request #3665 from altatof/fix_extrafields
reenable search criteria in sql clause
2015-10-09 20:32:42 +02:00
Laurent Destailleur
c675f88dda Merge pull request #3678 from GPCsolutions/3.7-calcul_price_total-warning
[Qual] Prevent warning
2015-10-09 20:29:24 +02:00
Laurent Destailleur
e886c89e06 Merge pull request #3668 from altatof/fix_stock_entity
fix entities warehouse share
2015-10-09 20:16:32 +02:00
Laurent Destailleur
53c9cb38ef Merge pull request #3664 from FHenry/3.7
FIX : New adherent from, always redirect on entity
2015-10-09 20:15:23 +02:00
Christophe Battarel
00f0aff6f0 FIX: change order date on clone (as everywhere else) 2015-10-08 15:58:19 +02:00
philippe grand
0e343ae3b2 syntax error 2015-10-08 09:34:02 +02:00
philippe grand
6cce2860c2 Merge branch '3.7' of https://github.com/Dolibarr/dolibarr.git into 3.7 2015-10-08 09:12:36 +02:00
Laurent Destailleur
8f5d9597f8 Merge pull request #3675 from GPCsolutions/3.7-3666
Fixes for checkbox extrafields
2015-10-07 14:31:30 +02:00
Raphaël Doursenaud
c208fccf35 [Qual] Prevent warning
calcul_price_total() prefers to have the seller and localtaxes specified
2015-10-06 15:03:59 +02:00
Raphaël Doursenaud
afbee44993 Fix #3667 checkbox extrafields on edit
For actions and members.
2015-10-05 20:51:43 +02:00
Raphaël Doursenaud
3fdd59bf0a Fix #3666 checkbox extrafields on edit 2015-10-05 20:39:14 +02:00
Raphaël Doursenaud
41354ca00d Added type hinting to extrafields object 2015-10-05 20:30:55 +02:00
Raphaël Doursenaud
d24f5538f9 Fix: wrong parameters order 2015-10-05 20:25:55 +02:00
Christophe Battarel
f3ef9b868f fix entities warehouse share 2015-10-05 16:19:54 +02:00
Christophe Battarel
bf262c2cae reenable search criteria in sql clause 2015-10-05 15:41:28 +02:00
Florian HENRY
9dd4a23365 Merge branch '3.7' of git@github.com:Dolibarr/dolibarr.git into 3.7 2015-10-05 15:22:38 +02:00
Florian HENRY
c9d8e041d5 FIX : New adherent from, always redirect on entity 2015-10-05 15:20:55 +02:00
philippe grand
78cb31e55f Merge branch '3.7' of https://github.com/Dolibarr/dolibarr.git into 3.7 2015-10-05 14:50:30 +02:00
Laurent Destailleur
406b271275 Merge pull request #3635 from FHenry/3.7
FIX : Mass Mailing activity don't display all status
2015-10-04 19:57:29 +02:00
philippe grand
e22fb3c538 fix : Typo 2015-10-02 12:39:09 +02:00
Florian HENRY
fd29bb34be FIX : Mass Mailing activity don't display all status 2015-10-01 16:09:04 +02:00
Laurent Destailleur
4201e8b032 FIX #3630 - Wrong balance report when module salaries and donation
disabled
2015-10-01 14:38:31 +02:00
Laurent Destailleur
076f2ed9d1 Merge remote-tracking branch 'origin/3.6' into 3.7
Conflicts:
	htdocs/core/lib/security.lib.php
2015-10-01 11:10:47 +02:00
Laurent Destailleur
72c31c0fa9 Merge branch '3.6' of git@github.com:Dolibarr/dolibarr.git into 3.6 2015-10-01 10:48:28 +02:00
Laurent Destailleur
4da8fb901b Add comment 2015-10-01 10:48:09 +02:00
Laurent Destailleur
1907e5da54 Merge pull request #3619 from atm-arnaud/3.6_fix_facturestat
FIX facturestat bad sql when customer view is limited
2015-10-01 10:48:05 +02:00
Laurent Destailleur
34adc60d26 Merge pull request #3618 from atm-alexis/fix_event_for_user_restricted_if_no_company
FIX error in SQL due to a previous fix
2015-10-01 10:35:07 +02:00
Laurent Destailleur
9c28894ec3 Merge pull request #3615 from FHenry/3.7
FIX : When delete actioncomm also delete actioncomm_resources
2015-10-01 10:34:54 +02:00
Laurent Destailleur
74fb718b77 Merge pull request #3612 from grandoc/3.7
missing translation
2015-10-01 10:28:27 +02:00
Florian HENRY
a96b92a618 FIX : Email selector contact must not include inactive contact 2015-09-30 14:06:45 +02:00
Florian HENRY
e209fb23a2 FIX : Admin fiche inter page do not take good action 2015-09-29 18:27:39 +02:00
Florian HENRY
fecd213bb8 FIX: display error on extrafields on ficheinter 2015-09-29 16:57:05 +02:00
Florian HENRY
bb0de1dcad FIX : update2.php test res befre assign it 2015-09-29 15:00:11 +02:00
Florian HENRY
766b8535ae spacing 2015-09-29 09:47:23 +02:00
Florian HENRY
4f5e207f08 review 2015-09-29 09:45:04 +02:00
arnaud
0b7305d21a FIX facturestat bad sql when customer view is limited 2015-09-28 16:55:34 +02:00
Alexis ALGOUD
453ed8a05e FIX error in SQL due to a previous fix 2015-09-28 15:36:27 +02:00
Florian HENRY
0f27edad5d FIX : When delete actioncomm also delete actioncomm_resources 2015-09-28 10:14:19 +02:00
Grand Philippe
6f128907fe fix : Missing argument 1 for CommonDocGenerator::__construct() 2015-09-27 11:30:23 +02:00
philippe
1454d942ef missing translation 2015-09-27 11:06:45 +02:00
Alexis Algoud
2d35124c71 FIX no need to remove file into mail form, the temp dir will be deleted after any sending 2015-09-23 11:11:19 +02:00
Laurent Destailleur
90b78702e5 Update ignore to secure packaging 2015-09-22 16:23:51 +02:00
Laurent Destailleur
c125ba0d66 Update ignore to secure
Conflicts:
	htdocs/.gitignore
2015-09-22 15:42:59 +02:00
Laurent Destailleur
f9973d13b4 Merge pull request #3550 from AlainRnet/patch-2
Update categorie.php
2015-09-18 20:51:46 +02:00
AlainRnet
8dd843ab8f Update categorie.php
voir https://github.com/Dolibarr/dolibarr/pull/3540/files (je n'avais pas vu dans quelle branche j'étais)
2015-09-17 23:23:18 +02:00
Laurent Destailleur
8251807408 Merge pull request #3532 from FHenry/3.7
FIX : #3530
2015-09-16 21:08:17 +02:00
Laurent Destailleur
30ccd28d01 Merge pull request #3535 from GPCsolutions/3.7-debian
FIX Syntax error in Debian Apache configuration
2015-09-16 21:07:04 +02:00
Raphaël Doursenaud
cb31ab3e2b FIX Syntax error in Debian Apache configuration
This issue prevented Apache from starting after dolibarr deb package
installation with the following error:
Syntax error on line 30 of /etc/apache2/conf.d/dolibarr.conf:
order takes one argument, 'allow,deny', 'deny,allow', or 'mutual-failure'
2015-09-16 19:53:32 +02:00
Marcos García de La Fuente
3818bff86a Fix: [ bug 1776 ] Undefined $deliverycompany variable in pdf_build_address 2015-09-16 12:49:05 +02:00
Marcos García de La Fuente
e80f29c271 Fix: [ bug 1794 ] - Error when cloning Proposal gives error in a malformed page 2015-09-16 12:47:13 +02:00
Florian HENRY
8fd9d2a7ce FIX : #3530 2015-09-16 10:21:32 +02:00
Juanjo Menent
4e19500cce Merge pull request #3527 from FHenry/3.7
FIX : Must not be able to create Proposal on thridparty with "close" status  #3526
2015-09-15 15:13:36 +02:00
Florian HENRY
a0fb27bd80 FIX : Can create Proposal on close thridparty #3526 2015-09-15 14:34:49 +02:00
89 changed files with 399 additions and 264 deletions

View File

@@ -8,6 +8,7 @@ You may also experience troubles with Mysql 5.5.41 with error "Lost connection"
Upgrading to any other version or database system is abolutely required BEFORE trying to
make a Dolibarr upgrade.
***** ChangeLog for 3.7.2 compared to 3.7.1 *****
FIX [ bug #2855 ] Wrong translation key in localtax report page
FIX [ bug #1852 ] JS error when editing a customer order line
@@ -126,7 +127,7 @@ For users:
Use accesskey on form search.
- New: Intervention documents are now available in ECM module.
- New: Add attachments on user card + in ECM module.
- New: Can add __PROJECT_REF__ and __TIHRPARTY_NAME__ into email topic or content template.
- New: Can add __PROJECT_REF__ and __THIRDPARTY_NAME__ into email topic or content template.
- New: [ task #1204 ] add Numering contrat module free (like leopard in product module).
- New: [ task #712 ] Add warning when creating invoice from proposal or order, when there is already one invoice.
- New: Enable supplier price log table.
@@ -246,6 +247,12 @@ Dolibarr better:
warehouse module and your Point Of Sale module setup if you use one.
- Replaced USER_UPDATE_SESSION trigger with an updateSession hook may break modules using it.
***** ChangeLog for 3.6.5 compared to 3.6.4 *****
- Fix: [ bug #1776 ] Undefined $deliverycompany variable in pdf_build_address
- Fix: [ bug #1794 ] Error when cloning Proposal gives error in a malformed page
***** ChangeLog for 3.6.4 compared to 3.6.3 *****
- Fix: [ bug #2893 ] Dolibarr error when viewing an invoice after changing invoice mask
***** ChangeLog for 3.6.3 compared to 3.6.2 *****
- Fix: ref_ext was not saved when recording a customer order from web service

View File

@@ -15,7 +15,7 @@ Alias /dolibarr /usr/share/dolibarr/htdocs
# Require all granted
# </IfVersion>
# <IfVersion < 2.3>
# Order allow, deny
# Order allow,deny
# Allow from all
# </IfVersion>
#
@@ -27,7 +27,7 @@ Alias /dolibarr /usr/share/dolibarr/htdocs
Require all granted
</IfVersion>
<IfVersion < 2.3>
Order allow, deny
Order allow,deny
Allow from all
</IfVersion>

View File

@@ -457,6 +457,7 @@ if ($nboftargetok) {
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/documents`;
# Removed known external modules to avoir any error when packaging on test env
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/custom/*`; # For custom we want to keep dir
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/allscreens*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/ancotec*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/calling*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/bootstrap*`;
@@ -470,8 +471,8 @@ if ($nboftargetok) {
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/public/test`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/teclib*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/timesheet*`;
# Removed other test files
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/oblyon*`;
# Removed other test files
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/eldy/*.new`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/public/test`;
$ret=`rm -fr $BUILDROOT/$PROJECT/test`;

3
htdocs/.gitignore vendored
View File

@@ -11,3 +11,6 @@
/teclib*
/test.php
/ultimatepdf*
/lead
/dolimed*
/allscreens*

View File

@@ -1,7 +1,7 @@
<?PHP
<?php
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.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
@@ -19,7 +19,7 @@
/**
* \file htdocs/accountancy/customer/card.php
* \ingroup Accounting Expert
* \ingroup Accountancy
* \brief Card customer ventilation
*/
@@ -84,7 +84,11 @@ if (! empty($id)) {
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON l.fk_code_ventilation = aa.rowid";
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = l.fk_facture";
$sql .= " WHERE f.fk_statut > 0 AND l.rowid = " . $id;
$sql .= " WHERE f.fk_statut > 0";
$sql .= " AND l.rowid = " . $id;
if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity = '" . $conf->entity . "'";
}
if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity = '" . $conf->entity . "'";

View File

@@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2014 Ari Elbaz (elarifr) <github@accedinfo.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
@@ -21,7 +21,7 @@
/**
* \file htdocs/accountancy/customer/list.php
* \ingroup Accounting Expert
* \ingroup Accountancy
* \brief Ventilation page from customers invoices
*/
@@ -121,7 +121,7 @@ if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
$offset = $limit * $page;
$sql = "SELECT f.facnumber, f.rowid as facid, l.fk_product, l.description, l.total_ht, l.rowid, l.fk_code_ventilation,";
$sql = "SELECT f.facnumber, f.rowid as facid, l.fk_product, l.description, l.total_ht, l.rowid, l.fk_code_ventilation, l.product_type,";
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_sell as code_sell";
$sql .= " , aa.rowid as aarowid";
$sql .= " FROM " . MAIN_DB_PREFIX . "facture as f";
@@ -129,7 +129,9 @@ $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facturedet as l ON f.rowid = l.fk_fac
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON p.accountancy_code_sell = aa.account_number";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_system as accsys ON accsys.pcg_version = aa.fk_pcg_version";
$sql .= " WHERE f.fk_statut > 0 AND fk_code_ventilation <= 0";
$sql .= " WHERE f.fk_statut > 0";
$sql. = " AND fk_code_ventilation <= 0";
$sql. = " AND product_type <= 2";
$sql .= " AND (accsys.rowid='" . $conf->global->CHARTOFACCOUNTS . "' OR p.accountancy_code_sell IS NULL OR p.accountancy_code_sell ='')";
if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity = '" . $conf->entity . "'";

View File

@@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
@@ -22,7 +22,7 @@
*/
/**
* \file htdocs/accountancy/supplier/card.php
* \ingroup Accounting Expert
* \ingroup Accountancy
* \brief Card supplier ventilation
*/
@@ -85,7 +85,8 @@ if ($_GET["id"]) {
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON l.fk_code_ventilation = aa.rowid";
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture_fourn as f ON f.rowid = l.fk_facture_fourn ";
$sql .= " WHERE f.fk_statut > 0 AND l.rowid = " . $id;
$sql .= " WHERE f.fk_statut > 0";
$sql .= " AND l.rowid = " . $id;
if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity = '" . $conf->entity . "'";
}

View File

@@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2014 Ari Elbaz (elarifr) <github@accedinfo.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>s
@@ -21,7 +21,7 @@
/**
* \file htdocs/accountancy/supplier/list.php
* \ingroup Accounting Expert
* \ingroup Accountancy
* \brief Ventilation page from suppliers invoices
*/
@@ -124,16 +124,17 @@ if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
$offset = $limit * $page;
$sql = "SELECT f.ref, f.rowid as facid, f.ref_supplier, l.fk_product, l.description, l.total_ht as price, l.rowid, l.fk_code_ventilation, ";
$sql = "SELECT f.ref, f.rowid as facid, f.ref_supplier, l.fk_product, l.description, l.total_ht as price, l.rowid, l.fk_code_ventilation, l.product_type,";
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_buy as code_buy";
$sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn as f";
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture_fourn_det as l ON f.rowid = l.fk_facture_fourn";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON p.accountancy_code_buy = aa.account_number";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_system as accsys ON accsys.pcg_version = aa.fk_pcg_version";
$sql .= " WHERE f.fk_statut > 0 AND fk_code_ventilation <= 0";
$sql .= " WHERE f.fk_statut > 0";
$sql .= " AND fk_code_ventilation <= 0";
$sql. = " AND product_type <= 2";
$sql .= " AND (accsys.rowid='".$conf->global->CHARTOFACCOUNTS."' OR p.accountancy_code_sell IS NULL OR p.accountancy_code_buy ='')";
if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity = '" . $conf->entity . "'";
}

View File

@@ -164,7 +164,7 @@ print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<tr '.$bc[$var].' id="tramount"><td>';
print $langs->trans("DefaultAmount");
print '</td><td align="right">';
print '<input type="text" id="MEMBER_NEWFORM_AMOUNT" name="MEMBER_NEWFORM_AMOUNT" size="5" value="'.(! empty($conf->global->MEMBER_NEWFORM_AMOUNT)?$conf->global->MEMBER_NEWFORM_AMOUNT:'').'">';;
print '<input type="text" id="MEMBER_NEWFORM_AMOUNT" name="MEMBER_NEWFORM_AMOUNT" size="5" value="'.(! empty($conf->global->MEMBER_NEWFORM_AMOUNT)?$conf->global->MEMBER_NEWFORM_AMOUNT:'').'">';
print "</td></tr>\n";
// Can edit
@@ -197,7 +197,7 @@ if (! empty($conf->paybox->enabled) || ! empty($conf->paypal->enabled))
print '<tr '.$bc[$var].' id="tremail"><td>';
print $langs->trans("MEMBER_PAYONLINE_SENDEMAIL");
print '</td><td align="right">';
print '<input type="text" id="MEMBER_PAYONLINE_SENDEMAIL" name="MEMBER_PAYONLINE_SENDEMAIL" size="24" value="'.(! empty($conf->global->MEMBER_PAYONLINE_SENDEMAIL)?$conf->global->MEMBER_PAYONLINE_SENDEMAIL:'').'">';;
print '<input type="text" id="MEMBER_PAYONLINE_SENDEMAIL" name="MEMBER_PAYONLINE_SENDEMAIL" size="24" value="'.(! empty($conf->global->MEMBER_PAYONLINE_SENDEMAIL)?$conf->global->MEMBER_PAYONLINE_SENDEMAIL:'').'">';
print "</td></tr>\n";
}

View File

@@ -249,7 +249,7 @@ if (empty($reshook))
}
$lastname=$_POST["lastname"];
$firstname=$_POST["firstname"];
$morphy=$morphy=$_POST["morphy"];;
$morphy=$morphy=$_POST["morphy"];
if ($morphy != 'mor' && empty($lastname)) {
$error++;
$langs->load("errors");

View File

@@ -678,7 +678,16 @@ if ($rowid > 0)
print '<br><br><table class="border" width="100%">';
foreach($extrafields->attribute_label as $key=>$label)
{
$value=(isset($_POST["options_".$key])?$_POST["options_".$key]:(isset($adht->array_options['options_'.$key])?$adht->array_options['options_'.$key]:''));
if (isset($_POST["options_" . $key])) {
if (is_array($_POST["options_" . $key])) {
// $_POST["options"] is an array but following code expects a comma separated string
$value = implode(",", $_POST["options_" . $key]);
} else {
$value = $_POST["options_" . $key];
}
} else {
$value = $adht->array_options["options_" . $key];
}
print '<tr><td width="30%">'.$label.'</td><td>';
print $extrafields->showInputField($key,$value);
print "</td></tr>\n";

View File

@@ -913,7 +913,7 @@ if ($id)
print "</tr>";
$colspan=count($fieldlist)+2;
if ($id == 4) $colspan++;;
if ($id == 4) $colspan++;
if (! empty($alabelisused)) // Si un des champs est un libelle
{

View File

@@ -203,7 +203,6 @@ else if ($action == 'set_FICHINTER_FREE_TEXT')
else if ($action == 'set_FICHINTER_DRAFT_WATERMARK')
{
$draft= GETPOST('FICHINTER_DRAFT_WATERMARK','alpha');
$res = dolibarr_set_const($db, "FICHINTER_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
@@ -538,7 +537,7 @@ print '<input size="50" class="flat" type="text" name="FICHINTER_DRAFT_WATERMARK
print '</td><td align="right">';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print "</td></tr>\n";
print '</form>';
// print products on fichinter
$var=! $var;
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';

View File

@@ -164,7 +164,7 @@ if (! empty($conf->service->enabled))
$var=! $var;
print '<tr '.$bc[$var].'><td>';
print $langs->trans("CashdeskShowServices");
print '<td colspan="2">';;
print '<td colspan="2">';
print $form->selectyesno("CASHDESK_SERVICES",$conf->global->CASHDESK_SERVICES,1);
print "</td></tr>\n";
}

View File

@@ -410,7 +410,7 @@ else if ($id || $ref)
// Ref
print '<tr><td width="20%">'.$langs->trans("Ref").'</td>';
print '<td class="valeur">';
print $form->showrefnav($member,'id');
print $form->showrefnav($member,'id','','1','rowid','ref','','&type=3');
print '</td></tr>';
// Login

View File

@@ -1164,7 +1164,7 @@ class Categorie extends CommonObject
{
$cats = array();
$typeid=-1; $table='';;
$typeid=-1; $table='';
if ($type == '0' || $type == 'product') { $typeid=0; $table='product'; $type='product'; }
else if ($type == '1' || $type == 'supplier') { $typeid=1; $table='societe'; $type='fournisseur'; }
else if ($type == '2' || $type == 'customer') { $typeid=2; $table='societe'; $type='societe'; }

View File

@@ -88,7 +88,7 @@ $hookmanager->initHooks(array('actioncard','globalcard'));
/*
* Actions
*/
$listUserAssignedUpdated = false;
// Remove user to assigned list
if (GETPOST('removedassigned') || GETPOST('removedassigned') == '0')
{
@@ -106,6 +106,8 @@ if (GETPOST('removedassigned') || GETPOST('removedassigned') == '0')
$donotclearsession=1;
if ($action == 'add') $action = 'create';
if ($action == 'update') $action = 'edit';
$listUserAssignedUpdated = true;
}
// Add user to assigned list
@@ -125,6 +127,8 @@ if (GETPOST('addassignedtouser') || GETPOST('updateassignedtouser'))
$donotclearsession=1;
if ($action == 'add') $action = 'create';
if ($action == 'update') $action = 'edit';
$listUserAssignedUpdated = true;
}
// Add event
@@ -803,6 +807,28 @@ if ($id > 0)
$result4=$object->fetch_userassigned();
$result5=$object->fetch_optionals($id,$extralabels);
if($listUserAssignedUpdated || $donotclearsession) {
$datep=dol_mktime($fulldayevent?'00':$aphour, $fulldayevent?'00':$apmin, 0, $_POST["apmonth"], $_POST["apday"], $_POST["apyear"]);
$datef=dol_mktime($fulldayevent?'23':$p2hour, $fulldayevent?'59':$p2min, $fulldayevent?'59':'0', $_POST["p2month"], $_POST["p2day"], $_POST["p2year"]);
$object->fk_action = dol_getIdFromCode($db, GETPOST("actioncode"), 'c_actioncomm');
$object->label = GETPOST("label");
$object->datep = $datep;
$object->datef = $datef;
$object->percentage = $percentage;
$object->priority = GETPOST("priority");
$object->fulldayevent= GETPOST("fullday")?1:0;
$object->location = GETPOST('location');
$object->socid = GETPOST("socid");
$object->contactid = GETPOST("contactid",'int');
//$object->societe->id = $_POST["socid"]; // deprecated
//$object->contact->id = $_POST["contactid"]; // deprecated
$object->fk_project = GETPOST("projectid",'int');
$object->note = GETPOST("note");
}
if ($result1 < 0 || $result2 < 0 || $result3 < 0 || $result4 < 0 || $result5 < 0)
{
dol_print_error($db,$object->error);
@@ -1202,7 +1228,16 @@ if ($id > 0)
print '<br><br><table class="border" width="100%">';
foreach($extrafields->attribute_label as $key=>$label)
{
$value=(isset($_POST["options_".$key])?$_POST["options_".$key]:(isset($object->array_options['options_'.$key])?$object->array_options['options_'.$key]:''));
if (isset($_POST["options_" . $key])) {
if (is_array($_POST["options_" . $key])) {
// $_POST["options"] is an array but following code expects a comma separated string
$value = implode(",", $_POST["options_" . $key]);
} else {
$value = $_POST["options_" . $key];
}
} else {
$value = $object->array_options["options_" . $key];
}
print '<tr><td width="30%">'.$label.'</td><td>';
print $extrafields->showOutputField($key,$value);
print "</td></tr>\n";

View File

@@ -542,7 +542,19 @@ class ActionComm extends CommonObject
$this->error=$this->db->lasterror();
$error++;
}
if (! $error) {
$sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm_resources";
$sql.= " WHERE fk_actioncomm=".$this->id;
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
$res=$this->db->query($sql);
if ($res < 0) {
$this->error=$this->db->lasterror();
$error++;
}
}
// Removed extrafields
if (! $error) {
$result=$this->deleteExtraFields();

View File

@@ -828,25 +828,25 @@ if ($id > 0)
print '<div class="tabsAction">';
if (! empty($conf->propal->enabled) && $user->rights->propal->creer)
if (! empty($conf->propal->enabled) && $user->rights->propal->creer && $object->status==1)
{
$langs->load("propal");
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/comm/propal.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddProp").'</a></div>';
}
if (! empty($conf->commande->enabled) && $user->rights->commande->creer)
if (! empty($conf->commande->enabled) && $user->rights->commande->creer && $object->status==1)
{
$langs->load("orders");
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/commande/card.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddOrder").'</a></div>';
}
if ($user->rights->contrat->creer)
if ($user->rights->contrat->creer && $object->status==1)
{
$langs->load("contracts");
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/contrat/card.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddContract").'</a></div>';
}
if (! empty($conf->ficheinter->enabled) && $user->rights->ficheinter->creer)
if (! empty($conf->ficheinter->enabled) && $user->rights->ficheinter->creer && $object->status==1)
{
$langs->load("fichinter");
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/fichinter/card.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddIntervention").'</a></div>';
@@ -855,7 +855,7 @@ if ($id > 0)
// Add invoice
if ($user->societe_id == 0)
{
if (! empty($conf->deplacement->enabled))
if (! empty($conf->deplacement->enabled) && $object->status==1)
{
$langs->load("trips");
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/compta/deplacement/card.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddTrip").'</a></div>';
@@ -863,7 +863,7 @@ if ($id > 0)
if (! empty($conf->facture->enabled))
{
if ($user->rights->facture->creer)
if ($user->rights->facture->creer && $object->status==1)
{
$langs->load("bills");
$langs->load("orders");

View File

@@ -166,8 +166,7 @@ if ($result)
print '<td align="right" class="nowrap">';
if ($filteremail)
{
if ($obj->sendstatut==-1) print $langs->trans("MailingStatusError").' '.img_error();
if ($obj->sendstatut==1) print $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut6');
print $email::libStatutDest($obj->sendstatut,2);
}
else
{

View File

@@ -115,7 +115,7 @@ if (empty($reshook))
// Action clone object
if ($action == 'confirm_clone' && $confirm == 'yes')
{
if (1 == 0 && ! GETPOST('clone_content') && ! GETPOST('clone_receivers'))
if (! GETPOST('socid', 3))
{
setEventMessage($langs->trans("NoCloneOptionsSpecified"), 'errors');
}
@@ -127,7 +127,7 @@ if (empty($reshook))
header("Location: " . $_SERVER['PHP_SELF'] . '?id=' . $result);
exit();
} else {
setEventMessage($object->error, 'errors');
if (count($object->errors) > 0) setEventMessage($object->errors, 'errors');
$action = '';
}
}
@@ -1267,7 +1267,7 @@ if ($action == 'create')
print '</td>';
} else {
print '<td colspan="2">';
print $form->select_company('', 'socid', 's.client = 1 OR s.client = 2 OR s.client = 3', 1);
print $form->select_company('', 'socid', '(s.client = 1 OR s.client = 2 OR s.client = 3) AND status=1', 1);
print '</td>';
}
print '</tr>' . "\n";
@@ -2255,7 +2255,7 @@ if ($action == 'create')
$formmail->substit['__PROPREF__'] = $object->ref;
$formmail->substit['__SIGNATURE__'] = $user->signature;
$formmail->substit['__REFCLIENT__'] = $object->ref_client;
$formmail->substit['__THIRPARTY_NAME__'] = $object->thirdparty->name;
$formmail->substit['__THIRDPARTY_NAME__'] = $object->thirdparty->name;
$formmail->substit['__PROJECT_REF__'] = (is_object($object->projet)?$object->projet->ref:'');
$formmail->substit['__PERSONALIZED__'] = '';
$formmail->substit['__CONTACTCIVNAME__'] = '';

View File

@@ -368,7 +368,7 @@ class Propal extends CommonObject
$localtaxes_type=getLocalTaxesFromRate($txtva,0,$this->thirdparty,$mysoc);
$tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type, '', $localtaxes_type);
$tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type, $mysoc, $localtaxes_type);
$total_ht = $tabprice[0];
$total_tva = $tabprice[1];
$total_ttc = $tabprice[2];
@@ -961,7 +961,7 @@ class Propal extends CommonObject
{
global $db, $user,$langs,$conf,$hookmanager;
dol_include_once('/projet/class.project.class.php');
dol_include_once('/projet/class/project.class.php');
$this->context['createfromclone']='createfromclone';
@@ -974,44 +974,42 @@ class Propal extends CommonObject
foreach($this->lines as $line)
$line->fetch_optionals($line->rowid);
// Load source object
$objFrom = dol_clone($this);
// Load dest object
$clonedObj = clone $this;
$objsoc=new Societe($this->db);
// Change socid if needed
if (! empty($socid) && $socid != $this->socid)
if (! empty($socid) && $socid != $clonedObj->socid)
{
if ($objsoc->fetch($socid) > 0)
{
$this->socid = $objsoc->id;
$this->cond_reglement_id = (! empty($objsoc->cond_reglement_id) ? $objsoc->cond_reglement_id : 0);
$this->mode_reglement_id = (! empty($objsoc->mode_reglement_id) ? $objsoc->mode_reglement_id : 0);
$project = new Project($db);
if($objFrom->fk_project > 0 && $project->fetch($objFrom->fk_project)) {
if($project->socid <= 0) $this->fk_project = $objFrom->fk_project;
else $this->fk_project = '';
$clonedObj->socid = $objsoc->id;
$clonedObj->cond_reglement_id = (! empty($objsoc->cond_reglement_id) ? $objsoc->cond_reglement_id : 0);
$clonedObj->mode_reglement_id = (! empty($objsoc->mode_reglement_id) ? $objsoc->mode_reglement_id : 0);
$clonedObj->fk_delivery_address = '';
$project = new Project($db);
if ($this->fk_project > 0 && $project->fetch($this->fk_project)) {
if ($project->socid <= 0) $clonedObj->fk_project = $this->fk_project;
else $clonedObj->fk_project = '';
} else {
$this->fk_project = '';
$clonedObj->fk_project = '';
}
$this->fk_delivery_address = '';
}
// reset ref_client
$this->ref_client = '';
$clonedObj->ref_client = '';
// TODO Change product price if multi-prices
}
else
{
$objsoc->fetch($this->socid);
$objsoc->fetch($clonedObj->socid);
}
$this->id=0;
$this->statut=0;
$clonedObj->id=0;
$clonedObj->statut=0;
if (empty($conf->global->PROPALE_ADDON) || ! is_readable(DOL_DOCUMENT_ROOT ."/core/modules/propale/".$conf->global->PROPALE_ADDON.".php"))
{
@@ -1020,32 +1018,32 @@ class Propal extends CommonObject
}
// Clear fields
$this->user_author = $user->id;
$this->user_valid = '';
$this->date = $now;
$this->datep = $now; // deprecated
$this->fin_validite = $this->date + ($this->duree_validite * 24 * 3600);
if (empty($conf->global->MAIN_KEEP_REF_CUSTOMER_ON_CLONING)) $this->ref_client = '';
$clonedObj->user_author = $user->id;
$clonedObj->user_valid = '';
$clonedObj->date = $now;
$clonedObj->datep = $now; // deprecated
$clonedObj->fin_validite = $clonedObj->date + ($clonedObj->duree_validite * 24 * 3600);
if (empty($conf->global->MAIN_KEEP_REF_CUSTOMER_ON_CLONING)) $clonedObj->ref_client = '';
// Set ref
require_once DOL_DOCUMENT_ROOT ."/core/modules/propale/".$conf->global->PROPALE_ADDON.'.php';
$obj = $conf->global->PROPALE_ADDON;
$modPropale = new $obj;
$this->ref = $modPropale->getNextValue($objsoc,$this);
$clonedObj->ref = $modPropale->getNextValue($objsoc,$clonedObj);
// Create clone
$result=$this->create($user);
$result=$clonedObj->create($user);
if ($result < 0) $error++;
else
{
// copy internal contacts
if ($this->copy_linked_contact($objFrom, 'internal') < 0)
if ($clonedObj->copy_linked_contact($this, 'internal') < 0)
$error++;
// copy external contacts if same company
elseif ($objFrom->socid == $this->socid)
elseif ($this->socid == $clonedObj->socid)
{
if ($this->copy_linked_contact($objFrom, 'external') < 0)
if ($clonedObj->copy_linked_contact($this, 'external') < 0)
$error++;
}
}
@@ -1055,9 +1053,9 @@ class Propal extends CommonObject
// Hook of thirdparty module
if (is_object($hookmanager))
{
$parameters=array('objFrom'=>$objFrom);
$parameters=array('objFrom'=>$this,'clonedObj'=>$clonedObj);
$action='';
$reshook=$hookmanager->executeHooks('createFrom',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
$reshook=$hookmanager->executeHooks('createFrom',$parameters,$clonedObj,$action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) $error++;
}
@@ -1073,7 +1071,7 @@ class Propal extends CommonObject
if (! $error)
{
$this->db->commit();
return $this->id;
return $clonedObj->id;
}
else
{

View File

@@ -48,7 +48,7 @@ class PropaleStats extends Stats
* Constructor
*
* @param DoliDB $db Database handler
* @param int $socid Id third party for filter
* @param int $socid Id third party for filter. This value must be forced during the new to external user company if user is an external user.
* @param int $userid Id user for filter (creation user)
*/
function __construct($db, $socid=0, $userid=0)

View File

@@ -2345,7 +2345,7 @@ if ($action == 'create' && $user->rights->commande->creer) {
$formmail->substit ['__ORDERREF__'] = $object->ref;
$formmail->substit ['__SIGNATURE__'] = $user->signature;
$formmail->substit ['__REFCLIENT__'] = $object->ref_client;
$formmail->substit ['__THIRPARTY_NAME__'] = $object->thirdparty->name;
$formmail->substit ['__THIRDPARTY_NAME__'] = $object->thirdparty->name;
$formmail->substit ['__PROJECT_REF__'] = (is_object($object->projet)?$object->projet->ref:'');
$formmail->substit ['__PERSONALIZED__'] = '';
$formmail->substit ['__CONTACTCIVNAME__'] = '';

View File

@@ -393,7 +393,7 @@ class Commande extends CommonOrder
{
$mouvP = new MouvementStock($this->db);
// We increment stock of product (and sub-products)
$result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("OrderBackToDraftInDolibarr",$this->ref));
$result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, 0, $langs->trans("OrderBackToDraftInDolibarr",$this->ref));
if ($result < 0) { $error++; }
}
}
@@ -576,7 +576,7 @@ class Commande extends CommonOrder
{
$mouvP = new MouvementStock($this->db);
// We increment stock of product (and sub-products)
$result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("OrderCanceledInDolibarr",$this->ref));
$result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, 0, $langs->trans("OrderCanceledInDolibarr",$this->ref)); // price is 0, we don't want WAP to be changed
if ($result < 0)
{
$error++;
@@ -920,6 +920,7 @@ class Commande extends CommonOrder
// Clear fields
$this->user_author_id = $user->id;
$this->user_valid = '';
$this->date = dol_now();
$this->date_creation = '';
$this->date_validation = '';
$this->ref_client = '';
@@ -1042,7 +1043,7 @@ class Commande extends CommonOrder
$this->ref_client = $object->ref_client;
$this->note_private = $object->note_private;
$this->note_public = $object->note_public;
$this->origin = $object->element;
$this->origin_id = $object->id;
@@ -1132,7 +1133,7 @@ class Commande extends CommonOrder
{
global $mysoc, $conf, $langs;
dol_syslog(get_class($this)."::addline commandeid=$this->id, desc=$desc, pu_ht=$pu_ht, qty=$qty, txtva=$txtva, fk_product=$fk_product, remise_percent=$remise_percent, info_bits=$info_bits, fk_remise_except=$fk_remise_except, price_base_type=$price_base_type, pu_ttc=$pu_ttc, date_start=$date_start, date_end=$date_end, type=$type", LOG_DEBUG);
dol_syslog(get_class($this)."::addline commandeid=$this->id, desc=$desc, pu_ht=$pu_ht, qty=$qty, txtva=$txtva, fk_product=$fk_product, remise_percent=$remise_percent, info_bits=$info_bits, fk_remise_except=$fk_remise_except, price_base_type=$price_base_type, pu_ttc=$pu_ttc, date_start=$date_start, date_end=$date_end, type=$type special_code=$special_code", LOG_DEBUG);
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';

View File

@@ -48,7 +48,7 @@ class CommandeStats extends Stats
* Constructor
*
* @param DoliDB $db Database handler
* @param int $socid Id third party for filter
* @param int $socid Id third party for filter. This value must be forced during the new to external user company if user is an external user.
* @param string $mode Option ('customer', 'supplier')
* @param int $userid Id user for filter (creation user)
*/

View File

@@ -343,7 +343,7 @@ else
elseif ($links[$key]['type']=='payment_supplier')
{
$paymentsupplierstatic->id=$links[$key]['url_id'];
$paymentsupplierstatic->ref=$langs->trans("Payment");;
$paymentsupplierstatic->ref=$langs->trans("Payment");
print ' '.$paymentsupplierstatic->getNomUrl(1);
$newline=0;
}

View File

@@ -1855,7 +1855,7 @@ if ($action == 'create')
else
{
print '<td colspan="2">';
print $form->select_company('', 'socid', 's.client = 1 OR s.client = 3', 1);
print $form->select_company('', 'socid', '(s.client = 1 OR s.client = 3) AND status=1', 1);
print '</td>';
}
print '</tr>' . "\n";
@@ -3627,7 +3627,7 @@ if ($action == 'create')
$formmail->substit['__FACREF__'] = $object->ref;
$formmail->substit['__SIGNATURE__'] = $user->signature;
$formmail->substit['__REFCLIENT__'] = $object->ref_client;
$formmail->substit['__THIRPARTY_NAME__'] = $object->thirdparty->name;
$formmail->substit['__THIRDPARTY_NAME__'] = $object->thirdparty->name;
$formmail->substit['__PROJECT_REF__'] = (is_object($object->projet)?$object->projet->ref:'');
$formmail->substit['__PERSONALIZED__'] = '';
$formmail->substit['__CONTACTCIVNAME__'] = '';

View File

@@ -1761,7 +1761,7 @@ class Facture extends CommonInvoice
$mouvP = new MouvementStock($this->db);
$mouvP->origin = &$this;
// We decrease stock for product
if ($this->type == self::TYPE_CREDIT_NOTE) $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceValidatedInDolibarr",$num));
if ($this->type == self::TYPE_CREDIT_NOTE) $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, 0, $langs->trans("InvoiceValidatedInDolibarr",$num));
else $result=$mouvP->livraison($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceValidatedInDolibarr",$num));
if ($result < 0) {
$error++;

View File

@@ -45,7 +45,7 @@ class FactureStats extends Stats
* Constructor
*
* @param DoliDB $db Database handler
* @param int $socid Id third party for filter
* @param int $socid Id third party for filter. This value must be forced during the new to external user company if user is an external user.
* @param string $mode Option ('customer', 'supplier')
* @param int $userid Id user for filter (creation user)
*/
@@ -168,7 +168,7 @@ class FactureStats extends Stats
$sql = "SELECT date_format(datef,'%m') as dm, AVG(f.".$this->field.")";
$sql.= " FROM ".$this->from;
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
if (!$user->rights->societe->client->voir && !$this->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE f.datef BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'";
$sql.= " AND ".$this->where;
$sql.= " GROUP BY dm";
@@ -188,7 +188,7 @@ class FactureStats extends Stats
$sql = "SELECT date_format(datef,'%Y') as year, COUNT(*) as nb, SUM(f.".$this->field.") as total, AVG(f.".$this->field.") as avg";
$sql.= " FROM ".$this->from;
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
if (!$user->rights->societe->client->voir && !$this->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE ".$this->where;
$sql.= " GROUP BY year";
$sql.= $this->db->order('year','DESC');

View File

@@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.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
@@ -104,7 +105,7 @@ if ($_GET["action"] == 'delete')
if ($result > 0)
{
$db->commit();
header("Location: ".DOL_URL_ROOT.'/compta/localtax/reglement.php');
header("Location: ".DOL_URL_ROOT.'/compta/localtax/reglement.php?localTaxType='.$localtax->ltt);
exit;
}
else

View File

@@ -547,7 +547,7 @@ if ($mysoc->tva_assuj == 'franchise') // Non assujeti
* Salaries
*/
if ($conf->salaries->enabled)
if (! empty($conf->salaries->enabled))
{
if ($modecompta == 'CREANCES-DETTES') {
$column = 'p.datev';
@@ -621,13 +621,16 @@ if ($conf->salaries->enabled)
* Donation
*/
if ($conf->donation->enabled)
if (! empty($conf->don->enabled))
{
print '<tr><td colspan="4">'.$langs->trans("Donation").'</td></tr>';
$sql = "SELECT p.societe as name, p.firstname, p.lastname, date_format(p.datedon,'%Y-%m') as dm, sum(p.amount) as amount";
$sql.= " FROM ".MAIN_DB_PREFIX."don as p";
$sql.= " WHERE p.entity = ".$conf->entity;
$sql.= " AND fk_statut=2";
if ($modecompta == 'CREANCES-DETTES')
$sql.= " AND fk_statut in (1,2)";
else
$sql.= " AND fk_statut=2";
if (! empty($date_start) && ! empty($date_end))
$sql.= " AND p.datedon >= '".$db->idate($date_start)."' AND p.datedon <= '".$db->idate($date_end)."'";
$sql.= " GROUP BY p.societe, p.firstname, p.lastname, dm";

View File

@@ -474,85 +474,93 @@ $reshook=$hookmanager->executeHooks('addStatisticLine',$parameters,$object,$acti
/*
* Salaries
*/
if ($modecompta == 'CREANCES-DETTES') {
$column = 'p.datev';
} else {
$column = 'p.datep';
}
$subtotal_ht = 0;
$subtotal_ttc = 0;
$sql = "SELECT p.label as nom, date_format($column,'%Y-%m') as dm, sum(p.amount) as amount";
$sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as p";
$sql.= " WHERE p.entity = ".$conf->entity;
$sql.= " GROUP BY p.label, dm";
dol_syslog("get social salaries payments");
$result=$db->query($sql);
if ($result)
if (! empty($conf->salaries->enabled))
{
$num = $db->num_rows($result);
$var=false;
$i = 0;
if ($num)
{
while ($i < $num)
{
$obj = $db->fetch_object($result);
if (! isset($decaiss[$obj->dm])) $decaiss[$obj->dm]=0;
$decaiss[$obj->dm] += $obj->amount;
if (! isset($decaiss_ttc[$obj->dm])) $decaiss_ttc[$obj->dm]=0;
$decaiss_ttc[$obj->dm] += $obj->amount;
$i++;
}
}
}
else
{
dol_print_error($db);
if ($modecompta == 'CREANCES-DETTES') {
$column = 'p.datev';
} else {
$column = 'p.datep';
}
$subtotal_ht = 0;
$subtotal_ttc = 0;
$sql = "SELECT p.label as nom, date_format($column,'%Y-%m') as dm, sum(p.amount) as amount";
$sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as p";
$sql.= " WHERE p.entity = ".$conf->entity;
$sql.= " GROUP BY p.label, dm";
dol_syslog("get social salaries payments");
$result=$db->query($sql);
if ($result)
{
$num = $db->num_rows($result);
$var=false;
$i = 0;
if ($num)
{
while ($i < $num)
{
$obj = $db->fetch_object($result);
if (! isset($decaiss[$obj->dm])) $decaiss[$obj->dm]=0;
$decaiss[$obj->dm] += $obj->amount;
if (! isset($decaiss_ttc[$obj->dm])) $decaiss_ttc[$obj->dm]=0;
$decaiss_ttc[$obj->dm] += $obj->amount;
$i++;
}
}
}
else
{
dol_print_error($db);
}
}
/*
* get dunning paiement
*/
$subtotal_ht = 0;
$subtotal_ttc = 0;
$sql = "SELECT p.societe as nom, p.firstname, p.lastname, date_format(p.datedon,'%Y-%m') as dm, sum(p.amount) as amount";
$sql.= " FROM ".MAIN_DB_PREFIX."don as p";
$sql.= " WHERE p.entity = ".$conf->entity;
$sql.= " AND fk_statut=2";
$sql.= " GROUP BY p.societe, p.firstname, p.lastname, dm";
dol_syslog("get social salaries payments");
$result=$db->query($sql);
if ($result)
* Donation get dunning paiement
*/
if (! empty($conf->don->enabled))
{
$num = $db->num_rows($result);
$var=false;
$i = 0;
if ($num)
{
while ($i < $num)
{
$obj = $db->fetch_object($result);
if (! isset($encaiss[$obj->dm])) $encaiss[$obj->dm]=0;
$encaiss[$obj->dm] += $obj->amount;
if (! isset($encaiss_ttc[$obj->dm])) $encaiss_ttc[$obj->dm]=0;
$encaiss_ttc[$obj->dm] += $obj->amount;
$i++;
}
}
}
else
{
dol_print_error($db);
$subtotal_ht = 0;
$subtotal_ttc = 0;
$sql = "SELECT p.societe as nom, p.firstname, p.lastname, date_format(p.datedon,'%Y-%m') as dm, sum(p.amount) as amount";
$sql.= " FROM ".MAIN_DB_PREFIX."don as p";
$sql.= " WHERE p.entity = ".$conf->entity;
if ($modecompta == 'CREANCES-DETTES')
$sql.= " AND fk_statut in (1,2)";
else
$sql.= " AND fk_statut=2";
$sql.= " GROUP BY p.societe, p.firstname, p.lastname, dm";
dol_syslog("get donation payments");
$result=$db->query($sql);
if ($result)
{
$num = $db->num_rows($result);
$var=false;
$i = 0;
if ($num)
{
while ($i < $num)
{
$obj = $db->fetch_object($result);
if (! isset($encaiss[$obj->dm])) $encaiss[$obj->dm]=0;
$encaiss[$obj->dm] += $obj->amount;
if (! isset($encaiss_ttc[$obj->dm])) $encaiss_ttc[$obj->dm]=0;
$encaiss_ttc[$obj->dm] += $obj->amount;
$i++;
}
}
}
else
{
dol_print_error($db);
}
}
/*

View File

@@ -298,7 +298,7 @@ for ($mois = 1+$nb_mois_decalage ; $mois <= 12+$nb_mois_decalage ; $mois++)
if ($annee_decalage != $year_end) print '<td width="15">&nbsp;</td>';
}
$total_ht[$annee]+=!empty($cum_ht[$case]) ? $cum_ht[$case] : 0;;
$total_ht[$annee]+=!empty($cum_ht[$case]) ? $cum_ht[$case] : 0;
$total[$annee]+=$cum[$case];
}

View File

@@ -1284,7 +1284,7 @@ class Contrat extends CommonObject
$localtaxes_type=getLocalTaxesFromRate($txtva, 0, $this->societe, $mysoc);
$tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, 1,'', $localtaxes_type);
$tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, 1,$mysoc, $localtaxes_type);
$total_ht = $tabprice[0];
$total_tva = $tabprice[1];
$total_ttc = $tabprice[2];
@@ -1420,7 +1420,7 @@ class Contrat extends CommonObject
$localtaxes_type=getLocalTaxesFromRate($tvatx, 0, $this->societe, $mysoc);
$tabprice=calcul_price_total($qty, $pu, $remise_percent, $tvatx, $localtax1tx, $localtax2tx, 0, $price_base_type, $info_bits, 1, '', $localtaxes_type);
$tabprice=calcul_price_total($qty, $pu, $remise_percent, $tvatx, $localtax1tx, $localtax2tx, 0, $price_base_type, $info_bits, 1, $mysoc, $localtaxes_type);
$total_ht = $tabprice[0];
$total_tva = $tabprice[1];
$total_ttc = $tabprice[2];
@@ -2333,7 +2333,7 @@ class ContratLigne extends CommonObject
*/
function update($user, $notrigger=0)
{
global $conf, $langs;
global $conf, $langs, $mysoc;
$error=0;
@@ -2370,7 +2370,9 @@ class ContratLigne extends CommonObject
// qty, pu, remise_percent et txtva
// TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker
// la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva.
$tabprice=calcul_price_total($this->qty, $this->price_ht, $this->remise_percent, $this->tva_tx, $this->localtax1_tx, $this->localtax2_tx, 0, 'HT', 0, 1);
$localtaxes_type = getLocalTaxesFromRate($this->txtva, 0, $this->societe, $mysoc);
$tabprice=calcul_price_total($this->qty, $this->price_ht, $this->remise_percent, $this->tva_tx, $this->localtax1_tx, $this->localtax2_tx, 0, 'HT', 0, 1, $mysoc, $localtaxes_type);
$this->total_ht = $tabprice[0];
$this->total_tva = $tabprice[1];
$this->total_ttc = $tabprice[2];

View File

@@ -3564,16 +3564,16 @@ abstract class CommonObject
else return 0;
}
/**
* Function to show lines of extrafields with output datas
*
* @param object $extrafields Extrafield Object
* @param string $mode Show output (view) or input (edit) for extrafield
* @param array $params Optionnal parameters
* @param string $keyprefix Prefix string to add into name and id of field (can be used to avoid duplicate names)
*
* @return string
*/
/**
* Function to show lines of extrafields with output datas
*
* @param Extrafields $extrafields Extrafield Object
* @param string $mode Show output (view) or input (edit) for extrafield
* @param array $params Optional parameters
* @param string $keyprefix Prefix string to add into name and id of field (can be used to avoid duplicate names)
*
* @return string
*/
function showOptionals($extrafields, $mode='view', $params=0, $keyprefix='')
{
global $_POST, $conf;
@@ -3601,7 +3601,16 @@ abstract class CommonObject
$value=$this->array_options["options_".$key];
break;
case "edit":
$value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$this->array_options["options_".$key]);
if (isset($_POST["options_" . $key])) {
if (is_array($_POST["options_" . $key])) {
// $_POST["options"] is an array but following code expects a comma separated string
$value = implode(",", $_POST["options_" . $key]);
} else {
$value = $_POST["options_" . $key];
}
} else {
$value = $this->array_options["options_" . $key];
}
break;
}
if ($extrafields->attribute_type[$key] == 'separate')

View File

@@ -762,7 +762,9 @@ class ExtraFields
{
$sqlwhere.= ' WHERE '.$InfoFieldList[4];
}
}else {
}
else
{
$sqlwhere.= ' WHERE 1';
}
if (in_array($InfoFieldList[0],array('tablewithentity'))) $sqlwhere.= ' AND entity = '.$conf->entity; // Some tables may have field, some other not. For the moment we disable it.
@@ -1155,7 +1157,7 @@ class ExtraFields
else if (in_array($key_type,array('checkbox')))
{
$value_arr=GETPOST("options_".$key.$keyprefix);
$value_key=implode($value_arr,',');
$value_key=implode(',', $value_arr);
}
else if (in_array($key_type,array('price','double')))
{

View File

@@ -143,7 +143,7 @@ class Notify
*/
function send($action, $object)
{
global $conf,$langs,$mysoc,$dolibarr_main_url_root;
global $user,$conf,$langs,$mysoc,$dolibarr_main_url_root;
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';

View File

@@ -2,6 +2,7 @@
/* Copyright (C) 2008-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012-2013 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.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
@@ -1041,6 +1042,9 @@ function dol_add_file_process($upload_dir, $allowoverwrite=0, $donotupdatesessio
// Define $destpath (path to file including filename) and $destfile (only filename)
$destpath=$upload_dir . "/" . $_FILES[$varfiles]['name'];
$destfile=$_FILES[$varfiles]['name'];
$savingdocmask = dol_sanitizeFileName($savingdocmask);
if ($savingdocmask)
{
$destpath=$upload_dir . "/" . preg_replace('/__file__/',$_FILES[$varfiles]['name'],$savingdocmask);

View File

@@ -231,7 +231,7 @@ function dol_getshmop($memoryid)
global $shmkeys,$shmoffset;
if (empty($shmkeys[$memoryid]) || ! function_exists("shmop_open")) return 0;
$shmkey=dol_getshmopaddress($memoryid);;
$shmkey=dol_getshmopaddress($memoryid);
//print 'dol_getshmop memoryid='.$memoryid." shmkey=".$shmkey."<br>\n";
$handle=@shmop_open($shmkey,'a',0,0);
if ($handle)

View File

@@ -304,7 +304,6 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target
if ($mode == 'source' && ! is_object($sourcecompany)) return -1;
if ($mode == 'target' && ! is_object($targetcompany)) return -1;
if ($mode == 'delivery' && ! is_object($deliverycompany)) return -1;
if (! empty($sourcecompany->state_id) && empty($sourcecompany->departement)) $sourcecompany->departement=getState($sourcecompany->state_id); //TODO: Deprecated
if (! empty($sourcecompany->state_id) && empty($sourcecompany->state)) $sourcecompany->state=getState($sourcecompany->state_id);

View File

@@ -121,17 +121,17 @@ function task_prepare_head($object)
$h = 0;
$head = array();
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/task.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':'');;
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/task.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':'');
$head[$h][1] = $langs->trans("Card");
$head[$h][2] = 'task_task';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/contact.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':'');;
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/contact.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':'');
$head[$h][1] = $langs->trans("TaskRessourceLinks");
$head[$h][2] = 'task_contact';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/time.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':'');;
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/time.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':'');
$head[$h][1] = $langs->trans("TimeSpent");
$head[$h][2] = 'task_time';
$h++;
@@ -147,14 +147,14 @@ function task_prepare_head($object)
$nbNote = 0;
if(!empty($object->note_private)) $nbNote++;
if(!empty($object->note_public)) $nbNote++;
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/note.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':'');;
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/note.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':'');
$head[$h][1] = $langs->trans('Notes');
if ($nbNote > 0) $head[$h][1].= ' <span class="badge">'.$nbNote.'</span>';
$head[$h][2] = 'task_notes';
$h++;
}
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/document.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':'');;
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/document.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':'');
$filesdir = $conf->projet->dir_output . "/" . dol_sanitizeFileName($object->project->ref) . '/' .dol_sanitizeFileName($object->ref);
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$listoffiles=dol_dir_list($filesdir,'files',1,'','thumbs');

View File

@@ -494,7 +494,7 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction,
$sql.= " AND f.fk_statut in (1,2)"; // Paid (partially or completely)
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2)";
else $sql.= " AND f.type IN (0,1,2,3)";
$sql.= " AND f.rowid = d.".$fk_facture;;
$sql.= " AND f.rowid = d.".$fk_facture;
$sql.= " AND pf.".$fk_facture2." = f.rowid";
$sql.= " AND pa.rowid = pf.".$fk_payment;
if ($y && $m)

View File

@@ -376,7 +376,7 @@ class ImportCsv extends ModeleImports
if ($obj) $tablewithentity_cache[$tablename]=1; // table contains entity field
else $tablewithentity_cache[$tablename]=0; // table does not contains entity field
}
else dol_print_error($this->db);;
else dol_print_error($this->db);
}
else
{

View File

@@ -75,6 +75,7 @@ class mailing_contacts1 extends MailingTargets
$statssql[0].= " WHERE c.entity IN (".getEntity('societe', 1).")";
$statssql[0].= " AND c.email != ''"; // Note that null != '' is false
$statssql[0].= " AND c.no_email = 0";
$statssql[0].= " AND c.statut = 1";
return $statssql;
}
@@ -98,6 +99,7 @@ class mailing_contacts1 extends MailingTargets
$sql.= " WHERE c.entity IN (".getEntity('societe', 1).")";
$sql.= " AND c.email != ''"; // Note that null != '' is false
$sql.= " AND c.no_email = 0";
$sql.= " AND c.statut = 1";
// La requete doit retourner un champ "nb" pour etre comprise
// par parent::getNbOfRecipients
@@ -204,6 +206,7 @@ class mailing_contacts1 extends MailingTargets
$sql.= " WHERE c.entity IN (".getEntity('societe', 1).")";
$sql.= " AND c.email <> ''";
$sql.= " AND c.no_email = 0";
$sql.= " AND c.statut = 1";
$sql.= " AND c.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$mailing_id.")";
foreach($filtersarray as $key)
{

View File

@@ -86,6 +86,7 @@ class mailing_contacts2 extends MailingTargets
$sql.= " WHERE sp.entity IN (".getEntity('societe', 1).")";
$sql.= " AND sp.email <> ''"; // Note that null != '' is false
$sql.= " AND sp.no_email = 0";
$sql.= " AND sp.statut = 1";
//$sql.= " AND sp.poste != ''";
$sql.= " AND sp.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$mailing_id.")";
if ($filtersarray[0]<>'all') $sql.= " AND sp.poste ='".$this->db->escape($filtersarray[0])."'";
@@ -168,6 +169,7 @@ class mailing_contacts2 extends MailingTargets
$sql.= " WHERE sp.entity IN (".getEntity('societe', 1).")";
$sql.= " AND sp.email != ''"; // Note that null != '' is false
$sql.= " AND sp.no_email = 0";
$sql.= " AND sp.statut = 1";
//$sql.= " AND sp.poste != ''";
// La requete doit retourner un champ "nb" pour etre comprise
// par parent::getNbOfRecipients
@@ -191,6 +193,7 @@ class mailing_contacts2 extends MailingTargets
$sql.= " WHERE sp.entity IN (".getEntity('societe', 1).")";
$sql.= " AND sp.email != ''"; // Note that null != '' is false
$sql.= " AND sp.no_email = 0";
$sql.= " AND sp.statut = 1";
$sql.= " AND (sp.poste IS NOT NULL AND sp.poste != '')";
$sql.= " GROUP BY sp.poste";
$sql.= " ORDER BY sp.poste";

View File

@@ -85,6 +85,7 @@ class mailing_contacts3 extends MailingTargets
if ($filtersarray[0] <> 'all') $sql.= ", ".MAIN_DB_PREFIX."categorie_societe as cs";
$sql.= " WHERE sp.email <> ''"; // Note that null != '' is false
$sql.= " AND sp.no_email = 0";
$sql.= " AND sp.statut = 1";
$sql.= " AND sp.entity IN (".getEntity('societe', 1).")";
$sql.= " AND sp.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$mailing_id.")";
if ($filtersarray[0] <> 'all') $sql.= " AND cs.fk_categorie = c.rowid";
@@ -173,6 +174,7 @@ class mailing_contacts3 extends MailingTargets
$sql.= " WHERE c.entity IN (".getEntity('societe', 1).")";
$sql.= " AND c.email != ''"; // Note that null != '' is false
$sql.= " AND c.no_email = 0";
$sql.= " AND c.statut = 1";
/*
$sql = "SELECT count(distinct(sp.email)) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp,";
@@ -208,6 +210,7 @@ class mailing_contacts3 extends MailingTargets
$sql.= " ".MAIN_DB_PREFIX."categorie_societe as cs";
$sql.= " WHERE sp.email != ''"; // Note that null != '' is false
$sql.= " AND sp.no_email = 0";
$sql.= " AND sp.statut = 1";
$sql.= " AND sp.entity IN (".getEntity('societe', 1).")";
$sql.= " AND cs.fk_categorie = c.rowid";
$sql.= " AND cs.fk_societe = sp.fk_soc";

View File

@@ -85,6 +85,7 @@ class mailing_contacts4 extends MailingTargets
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = sp.fk_soc";
$sql.= " WHERE sp.email != ''"; // Note that null != '' is false
$sql.= " AND sp.no_email = 0";
$sql.= " AND sp.statut = 1";
$sql.= " AND sp.entity IN (".getEntity('societe', 1).")";
if ($filtersarray[0] <> 'all') $sql.= " AND c.label = '".$this->db->escape($filtersarray[0])."'";
$sql.= " ORDER BY sp.lastname, sp.firstname";
@@ -173,6 +174,7 @@ class mailing_contacts4 extends MailingTargets
$sql.= " WHERE c.entity IN (".getEntity('societe', 1).")";
$sql.= " AND c.email != ''"; // Note that null != '' is false
$sql.= " AND c.no_email = 0";
$sql.= " AND c.statut = 1";
/*
$sql = "SELECT count(distinct(sp.email)) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp,";
@@ -208,6 +210,7 @@ class mailing_contacts4 extends MailingTargets
$sql.= " INNER JOIN ".MAIN_DB_PREFIX."categorie as c ON cs.fk_categorie = c.rowid";
$sql.= " WHERE sp.email != ''"; // Note that null != '' is false
$sql.= " AND sp.no_email = 0";
$sql.= " AND sp.statut = 1";
$sql.= " AND sp.entity IN (".getEntity('societe', 1).")";
$sql.= " GROUP BY c.label";
$sql.= " ORDER BY c.label";

View File

@@ -136,7 +136,7 @@ class modContrat extends DolibarrModules
$r=1;
$this->export_code[$r]=$this->rights_class.'_'.$r;
$this->export_label[$r]='ContractAndServices'; // Translation key (used only if key ExportDataset_xxx_z not found)
$this->export_label[$r]='ContractsAndServices'; // Translation key (used only if key ExportDataset_xxx_z not found)
$this->export_icon[$r]='contract';
$this->export_permission[$r]=array(array("contrat","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',

View File

@@ -416,7 +416,7 @@ class doc_generic_task_odt extends ModelePDFTask
$project= new Project($this->db);
$project->fetch($object->fk_project);
$dir = $conf->projet->dir_output. "/" . $project->ref. "/";;
$dir = $conf->projet->dir_output. "/" . $project->ref. "/";
$objectref = dol_sanitizeFileName($object->ref);
if (! preg_match('/specimen/i',$objectref)) $dir.= "/" . $objectref;
$file = $dir . "/" . $objectref . ".odt";

View File

@@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2013-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.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
@@ -48,7 +49,7 @@ if (empty($conf->global->MAIN_DISABLE_SUGGEST_REF_AS_PREFIX))
//var_dump($modulepart);
if (in_array($modulepart,array('facture_fournisseur','commande_fournisseur','facture','commande','propal','ficheinter','contract','project','project_task')))
{
$savingdocmask=$object->ref.'-__file__';
$savingdocmask=dol_sanitizeFileName($object->ref).'-__file__';
}
/*if (in_array($modulepart,array('member')))
{

View File

@@ -451,7 +451,7 @@ jQuery(document).ready(function() {
<?php if (! empty($usemargins) && $user->rights->margins->creer) { ?>
/* Code for margin */
$("#fournprice_predef options").remove();
$("#fournprice_predef").find("option").remove();
$("#fournprice_predef").hide();
$("#buying_price").val("").show();
$.post('<?php echo DOL_URL_ROOT; ?>/fourn/ajax/getSupplierPrices.php', { 'idprod': $(this).val() }, function(data) {

View File

@@ -61,6 +61,10 @@ class InterfaceWorkflowManager extends DolibarrTriggers
include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
$newobject = new Commande($this->db);
$newobject->context['createfrompropal'] = 'createfrompropal';
$newobject->context['origin'] = $object->element;
$newobject->context['origin_id'] = $object->id;
$ret=$newobject->createFromProposal($object);
if ($ret < 0) { $this->error=$newobject->error; $this->errors[]=$newobject->error; }
return $ret;
@@ -76,6 +80,10 @@ class InterfaceWorkflowManager extends DolibarrTriggers
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$newobject = new Facture($this->db);
$newobject->context['createfromorder'] = 'createfromorder';
$newobject->context['origin'] = $object->element;
$newobject->context['origin_id'] = $object->id;
$ret=$newobject->createFromOrder($object);
if ($ret < 0) { $this->error=$newobject->error; $this->errors[]=$newobject->error; }
return $ret;

View File

@@ -980,7 +980,7 @@ class Expedition extends CommonObject
$mouvS->origin = &$this;
// We decrement stock of product (and sub-products)
// We use warehouse selected for each line
$result=$mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $obj->qty, $obj->subprice, $langs->trans("ShipmentDeletedInDolibarr",$this->ref));
$result=$mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $obj->qty, 0, $langs->trans("ShipmentDeletedInDolibarr",$this->ref));
if ($result < 0)
{
$error++;

View File

@@ -112,7 +112,7 @@ $field=GETPOST("field");
$objexport=new Export($db);
$objexport->load_arrays($user,$datatoexport);
$objmodelexport=new ModeleExports();
$objmodelexport=new ModeleExports($db);
$form = new Form($db);
$htmlother = new FormOther($db);
$formfile = new FormFile($db);

View File

@@ -867,6 +867,7 @@ else if ($action == 'update_extras')
if ($result < 0)
{
$error++;
setEventMessage($object->error,'errors');
}
}
else if ($reshook < 0) $error++;

View File

@@ -1981,7 +1981,7 @@ elseif (! empty($object->id))
// Tableau des substitutions
$formmail->substit['__ORDERREF__']=$object->ref;
$formmail->substit['__ORDERSUPPLIERREF__']=$object->ref_supplier;
$formmail->substit['__THIRPARTY_NAME__'] = $object->thirdparty->name;
$formmail->substit['__THIRDPARTY_NAME__'] = $object->thirdparty->name;
$formmail->substit['__PROJECT_REF__'] = (is_object($object->projet)?$object->projet->ref:'');
$formmail->substit['__SIGNATURE__']=$user->signature;
$formmail->substit['__PERSONALIZED__']='';

View File

@@ -44,7 +44,7 @@ $langs->load('orders');
$langs->load('deliveries');
$langs->load('companies');
if (! $user->rights->facture->creer)
if (! $user->rights->fournisseur->facture->creer)
accessforbidden();
$id = (GETPOST('id') ? GETPOST('id', 'int') : GETPOST("facid")); // For backward compatibility

View File

@@ -5,11 +5,8 @@
* Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
<<<<<<< HEAD
* Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com>
=======
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
>>>>>>> refs/remotes/origin/3.6
*
* 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
@@ -46,6 +43,7 @@ $confirm = GETPOST('confirm');
$facid=GETPOST('facid','int');
$socid=GETPOST('socid','int');
$accountid = GETPOST('accountid');
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
@@ -200,7 +198,7 @@ if (empty($reshook))
if (! $error)
{
$result=$paiement->addPaymentToBank($user,'payment_supplier','(SupplierInvoicePayment)',$_POST['accountid'],'','');
$result=$paiement->addPaymentToBank($user,'payment_supplier','(SupplierInvoicePayment)',$accountid,'','');
if ($result < 0)
{
setEventMessage($paiement->error, 'errors');
@@ -304,7 +302,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
if (! empty($conf->banque->enabled))
{
print '<tr><td class="fieldrequired">'.$langs->trans('Account').'</td><td>';
$form->select_comptes(empty($_POST['accountid'])?'':$_POST['accountid'],'accountid',0,'',2);
$form->select_comptes(empty($accountid)?'':$accountid,'accountid',0,'',2);
print '</td></tr>';
}
else

View File

@@ -3818,8 +3818,8 @@ function migrate_reload_modules($db,$langs,$conf,$listofmodule=array())
if ($moduletoreload == 'MAIN_MODULE_SERVICE') // Permission has changed into 2.7
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Service");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modService.class.php';
if ($res) {
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modService.class.php';
$mod=new modService($db);
//$mod->remove('noboxes');
$mod->init('newboxdefonly');
@@ -3828,8 +3828,8 @@ function migrate_reload_modules($db,$langs,$conf,$listofmodule=array())
if ($moduletoreload == 'MAIN_MODULE_COMMANDE') // Permission has changed into 2.9
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Commande");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modCommande.class.php';
if ($res) {
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modCommande.class.php';
$mod=new modCommande($db);
//$mod->remove('noboxes');
$mod->init('newboxdefonly');
@@ -3838,8 +3838,8 @@ function migrate_reload_modules($db,$langs,$conf,$listofmodule=array())
if ($moduletoreload == 'MAIN_MODULE_FACTURE') // Permission has changed into 2.9
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Facture");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modFacture.class.php';
if ($res) {
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modFacture.class.php';
$mod=new modFacture($db);
//$mod->remove('noboxes');
$mod->init('newboxdefonly');
@@ -3878,8 +3878,8 @@ function migrate_reload_modules($db,$langs,$conf,$listofmodule=array())
if ($moduletoreload == 'MAIN_MODULE_ECM') // Permission has changed into 3.0 and 3.1
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module ECM");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modECM.class.php';
if ($res) {
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modECM.class.php';
$mod=new modECM($db);
$mod->remove('noboxes'); // We need to remove because a permission id has been removed
$mod->init('newboxdefonly');

View File

@@ -1170,6 +1170,7 @@ ContractsNumberingModules=Contracts numbering modules
TemplatePDFContracts=Contracts documents models
FreeLegalTextOnContracts=Free text on contracts
WatermarkOnDraftContractCards=Watermark on draft contracts (none if empty)
ContractsAndServices=List of contracts and services
##### Members #####
MembersSetup=Members module setup
MemberMainOptions=Main options

View File

@@ -138,9 +138,9 @@ AnnualByCompaniesInputOutputMode=Balance of income and expenses, detail by third
SeeReportInInputOutputMode=See report <b>%sIncomes-Expenses%s</b> said <b>cash accounting</b> for a calculation on actual payments made
SeeReportInDueDebtMode=See report <b>%sClaims-Debts%s</b> said <b>commitment accounting</b> for a calculation on issued invoices
RulesAmountWithTaxIncluded=- Amounts shown are with all taxes included
RulesResultDue=- It includes outstanding invoices, expenses and VAT whether they are paid or not. <br>- It is based on the validation date of invoices and VAT and on the due date for expenses.
RulesResultInOut=- It includes the real payments made on invoices, expenses and VAT. <br>- It is based on the payment dates of the invoices, expenses and VAT.
RulesCADue=- It includes the client's due invoices whether they are paid or not. <br>- It is based on the validation date of these invoices. <br>
RulesResultDue=- It includes outstanding invoices, expenses, VAT, donations whether they are paid or not. Is also includes paid salaries.<br>- It is based on the validation date of invoices and VAT and on the due date for expenses. For salaries defined with Salary module, the value date of payment is used.
RulesResultInOut=- It includes the real payments made on invoices, expenses, VAT and salaries. <br>- It is based on the payment dates of the invoices, expenses, VAT and salaries. The donation date for donation.
RulesCADue=- It includes the client's due invoices whether they are paid or not. <br>- It is based on the validation date of these invoices.<br>
RulesCAIn=- It includes all the effective payments of invoices received from clients.<br>- It is based on the payment date of these invoices<br>
DepositsAreNotIncluded=- Deposit invoices are nor included
DepositsAreIncluded=- Deposit invoices are included

View File

@@ -138,8 +138,8 @@ AnnualByCompaniesInputOutputMode=Bilan des recettes et dépenses, détail par ti
SeeReportInInputOutputMode=Cliquer sur <b>%sRecettes-Dépenses%s</b> dit <b>comptabilité de caisse</b> pour un calcul sur les paiements effectivement réalisés
SeeReportInDueDebtMode=Cliquer sur <b>%sCréances-Dettes%s</b> dit <b>comptabilité d'engagement</b> pour un calcul sur les factures émises
RulesAmountWithTaxIncluded=- Les montants affichés sont les montants taxe incluse
RulesResultDue=- Il inclut les factures, charges et tva dues, qu'elles soient payées ou non.<br>- Il se base sur la date de validation pour les factures et la tva et sur la date d'échéance pour les charges.
RulesResultInOut=- Il inclut les règlements effectivement réalisés pour les factures, les charges et la TVA.<br>- Il se base sur la date de règlement de ces factures, charges et TVA.
RulesResultDue=- Il inclut les factures, charges, tva dues, et dons qu'ils soient payées ou non.<br>- Il se base sur la date de validation pour les factures et la tva et sur la date d'échéance pour les charges. Pour les salaires saisis depuis le module Salaires, la date de valeur du paiement est utilisée.
RulesResultInOut=- Il inclut les règlements effectivement réalisés pour les factures, les charges, TVA et salaires.<br>- Il se base sur la date de règlement de ces factures, charges, TVA ou salaires. La date de don pour les dons.
RulesCADue=- Il inclut les factures clients dues, qu'elles soient payées ou non.<br>- Il se base sur la date de validation de ces factures.<br>
RulesCAIn=- Il inclut les règlements effectivement reçus des factures clients.<br>- Il se base sur la date de règlement de ces factures<br>
DepositsAreNotIncluded=- Les factures d'acomptes ne sont pas incluses

View File

@@ -383,7 +383,7 @@ if ($action == 'create')
*/
print '<td align="center">';
$quantite_livree = $commande->livraisons[$line->id];
print $quantite_livree;;
print $quantite_livree;
print '</td>';
$quantite_commandee = $line->qty;

View File

@@ -367,7 +367,7 @@ if ($comments) {
}
else
{
print $langs->trans("NoCommentYet").'<br>';;
print $langs->trans("NoCommentYet").'<br>';
}
print '<br>';

View File

@@ -252,7 +252,7 @@ if ($id > 0 || ! empty($ref))
$productstatic->type=$value["fk_product_type"];
$productstatic->ref=$value['label'];
print '<tr>';
print '<td>'.$productstatic->getNomUrl(1,'composition').'</td>';;
print '<td>'.$productstatic->getNomUrl(1,'composition').'</td>';
print '</tr>';
}
print '</table>';
@@ -401,7 +401,7 @@ if ($id > 0 || ! empty($ref))
$productstatic->type=$value["fk_product_type"];
$productstatic->ref=$value['label'];
print '<tr>';
print '<td>'.$productstatic->getNomUrl(1,'composition').'</td>';;
print '<td>'.$productstatic->getNomUrl(1,'composition').'</td>';
print '</tr>';
}
print '</table>';

View File

@@ -299,7 +299,7 @@ if ($result)
if (empty($conf->global->PRODUIT_MULTIPRICES))
{
print '<td align="right">';
if ($objp->price_base_type == 'TTC') print price($objp->price_ttc).' '.$langs->trans("TTC");
if (isset($objp->price_base_type) && $objp->price_base_type == 'TTC') print price($objp->price_ttc).' '.$langs->trans("TTC");
else print price($objp->price).' '.$langs->trans("HT");
print '</td>';
}

View File

@@ -118,8 +118,8 @@ if ($id > 0 || ! empty($ref))
print '</div>';
$sql = "SELECT distinct s.nom as name, s.rowid as socid, s.code_client, c.rowid, c.total_ht as total_ht, c.ref,";
$sql.= " c.date_commande, c.fk_statut as statut, c.facture, c.rowid as commandeid, d.qty";
$sql = "SELECT s.nom as name, s.rowid as socid, s.code_client, c.rowid, c.total_ht as total_ht, c.ref,";
$sql.= " c.date_commande, c.fk_statut as statut, c.facture, c.rowid as commandeid, SUM(d.qty) as qty";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user ";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql.= ", ".MAIN_DB_PREFIX."commande as c";
@@ -131,6 +131,7 @@ if ($id > 0 || ! empty($ref))
$sql.= " AND d.fk_product =".$product->id;
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
if ($socid) $sql.= " AND c.fk_soc = ".$socid;
$sql.= " GROUP BY c.rowid ";
$sql.= " ORDER BY $sortfield $sortorder ";
$sql.= $db->plimit($conf->liste_limit +1, $offset);

View File

@@ -112,7 +112,7 @@ if ($id > 0 || ! empty($ref))
$sql = "SELECT distinct s.nom as name, s.rowid as socid, s.code_client,";
$sql.= " c.rowid, c.total_ht as total_ht, c.ref,";
$sql.= " c.date_commande, c.fk_statut as statut, c.rowid as commandeid, d.qty";
$sql.= " c.date_commande, c.fk_statut as statut, c.rowid as commandeid, SUM(d.qty) as qty";
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user ";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql.= ", ".MAIN_DB_PREFIX."commande_fournisseur as c";
@@ -124,6 +124,7 @@ if ($id > 0 || ! empty($ref))
$sql.= " AND d.fk_product =".$product->id;
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
if ($socid) $sql.= " AND c.fk_soc = ".$socid;
$sql.= " GROUP BY c.rowid ";
$sql.= " ORDER BY $sortfield $sortorder ";
$sql.= $db->plimit($conf->liste_limit +1, $offset);

View File

@@ -124,9 +124,9 @@ if ($id > 0 || ! empty($ref))
if ($user->rights->facture->lire) {
$sql = "SELECT distinct s.nom as name, s.rowid as socid, s.code_client,";
$sql = "SELECT s.nom as name, s.rowid as socid, s.code_client,";
$sql.= " f.facnumber, f.total as total_ht,";
$sql.= " f.datef, f.paye, f.fk_statut as statut, f.rowid as facid, d.qty";
$sql.= " f.datef, f.paye, f.fk_statut as statut, f.rowid as facid, SUM(d.qty) as qty";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user ";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql.= ", ".MAIN_DB_PREFIX."facture as f";
@@ -138,6 +138,7 @@ if ($id > 0 || ! empty($ref))
$sql.= " AND d.fk_product =".$product->id;
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
if ($socid) $sql.= " AND f.fk_soc = $socid";
$sql.= " GROUP BY f.rowid ";
$sql.= " ORDER BY $sortfield $sortorder ";
$sql.= $db->plimit($conf->liste_limit +1, $offset);

View File

@@ -122,8 +122,8 @@ if ($id > 0 || ! empty($ref))
print '</div>';
$sql = "SELECT distinct s.nom as name, s.rowid as socid, s.code_client, f.ref, f.total_ht as total_ht,";
$sql.= " f.datef, f.paye, f.fk_statut as statut, f.rowid as facid, d.qty";
$sql = "SELECT s.nom as name, s.rowid as socid, s.code_client, f.ref, f.total_ht as total_ht,";
$sql.= " f.datef, f.paye, f.fk_statut as statut, f.rowid as facid, SUM(d.qty) as qty";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user ";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql.= ", ".MAIN_DB_PREFIX."facture_fourn as f";
@@ -135,6 +135,7 @@ if ($id > 0 || ! empty($ref))
$sql.= " AND d.fk_product =".$product->id;
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
if ($socid) $sql.= " AND f.fk_soc = ".$socid;
$sql.= " GROUP BY f.rowid ";
$sql.= " ORDER BY $sortfield $sortorder ";
$sql.= $db->plimit($conf->liste_limit +1, $offset);

View File

@@ -113,8 +113,8 @@ if ($id > 0 || ! empty($ref))
print '</div>';
$sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, p.rowid as propalid, p.ref, p.total_ht as amount,";
$sql.= "p.datep, p.fk_statut as statut, d.qty";
$sql = "SELECT s.nom as name, s.rowid as socid, p.rowid as propalid, p.ref, p.total_ht as amount,";
$sql.= "p.datep, p.fk_statut as statut, SUM(d.qty) as qty";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user ";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql.= ",".MAIN_DB_PREFIX."propal as p";
@@ -126,6 +126,7 @@ if ($id > 0 || ! empty($ref))
$sql.= " AND d.fk_product =".$product->id;
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
if ($socid) $sql.= " AND p.fk_soc = ".$socid;
$sql.= " GROUP BY p.rowid ";
$sql.= " ORDER BY $sortfield $sortorder ";
$sql.= $db->plimit($conf->liste_limit +1, $offset);

View File

@@ -135,14 +135,14 @@ class Entrepot extends CommonObject
*/
function update($id, $user)
{
$this->libelle=$this->db->escape(trim($this->libelle));
$this->description=$this->db->escape(trim($this->description));
$this->libelle=trim($this->libelle);
$this->description=trim($this->description);
$this->lieu=$this->db->escape(trim($this->lieu));
$this->lieu=trim($this->lieu);
$this->address=$this->db->escape(trim($this->address));
$this->zip=$this->zip?trim($this->zip):trim($this->zip);
$this->town=$this->town?trim($this->town):trim($this->town);
$this->address=trim($this->address);
$this->zip=trim($this->zip);
$this->town=trim($this->town);
$this->country_id=($this->country_id > 0 ? $this->country_id : $this->country_id);
$sql = "UPDATE ".MAIN_DB_PREFIX."entrepot ";

View File

@@ -682,9 +682,10 @@ if ( (! empty($conf->productbatch->enabled)) && $product->hasbatch()) {
print '</tr>';
}
$sql = "SELECT e.rowid, e.label, ps.reel, ps.pmp, ps.rowid as product_stock_id";
$sql = "SELECT e.rowid, e.label, ps.reel, p.pmp, ps.rowid as product_stock_id";
$sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e,";
$sql.= " ".MAIN_DB_PREFIX."product_stock as ps";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = ps.fk_product";
$sql.= " WHERE ps.reel != 0";
$sql.= " AND ps.fk_entrepot = e.rowid";
$sql.= " AND e.entity IN (".getEntity('stock',1).')';

View File

@@ -31,7 +31,7 @@ $langs->load("stocks");
// Security check
$result=restrictedArea($user,'stock');
$sref=GETPOST("sref");;
$sref=GETPOST("sref");
$snom=GETPOST("snom");
$sall=GETPOST("sall");

View File

@@ -131,7 +131,7 @@ if ($id > 0 || ! empty($ref))
$colwidth=30;
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
dol_fiche_end();;
dol_fiche_end();
}
llxFooter();

View File

@@ -304,7 +304,6 @@ if ($action == 'add')
$urlback=DOL_MAIN_URL_ROOT.'/public/paybox/newpayment.php?from=membernewform&source=membersubscription&ref='.$adh->ref;
if (price2num(GETPOST('amount'))) $urlback.='&amount='.price2num(GETPOST('amount'));
if (GETPOST('email')) $urlback.='&email='.urlencode(GETPOST('email'));
if (! empty($entity)) $urlback.='&entity='.$entity;
}
else if ($conf->global->MEMBER_NEWFORM_PAYONLINE == 'paypal')
{
@@ -315,7 +314,7 @@ if ($action == 'add')
{
$urlback.='&securekey='.dol_hash($conf->global->PAYPAL_SECURITY_TOKEN . 'membersubscription' . $adh->ref, 2);
}
if (! empty($entity)) $urlback.='&entity='.$entity;
}
else
{
@@ -324,6 +323,7 @@ if ($action == 'add')
}
}
if (! empty($entity)) $urlback.='&entity='.$entity;
dol_syslog("member ".$adh->ref." was created, we redirect to ".$urlback);
Header("Location: ".$urlback);
exit;

View File

@@ -107,7 +107,7 @@ dol_fiche_head($head, 'card', $langs->trans("ThirdParty"),0,'company');
<tr>
<td><?php echo $langs->trans('EMail'); ?></td>
<td><?php echo $this->control->tpl['email'];; ?></td>
<td><?php echo $this->control->tpl['email']; ?></td>
<td><?php echo $langs->trans('Web'); ?></td>
<td><?php echo $this->control->tpl['url']; ?></td>
</tr>

View File

@@ -106,7 +106,7 @@ dol_fiche_head($head, 'card', $langs->trans("ThirdParty"),0,'company');
<tr>
<td><?php echo $langs->trans('EMail'); ?></td>
<td><?php echo $this->control->tpl['email'];; ?></td>
<td><?php echo $this->control->tpl['email']; ?></td>
<td><?php echo $langs->trans('Web'); ?></td>
<td><?php echo $this->control->tpl['url']; ?></td>
</tr>

View File

@@ -401,7 +401,14 @@ if ($socid && $action != 'edit' && $action != "create")
}
if (count($rib_list) == 0) {
print '<tr '.$bc[0].'><td colspan="7" align="center">'.$langs->trans("NoBANRecord").'</td></tr>';
if (! empty($conf->prelevement->enabled)) {
$colspan = 8;
} else {
$colspan = 7;
}
print '<tr '.$bc[0].'><td colspan="'.$colspan.'" align="center">'.$langs->trans("NoBANRecord").'</td></tr>';
}
print '</table>';

View File

@@ -1,2 +1,3 @@
/bootstrap
/oblyon
/allscreens/

View File

@@ -160,6 +160,6 @@ echo '</pre>';
echo '<h4>SOAP Message</h4>';
echo '<pre>' . htmlspecialchars($soapclient->response, ENT_QUOTES) . '</pre>';
echo '</body>'."\n";;
echo '</html>'."\n";;
echo '</body>'."\n";
echo '</html>'."\n";
?>

View File

@@ -92,6 +92,6 @@ echo '<h4>SOAP Message</h4>';
echo '<pre>' . htmlspecialchars($soapclient->response, ENT_QUOTES) . '</pre>';
echo '</body>'."\n";;
echo '</html>'."\n";;
echo '</body>'."\n";
echo '</html>'."\n";
?>

View File

@@ -136,6 +136,6 @@ echo '</pre>';
echo '<h4>SOAP Message</h4>';
echo '<pre>' . htmlspecialchars($soapclient2->response, ENT_QUOTES) . '</pre>';
echo '</body>'."\n";;
echo '</html>'."\n";;
echo '</body>'."\n";
echo '</html>'."\n";
?>

View File

@@ -99,6 +99,6 @@ echo '</pre>';
echo '<h4>SOAP Message</h4>';
echo '<pre>' . htmlspecialchars($soapclient->response, ENT_QUOTES) . '</pre>';
echo '</body>'."\n";;
echo '</html>'."\n";;
echo '</body>'."\n";
echo '</html>'."\n";
?>

View File

@@ -177,6 +177,6 @@ echo '</pre>';
echo '<h4>SOAP Message</h4>';
echo '<pre>' . htmlspecialchars($soapclient3->response, ENT_QUOTES) . '</pre>';
echo '</body>'."\n";;
echo '</html>'."\n";;
echo '</body>'."\n";
echo '</html>'."\n";
?>

View File

@@ -223,6 +223,6 @@ echo '</pre>';
echo '<h4>SOAP Message</h4>';
echo '<pre>' . htmlspecialchars($soapclient->response, ENT_QUOTES) . '</pre>';
echo '</body>'."\n";;
echo '</html>'."\n";;
echo '</body>'."\n";
echo '</html>'."\n";
?>

View File

@@ -116,7 +116,7 @@ if ($resql)
$oldemail = $obj->email;
$olduid = $obj->uid;
$oldlang = $obj->lang;
$oldsalerepresentative=dolGetFirstLastname($obj->firstname, $obj->lastname);;
$oldsalerepresentative=dolGetFirstLastname($obj->firstname, $obj->lastname);
$message = '';
$total = 0;
$foundtoprocess = 0;

View File

@@ -120,7 +120,7 @@ if ($resql)
$oldemail = $obj->email;
$olduid = $obj->uid;
$oldlang = $obj->lang;
$oldsalerepresentative=dolGetFirstLastname($obj->firstname, $obj->lastname);;
$oldsalerepresentative=dolGetFirstLastname($obj->firstname, $obj->lastname);
$message = '';
$total = 0;
$foundtoprocess = 0;