mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-05 17:18:13 +01:00
Compare commits
339 Commits
phpstan-ba
...
3.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b7abe9e08a | ||
|
|
e6e9debaa0 | ||
|
|
45ccb07964 | ||
|
|
47c3b14a11 | ||
|
|
e918d9115e | ||
|
|
8ee98b4846 | ||
|
|
1e5a861766 | ||
|
|
fa668910c2 | ||
|
|
ff143e9bc3 | ||
|
|
f3b952ef2d | ||
|
|
ffa593eda2 | ||
|
|
114ee9dc07 | ||
|
|
7847e544a4 | ||
|
|
637aa69e37 | ||
|
|
715c88b52e | ||
|
|
d4e1300620 | ||
|
|
74579860c7 | ||
|
|
a2cd3e5969 | ||
|
|
6222d8b2cb | ||
|
|
a3fb6efe69 | ||
|
|
54a57941a0 | ||
|
|
8c1c301a3d | ||
|
|
aaa19c23ec | ||
|
|
4bcee36349 | ||
|
|
b5406c704a | ||
|
|
93eaf722a1 | ||
|
|
5b74a5aa9a | ||
|
|
8cbdcb9c20 | ||
|
|
6c2b1f5244 | ||
|
|
2548c1d2a4 | ||
|
|
2297e940b3 | ||
|
|
9635f5858a | ||
|
|
c4f40462d1 | ||
|
|
c0b5a25430 | ||
|
|
0a0e426e40 | ||
|
|
4fee09738b | ||
|
|
28116d13fb | ||
|
|
f298f302ff | ||
|
|
2af2280006 | ||
|
|
11c2a7c076 | ||
|
|
bf8b8f180f | ||
|
|
745acdf313 | ||
|
|
609d01d386 | ||
|
|
e4a32f2d23 | ||
|
|
db04e91f06 | ||
|
|
eaac97256e | ||
|
|
f4817de2d0 | ||
|
|
b2b5505304 | ||
|
|
051d6f5ce8 | ||
|
|
7fdf1d8f3b | ||
|
|
b4123e4e4c | ||
|
|
99ea8e6bf0 | ||
|
|
9229f8799a | ||
|
|
e99e7973df | ||
|
|
81f58fe8ff | ||
|
|
eaf3e2a3ec | ||
|
|
8e912dde63 | ||
|
|
1d12f8e188 | ||
|
|
7c54bbfd2e | ||
|
|
5e00e2dc15 | ||
|
|
7586204aad | ||
|
|
f32e92dbcd | ||
|
|
ec33c4a999 | ||
|
|
4987bec341 | ||
|
|
981aa4e0df | ||
|
|
1b926f6a7e | ||
|
|
508f581bca | ||
|
|
0374d9836f | ||
|
|
ee15efdd7e | ||
|
|
98025222e0 | ||
|
|
575661eddc | ||
|
|
126f170122 | ||
|
|
666fc9b91d | ||
|
|
692f19db2a | ||
|
|
88293c9ab8 | ||
|
|
dd80a7854b | ||
|
|
a34358fe00 | ||
|
|
420c7309f7 | ||
|
|
123fab92d3 | ||
|
|
6671e8cf5b | ||
|
|
4126b6149f | ||
|
|
f822a03a82 | ||
|
|
f0a15ff975 | ||
|
|
737eb57b33 | ||
|
|
4e1d689bf8 | ||
|
|
0ffc86fe02 | ||
|
|
22a26b9e2b | ||
|
|
8b1b3ef1b3 | ||
|
|
fe212f729f | ||
|
|
26c3bd4993 | ||
|
|
f142d4f0f1 | ||
|
|
42343a1206 | ||
|
|
6110ec4b2a | ||
|
|
6a610e6518 | ||
|
|
8abbf6a537 | ||
|
|
b75f610ec1 | ||
|
|
72459ac35c | ||
|
|
52ee7183d9 | ||
|
|
5741b19203 | ||
|
|
f07557f6ec | ||
|
|
0317ae75de | ||
|
|
5311001ae2 | ||
|
|
e76290c767 | ||
|
|
385d75f0e2 | ||
|
|
8d8629eab9 | ||
|
|
390214e265 | ||
|
|
99b300f01b | ||
|
|
025e887e04 | ||
|
|
e54bfd21b7 | ||
|
|
d9dea81e75 | ||
|
|
86801c2e8a | ||
|
|
6f11d1e28e | ||
|
|
8336e81b95 | ||
|
|
57b12edbbb | ||
|
|
731cb8d806 | ||
|
|
1c00dead1c | ||
|
|
f5ad2692f5 | ||
|
|
2a3c726f41 | ||
|
|
635f9ce3aa | ||
|
|
919ea45ccb | ||
|
|
ad8bf92d98 | ||
|
|
130c89a18c | ||
|
|
dfbe0c78dc | ||
|
|
0d47653e14 | ||
|
|
500d60fc7e | ||
|
|
608ad7c688 | ||
|
|
d34a653734 | ||
|
|
eee0d1aa07 | ||
|
|
8348de5591 | ||
|
|
cb7c17e11a | ||
|
|
468d79e8c4 | ||
|
|
a06a1cb25c | ||
|
|
9aebe0d1ba | ||
|
|
d452049790 | ||
|
|
fc1087ac8d | ||
|
|
a069c1ce63 | ||
|
|
180ca71367 | ||
|
|
5f42ab9d65 | ||
|
|
6a590ffec8 | ||
|
|
829b8e98ad | ||
|
|
ab4a1af224 | ||
|
|
1970a5dda9 | ||
|
|
51c1cfed8a | ||
|
|
86fb0aa1b7 | ||
|
|
598e87ab62 | ||
|
|
03c82f3dee | ||
|
|
115d08b4d7 | ||
|
|
424eabd13c | ||
|
|
41f73f57a3 | ||
|
|
ab7ffebf83 | ||
|
|
a2a20ab527 | ||
|
|
216d786638 | ||
|
|
c26f78516c | ||
|
|
1900a96ca6 | ||
|
|
0324b532f8 | ||
|
|
fa0d06dd8c | ||
|
|
e291c209e6 | ||
|
|
d8c92fd210 | ||
|
|
738d327fcf | ||
|
|
5e1ebe9de3 | ||
|
|
cb6f960b42 | ||
|
|
96e05a0363 | ||
|
|
ceccedcac0 | ||
|
|
5c5682998c | ||
|
|
cd19b1f2d6 | ||
|
|
035bc672a8 | ||
|
|
d8004865b1 | ||
|
|
5c9300ac39 | ||
|
|
47e5bd9bf1 | ||
|
|
5c0f95db44 | ||
|
|
1c06114383 | ||
|
|
af97652c9b | ||
|
|
cc39ca7287 | ||
|
|
e1db0ef946 | ||
|
|
6e90b6c082 | ||
|
|
9dd6c64b38 | ||
|
|
4b49bae945 | ||
|
|
5240a5d7cf | ||
|
|
05da13c469 | ||
|
|
fbdccb217a | ||
|
|
092f0dcf77 | ||
|
|
3617a36f06 | ||
|
|
0a7cdf53e7 | ||
|
|
e113c84745 | ||
|
|
9f8d5f75a6 | ||
|
|
769ae718f8 | ||
|
|
920b521a2c | ||
|
|
0baaf26d2d | ||
|
|
29bb629ded | ||
|
|
b96bd1a929 | ||
|
|
14243f4120 | ||
|
|
3c04c18a54 | ||
|
|
588388f2e8 | ||
|
|
8021b51fe1 | ||
|
|
c5772a56eb | ||
|
|
b931a59da1 | ||
|
|
4392776bfb | ||
|
|
da921bb973 | ||
|
|
eb7fd25ced | ||
|
|
973c98aa31 | ||
|
|
3f59e585d0 | ||
|
|
2b1ace1b8c | ||
|
|
ecc11e39b3 | ||
|
|
6a275e9c64 | ||
|
|
73c9295178 | ||
|
|
fdbf579d25 | ||
|
|
f0f200295a | ||
|
|
0b935cabdf | ||
|
|
4356eb8b16 | ||
|
|
f46c148fc6 | ||
|
|
6cf20da188 | ||
|
|
c9cd90b19e | ||
|
|
cd51211292 | ||
|
|
5c25d43473 | ||
|
|
eabf281c20 | ||
|
|
3972267c3b | ||
|
|
f4433923b7 | ||
|
|
a4853e4d31 | ||
|
|
296d8e490d | ||
|
|
23da34b339 | ||
|
|
a8409589bc | ||
|
|
73437223d8 | ||
|
|
fa95cb2540 | ||
|
|
c4ae5968b2 | ||
|
|
850cf003f1 | ||
|
|
133ef22ef8 | ||
|
|
416c2cb93e | ||
|
|
74ba59f8d3 | ||
|
|
4a1b8d2c70 | ||
|
|
11bf3e9f4d | ||
|
|
594d8db7cf | ||
|
|
d91663e97b | ||
|
|
aa9ccb41cc | ||
|
|
8b534d1391 | ||
|
|
be18f46b4a | ||
|
|
3ed533fc7e | ||
|
|
8baee6658f | ||
|
|
19920dd2a7 | ||
|
|
6ccb3dcc98 | ||
|
|
bbef42e594 | ||
|
|
1761aca350 | ||
|
|
80ed70d32e | ||
|
|
c41f26fb0a | ||
|
|
8f32052fe1 | ||
|
|
8796cc5aad | ||
|
|
9f5687decb | ||
|
|
3e27fb9d97 | ||
|
|
e40cef2b85 | ||
|
|
98605f08ac | ||
|
|
bf64059357 | ||
|
|
767da4d86a | ||
|
|
e4b445fcb1 | ||
|
|
20dea64979 | ||
|
|
e1b50e4456 | ||
|
|
014cf0b1e6 | ||
|
|
c10a1d7d4e | ||
|
|
1b644466b2 | ||
|
|
818742f8d1 | ||
|
|
66eda574ea | ||
|
|
eba944b80b | ||
|
|
9c823a7310 | ||
|
|
0525fb8f64 | ||
|
|
115e5e5243 | ||
|
|
4f64548061 | ||
|
|
820722f113 | ||
|
|
49d98fcb6f | ||
|
|
864c15afe1 | ||
|
|
d9e7c6b71d | ||
|
|
222d123800 | ||
|
|
8dc2a9b2c9 | ||
|
|
e2fcf23985 | ||
|
|
65b543c1bf | ||
|
|
ed5f26ac02 | ||
|
|
462fddd63a | ||
|
|
993c8a8bab | ||
|
|
16a5028904 | ||
|
|
c3460f2d41 | ||
|
|
a9918d8818 | ||
|
|
d2fb25ef24 | ||
|
|
f097b11967 | ||
|
|
89adc77bd1 | ||
|
|
f42250d0be | ||
|
|
b02b67bce2 | ||
|
|
ff02f5ca03 | ||
|
|
92897d5cca | ||
|
|
f6870bcaa5 | ||
|
|
f46a6e62fd | ||
|
|
ec3e706051 | ||
|
|
f48cb64447 | ||
|
|
380cfe87b8 | ||
|
|
0c51cc4d6e | ||
|
|
306aec52c3 | ||
|
|
4bc4316d86 | ||
|
|
b2ba52247c | ||
|
|
8a1a542d95 | ||
|
|
a34206e6e6 | ||
|
|
da3e3a6616 | ||
|
|
49368b5d5b | ||
|
|
d690261eba | ||
|
|
cfbe8515c1 | ||
|
|
7811037f48 | ||
|
|
a5c350f169 | ||
|
|
0829fd31ef | ||
|
|
93367e9d57 | ||
|
|
1b31edf654 | ||
|
|
98b62da53e | ||
|
|
697d314970 | ||
|
|
08b1f16306 | ||
|
|
66f0676909 | ||
|
|
1cb871e295 | ||
|
|
5320e8c2c9 | ||
|
|
12812ef28b | ||
|
|
f790f36a62 | ||
|
|
86f811aeee | ||
|
|
7633e2ecf4 | ||
|
|
2adc0e5710 | ||
|
|
ef08148a47 | ||
|
|
6ac1deb70b | ||
|
|
a84544e916 | ||
|
|
f11b9bbf6d | ||
|
|
dcd2e50ac4 | ||
|
|
5036cae36c | ||
|
|
61871f6f7b | ||
|
|
9d21bdfddb | ||
|
|
2d936e86c0 | ||
|
|
7360bc1b6f | ||
|
|
3a1da723e2 | ||
|
|
2a96589009 | ||
|
|
69aee95b21 | ||
|
|
8a58ab981e | ||
|
|
944277bc5e | ||
|
|
9f81bd2c72 | ||
|
|
2d42ab0d35 | ||
|
|
333e7092ab | ||
|
|
5baa28b3bb | ||
|
|
0831bbd3bf | ||
|
|
7d1cfe36e0 | ||
|
|
5ae3a2d35a | ||
|
|
916a9f7a39 |
11
.gitignore
vendored
Normal file
11
.gitignore
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
htdocs/conf/conf.php
|
||||
htdocs/conf/conf.php.old
|
||||
documents/
|
||||
custom/
|
||||
custom2/
|
||||
nbproject
|
||||
.settings/
|
||||
.buildpath
|
||||
default.properties
|
||||
/.git
|
||||
/.project
|
||||
@@ -1,4 +1,4 @@
|
||||
#Sun Oct 03 22:45:56 CEST 2010
|
||||
#Wed Feb 08 12:16:54 CET 2012
|
||||
eclipse.preferences.version=1
|
||||
encoding//build/exe/doliwamp/Languages=ISO-8859-1
|
||||
encoding//htdocs/langs/fr_FR/other.lang=UTF-8
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
#Wed Dec 01 20:46:32 CET 2010
|
||||
#Sat Sep 17 16:07:47 CEST 2011
|
||||
eclipse.preferences.version=1
|
||||
include_path=
|
||||
include_path=0;/dolibarrveryold
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
License
|
||||
-------
|
||||
|
||||
Dolibarr is distributed under GPL terms 2.0 (See COPYING file)
|
||||
Dolibarr is released under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the License,
|
||||
or (at your option) any later version
|
||||
|
||||
However it uses some external libraries under different licences. This is compatibility summary:
|
||||
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
--------------------------------------------------------------
|
||||
English Dolibarr ChangeLog
|
||||
$Id$
|
||||
--------------------------------------------------------------
|
||||
|
||||
***** ChangeLog for 3.0 compared to 2.9 *****
|
||||
|
||||
@@ -6,7 +9,7 @@ For users:
|
||||
- New: Can edit date of cheque receipts.
|
||||
- New: Add Sales journal and Purchase journal report.
|
||||
- New: Can create supplier invoice from supplier order.
|
||||
New: Support login by openid
|
||||
- New: Support login by openid
|
||||
- New: Support "full day" event in calendar module.
|
||||
- New: Add a weather on dashboard.
|
||||
- New: Add a Paypal module.
|
||||
@@ -69,6 +72,7 @@ For users:
|
||||
readers when using "mail php function".
|
||||
- Fix: When cloning commercial proposal, due date is creation date + delay
|
||||
by default.
|
||||
- Fix: Can edit ordering methods.
|
||||
|
||||
For translators:
|
||||
- New: Update and complete slovenian language sl_SL.
|
||||
@@ -84,6 +88,9 @@ For developers:
|
||||
- New: Add first Selenium GUI tests.
|
||||
- New: Enhance a lot of internal function to build external modules
|
||||
more easily.
|
||||
- New: Add a user field ref_ext in object tables to allow external
|
||||
systems to store their id and make self-developed synchronizing
|
||||
functions easier to build.
|
||||
- New: Local user timezone is saved into session (not used yet).
|
||||
- New: Works with Mysql 5.5.
|
||||
- Qual: Menu system code is simpler.
|
||||
|
||||
@@ -7,7 +7,9 @@ makepack-google.conf
|
||||
module_google-*.tgz
|
||||
module_pibarcode-1.0.tgz
|
||||
*.exe
|
||||
*.tgz
|
||||
*.torrent
|
||||
*.zip
|
||||
version-phpsane.txt
|
||||
makepack-phpsane.conf
|
||||
html
|
||||
|
||||
@@ -9,7 +9,7 @@ Section: web
|
||||
Priority: optional
|
||||
Recommends: mozilla | netscape
|
||||
Homepage: http://www.dolibarr.org
|
||||
Description: Dolibarr ERP/CRM
|
||||
Description: Dolibarr ERP & CRM
|
||||
Dolibarr ERP/CRM is an open source/free software for
|
||||
small and medium companies, foundations or freelances. It includes
|
||||
different features for Enterprise Resource Planning (ERP) and Customer
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
[Desktop Entry]
|
||||
# This file is used to add Ubuntu menu entry
|
||||
# It must be saved into directory /usr/share/applications
|
||||
Version=1.0
|
||||
Encoding=UTF-8
|
||||
Name=Dolibarr ERP/CRM
|
||||
GenericName=Dolibarr ERP/CRM
|
||||
@@ -10,7 +11,8 @@ Exec=xdg-open http://localhost/dolibarr
|
||||
Icon=dolibarr
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Category=Application;Office
|
||||
Category=Application;Office;
|
||||
StartupNotify=true
|
||||
InitialPreference=5
|
||||
#NoDisplay=true
|
||||
#OnlyShowIn=GNOME
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
# This file seems to be useless for Ubuntu
|
||||
# Good way to add menu on Ubuntu is adding file dolibarr.desktop
|
||||
?package(dolibarr):needs="X11" section="Applications/File Management" \
|
||||
title="Dolibarr" command="/usr/share/dolibarr/build/deb/rundolibarr.sh" icon="/usr/share/pixmaps/dolibarr.xpm"
|
||||
?package(dolibarr):needs="X11" section="Applications/Office"\
|
||||
title="Dolibarr ERP & CRM" longtitle="The manager for small and medium enterprises or foundations"\
|
||||
description="Dolibarr ERP & CRM features agenda, orders, invoices and stock management, marketing campaigns, POS, etc."\
|
||||
command="/usr/share/dolibarr/build/deb/rundolibarr.sh" icon="/usr/share/pixmaps/dolibarr.xpm"
|
||||
|
||||
@@ -29,7 +29,7 @@ case "$1" in
|
||||
# Copy include for apache.conf
|
||||
fileorig="/usr/share/dolibarr/build/deb/apache.conf"
|
||||
config="/etc/dolibarr/apache.conf"
|
||||
mkdir -p /etc/dolibarr
|
||||
mkdir -p /etc/dolibarr
|
||||
cp -p $fileorig $config
|
||||
|
||||
# Create install.forced.php
|
||||
@@ -49,6 +49,12 @@ case "$1" in
|
||||
cat $fileorig | sed -e 's/__SUPERUSERLOGIN__/'$superuserlogin'/g' | sed -e 's/__SUPERUSERPASSWORD__/'$superuserpassword'/g' > $config
|
||||
fi
|
||||
|
||||
# Create /var/lib/dolibarr/documents
|
||||
mkdir -p /var/lib/dolibarr/documents
|
||||
chown -R www-data.www-data /var/lib/dolibarr/documents;
|
||||
chmod -R 775 /var/lib/dolibarr/documents;
|
||||
chmod -R g+s /var/lib/dolibarr/documents;
|
||||
|
||||
# Create empty conf.php
|
||||
if [ ! -f /usr/share/dolibarr/htdocs/conf/conf.php ]
|
||||
then
|
||||
@@ -120,18 +126,21 @@ case "$1" in
|
||||
done
|
||||
|
||||
# Copy icon file
|
||||
echo "Copy icon file"
|
||||
fileorig="/usr/share/dolibarr/doc/images/dolibarr.xpm"
|
||||
target="/usr/share/pixmaps/"
|
||||
cp -p $fileorig $target
|
||||
#echo "Copy icon file"
|
||||
#fileorig="/usr/share/dolibarr/doc/images/dolibarr.xpm"
|
||||
#target="/usr/share/pixmaps/"
|
||||
#cp -f $fileorig $target
|
||||
|
||||
echo "Install menu entry"
|
||||
#echo "Install menu entry"
|
||||
# This one is for Gnome ubuntu
|
||||
fileorig="/usr/share/dolibarr/build/deb/dolibarr.desktop"
|
||||
target="/usr/share/applications/"
|
||||
cp -p $fileorig $target
|
||||
# Not sure this one is usefull
|
||||
if test -x /usr/bin/update-menus; then update-menus; fi
|
||||
#fileorig="/usr/share/dolibarr/build/deb/dolibarr.desktop"
|
||||
#target="/usr/share/applications/"
|
||||
#cp -f $fileorig $target
|
||||
# Not sure this is usefull
|
||||
if test -x /usr/bin/update-menus; then
|
||||
echo "update-menus"
|
||||
update-menus;
|
||||
fi
|
||||
|
||||
# TODO Create the file to force parameters in Web installer
|
||||
#if grep DBHOST /usr/share/dolibarr/htdocs/conf/conf.php > /dev/null
|
||||
|
||||
@@ -221,11 +221,11 @@ case "$1" in
|
||||
echo "postrm Force remove of /usr/share/dolibarr/htdocs/install"
|
||||
rm -fr /usr/share/dolibarr/htdocs/install
|
||||
|
||||
echo "postrm Remove menu entry and image"
|
||||
fileorig="/usr/share/applications/dolibarr.desktop"
|
||||
rm -f $fileorig
|
||||
fileorig="/usr/share/pixmaps/dolibarr.xpm"
|
||||
rm -f $fileorig
|
||||
#echo "postrm Remove menu entry and image"
|
||||
#fileorig="/usr/share/applications/dolibarr.desktop"
|
||||
#rm -f $fileorig
|
||||
#fileorig="/usr/share/pixmaps/dolibarr.xpm"
|
||||
#rm -f $fileorig
|
||||
# Not sure this is usefull
|
||||
if test -x /usr/bin/update-menus; then update-menus; fi
|
||||
;;
|
||||
|
||||
@@ -48,8 +48,8 @@
|
||||
<release>
|
||||
<Version>
|
||||
<name>stable</name>
|
||||
<created>2010-08-01</created>
|
||||
<revision>2.9.0</revision>
|
||||
<created>2011-02-09</created>
|
||||
<revision>3.0.0</revision>
|
||||
</Version>
|
||||
</release>
|
||||
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
; ----- Change this -----
|
||||
AppName=DoliWamp
|
||||
; DoliWamp-x.x.x or DoliWamp-x.x.x-dev or DoliWamp-x.x.x-beta
|
||||
AppVerName=DoliWamp-3.0.0-beta
|
||||
AppVerName=DoliWamp-3.0.0
|
||||
; DoliWamp-x.x x or DoliWamp-x.x.x-dev or DoliWamp-x.x.x-beta
|
||||
OutputBaseFilename=DoliWamp-3.0.0-beta
|
||||
OutputBaseFilename=DoliWamp-3.0.0
|
||||
; Define full path from wich all relative path are defined
|
||||
; You must modify this to put here your dolibarr root directory
|
||||
SourceDir=C:\Work\Data\Workspace\dolibarr
|
||||
@@ -35,7 +35,7 @@ AppComments=DoliWamp includes Dolibarr, Apache, PHP and Mysql softwares.
|
||||
AppCopyright=Copyright (C) 2008-2011 Laurent Destailleur, NLTechno
|
||||
DefaultDirName=c:\dolibarr
|
||||
DefaultGroupName=Dolibarr
|
||||
LicenseFile=COPYING
|
||||
;LicenseFile=COPYING
|
||||
;Compression=none
|
||||
Compression=lzma
|
||||
SolidCompression=yes
|
||||
|
||||
@@ -11,7 +11,7 @@ use Cwd;
|
||||
$PROJECT="dolibarr";
|
||||
$MAJOR="3";
|
||||
$MINOR="0";
|
||||
$BUILD="0-dev"; # Mettre x pour release, x-dev pour dev, x-beta pour beta, x-rc pour release candidate
|
||||
$BUILD="0"; # Mettre x pour release, x-dev pour dev, x-beta pour beta, x-rc pour release candidate
|
||||
$RPMSUBVERSION="1"; # A incrementer au moment de la release
|
||||
|
||||
@LISTETARGET=("TGZ","ZIP","RPM","DEB","EXE","EXEDOLIWAMP","SNAPSHOT"); # Possible packages
|
||||
@@ -104,6 +104,10 @@ my $batch=0;
|
||||
for (0..@ARGV-1) {
|
||||
if ($ARGV[$_] =~ /^-*target=(\w+)/i) { $target=$1; $batch=1; }
|
||||
if ($ARGV[$_] =~ /^-*desti=(.+)/i) { $DESTI=$1; }
|
||||
if ($ARGV[$_] =~ /^-*prefix=(.+)/i) {
|
||||
$PREFIX=$1;
|
||||
$FILENAMESNAPSHOT.="-".$PREFIX;
|
||||
}
|
||||
}
|
||||
|
||||
print "Makepack version $VERSION\n";
|
||||
@@ -215,9 +219,11 @@ if ($nboftargetok) {
|
||||
if ($nboftargetneedcvs)
|
||||
{
|
||||
print "Go to directory $SOURCE\n";
|
||||
$olddir=getcwd();
|
||||
chdir("$SOURCE");
|
||||
print "Run cvs update -P -d\n";
|
||||
$ret=`cvs update -P -d 2>&1`;
|
||||
chdir("$olddir");
|
||||
}
|
||||
|
||||
# Update buildroot if required
|
||||
@@ -229,9 +235,9 @@ if ($nboftargetok) {
|
||||
$ret=`rm -fr "$BUILDROOT"`;
|
||||
|
||||
mkdir "$BUILDROOT";
|
||||
mkdir "$BUILDROOT/dolibarr";
|
||||
print "Copy $SOURCE into $BUILDROOT/dolibarr\n";
|
||||
$ret=`cp -pr "$SOURCE" "$BUILDROOT/dolibarr"`;
|
||||
mkdir "$BUILDROOT/$PROJECT";
|
||||
print "Copy $SOURCE into $BUILDROOT/$PROJECT\n";
|
||||
$ret=`cp -pr "$SOURCE" "$BUILDROOT/$PROJECT"`;
|
||||
}
|
||||
print "Clean $BUILDROOT\n";
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/.cache`;
|
||||
@@ -263,11 +269,11 @@ if ($nboftargetok) {
|
||||
if ($target eq 'SNAPSHOT') {
|
||||
print "Rename $BUILDROOT/$PROJECT to $BUILDROOT/$FILENAMESNAPSHOT\n";
|
||||
rename("$BUILDROOT/$PROJECT","$BUILDROOT/$FILENAMESNAPSHOT");
|
||||
unlink("$FILENAMESNAPSHOT.tgz");
|
||||
unlink("$DESTI/$FILENAMESNAPSHOT.tgz");
|
||||
|
||||
print "Compress $BUILDROOT into $FILENAMESNAPSHOT.tgz...\n";
|
||||
#$cmd="tar --exclude \"$BUILDROOT/tgz/tar_exclude.txt\" --exclude .cache --exclude .settings --exclude conf.php --directory \"$BUILDROOT\" -czvf \"$FILENAMESNAPSHOT.tgz\" $FILENAMESNAPSHOT";
|
||||
$cmd="tar --exclude .cache --exclude .settings --exclude conf.php --exclude conf.php.mysql --exclude conf.php.old --exclude conf.php.postgres --directory \"$BUILDROOT\" --mode=go-w --group=500 --owner=500 -czvf \"$FILENAMESNAPSHOT.tgz\" $FILENAMESNAPSHOT";
|
||||
$cmd="tar --exclude doli*.tgz --exclude doli*.deb --exclude doli*.exe --exclude doli*.zip --exclude doli*.rpm --exclude .cache --exclude .settings --exclude conf.php --exclude conf.php.mysql --exclude conf.php.old --exclude conf.php.postgres --directory \"$BUILDROOT\" --mode=go-w --group=500 --owner=500 -czvf \"$FILENAMESNAPSHOT.tgz\" $FILENAMESNAPSHOT";
|
||||
print $cmd."\n";
|
||||
$ret=`$cmd`;
|
||||
if ($OS =~ /windows/i)
|
||||
@@ -298,28 +304,36 @@ if ($nboftargetok) {
|
||||
}
|
||||
else
|
||||
{
|
||||
print "Move $FILENAMETGZ.tgz to $DESTI/$FILENAMETGZ.tgz\n";
|
||||
$ret=`mv "$FILENAMETGZ.tgz" "$DESTI/$FILENAMETGZ.tgz"`;
|
||||
}
|
||||
next;
|
||||
}
|
||||
|
||||
if ($target eq 'ZIP') {
|
||||
print "Rename $BUILDROOT/$PROJECT to $BUILDROOT/$FILENAMETGZ\n";
|
||||
rename("$BUILDROOT/$PROJECT","$BUILDROOT/$FILENAMETGZ");
|
||||
unlink("$FILENAMEZIP.zip");
|
||||
print "Compress $FILENAMETGZ into $FILENAMEZIP.zip...\n";
|
||||
print "Rename $BUILDROOT/$PROJECT to $BUILDROOT/$FILENAMEZIP\n";
|
||||
rename("$BUILDROOT/$PROJECT","$BUILDROOT/$FILENAMEZIP");
|
||||
unlink("$DESTI/$FILENAMEZIP.zip");
|
||||
print "Compress $FILENAMEZIP into $FILENAMEZIP.zip...\n";
|
||||
|
||||
print "Go to directory $BUILDROOT\n";
|
||||
print "Go to directory $BUILDROOT\n";
|
||||
$olddir=getcwd();
|
||||
chdir("$BUILDROOT");
|
||||
|
||||
$cmd= "7z a -r -tzip -xr\@\"$BUILDROOT\/$FILENAMETGZ\/build\/zip\/zip_exclude.txt\" -mx $BUILDROOT/$FILENAMEZIP.zip $FILENAMETGZ\\*";
|
||||
$cmd= "7z a -r -tzip -xr\@\"$BUILDROOT\/$FILENAMEZIP\/build\/zip\/zip_exclude.txt\" -mx $BUILDROOT/$FILENAMEZIP.zip $FILENAMEZIP\\*";
|
||||
print $cmd."\n";
|
||||
$ret= `$cmd`;
|
||||
#print $ret;
|
||||
#print "Go to directory $DESTI\n";
|
||||
#chdir("$DESTI");
|
||||
print "Move $FILENAMEZIP.zip to $DESTI\n";
|
||||
rename("$BUILDROOT/$FILENAMEZIP.zip","$DESTI/$FILENAMEZIP.zip");
|
||||
chdir("$olddir");
|
||||
|
||||
if ($OS =~ /windows/i)
|
||||
{
|
||||
print "Move $FILENAMEZIP.zip to $DESTI/$FILENAMEZIP.zip\n";
|
||||
$ret=`mv "$BUILDROOT/$FILENAMEZIP.zip" "$DESTI/$FILENAMEZIP.zip"`;
|
||||
}
|
||||
else
|
||||
{
|
||||
print "Move $FILENAMEZIP.zip to $DESTI/$FILENAMEZIP.zip\n";
|
||||
$ret=`mv "$BUILDROOT/$FILENAMEZIP.zip" "$DESTI/$FILENAMEZIP.zip"`;
|
||||
}
|
||||
next;
|
||||
}
|
||||
|
||||
@@ -329,7 +343,7 @@ if ($nboftargetok) {
|
||||
|
||||
print "Rename $BUILDROOT/$PROJECT to $BUILDROOT/$FILENAMETGZ\n";
|
||||
rename("$BUILDROOT/$PROJECT","$BUILDROOT/$FILENAMETGZ");
|
||||
unlink("$FILENAMETGZ.tgz");
|
||||
unlink("$DESTI/$FILENAMETGZ.tgz");
|
||||
print "Compress $FILENAMETGZ into $FILENAMETGZ.tgz...\n";
|
||||
$ret=`tar --exclude-from "$SOURCE/build/tgz/tar_exclude.txt" --directory "$BUILDROOT" -czvf "$BUILDROOT/$FILENAMETGZ.tgz" $FILENAMETGZ`;
|
||||
|
||||
@@ -358,6 +372,7 @@ if ($nboftargetok) {
|
||||
}
|
||||
|
||||
if ($target eq 'DEB') {
|
||||
unlink("$DESTI/$FILENAMEDEB.deb");
|
||||
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/.cvsignore $BUILDROOT/$PROJECT/*/.cvsignore $BUILDROOT/$PROJECT/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.cvsignore`;
|
||||
|
||||
@@ -417,18 +432,26 @@ if ($nboftargetok) {
|
||||
open (SPECTO,">$BUILDROOT/$PROJECT/DEBIAN/control") || die "Error";
|
||||
while (<SPECFROM>) {
|
||||
$newbuild = $BUILD;
|
||||
$newbuild =~ s/dev/0/gi;
|
||||
$newbuild =~ s/alpha/0/gi;
|
||||
$newbuild =~ s/beta/1/gi;
|
||||
if ($newbuild !~ /-/) { $newbuild.='-2'; }
|
||||
$newbuild =~ s/(dev|alpha)/0/gi; # dev
|
||||
$newbuild =~ s/beta/1/gi; # beta
|
||||
$newbuild =~ s/rc./2/gi; # rc
|
||||
if ($newbuild !~ /-/) { $newbuild.='-3'; } # finale
|
||||
$_ =~ s/__VERSION__/$MAJOR.$MINOR.$newbuild/;
|
||||
print SPECTO $_;
|
||||
}
|
||||
close SPECFROM;
|
||||
close SPECTO;
|
||||
print "Version set to $MAJOR.$MINOR.$newbuild\n";
|
||||
|
||||
print "Create directory $BUILDROOT/$PROJECT/usr/share/applications\n";
|
||||
$ret=`mkdir -p "$BUILDROOT/$PROJECT/usr/share/applications"`;
|
||||
print "Copy desktop file into $BUILDROOT/$PROJECT/usr/share/applications/dolibarr.desktop\n";
|
||||
$ret=`cp "$SOURCE/build/deb/dolibarr.desktop" "$BUILDROOT/$PROJECT/usr/share/applications/dolibarr.desktop"`;
|
||||
|
||||
print "Create directory $BUILDROOT/$PROJECT/usr/share/$PROJECT/documents\n";
|
||||
$ret=`mkdir -p "$BUILDROOT/$PROJECT/usr/share/$PROJECT/documents"`;
|
||||
print "Create directory $BUILDROOT/$PROJECT/usr/share/pixmaps\n";
|
||||
$ret=`mkdir -p "$BUILDROOT/$PROJECT/usr/share/pixmaps"`;
|
||||
print "Copy pixmap file into $BUILDROOT/$PROJECT/usr/share/pixmaps/dolibarr.xpm\n";
|
||||
$ret=`cp "$SOURCE/doc/images/dolibarr.xpm" "$BUILDROOT/$PROJECT/usr/share/pixmaps/dolibarr.xpm"`;
|
||||
|
||||
#print "Create directory $BUILDROOT/$PROJECT/etc/$PROJECT\n";
|
||||
#$ret=`mkdir -p "$BUILDROOT/$PROJECT/etc/$PROJECT"`;
|
||||
@@ -445,6 +468,9 @@ if ($nboftargetok) {
|
||||
#print "Copy apache conf file into $BUILDROOT/$PROJECT/etc/$PROJECT\n";
|
||||
#$ret=`cp "$SOURCE/build/deb/apache.conf" "$BUILDROOT/$PROJECT/etc/$PROJECT"`;
|
||||
|
||||
print "Create directory $BUILDROOT/$PROJECT/usr/share/$PROJECT/documents\n";
|
||||
$ret=`mkdir -p "$BUILDROOT/$PROJECT/usr/share/$PROJECT/documents"`;
|
||||
|
||||
print "Set permissions/owners on files/dir\n";
|
||||
$ret=`chown -R root.root $BUILDROOT/$PROJECT`;
|
||||
$ret=`chown -R www-data.www-data $BUILDROOT/$PROJECT/usr/share/$PROJECT/documents`;
|
||||
@@ -454,17 +480,30 @@ if ($nboftargetok) {
|
||||
$ret=`chmod -R 755 $BUILDROOT/$PROJECT/DEBIAN`;
|
||||
|
||||
print "Go to directory $BUILDROOT\n";
|
||||
$olddir=getcwd();
|
||||
chdir("$BUILDROOT");
|
||||
|
||||
$cmd="dpkg -b $BUILDROOT/$PROJECT $BUILDROOT/${FILENAMEDEB}.deb";
|
||||
print "Launch DEB build ($cmd)\n";
|
||||
$ret=`$cmd`;
|
||||
print $ret."\n";
|
||||
chdir("$olddir");
|
||||
|
||||
if ($OS =~ /windows/i)
|
||||
{
|
||||
print "Move ${FILENAMEDEB}.deb to $BUILDROOT/${FILENAMEDEB}.deb\n";
|
||||
$ret=`mv "$BUILDROOT/${FILENAMEDEB}.deb" "$DESTI/${FILENAMEDEB}.deb"`;
|
||||
}
|
||||
else
|
||||
{
|
||||
print "Move ${FILENAMEDEB}.deb to $BUILDROOT/${FILENAMEDEB}.deb\n";
|
||||
$ret=`mv "$BUILDROOT/${FILENAMEDEB}.deb" "$DESTI/${FILENAMEDEB}.deb"`;
|
||||
}
|
||||
next;
|
||||
}
|
||||
|
||||
if ($target eq 'EXE') {
|
||||
unlink "$FILENAMEEXE.exe";
|
||||
unlink "$DESTI/$FILENAMEEXE.exe";
|
||||
print "Compress into $FILENAMEEXE.exe by $FILENAMEEXE.nsi...\n";
|
||||
$command="\"$REQUIREMENTTARGET{$target}\" /DMUI_VERSION_DOT=$MAJOR.$MINOR.$BUILD /X\"SetCompressor bzip2\" \"$SOURCE\\build\\exe\\$FILENAME.nsi\"";
|
||||
print "$command\n";
|
||||
@@ -476,7 +515,7 @@ if ($nboftargetok) {
|
||||
|
||||
if ($target eq 'EXEDOLIWAMP')
|
||||
{
|
||||
unlink "$FILENAMEEXEDOLIWAMP.exe";
|
||||
unlink "$DESTI/$FILENAMEEXEDOLIWAMP.exe";
|
||||
print "Compil exe $FILENAMEEXEDOLIWAMP.exe file from iss file \"$SOURCE\\build\\exe\\doliwamp\\doliwamp.iss\"\n";
|
||||
$cmd= "iscc.exe \"$SOURCE\\build\\exe\\doliwamp\\doliwamp.iss\"";
|
||||
print "$cmd\n";
|
||||
|
||||
@@ -13,6 +13,7 @@ $PROJECT="mymodule";
|
||||
@LISTETARGET=("TGZ"); # Possible packages
|
||||
%REQUIREMENTTARGET=( # Tool requirement for each package
|
||||
"TGZ"=>"tar",
|
||||
"ZIP"=>"7z"
|
||||
);
|
||||
%ALTERNATEPATH=(
|
||||
);
|
||||
@@ -68,190 +69,286 @@ $BUILDROOT="$TEMP/dolibarr-buildroot";
|
||||
my $copyalreadydone=0;
|
||||
my $batch=0;
|
||||
|
||||
print "Makepack module version $VERSION\n";
|
||||
print "Enter name for your module (mymodule, mywonderfulmondule, ...) : ";
|
||||
$PROJECT=<STDIN>;
|
||||
chomp($PROJECT);
|
||||
print "Move to ".$DIR." directory.\n";
|
||||
chdir($DIR);
|
||||
|
||||
if (! -f "makepack-".$PROJECT.".conf")
|
||||
{
|
||||
print "Error: can't open conf file makepack-".$PROJECT.".conf\n";
|
||||
print "\n";
|
||||
print "For help on building a module package, see web page\n";
|
||||
print "http://wiki.dolibarr.org/index.php/Module_development#Create_a_package_to_distribute_and_install_your_module\n";
|
||||
print "makepack-dolibarrmodule.pl aborted.\n";
|
||||
sleep 2;
|
||||
exit 2;
|
||||
for (0..@ARGV-1) {
|
||||
if ($ARGV[$_] =~ /^-*target=(\w+)/i) { $target=$1; $batch=1; }
|
||||
if ($ARGV[$_] =~ /^-*desti=(.+)/i) { $DESTI=$1; }
|
||||
if ($ARGV[$_] =~ /^-*prefix=(.+)/i) {
|
||||
$PREFIX=$1;
|
||||
$FILENAMESNAPSHOT.="-".$PREFIX;
|
||||
}
|
||||
}
|
||||
|
||||
print "Makepack for modules version $VERSION\n";
|
||||
|
||||
# Ask and set version $MAJOR and $MINOR
|
||||
print "Enter value for version: ";
|
||||
$PROJVERSION=<STDIN>;
|
||||
chomp($PROJVERSION);
|
||||
($MAJOR,$MINOR)=split(/\./,$PROJVERSION,2);
|
||||
($MAJOR,$MINOR,$BUILD)=split(/\./,$PROJVERSION,3);
|
||||
if ($MINOR eq '')
|
||||
{
|
||||
print "Enter value for minor version: ";
|
||||
$MINOR=<STDIN>;
|
||||
chomp($MINOR);
|
||||
print "Enter value for minor version: ";
|
||||
$MINOR=<STDIN>;
|
||||
chomp($MINOR);
|
||||
}
|
||||
|
||||
$FILENAME="$PROJECT";
|
||||
$FILENAMETGZ="module_$PROJECT-$MAJOR.$MINOR";
|
||||
if (-d "/usr/src/redhat") {
|
||||
# redhat
|
||||
$RPMDIR="/usr/src/redhat";
|
||||
}
|
||||
if (-d "/usr/src/RPM") {
|
||||
# mandrake
|
||||
$RPMDIR="/usr/src/RPM";
|
||||
}
|
||||
# Ask module
|
||||
print "Enter name for your module (mymodule, mywonderfulmondule, ...) : ";
|
||||
$PROJECTINPUT=<STDIN>;
|
||||
chomp($PROJECTINPUT);
|
||||
print "Move to ".$DIR." directory.\n";
|
||||
chdir($DIR);
|
||||
|
||||
$SOURCE="$DIR/..";
|
||||
$DESTI="$SOURCE/build";
|
||||
|
||||
print "Source directory: $SOURCE\n";
|
||||
print "Target directory: $DESTI\n";
|
||||
|
||||
# Choose package targets
|
||||
#-----------------------
|
||||
$target="TGZ"; # Dolibarr modules are tgz format
|
||||
$CHOOSEDTARGET{uc($target)}=1;
|
||||
|
||||
|
||||
# Test if requirement is ok
|
||||
#--------------------------
|
||||
foreach my $target (keys %CHOOSEDTARGET) {
|
||||
foreach my $req (split(/[,\s]/,$REQUIREMENTTARGET{$target})) {
|
||||
# Test
|
||||
print "Test requirement for target $target: Search '$req'... ";
|
||||
$ret=`"$req" 2>&1`;
|
||||
$coderetour=$?; $coderetour2=$coderetour>>8;
|
||||
if ($coderetour != 0 && (($coderetour2 == 1 && $OS =~ /windows/ && $ret !~ /Usage/i) || ($coderetour2 == 127 && $OS !~ /windows/)) && $PROGPATH) {
|
||||
# Not found error, we try in PROGPATH
|
||||
$ret=`"$PROGPATH/$ALTERNATEPATH{$req}/$req\" 2>&1`;
|
||||
$coderetour=$?; $coderetour2=$coderetour>>8;
|
||||
$REQUIREMENTTARGET{$target}="$PROGPATH/$ALTERNATEPATH{$req}/$req";
|
||||
}
|
||||
|
||||
if ($coderetour != 0 && (($coderetour2 == 1 && $OS =~ /windows/ && $ret !~ /Usage/i) || ($coderetour2 == 127 && $OS !~ /windows/))) {
|
||||
# Not found error
|
||||
print "Not found\nCan't build target $target. Requirement '$req' not found in PATH\n";
|
||||
$CHOOSEDTARGET{$target}=-1;
|
||||
last;
|
||||
} else {
|
||||
# Pas erreur ou erreur autre que programme absent
|
||||
print " Found ".$REQUIREMENTTARGET{$target}."\n";
|
||||
}
|
||||
my @PROJECTLIST=();
|
||||
if ($PROJECTINPUT eq "all")
|
||||
{
|
||||
opendir(DIR, $DIR) || return;
|
||||
local @rv = grep { /^makepack\-(.*)\.conf$/ } sort readdir(DIR);
|
||||
closedir(DIR);
|
||||
foreach my $xxx (0..@rv-1) {
|
||||
if ($rv[$xxx] =~ /^makepack\-(.*)\.conf$/)
|
||||
{
|
||||
@PROJECTLIST[$xxx]=$1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print "\n";
|
||||
|
||||
# Check if there is at least on target to build
|
||||
#----------------------------------------------
|
||||
$nboftargetok=0;
|
||||
foreach my $target (keys %CHOOSEDTARGET) {
|
||||
if ($CHOOSEDTARGET{$target} < 0) { next; }
|
||||
$nboftargetok++;
|
||||
else
|
||||
{
|
||||
@PROJECTLIST=($PROJECTINPUT);
|
||||
}
|
||||
|
||||
if ($nboftargetok) {
|
||||
|
||||
# Update buildroot
|
||||
#-----------------
|
||||
if (! $copyalreadydone) {
|
||||
print "Delete directory $BUILDROOT\n";
|
||||
$ret=`rm -fr "$BUILDROOT"`;
|
||||
mkdir "$BUILDROOT";
|
||||
|
||||
$result=open(IN,"<makepack-".$PROJECT.".conf");
|
||||
if (! $result) { die "Error: Can't open conf file makepack-".$PROJECT.".conf for reading.\n"; }
|
||||
while(<IN>)
|
||||
{
|
||||
if ($_ =~ /^#/) { next; } # Do not process comments
|
||||
|
||||
$_ =~ s/\n//;
|
||||
$_ =~ /^(.*)\/[^\/]+/;
|
||||
print "Create directory $BUILDROOT/$1\n";
|
||||
$ret=`mkdir -p "$BUILDROOT/$1"`;
|
||||
print "Copy $SOURCE/$_ into $BUILDROOT/$_\n";
|
||||
$ret=`cp -pr "$SOURCE/$_" "$BUILDROOT/$_"`;
|
||||
}
|
||||
close IN;
|
||||
# Loop on each projects
|
||||
foreach my $PROJECT (@PROJECTLIST) {
|
||||
|
||||
if (! -f "makepack-".$PROJECT.".conf")
|
||||
{
|
||||
print "Error: can't open conf file makepack-".$PROJECT.".conf\n";
|
||||
print "\n";
|
||||
print "For help on building a module package, see web page\n";
|
||||
print "http://wiki.dolibarr.org/index.php/Module_development#Create_a_package_to_distribute_and_install_your_module\n";
|
||||
print "makepack-dolibarrmodule.pl aborted.\n";
|
||||
sleep 2;
|
||||
exit 2;
|
||||
}
|
||||
|
||||
$FILENAME="$PROJECT";
|
||||
$FILENAMETGZ="module_$PROJECT-$MAJOR.$MINOR";
|
||||
$FILENAMEZIP="module_$PROJECT-$MAJOR.$MINOR";
|
||||
if (-d "/usr/src/redhat") {
|
||||
# redhat
|
||||
$RPMDIR="/usr/src/redhat";
|
||||
}
|
||||
if (-d "/usr/src/RPM") {
|
||||
# mandrake
|
||||
$RPMDIR="/usr/src/RPM";
|
||||
}
|
||||
|
||||
|
||||
# Choose package targets
|
||||
#-----------------------
|
||||
$target="ZIP"; # Dolibarr modules are this format
|
||||
$CHOOSEDTARGET{uc($target)}=1;
|
||||
|
||||
|
||||
# Test if requirement is ok
|
||||
#--------------------------
|
||||
foreach my $target (keys %CHOOSEDTARGET) {
|
||||
foreach my $req (split(/[,\s]/,$REQUIREMENTTARGET{$target})) {
|
||||
# Test
|
||||
print "Test requirement for target $target: Search '$req'... ";
|
||||
$ret=`"$req" 2>&1`;
|
||||
$coderetour=$?; $coderetour2=$coderetour>>8;
|
||||
if ($coderetour != 0 && (($coderetour2 == 1 && $OS =~ /windows/ && $ret !~ /Usage/i) || ($coderetour2 == 127 && $OS !~ /windows/)) && $PROGPATH) {
|
||||
# Not found error, we try in PROGPATH
|
||||
$ret=`"$PROGPATH/$ALTERNATEPATH{$req}/$req\" 2>&1`;
|
||||
$coderetour=$?; $coderetour2=$coderetour>>8;
|
||||
$REQUIREMENTTARGET{$target}="$PROGPATH/$ALTERNATEPATH{$req}/$req";
|
||||
}
|
||||
|
||||
if ($coderetour != 0 && (($coderetour2 == 1 && $OS =~ /windows/ && $ret !~ /Usage/i) || ($coderetour2 == 127 && $OS !~ /windows/))) {
|
||||
# Not found error
|
||||
print "Not found\nCan't build target $target. Requirement '$req' not found in PATH\n";
|
||||
$CHOOSEDTARGET{$target}=-1;
|
||||
last;
|
||||
} else {
|
||||
# Pas erreur ou erreur autre que programme absent
|
||||
print " Found ".$REQUIREMENTTARGET{$target}."\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print "\n";
|
||||
|
||||
# Check if there is at least on target to build
|
||||
#----------------------------------------------
|
||||
$nboftargetok=0;
|
||||
$nboftargetneedbuildroot=0;
|
||||
$nboftargetneedcvs=0;
|
||||
foreach my $target (keys %CHOOSEDTARGET) {
|
||||
if ($CHOOSEDTARGET{$target} < 0) { next; }
|
||||
if ($target ne 'EXE' && $target ne 'EXEDOLIWAMP')
|
||||
{
|
||||
$nboftargetneedbuildroot++;
|
||||
}
|
||||
if ($target eq 'SNAPSHOT')
|
||||
{
|
||||
$nboftargetneedcvs++;
|
||||
}
|
||||
$nboftargetok++;
|
||||
}
|
||||
|
||||
if ($nboftargetok) {
|
||||
|
||||
# Update CVS if required
|
||||
#-----------------------
|
||||
if ($nboftargetneedcvs)
|
||||
{
|
||||
print "Go to directory $SOURCE\n";
|
||||
$olddir=getcwd();
|
||||
chdir("$SOURCE");
|
||||
print "Run cvs update -P -d\n";
|
||||
$ret=`cvs update -P -d 2>&1`;
|
||||
chdir("$olddir");
|
||||
}
|
||||
|
||||
@timearray=localtime(time());
|
||||
$fulldate=($timearray[5]+1900).'-'.($timearray[4]+1).'-'.$timearray[3].' '.$timearray[2].':'.$timearray[1];
|
||||
$versionfile=open(VF,">$BUILDROOT/build/version-".$PROJECT.".txt");
|
||||
# Update buildroot if required
|
||||
#-----------------------------
|
||||
if ($nboftargetneedbuildroot)
|
||||
{
|
||||
if (! $copyalreadydone) {
|
||||
print "Delete directory $BUILDROOT\n";
|
||||
$ret=`rm -fr "$BUILDROOT"`;
|
||||
|
||||
mkdir "$BUILDROOT";
|
||||
mkdir "$BUILDROOT/$PROJECT";
|
||||
|
||||
$result=open(IN,"<makepack-".$PROJECT.".conf");
|
||||
if (! $result) { die "Error: Can't open conf file makepack-".$PROJECT.".conf for reading.\n"; }
|
||||
while(<IN>)
|
||||
{
|
||||
if ($_ =~ /^#/) { next; } # Do not process comments
|
||||
|
||||
$_ =~ s/\n//;
|
||||
$_ =~ /^(.*)\/[^\/]+/;
|
||||
print "Create directory $BUILDROOT/$PROJECT/$1\n";
|
||||
$ret=`mkdir -p "$BUILDROOT/$PROJECT/$1"`;
|
||||
if ($_ !~ /version\-/)
|
||||
{
|
||||
print "Copy $SOURCE/$_ into $BUILDROOT/$PROJECT/$_\n";
|
||||
$ret=`cp -pr "$SOURCE/$_" "$BUILDROOT/$PROJECT/$_"`;
|
||||
}
|
||||
}
|
||||
close IN;
|
||||
|
||||
@timearray=localtime(time());
|
||||
$fulldate=($timearray[5]+1900).'-'.($timearray[4]+1).'-'.$timearray[3].' '.$timearray[2].':'.$timearray[1];
|
||||
open(VF,">$BUILDROOT/$PROJECT/build/version-".$PROJECT.".txt");
|
||||
|
||||
print "Create version file $BUILDROOT/$PROJECT/build/version-".$PROJECT.".txt with date ".$fulldate."\n";
|
||||
$ret=`mkdir -p "$BUILDROOT/$PROJECT/build"`;
|
||||
print VF "Version: ".$MAJOR.".".$MINOR."\n";
|
||||
print VF "Build : ".$fulldate."\n";
|
||||
close VF;
|
||||
}
|
||||
print "Clean $BUILDROOT\n";
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/.cache`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/.project`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/.settings`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/index.php`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/build/html`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/documents`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/document`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/conf/conf.php.mysql`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/conf/conf.php.old`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/conf/conf.php.postgres`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/conf/conf*sav*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/custom`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/custom2`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/theme/bureau2crea`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/test`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/Thumbs.db $BUILDROOT/$PROJECT/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/*/Thumbs.db`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/CVS* $BUILDROOT/$PROJECT/*/CVS* $BUILDROOT/$PROJECT/*/*/CVS* $BUILDROOT/$PROJECT/*/*/*/CVS* $BUILDROOT/$PROJECT/*/*/*/*/CVS* $BUILDROOT/$PROJECT/*/*/*/*/*/CVS*`;
|
||||
}
|
||||
|
||||
# Build package for each target
|
||||
#------------------------------
|
||||
foreach my $target (keys %CHOOSEDTARGET) {
|
||||
if ($CHOOSEDTARGET{$target} < 0) { next; }
|
||||
|
||||
print "\nBuild package for target $target\n";
|
||||
|
||||
if ($target eq 'TGZ') {
|
||||
print "Remove target $FILENAMETGZ.tgz...\n";
|
||||
unlink("$DESTI/$FILENAMETGZ.tgz");
|
||||
print "Compress $BUILDROOT/* into $FILENAMETGZ.tgz...\n";
|
||||
$cmd="tar --exclude-vcs --exclude *.tgz --directory \"$BUILDROOT\" --mode=go-w --group=500 --owner=500 -czvf \"$FILENAMETGZ.tgz\" .";
|
||||
$ret=`$cmd`;
|
||||
if ($OS =~ /windows/i) {
|
||||
print "Move $FILENAMETGZ.tgz to $DESTI/$FILENAMETGZ.tgz\n";
|
||||
$ret=`mv "$FILENAMETGZ.tgz" "$DESTI/$FILENAMETGZ.tgz"`;
|
||||
}
|
||||
else
|
||||
{
|
||||
$ret=`mv "$FILENAMETGZ.tgz" "$DESTI/$FILENAMETGZ.tgz"`;
|
||||
}
|
||||
next;
|
||||
}
|
||||
|
||||
if ($target eq 'ZIP') {
|
||||
print "Remove target $FILENAMEZIP.zip...\n";
|
||||
unlink "$DESTI/$FILENAMEZIP.zip";
|
||||
print "Compress $FILENAMEZIP into $FILENAMEZIP.zip...\n";
|
||||
|
||||
print "Go to directory $BUILDROOT/$PROJECT\n";
|
||||
$olddir=getcwd();
|
||||
chdir("$BUILDROOT/$PROJECT");
|
||||
$cmd= "7z a -r -tzip -mx $BUILDROOT/$FILENAMEZIP.zip *";
|
||||
print $cmd."\n";
|
||||
$ret= `$cmd`;
|
||||
chdir("$olddir");
|
||||
|
||||
print "Move $FILENAMEZIP.zip to $DESTI/$FILENAMEZIP.zip\n";
|
||||
$ret=`mv "$BUILDROOT/$FILENAMEZIP.zip" "$DESTI/$FILENAMEZIP.zip"`;
|
||||
next;
|
||||
}
|
||||
|
||||
if ($target eq 'EXE') {
|
||||
print "Remove target $FILENAMEEXE.exe...\n";
|
||||
unlink "$DESTI/$FILENAMEEXE.exe";
|
||||
print "Compress into $FILENAMEEXE.exe by $FILENAMEEXE.nsi...\n";
|
||||
$command="\"$REQUIREMENTTARGET{$target}\" /DMUI_VERSION_DOT=$MAJOR.$MINOR.$BUILD /X\"SetCompressor bzip2\" \"$SOURCE\\build\\exe\\$FILENAME.nsi\"";
|
||||
print "$command\n";
|
||||
$ret=`$command`;
|
||||
print "Move $FILENAMEEXE.exe to $DESTI\n";
|
||||
rename("$SOURCE\\build\\exe\\$FILENAMEEXE.exe","$DESTI/$FILENAMEEXE.exe");
|
||||
next;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
print "\n----- Summary -----\n";
|
||||
foreach my $target (keys %CHOOSEDTARGET) {
|
||||
if ($CHOOSEDTARGET{$target} < 0) {
|
||||
print "Package $target not built (bad requirement).\n";
|
||||
} else {
|
||||
print "Package $target built successfully in $DESTI\n";
|
||||
}
|
||||
}
|
||||
|
||||
print "Create version file $BUILDROOT/build/version-".$PROJECT.".txt with date ".$fulldate."\n";
|
||||
$ret=`mkdir -p "$BUILDROOT/build"`;
|
||||
print VF "Version: ".$MAJOR.".".$MINOR."\n";
|
||||
print VF "Build : ".$fulldate."\n";
|
||||
close VF;
|
||||
}
|
||||
|
||||
|
||||
# Build package for each target
|
||||
#------------------------------
|
||||
foreach my $target (keys %CHOOSEDTARGET) {
|
||||
if ($CHOOSEDTARGET{$target} < 0) { next; }
|
||||
|
||||
print "\nBuild package for target $target\n";
|
||||
|
||||
if ($target eq 'TGZ') {
|
||||
print "Remove target $FILENAMETGZ.tgz...\n";
|
||||
unlink("$DESTI/$FILENAMETGZ.tgz");
|
||||
print "Compress $BUILDROOT/* into $FILENAMETGZ.tgz...\n";
|
||||
$cmd="tar --exclude-vcs --exclude *.tgz --directory \"$BUILDROOT\" --mode=go-w --group=500 --owner=500 -czvf \"$FILENAMETGZ.tgz\" .";
|
||||
$ret=`$cmd`;
|
||||
if ($OS =~ /windows/i) {
|
||||
print "Move $FILENAMETGZ.tgz to $DESTI/$FILENAMETGZ.tgz\n";
|
||||
$ret=`mv "$FILENAMETGZ.tgz" "$DESTI/$FILENAMETGZ.tgz"`;
|
||||
}
|
||||
else
|
||||
{
|
||||
$ret=`mv "$FILENAMETGZ.tgz" "$DESTI/$FILENAMETGZ.tgz"`;
|
||||
}
|
||||
next;
|
||||
}
|
||||
|
||||
if ($target eq 'ZIP') {
|
||||
unlink $FILENAMEZIP.zip;
|
||||
print "Compress $FILENAMETGZ into $FILENAMEZIP.zip...\n";
|
||||
chdir("$BUILDROOT");
|
||||
#print "cd $BUILDROOTNT & 7z a -r -tzip -mx $BUILDROOT/$FILENAMEZIP.zip $FILENAMETGZ\\*.*\n";
|
||||
#$ret=`cd $BUILDROOTNT & 7z a -r -tzip -mx $BUILDROOT/$FILENAMEZIP.zip $FILENAMETGZ\\*.*`;
|
||||
$ret=`7z a -r -tzip -mx $BUILDROOT/$FILENAMEZIP.zip $FILENAMETGZ\\*.*`;
|
||||
print "Move $FILENAMEZIP.zip to $DESTI\n";
|
||||
rename("$BUILDROOT/$FILENAMEZIP.zip","$DESTI/$FILENAMEZIP.zip");
|
||||
next;
|
||||
}
|
||||
|
||||
if ($target eq 'EXE') {
|
||||
unlink "$FILENAMEEXE.exe";
|
||||
print "Compress into $FILENAMEEXE.exe by $FILENAMEEXE.nsi...\n";
|
||||
$command="\"$REQUIREMENTTARGET{$target}\" /DMUI_VERSION_DOT=$MAJOR.$MINOR.$BUILD /X\"SetCompressor bzip2\" \"$SOURCE\\build\\exe\\$FILENAME.nsi\"";
|
||||
print "$command\n";
|
||||
$ret=`$command`;
|
||||
print "Move $FILENAMEEXE.exe to $DESTI\n";
|
||||
rename("$SOURCE\\build\\exe\\$FILENAMEEXE.exe","$DESTI/$FILENAMEEXE.exe");
|
||||
next;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
print "\n----- Summary -----\n";
|
||||
foreach my $target (keys %CHOOSEDTARGET) {
|
||||
if ($CHOOSEDTARGET{$target} < 0) {
|
||||
print "Package $target not built (bad requirement).\n";
|
||||
} else {
|
||||
print "Package $target built successfully in $DESTI\n";
|
||||
}
|
||||
}
|
||||
|
||||
if (! $btach) {
|
||||
if (! $batch) {
|
||||
print "\nPress key to finish...";
|
||||
my $WAITKEY=<STDIN>;
|
||||
}
|
||||
|
||||
@@ -9,10 +9,12 @@ beta version of Dolibarr, step by step.
|
||||
|
||||
- Check all files are commited.
|
||||
- Update version/info in / directory (README*.txt, ChangeLog...)
|
||||
- Update version number in build/makepack-dolibarr.pl
|
||||
- Update version number in build/exe/doliwamp/doliwamp.iss
|
||||
- Update version number in htdocs/filefunc.inc.php
|
||||
- Update version number in htdocs/install/inc.php
|
||||
- Update version number with x.x.x in build/doxygen/dolibarr-doxygen.doxyfile
|
||||
- Update version number with x.x.x in build/perl/virtualmin/dolibarr.pl
|
||||
- Update version number with x.x.x-y in build/makepack-dolibarr.pl
|
||||
- Update version number with x.x.x-y in build/exe/doliwamp/doliwamp.iss
|
||||
- Update version number with x.x.x-y in htdocs/filefunc.inc.php
|
||||
- Update version number with x.x.x-y in htdocs/install/inc.php
|
||||
- Commit all changes.
|
||||
- Add a CVS Tag (DOLIBARR_x_y_BETA)
|
||||
- If it's a new branch (Vx.y), create a branch (DOLIBARR_x_y_BRANCH).
|
||||
@@ -35,12 +37,10 @@ complete release of Dolibarr, step by step.
|
||||
|
||||
- Check all files are commited.
|
||||
- Update version/info in / directory (README*.txt, ChangeLog...)
|
||||
- Update version number in build/makepack-dolibarr.pl
|
||||
- Update version number in build/doxygen/dolibarr-doxygen.doxyfile
|
||||
- Update version number in build/exe/doliwamp/doliwamp.iss
|
||||
- Update version number in build/perl/virtualmin/dolibarr.pl
|
||||
- Update version number in htdocs/filefunc.inc.php
|
||||
- Update version number in htdocs/install/inc.php
|
||||
- Update version number with x.x.x-y in build/makepack-dolibarr.pl
|
||||
- Update version number with x.x.x-y in build/exe/doliwamp/doliwamp.iss
|
||||
- Update version number with x.x.x-y in htdocs/filefunc.inc.php
|
||||
- Update version number with x.x.x-y in htdocs/install/inc.php
|
||||
- Update PAD and DOAP files.
|
||||
- Commit all changes.
|
||||
- Add a CVS Tag (DOLIBARR_x_y)
|
||||
|
||||
@@ -78,6 +78,7 @@ CVS
|
||||
.#*
|
||||
.cache
|
||||
.cvsignore
|
||||
.externalToolBuilders
|
||||
.htaccess
|
||||
.settings
|
||||
.project
|
||||
|
||||
@@ -1,18 +1,25 @@
|
||||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
#------------------------------------------------------
|
||||
# Script to purge and init a database with demo values.
|
||||
# Note: "dialog" tool need to be available.
|
||||
#
|
||||
# Regis Houssin - regis@dolibarr.fr
|
||||
# Regis Houssin - regis@dolibarr.fr
|
||||
# Laurent Destailleur - eldy@users.sourceforge.net
|
||||
#------------------------------------------------------
|
||||
# WARNING: This script erase all data of database
|
||||
# with data into initdemo.sql
|
||||
# with data into dump file
|
||||
#------------------------------------------------------
|
||||
|
||||
export mydir=`echo "$_" | sed -e 's/initdemo.sh//'`;
|
||||
|
||||
export dumpfile="mysqldump_dolibarr_3.0.0.sql"
|
||||
export mydir=`echo "$0" | sed -e 's/initdemo.sh//'`;
|
||||
if [ "x$mydir" = "x" ]
|
||||
then
|
||||
export mydir="."
|
||||
fi
|
||||
export id=`id -u`;
|
||||
|
||||
|
||||
# ----------------------------- check if root
|
||||
if [ "x$id" != "x0" -a "x$id" != "x1001" ]
|
||||
then
|
||||
@@ -20,13 +27,30 @@ then
|
||||
exit
|
||||
fi
|
||||
|
||||
# ----------------------------- input file
|
||||
DIALOG=${DIALOG=dialog}
|
||||
DIALOG="$DIALOG --ascii-lines"
|
||||
fichtemp=`tempfile 2>/dev/null` || fichtemp=/tmp/test$$
|
||||
trap "rm -f $fichtemp" 0 1 2 5 15
|
||||
$DIALOG --title "Init Dolibarr with demo values" --clear \
|
||||
--inputbox "Input dump file :" 16 55 $dumpfile 2> $fichtemp
|
||||
valret=$?
|
||||
case $valret in
|
||||
0)
|
||||
dumpfile=`cat $fichtemp`;;
|
||||
1)
|
||||
exit;;
|
||||
255)
|
||||
exit;;
|
||||
esac
|
||||
|
||||
# ----------------------------- database name
|
||||
DIALOG=${DIALOG=dialog}
|
||||
DIALOG="$DIALOG --ascii-lines"
|
||||
fichtemp=`tempfile 2>/dev/null` || fichtemp=/tmp/test$$
|
||||
trap "rm -f $fichtemp" 0 1 2 5 15
|
||||
$DIALOG --title "Init Dolibarr with demo values" --clear \
|
||||
--inputbox "Mysql database name :" 16 51 dolibarrdemo 2> $fichtemp
|
||||
--inputbox "Mysql database name :" 16 55 dolibarrdemo 2> $fichtemp
|
||||
valret=$?
|
||||
case $valret in
|
||||
0)
|
||||
@@ -42,7 +66,7 @@ DIALOG=${DIALOG=dialog}
|
||||
fichtemp=`tempfile 2>/dev/null` || fichtemp=/tmp/test$$
|
||||
trap "rm -f $fichtemp" 0 1 2 5 15
|
||||
$DIALOG --title "Init Dolibarr with demo values" --clear \
|
||||
--inputbox "Mysql port (ex: 3306):" 16 51 3306 2> $fichtemp
|
||||
--inputbox "Mysql port (ex: 3306):" 16 55 3306 2> $fichtemp
|
||||
|
||||
valret=$?
|
||||
|
||||
@@ -60,7 +84,7 @@ DIALOG=${DIALOG=dialog}
|
||||
fichtemp=`tempfile 2>/dev/null` || fichtemp=/tmp/test$$
|
||||
trap "rm -f $fichtemp" 0 1 2 5 15
|
||||
$DIALOG --title "Init Dolibarr with demo values" --clear \
|
||||
--inputbox "Mysql root login (ex: root):" 16 51 root 2> $fichtemp
|
||||
--inputbox "Mysql root login (ex: root):" 16 55 root 2> $fichtemp
|
||||
|
||||
valret=$?
|
||||
|
||||
@@ -78,7 +102,7 @@ DIALOG=${DIALOG=dialog}
|
||||
fichtemp=`tempfile 2>/dev/null` || fichtemp=/tmp/test$$
|
||||
trap "rm -f $fichtemp" 0 1 2 5 15
|
||||
$DIALOG --title "Init Dolibarr with demo values" --clear \
|
||||
--inputbox "Password for Mysql root login :" 16 51 2> $fichtemp
|
||||
--inputbox "Password for Mysql root login :" 16 55 2> $fichtemp
|
||||
|
||||
valret=$?
|
||||
|
||||
@@ -96,7 +120,7 @@ esac
|
||||
#fichtemp=`tempfile 2>/dev/null` || fichtemp=/tmp/test$$
|
||||
#trap "rm -f $fichtemp" 0 1 2 5 15
|
||||
#$DIALOG --title "Init Dolibarr with demo values" --clear \
|
||||
# --inputbox "Full path to documents directory (ex: /var/www/dolibarr/documents)- no / at end :" 16 51 2> $fichtemp
|
||||
# --inputbox "Full path to documents directory (ex: /var/www/dolibarr/documents)- no / at end :" 16 55 2> $fichtemp
|
||||
|
||||
#valret=$?
|
||||
|
||||
@@ -112,7 +136,7 @@ esac
|
||||
# ---------------------------- confirmation
|
||||
DIALOG=${DIALOG=dialog}
|
||||
$DIALOG --title "Init Dolibarr with demo values" --clear \
|
||||
--yesno "Do you confirm ? \n Mysql database : '$base' \n Mysql port : '$port' \n Mysql login: '$admin' \n Mysql password : '$passwd'" 15 40
|
||||
--yesno "Do you confirm ? \n Dump file : '$dumpfile' \n Dump dir : '$mydir' \n Mysql database : '$base' \n Mysql port : '$port' \n Mysql login: '$admin' \n Mysql password : '$passwd'" 15 55
|
||||
|
||||
case $? in
|
||||
0) echo "Ok, start process...";;
|
||||
@@ -125,10 +149,10 @@ if [ "x$passwd" != "x" ]
|
||||
then
|
||||
export passwd="-p$passwd"
|
||||
fi
|
||||
#echo "mysql -P$port -u$admin $passwd $base < $mydir/initdemo.sql"
|
||||
#mysql -P$port -u$admin $passwd $base < $mydir/initdemo.sql
|
||||
echo "mysql -P$port $base < $mydir/initdemo.sql"
|
||||
mysql -P$port -u$admin $passwd $base < $mydir/initdemo.sql
|
||||
#echo "mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile"
|
||||
#mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile
|
||||
echo "mysql -P$port $base < $mydir/$dumpfile"
|
||||
mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile
|
||||
|
||||
echo "Dolibarr data demo has been loaded."
|
||||
echo
|
||||
|
||||
0
dev/initdata/initdemo.sql → dev/initdata/mysqldump_dolibarr_2.9.0.sql
Normal file → Executable file
0
dev/initdata/initdemo.sql → dev/initdata/mysqldump_dolibarr_2.9.0.sql
Normal file → Executable file
5272
dev/initdata/mysqldump_dolibarr_3.0.0.sql
Executable file
5272
dev/initdata/mysqldump_dolibarr_3.0.0.sql
Executable file
File diff suppressed because one or more lines are too long
1
htdocs/.gitignore
vendored
Normal file
1
htdocs/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/custom
|
||||
@@ -4,6 +4,8 @@
|
||||
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
*
|
||||
* 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
|
||||
|
||||
@@ -699,7 +699,7 @@ if ($rowid)
|
||||
});
|
||||
jQuery("#invoiceonly").click(function() {
|
||||
jQuery(".bankswitchclass").hide();
|
||||
jQuery(".bankswitchclass2").show();
|
||||
jQuery(".bankswitchclass2").hide();
|
||||
});
|
||||
';
|
||||
if (GETPOST('paymentsave')) print 'jQuery("#'.GETPOST('paymentsave').'").attr(\'checked\',true);';
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* 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
|
||||
@@ -49,9 +50,9 @@ $adh = new Adherent($db);
|
||||
$adho = new AdherentOptions($db);
|
||||
$errmsg='';
|
||||
|
||||
$action=isset($_GET["action"])?$_GET["action"]:$_POST["action"];
|
||||
$rowid=isset($_GET["rowid"])?$_GET["rowid"]:$_POST["rowid"];
|
||||
$typeid=isset($_GET["typeid"])?$_GET["typeid"]:$_POST["typeid"];
|
||||
$action=GETPOST("action");
|
||||
$rowid=GETPOST("rowid");
|
||||
$typeid=GETPOST("typeid");
|
||||
|
||||
if ($rowid)
|
||||
{
|
||||
@@ -122,6 +123,7 @@ if ($_POST['action'] == 'setsocid')
|
||||
{
|
||||
$sql ="SELECT rowid FROM ".MAIN_DB_PREFIX."adherent";
|
||||
$sql.=" WHERE fk_soc = '".$_POST["socid"]."'";
|
||||
$sql.=" AND entity = ".$conf->entity;
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
@@ -133,7 +135,7 @@ if ($_POST['action'] == 'setsocid')
|
||||
$thirdparty=new Societe($db);
|
||||
$thirdparty->fetch($_POST["socid"]);
|
||||
$error++;
|
||||
$mesg='<div class="error">'.$langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->nom).'</div>';
|
||||
$errmsg='<div class="error">'.$langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->nom).'</div>';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -176,7 +178,7 @@ if ($_POST["action"] == 'confirm_create_thirdparty' && $_POST["confirm"] == 'yes
|
||||
{
|
||||
// Creation user
|
||||
$company = new Societe($db);
|
||||
$result=$company->create_from_member($adh,$_POST["name"]);
|
||||
$result=$company->create_from_member($adh,$_POST["companyname"]);
|
||||
|
||||
if ($result < 0)
|
||||
{
|
||||
@@ -616,13 +618,9 @@ if ($action == 'create')
|
||||
|
||||
print_fiche_titre($langs->trans("NewMember"));
|
||||
|
||||
if ($errmsg)
|
||||
{
|
||||
print '<div class="error">'.$errmsg.'</div>';
|
||||
}
|
||||
if ($errmsg) print '<div class="error">'.$errmsg.'</div>';
|
||||
if ($mesg) print '<div class="ok">'.$mesg.'</div>';
|
||||
|
||||
|
||||
if ($conf->use_javascript_ajax)
|
||||
{
|
||||
print "\n".'<script type="text/javascript" language="javascript">';
|
||||
@@ -635,7 +633,6 @@ if ($action == 'create')
|
||||
print '</script>'."\n";
|
||||
}
|
||||
|
||||
|
||||
print '<form name="formsoc" action="'.$_SERVER["PHP_SELF"].'" method="post" enctype="multipart/form-data">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
@@ -818,7 +815,6 @@ if ($action == 'edit')
|
||||
|
||||
if ($mesg) print '<div class="ok">'.$mesg.'</div>';
|
||||
|
||||
|
||||
if ($conf->use_javascript_ajax)
|
||||
{
|
||||
print "\n".'<script type="text/javascript" language="javascript">';
|
||||
@@ -1014,13 +1010,13 @@ if ($rowid && $action != 'edit')
|
||||
|
||||
dol_fiche_head($head, 'general', $langs->trans("Member"), 0, 'user');
|
||||
|
||||
if ($msg) print '<div class="error">'.$msg.'</div>';
|
||||
dol_htmloutput_errors($errmsg,$errmsgs);
|
||||
|
||||
// Confirm create user
|
||||
if ($_GET["action"] == 'create_user')
|
||||
{
|
||||
$login=$adh->login;
|
||||
if (empty($login))
|
||||
if (empty($login))
|
||||
{
|
||||
// Full firstname and name separated with a dot : firstname.name
|
||||
include_once(DOL_DOCUMENT_ROOT.'/lib/functions2.lib.php');
|
||||
@@ -1039,9 +1035,7 @@ if ($rowid && $action != 'edit')
|
||||
// Confirm create third party
|
||||
if ($_GET["action"] == 'create_thirdparty')
|
||||
{
|
||||
$name =$adh->nom;
|
||||
if ($adh->nom && $adh->prenom) $name.=' ';
|
||||
$name.=$adh->prenom;
|
||||
$name = $adh->getFullName($langs);
|
||||
if (! empty($name))
|
||||
{
|
||||
if ($adh->societe) $name.=' ('.$adh->societe.')';
|
||||
|
||||
@@ -129,7 +129,7 @@ if ($user->rights->adherent->cotisation->creer && $_REQUEST["action"] == 'update
|
||||
if ($_REQUEST["action"] == 'confirm_delete' && $_REQUEST["confirm"] == 'yes' && $user->rights->adherent->cotisation->creer)
|
||||
{
|
||||
$result=$subscription->fetch($rowid);
|
||||
$result=$subscription->delete();
|
||||
$result=$subscription->delete($user);
|
||||
if ($result > 0)
|
||||
{
|
||||
Header("Location: card_subscriptions.php?rowid=".$subscription->fk_adherent);
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* 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
|
||||
@@ -33,6 +34,9 @@ $langs->load("members");
|
||||
|
||||
$rowid=isset($_GET["rowid"])?$_GET["rowid"]:$_POST["rowid"];
|
||||
|
||||
// Security check
|
||||
if (! $user->rights->adherent->lire) accessforbidden();
|
||||
|
||||
if ($_REQUEST["button_removefilter"])
|
||||
{
|
||||
$_GET["search_nom"]="";
|
||||
|
||||
@@ -285,7 +285,7 @@ if ((isset($_GET["action"]) && $_GET["action"] == 'edit')
|
||||
print '<tr class="liste_titre"><td width="35%">'.$langs->trans("CompanyInfo").'</td><td>'.$langs->trans("Value").'</td></tr>'."\n";
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("CompanyName").'</td><td>';
|
||||
print '<tr '.$bc[$var].'><td class="fieldrequired">'.$langs->trans("CompanyName").'</td><td>';
|
||||
print '<input name="nom" size="30" value="'. ($conf->global->MAIN_INFO_SOCIETE_NOM?$conf->global->MAIN_INFO_SOCIETE_NOM:$_POST["nom"]) . '"></td></tr>'."\n";
|
||||
|
||||
$var=!$var;
|
||||
@@ -302,7 +302,7 @@ if ((isset($_GET["action"]) && $_GET["action"] == 'edit')
|
||||
|
||||
// Country
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("Country").'</td><td>';
|
||||
print '<tr '.$bc[$var].'><td class="fieldrequired">'.$langs->trans("Country").'</td><td>';
|
||||
$pays_selected=$pays_id;
|
||||
//if (empty($pays_selected)) $pays_selected=substr($langs->defaultlang,-2); // Par defaut, pays de la localisation
|
||||
$form->select_pays($pays_selected,'pays_id');
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
require("../main.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formadmin.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formcompany.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php");
|
||||
|
||||
$langs->load("other");
|
||||
$langs->load("admin");
|
||||
@@ -51,7 +52,7 @@ $active = 1;
|
||||
// Mettre ici tous les caracteristiques des dictionnaires
|
||||
|
||||
// Ordres d'affichage des dictionnaires (0 pour espace)
|
||||
$taborder=array(9,0,4,3,2,0,1,8,19,16,0,5,11,0,6,0,10,12,13,0,14,0,7,17,0,18,0,15);
|
||||
$taborder=array(9,0,4,3,2,0,1,8,19,16,0,5,11,0,6,0,10,12,13,0,14,0,7,17,0,20,18,0,15);
|
||||
|
||||
// Nom des tables des dictionnaires
|
||||
$tabname[1] = MAIN_DB_PREFIX."c_forme_juridique";
|
||||
@@ -73,6 +74,7 @@ $tabname[16]= MAIN_DB_PREFIX."c_prospectlevel";
|
||||
$tabname[17]= MAIN_DB_PREFIX."c_type_fees";
|
||||
$tabname[18]= MAIN_DB_PREFIX."c_shipment_mode";
|
||||
$tabname[19]= MAIN_DB_PREFIX."c_effectif";
|
||||
$tabname[20]= MAIN_DB_PREFIX."c_methode_commande_fournisseur";
|
||||
|
||||
// Dictionary labels
|
||||
$tablib[1] = $langs->trans("DictionnaryCompanyJuridicalType");
|
||||
@@ -94,6 +96,7 @@ $tablib[16]= $langs->trans("DictionnaryProspectLevel");
|
||||
$tablib[17]= $langs->trans("DictionnaryFees");
|
||||
$tablib[18]= $langs->trans("DictionnarySendingMethods");
|
||||
$tablib[19]= $langs->trans("DictionnaryStaff");
|
||||
$tablib[20]= $langs->trans("DictionnaryOrderMethods");
|
||||
|
||||
// Requete pour extraction des donnees des dictionnaires
|
||||
$tabsql[1] = "SELECT f.rowid as rowid, f.code, f.libelle, p.code as pays_code, p.libelle as pays, f.active FROM ".MAIN_DB_PREFIX."c_forme_juridique as f, ".MAIN_DB_PREFIX."c_pays as p WHERE f.fk_pays=p.rowid";
|
||||
@@ -115,6 +118,7 @@ $tabsql[16]= "SELECT code, label as libelle, active FROM ".MAIN_DB_PREFIX."c_pro
|
||||
$tabsql[17]= "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_type_fees";
|
||||
$tabsql[18]= "SELECT rowid as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_shipment_mode";
|
||||
$tabsql[19]= "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_effectif";
|
||||
$tabsql[20]= "SELECT rowid as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_methode_commande_fournisseur";
|
||||
|
||||
// Critere de tri du dictionnaire
|
||||
$tabsqlsort[1] ="pays ASC, code ASC";
|
||||
@@ -136,6 +140,7 @@ $tabsqlsort[16]="sortorder ASC";
|
||||
$tabsqlsort[17]="code ASC";
|
||||
$tabsqlsort[18]="code ASC, libelle ASC";
|
||||
$tabsqlsort[19]="id ASC";
|
||||
$tabsqlsort[20]="code ASC, libelle ASC";
|
||||
|
||||
// Nom des champs en resultat de select pour affichage du dictionnaire
|
||||
$tabfield[1] = "code,libelle,pays";
|
||||
@@ -157,6 +162,7 @@ $tabfield[16]= "code,libelle";
|
||||
$tabfield[17]= "code,libelle";
|
||||
$tabfield[18]= "code,libelle";
|
||||
$tabfield[19]= "code,libelle";
|
||||
$tabfield[20]= "code,libelle";
|
||||
|
||||
// Nom des champs d'edition pour modification d'un enregistrement
|
||||
$tabfieldvalue[1] = "code,libelle,pays";
|
||||
@@ -178,6 +184,7 @@ $tabfieldvalue[16]= "code,libelle";
|
||||
$tabfieldvalue[17]= "code,libelle";
|
||||
$tabfieldvalue[18]= "code,libelle";
|
||||
$tabfieldvalue[19]= "code,libelle";
|
||||
$tabfieldvalue[20]= "code,libelle";
|
||||
|
||||
// Nom des champs dans la table pour insertion d'un enregistrement
|
||||
$tabfieldinsert[1] = "code,libelle,fk_pays";
|
||||
@@ -199,8 +206,11 @@ $tabfieldinsert[16]= "code,label";
|
||||
$tabfieldinsert[17]= "code,libelle";
|
||||
$tabfieldinsert[18]= "code,libelle";
|
||||
$tabfieldinsert[19]= "code,libelle";
|
||||
$tabfieldinsert[20]= "code,libelle";
|
||||
|
||||
// Nom du rowid si le champ n'est pas de type autoincrement
|
||||
// Example: "" if id field is "rowid" and has autoincrement on
|
||||
// "nameoffield" if id field is not "rowid" or has not autoincrement on
|
||||
$tabrowid[1] = "";
|
||||
$tabrowid[2] = "";
|
||||
$tabrowid[3] = "";
|
||||
@@ -220,6 +230,7 @@ $tabrowid[16]= "code";
|
||||
$tabrowid[17]= "id";
|
||||
$tabrowid[18]= "rowid";
|
||||
$tabrowid[19]= "id";
|
||||
$tabrowid[20]= "";
|
||||
|
||||
// Condition to show dictionnary in setup page
|
||||
$tabcond[1] = true;
|
||||
@@ -241,6 +252,7 @@ $tabcond[16]= $conf->societe->enabled;
|
||||
$tabcond[17]= $conf->deplacement->enabled;
|
||||
$tabcond[18]= $conf->expedition->enabled;
|
||||
$tabcond[19]= $conf->societe->enabled;
|
||||
$tabcond[20]= $conf->fournisseur->enabled;
|
||||
|
||||
$msg='';
|
||||
|
||||
|
||||
@@ -579,7 +579,5 @@ print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">'
|
||||
print "</td></tr>\n";
|
||||
print '</form>';
|
||||
|
||||
closedir($handle);
|
||||
|
||||
llxFooter('$Date$ - $Revision$');
|
||||
?>
|
||||
|
||||
@@ -74,6 +74,7 @@ if ($_GET["action"] == 'setvalue' && $user->admin)
|
||||
|
||||
llxHeader('',$langs->trans("LDAPSetup"),'EN:Module_LDAP_En|FR:Module_LDAP|ES:Módulo_LDAP');
|
||||
|
||||
print_fiche_titre($langs->trans("LDAPSetup"),'','setup');
|
||||
|
||||
$head = ldap_prepare_head();
|
||||
|
||||
|
||||
@@ -80,6 +80,8 @@ if ($_GET["action"] == 'setvalue' && $user->admin)
|
||||
|
||||
llxHeader('',$langs->trans("LDAPSetup"),'EN:Module_LDAP_En|FR:Module_LDAP|ES:Módulo_LDAP');
|
||||
|
||||
print_fiche_titre($langs->trans("LDAPSetup"),'','setup');
|
||||
|
||||
$head = ldap_prepare_head();
|
||||
|
||||
// Test si fonction LDAP actives
|
||||
|
||||
@@ -72,6 +72,8 @@ if ($_GET["action"] == 'setvalue' && $user->admin)
|
||||
|
||||
llxHeader('',$langs->trans("LDAPSetup"),'EN:Module_LDAP_En|FR:Module_LDAP|ES:Módulo_LDAP');
|
||||
|
||||
print_fiche_titre($langs->trans("LDAPSetup"),'','setup');
|
||||
|
||||
$head = ldap_prepare_head();
|
||||
|
||||
// Test si fonction LDAP actives
|
||||
|
||||
@@ -94,6 +94,8 @@ if ($_GET["action"] == 'setvalue' && $user->admin)
|
||||
|
||||
llxHeader('',$langs->trans("LDAPSetup"),'EN:Module_LDAP_En|FR:Module_LDAP|ES:Módulo_LDAP');
|
||||
|
||||
print_fiche_titre($langs->trans("LDAPSetup"),'','setup');
|
||||
|
||||
$head = ldap_prepare_head();
|
||||
|
||||
// Test si fonction LDAP actives
|
||||
|
||||
@@ -82,6 +82,8 @@ if ($_GET["action"] == 'setvalue' && $user->admin)
|
||||
|
||||
llxHeader('',$langs->trans("LDAPSetup"),'EN:Module_LDAP_En|FR:Module_LDAP|ES:Módulo_LDAP');
|
||||
|
||||
print_fiche_titre($langs->trans("LDAPSetup"),'','setup');
|
||||
|
||||
$head = ldap_prepare_head();
|
||||
|
||||
// Test si fonction LDAP actives
|
||||
|
||||
@@ -51,12 +51,14 @@ $substitutionarrayfortest=array(
|
||||
if (isset($_POST["action"]) && $_POST["action"] == 'update' && empty($_POST["cancel"]))
|
||||
{
|
||||
dolibarr_set_const($db, "MAIN_DISABLE_ALL_MAILS", $_POST["MAIN_DISABLE_ALL_MAILS"],'chaine',0,'',$conf->entity);
|
||||
|
||||
dolibarr_set_const($db, "MAIN_MAIL_SENDMODE", $_POST["MAIN_MAIL_SENDMODE"],'chaine',0,'',0);
|
||||
dolibarr_set_const($db, "MAIN_MAIL_SMTP_PORT", $_POST["MAIN_MAIL_SMTP_PORT"],'chaine',0,'',0);
|
||||
dolibarr_set_const($db, "MAIN_MAIL_SMTP_SERVER", $_POST["MAIN_MAIL_SMTP_SERVER"],'chaine',0,'',0);
|
||||
if (isset($_POST["MAIN_MAIL_SMTPS_ID"])) dolibarr_set_const($db, "MAIN_MAIL_SMTPS_ID", $_POST["MAIN_MAIL_SMTPS_ID"],'chaine',0,'',0);
|
||||
if (isset($_POST["MAIN_MAIL_SMTPS_PW"])) dolibarr_set_const($db, "MAIN_MAIL_SMTPS_PW", $_POST["MAIN_MAIL_SMTPS_PW"],'chaine',0,'',0);
|
||||
if (isset($_POST["MAIN_MAIL_EMAIL_TLS"])) dolibarr_set_const($db, "MAIN_MAIL_EMAIL_TLS", $_POST["MAIN_MAIL_EMAIL_TLS"],'chaine',0,'',0);
|
||||
|
||||
dolibarr_set_const($db, "MAIN_MAIL_EMAIL_FROM", $_POST["MAIN_MAIL_EMAIL_FROM"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_MAIL_AUTOCOPY_TO", $_POST["MAIN_MAIL_AUTOCOPY_TO"],'chaine',0,'',$conf->entity);
|
||||
|
||||
@@ -600,9 +602,9 @@ else
|
||||
$formmail->withsubstit=0;
|
||||
$formmail->withfrom=1;
|
||||
$formmail->witherrorsto=1;
|
||||
$formmail->withto=(isset($_POST['sendto'])?$_POST['sendto']:$user->email?$user->email:1);
|
||||
$formmail->withtocc=(isset($_POST['sendtocc'])?$_POST['sendtocc']:1);
|
||||
$formmail->withtoccc=(isset($_POST['sendtoccc'])?$_POST['sendtoccc']:1);
|
||||
$formmail->withto=(! empty($_POST['sendto'])?$_POST['sendto']:($user->email?$user->email:1));
|
||||
$formmail->withtocc=(! empty($_POST['sendtocc'])?$_POST['sendtocc']:1); // ! empty to keep field if empty
|
||||
$formmail->withtoccc=(! empty($_POST['sendtoccc'])?$_POST['sendtoccc']:1); // ! empty to keep field if empty
|
||||
$formmail->withtopic=(isset($_POST['subject'])?$_POST['subject']:$langs->trans("Test"));
|
||||
$formmail->withtopicreadonly=0;
|
||||
$formmail->withfile=2;
|
||||
@@ -645,9 +647,9 @@ else
|
||||
$formmail->withsubstit=0;
|
||||
$formmail->withfrom=1;
|
||||
$formmail->witherrorsto=1;
|
||||
$formmail->withto=(isset($_POST['sendto'])?$_POST['sendto']:$user->email?$user->email:1);
|
||||
$formmail->withtocc=(isset($_POST['sendtocc'])?$_POST['sendtocc']:1);
|
||||
$formmail->withtoccc=(isset($_POST['sendtoccc'])?$_POST['sendtoccc']:1);
|
||||
$formmail->withto=(! empty($_POST['sendto'])?$_POST['sendto']:($user->email?$user->email:1));
|
||||
$formmail->withtocc=(! empty($_POST['sendtocc'])?$_POST['sendtocc']:1); // ! empty to keep field if empty
|
||||
$formmail->withtoccc=(! empty($_POST['sendtoccc'])?$_POST['sendtoccc']:1); // ! empty to keep field if empty
|
||||
$formmail->withtopic=(isset($_POST['subject'])?$_POST['subject']:$langs->trans("Test"));
|
||||
$formmail->withtopicreadonly=0;
|
||||
$formmail->withfile=2;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||
* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2009-2010 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2009-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* 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
|
||||
@@ -35,9 +35,9 @@ $langs->load("admin");
|
||||
if (! $user->admin)
|
||||
accessforbidden();
|
||||
|
||||
$dirtop = "../../includes/menus/standard";
|
||||
$dirleft = "../../includes/menus/standard";
|
||||
$dirsmartphone = "../../includes/menus/smartphone";
|
||||
$dirtop = "/includes/menus/standard";
|
||||
$dirleft = "/includes/menus/standard";
|
||||
$dirsmartphone = "/includes/menus/smartphone";
|
||||
|
||||
$dirmenu = array($dirleft,$dirsmartphone);
|
||||
|
||||
@@ -333,7 +333,6 @@ if (isset($_GET["action"]) && $_GET["action"] == 'create')
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
elseif (isset($_GET["action"]) && $_GET["action"] == 'edit')
|
||||
{
|
||||
print_fiche_titre($langs->trans("ModifMenu"),'','setup');
|
||||
@@ -349,7 +348,7 @@ elseif (isset($_GET["action"]) && $_GET["action"] == 'edit')
|
||||
$menu = new Menubase($db);
|
||||
$result=$menu->fetch($_GET['menuId']);
|
||||
//var_dump($menu);
|
||||
|
||||
|
||||
// MenuId Parent
|
||||
print '<tr><td>'.$langs->trans('MenuIdParent').'</td>';
|
||||
//$menu_handler
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||
* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2009-2010 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2007-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2009-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* 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
|
||||
@@ -35,9 +35,9 @@ $langs->load("admin");
|
||||
if (! $user->admin)
|
||||
accessforbidden();
|
||||
|
||||
$dirtop = "../../includes/menus/standard";
|
||||
$dirleft = "../../includes/menus/standard";
|
||||
$dirsmartphone = "../../includes/menus/smartphone";
|
||||
$dirtop = "/includes/menus/standard";
|
||||
$dirleft = "/includes/menus/standard";
|
||||
$dirsmartphone = "/includes/menus/smartphone";
|
||||
|
||||
$dirmenu = array($dirleft,$dirsmartphone);
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/admin/system/dolibarr.php
|
||||
* \brief Fichier page info systemes Dolibarr
|
||||
* \file htdocs/admin/system/modules.php
|
||||
* \brief Page to list all modules
|
||||
* \version $Id$
|
||||
*/
|
||||
|
||||
@@ -97,12 +97,12 @@ foreach($sortorder as $numero=>$name)
|
||||
$alt=$name.' - '.$modules_files[$numero];
|
||||
if (! empty($picto[$numero]))
|
||||
{
|
||||
if (preg_match('/^\//',$picto[$numero])) print img_picto($alt,$picto[$numero],'',1);
|
||||
else print img_object($alt,$picto[$numero]);
|
||||
if (preg_match('/^\//',$picto[$numero])) print img_picto($alt,$picto[$numero],'width="14px"',1);
|
||||
else print img_object($alt,$picto[$numero],'width="14px"');
|
||||
}
|
||||
else
|
||||
{
|
||||
print img_object($alt,$picto[$numero]);
|
||||
print img_object($alt,$picto[$numero],'width="14px"');
|
||||
}
|
||||
print ' '.$modules[$numero]->getName();
|
||||
print "</td>";
|
||||
|
||||
@@ -61,12 +61,18 @@ $formfile = new FormFile($db);
|
||||
|
||||
print_fiche_titre($langs->trans("Backup"),'','setup');
|
||||
|
||||
// TODO Define ExecTimeLimit and MemoryLimit
|
||||
$ExecTimeLimit=600;
|
||||
if (!empty($ExecTimeLimit)) {
|
||||
@set_time_limit($ExecTimeLimit);
|
||||
// Cette page peut etre longue. On augmente le delai autorise.
|
||||
// Ne fonctionne que si on est pas en safe_mode.
|
||||
$err=error_reporting();
|
||||
error_reporting(0); // Disable all errors
|
||||
//error_reporting(E_ALL);
|
||||
@set_time_limit($ExecTimeLimit); // Need more than 240 on Windows 7/64
|
||||
error_reporting($err);
|
||||
}
|
||||
if (!empty($MemoryLimit)) {
|
||||
@ini_set('memory_limit', $MemoryLimit);
|
||||
@ini_set('memory_limit', $MemoryLimit);
|
||||
}
|
||||
|
||||
// Start with empty buffer
|
||||
@@ -158,12 +164,14 @@ if ($what == 'mysql')
|
||||
|
||||
if ($handle)
|
||||
{
|
||||
$ok=0;
|
||||
dol_syslog("Run command ".$fullcommandcrypted);
|
||||
$handlein = popen($fullcommandclear, 'r');
|
||||
while (!feof($handlein))
|
||||
{
|
||||
$read = fgets($handlein);
|
||||
fwrite($handle,$read);
|
||||
if (preg_match('/-- Dump completed/i',$read)) $ok=1;
|
||||
}
|
||||
pclose($handlein);
|
||||
|
||||
@@ -192,7 +200,7 @@ if ($what == 'mysql')
|
||||
if ($compression == 'none') fclose($handle);
|
||||
if ($compression == 'gz') gzclose($handle);
|
||||
if ($compression == 'bz') bzclose($handle);
|
||||
if (preg_match('/^-- MySql/i',$errormsg)) $errormsg=''; // Pas erreur
|
||||
if ($ok && preg_match('/^-- MySql/i',$errormsg)) $errormsg=''; // Pas erreur
|
||||
else
|
||||
{
|
||||
// Renommer fichier sortie en fichier erreur
|
||||
|
||||
@@ -27,6 +27,8 @@
|
||||
require("../../main.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT.'/lib/admin.lib.php');
|
||||
|
||||
$langs->load("install");
|
||||
|
||||
if (! $user->admin)
|
||||
accessforbidden();
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ function printBookmarksList ($aDb, $aLangs)
|
||||
|
||||
$bookm = new Bookmark($db);
|
||||
|
||||
$langs->load("@bookmarks");
|
||||
$langs->load("bookmarks");
|
||||
|
||||
$url= $_SERVER["PHP_SELF"].(! empty($_SERVER["QUERY_STRING"])?'?'.$_SERVER["QUERY_STRING"]:'');
|
||||
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
/*
|
||||
* Language code: it_IT
|
||||
* Automatic generated via autotranslator.php tool
|
||||
* Generation date 2009-08-13 20:49:18
|
||||
*/
|
||||
|
||||
// START - Lines generated via autotranslator.php tool (2009-08-13 20:49:18).
|
||||
// Reference language: en_US
|
||||
CHARSET=UTF-8
|
||||
Bookm=Segnalibri
|
||||
NewBookmark=Nuovo segnalibro
|
||||
AddThisPageToBookmarks=Aggiungi questa pagina ai preferiti
|
||||
// STOP - Lines generated via autotranslator.php tool (2009-08-13 20:49:18).
|
||||
@@ -27,6 +27,5 @@ CREATE TABLE llx_pos_tmp (
|
||||
remise real NOT NULL,
|
||||
total_ht double(24,8) NOT NULL,
|
||||
total_tva double(24,8) NOT NULL,
|
||||
total_ttc double(24,8) NOT NULL,
|
||||
PRIMARY KEY (id)
|
||||
total_ttc double(24,8) NOT NULL
|
||||
) ENGINE=innodb;
|
||||
|
||||
@@ -32,6 +32,7 @@ require("../main.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/categories/class/categorie.class.php");
|
||||
|
||||
$langs->load("categories");
|
||||
$langs->load("products");
|
||||
|
||||
$mesg=isset($_GET["mesg"])?'<div class="ok">'.$_GET["mesg"].'</div>':'';
|
||||
|
||||
@@ -424,7 +425,7 @@ function formCategory($db,$object,$typeid)
|
||||
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td width="40%">';
|
||||
print $langs->trans("ClassifyInCategory");
|
||||
print $langs->trans("ClassifyInCategory");
|
||||
print $html->select_all_categories($typeid);
|
||||
print '</td><td>';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Classify").'"></td>';
|
||||
|
||||
@@ -265,54 +265,112 @@ class Categorie
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete category
|
||||
* Les produits et sous-categories deviennent orphelins
|
||||
* si $all = false, et sont (seront :) supprimes sinon
|
||||
* Delete a category from database
|
||||
* @param user Object user that ask to delete
|
||||
*/
|
||||
function remove ($all = false)
|
||||
function delete($user)
|
||||
{
|
||||
global $conf,$langs;
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_product";
|
||||
$sql .= " WHERE fk_categorie = ".$this->id;
|
||||
$error=0;
|
||||
|
||||
dol_syslog("Categorie::remove");
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
if (!$this->db->query($sql))
|
||||
if (! $error)
|
||||
{
|
||||
dol_print_error($this->db);
|
||||
return -1;
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_societe";
|
||||
$sql .= " WHERE fk_categorie = ".$this->id;
|
||||
if (!$this->db->query($sql))
|
||||
{
|
||||
$this->error=$this->db->lasterror();
|
||||
dol_syslog("Error sql=".$sql." ".$this->error, LOG_ERR);
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
if (! $error)
|
||||
{
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_fournisseur";
|
||||
$sql .= " WHERE fk_categorie = ".$this->id;
|
||||
if (!$this->db->query($sql))
|
||||
{
|
||||
$this->error=$this->db->lasterror();
|
||||
dol_syslog("Error sql=".$sql." ".$this->error, LOG_ERR);
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
if (! $error)
|
||||
{
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_product";
|
||||
$sql .= " WHERE fk_categorie = ".$this->id;
|
||||
if (!$this->db->query($sql))
|
||||
{
|
||||
$this->error=$this->db->lasterror();
|
||||
dol_syslog("Error sql=".$sql." ".$this->error, LOG_ERR);
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
if (! $error)
|
||||
{
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_member";
|
||||
$sql .= " WHERE fk_categorie = ".$this->id;
|
||||
if (!$this->db->query($sql))
|
||||
{
|
||||
$this->error=$this->db->lasterror();
|
||||
dol_syslog("Error sql=".$sql." ".$this->error, LOG_ERR);
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
// Link childs to parent
|
||||
if (! $error)
|
||||
{
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_association";
|
||||
$sql .= " WHERE fk_categorie_mere = ".$this->id;
|
||||
$sql .= " OR fk_categorie_fille = ".$this->id;
|
||||
if (!$this->db->query($sql))
|
||||
{
|
||||
$this->error=$this->db->lasterror();
|
||||
dol_syslog("Error sql=".$sql." ".$this->error, LOG_ERR);
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_association";
|
||||
$sql .= " WHERE fk_categorie_mere = ".$this->id;
|
||||
$sql .= " OR fk_categorie_fille = ".$this->id;
|
||||
|
||||
if (!$this->db->query($sql))
|
||||
// Delete category
|
||||
if (! $error)
|
||||
{
|
||||
dol_print_error($this->db);
|
||||
return -1;
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie";
|
||||
$sql .= " WHERE rowid = ".$this->id;
|
||||
if (!$this->db->query($sql))
|
||||
{
|
||||
$this->error=$this->db->lasterror();
|
||||
dol_syslog("Error sql=".$sql." ".$this->error, LOG_ERR);
|
||||
$error++;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Appel des triggers
|
||||
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('CATEGORY_DELETE',$this,$user,$langs,$conf);
|
||||
if ($result < 0) { $error++; $this->errors=$interface->errors; $this->error=join(',',$this->errors); }
|
||||
// Fin appel triggers
|
||||
}
|
||||
}
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie";
|
||||
$sql .= " WHERE rowid = ".$this->id;
|
||||
|
||||
if (!$this->db->query($sql))
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
dol_print_error($this->db);
|
||||
return -1;
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Appel des triggers
|
||||
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers('CATEGORY_DELETE',$this,$user,$langs,$conf);
|
||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// Fin appel triggers
|
||||
|
||||
return 1;
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Ajout d'une sous-categorie
|
||||
|
||||
@@ -60,7 +60,7 @@ $type=$c->type;
|
||||
|
||||
if ($user->rights->categorie->supprimer && $_POST["action"] == 'confirm_delete' && $_POST['confirm'] == 'yes')
|
||||
{
|
||||
if ($c->remove() >= 0)
|
||||
if ($c->delete($user) >= 0)
|
||||
{
|
||||
header("Location: ".DOL_URL_ROOT.'/categories/index.php?type='.$type);
|
||||
exit;
|
||||
@@ -331,7 +331,7 @@ if($c->type == 2)
|
||||
// List of members
|
||||
if ($c->type == 3)
|
||||
{
|
||||
require_once(DOL_DOCUMENT_ROOT."/adherents/class/Adherent.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/adherents/class/adherent.class.php");
|
||||
|
||||
$prods = $c->get_type("member","Adherent");
|
||||
if ($prods < 0)
|
||||
|
||||
@@ -422,18 +422,18 @@ class ActionComm extends CommonObject
|
||||
{
|
||||
global $conf, $user;
|
||||
|
||||
$now=gmmktime(); // gmmktime(0,0,0,1,1,1970) -> 0, mktime(0,0,0,1,1,1970) -> -3600;
|
||||
$now=dol_now();
|
||||
|
||||
$this->nbtodo=$this->nbtodolate=0;
|
||||
$sql = "SELECT a.id, a.datep as dp";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql.= " FROM (".MAIN_DB_PREFIX."actioncomm as a";
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= ")";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid AND s.entity in (0, ".$conf->entity.")";
|
||||
$sql.= " WHERE a.percent < 100";
|
||||
$sql.= " AND a.fk_soc = s.rowid";
|
||||
$sql.= " AND s.entity = ".$conf->entity;
|
||||
if ($user->societe_id) $sql.=" AND a.fk_soc = ".$user->societe_id;
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND a.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if ($user->societe_id) $sql.=" AND a.fk_soc = ".$user->societe_id;
|
||||
//print $sql;
|
||||
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
|
||||
@@ -132,6 +132,8 @@ class CActionComm {
|
||||
if ($obj->module == 'invoice' && ! $conf->facture->enabled) $qualified=0;
|
||||
if ($obj->module == 'order' && ! $conf->commande->enabled) $qualified=0;
|
||||
if ($obj->module == 'propal' && ! $conf->propal->enabled) $qualified=0;
|
||||
if ($obj->module == 'invoice_supplier' && ! $conf->fournisseur->enabled) $qualified=0;
|
||||
if ($obj->module == 'order_supplier' && ! $conf->fournisseur->enabled) $qualified=0;
|
||||
}
|
||||
if ($qualified)
|
||||
{
|
||||
|
||||
@@ -573,7 +573,7 @@ if (GETPOST('action') == 'create')
|
||||
print '</td></tr>';
|
||||
|
||||
// If company is forced, we propose contacts (may be contact is also forced)
|
||||
if (GETPOST("socid") > 0)
|
||||
if (GETPOST("contactid") > 0 || GETPOST("socid") > 0)
|
||||
{
|
||||
print '<tr><td nowrap>'.$langs->trans("ActionOnContact").'</td><td>';
|
||||
$html->select_contacts(GETPOST("socid"),GETPOST('contactid'),'contactid',1,1);
|
||||
|
||||
@@ -392,7 +392,7 @@ if ($showbirthday)
|
||||
|
||||
$maxlength=16;
|
||||
$cachethirdparties=array();
|
||||
$cachecontact=array();
|
||||
$cachecontacts=array();
|
||||
|
||||
// Define theme_datacolor array
|
||||
$color_file = DOL_DOCUMENT_ROOT."/theme/".$conf->theme."/graph-color.php";
|
||||
@@ -484,7 +484,7 @@ else // View by day
|
||||
echo " </tr>\n";
|
||||
echo " <tr>\n";
|
||||
echo ' <td class="'.$style.'" width="14%" valign="top" nowrap="nowrap">';
|
||||
show_day_events ($db, $day, $month, $year, $month, $style, $actionarray, 0, 0, $maxlength);
|
||||
show_day_events ($db, $day, $month, $year, $month, $style, $actionarray, 0, 80, $newparam);
|
||||
echo "</td>\n";
|
||||
echo " </tr>\n";
|
||||
echo '</table>';
|
||||
@@ -510,15 +510,13 @@ llxFooter('$Date$ - $Revision$');
|
||||
* @param $maxPrint Nb of actions to show each day on month view (0 means non limit)
|
||||
* @param $maxnbofchar Nb of characters to show for event line
|
||||
* @param $newparam Parameters on current URL
|
||||
* @param $companystatic Object thirdparty
|
||||
* @param $contactstatic Object contact
|
||||
*/
|
||||
function show_day_events($db, $day, $month, $year, $monthshown, $style, &$actionarray, $maxPrint=0, $maxnbofchar=14, $newparam='')
|
||||
{
|
||||
global $user, $conf, $langs;
|
||||
global $filter, $filtera, $filtert, $filterd, $status;
|
||||
global $theme_datacolor;
|
||||
global $cachethirdparty, $cachecontact;
|
||||
global $cachethirdparties, $cachecontacts;
|
||||
|
||||
if ($_GET["action"] == 'maxPrint')
|
||||
{
|
||||
@@ -613,16 +611,18 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$action
|
||||
$thirdparty->fetch($action->societe->id);
|
||||
$cachethirdparties[$action->societe->id]=$thirdparty;
|
||||
}
|
||||
else $thirdparty=$cachethirdparties[$event->societe->id];
|
||||
$linerelatedto.=$thirdparty->getNomUrl(1,'',$length);
|
||||
}
|
||||
if (! empty($action->contact->id))
|
||||
{
|
||||
if (empty($cachetcontact[$action->societe->id]))
|
||||
if (empty($cachecontacts[$action->contact->id]))
|
||||
{
|
||||
$contact=new Contact($db);
|
||||
$contact->fetch($action->contact->id);
|
||||
$cachethirdparties[$action->contact->id]=$thirdparty;
|
||||
$cachecontacts[$action->contact->id]=$contact;
|
||||
}
|
||||
else $contact=$cachecontacts[$event->contact->id];
|
||||
if ($linerelatedto) $linerelatedto.=' / ';
|
||||
$linerelatedto.=$contact->getNomUrl(1,'',$length);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
/**
|
||||
* \file htdocs/comm/action/listactions.php
|
||||
* \ingroup agenda
|
||||
* \brief Page liste des actions commerciales
|
||||
* \brief Page to list actions
|
||||
* \version $Id$
|
||||
*/
|
||||
|
||||
@@ -56,7 +56,7 @@ $offset = $limit * $page ;
|
||||
if (! $sortorder)
|
||||
{
|
||||
$sortorder="ASC";
|
||||
if ($status == 'todo') $sortorder="DESC";
|
||||
if ($status == 'todo') $sortorder="ASC";
|
||||
if ($status == 'done') $sortorder="DESC";
|
||||
}
|
||||
if (! $sortfield)
|
||||
|
||||
@@ -198,7 +198,9 @@ if ($socid > 0)
|
||||
|
||||
if ($objsoc->client)
|
||||
{
|
||||
print '<tr><td nowrap>';
|
||||
$langs->load("compta");
|
||||
|
||||
print '<tr><td nowrap>';
|
||||
print $langs->trans('CustomerCode').'</td><td colspan="3">';
|
||||
print $objsoc->code_client;
|
||||
if ($objsoc->check_codeclient() <> 0) print ' <font class="error">('.$langs->trans("WrongCustomerCode").')</font>';
|
||||
|
||||
@@ -140,7 +140,7 @@ if ($conf->contrat->enabled && $user->rights->contrat->lire)
|
||||
*/
|
||||
if ($conf->propal->enabled && $user->rights->propale->lire)
|
||||
{
|
||||
$sql = "SELECT p.rowid, p.ref, p.total_ht, s.rowid as socid, s.nom, s.client";
|
||||
$sql = "SELECT p.rowid, p.ref, p.total_ht, s.rowid as socid, s.nom as name, s.client, s.canvas";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."propal as p";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
@@ -158,8 +158,8 @@ if ($conf->propal->enabled && $user->rights->propale->lire)
|
||||
if ($num > 0)
|
||||
{
|
||||
print '<table class="noborder" width="100%">';
|
||||
print "<tr class=\"liste_titre\">";
|
||||
print "<td colspan=\"3\">".$langs->trans("ProposalsDraft")."</td></tr>";
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="3">'.$langs->trans("ProposalsDraft").'</td></tr>';
|
||||
|
||||
$i = 0;
|
||||
$var=true;
|
||||
@@ -174,8 +174,9 @@ if ($conf->propal->enabled && $user->rights->propale->lire)
|
||||
print '</td>';
|
||||
print '<td nowrap="nowrap">';
|
||||
$companystatic->id=$obj->socid;
|
||||
$companystatic->nom=$obj->nom;
|
||||
$companystatic->name=$obj->name;
|
||||
$companystatic->client=$obj->client;
|
||||
$companystatic->canvas=$obj->canvas;
|
||||
print $companystatic->getNomUrl(1,'customer',16);
|
||||
print '</td>';
|
||||
print '<td align="right" nowrap="nowrap">'.price($obj->total_ht).'</td></tr>';
|
||||
@@ -205,7 +206,7 @@ if ($conf->commande->enabled && $user->rights->commande->lire)
|
||||
{
|
||||
$langs->load("orders");
|
||||
|
||||
$sql = "SELECT c.rowid, c.ref, c.total_ttc, s.rowid as socid, s.nom, s.client";
|
||||
$sql = "SELECT c.rowid, c.ref, c.total_ttc, s.rowid as socid, s.nom as name, s.client, s.canvas";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."commande as c";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
@@ -235,8 +236,9 @@ if ($conf->commande->enabled && $user->rights->commande->lire)
|
||||
print '<tr '.$bc[$var].'><td nowrap="nowrap"><a href="../commande/fiche.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref.'</a></td>';
|
||||
print '<td nowrap="nowrap">';
|
||||
$companystatic->id=$obj->socid;
|
||||
$companystatic->nom=$obj->nom;
|
||||
$companystatic->name=$obj->name;
|
||||
$companystatic->client=$obj->client;
|
||||
$companystatic->canvas=$obj->canvas;
|
||||
print $companystatic->getNomUrl(1,'customer',16);
|
||||
print '</td>';
|
||||
print '<td align="right" nowrap="nowrap">'.price($obj->total_ttc).'</td></tr>';
|
||||
@@ -277,7 +279,7 @@ $max=3;
|
||||
|
||||
if ($conf->propal->enabled && $user->rights->propale->lire)
|
||||
{
|
||||
$sql = "SELECT s.nom, s.rowid, p.rowid as propalid, p.total_ht, p.ref, p.fk_statut, p.datep as dp";
|
||||
$sql = "SELECT s.nom as name, s.rowid as socid, s.client, s.canvas, p.rowid as propalid, p.total_ht, p.ref, p.fk_statut, p.datep as dp";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."propal as p";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
@@ -326,12 +328,18 @@ if ($conf->propal->enabled && $user->rights->propale->lire)
|
||||
|
||||
print '</td>';
|
||||
|
||||
print '<td align="left"><a href="fiche.php?socid='.$objp->rowid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($objp->nom,44).'</a></td>';
|
||||
print "<td align=\"right\">";
|
||||
print dol_print_date($db->jdate($objp->dp),'day')."</td>\n";
|
||||
print "<td align=\"right\">".price($objp->total_ht)."</td>\n";
|
||||
print "<td align=\"center\" width=\"14\">".$propalstatic->LibStatut($objp->fk_statut,3)."</td>\n";
|
||||
print "</tr>\n";
|
||||
print '<td align="left">';
|
||||
$companystatic->id=$objp->socid;
|
||||
$companystatic->name=$objp->name;
|
||||
$companystatic->client=$objp->client;
|
||||
$companystatic->canvas=$objp->canvas;
|
||||
print $companystatic->getNomUrl(1,'customer',44);
|
||||
print '</td>';
|
||||
print '<td align="right">';
|
||||
print dol_print_date($db->jdate($objp->dp),'day').'</td>'."\n";
|
||||
print '<td align="right">'.price($objp->total_ht).'</td>'."\n";
|
||||
print '<td align="center" width="14">'.$propalstatic->LibStatut($objp->fk_statut,3).'</td>'."\n";
|
||||
print '</tr>'."\n";
|
||||
$i++;
|
||||
$var=!$var;
|
||||
}
|
||||
@@ -352,7 +360,7 @@ if ($conf->societe->enabled && $user->rights->societe->lire)
|
||||
{
|
||||
$langs->load("boxes");
|
||||
|
||||
$sql = "SELECT s.rowid,s.nom,s.client,s.datec,s.tms";
|
||||
$sql = "SELECT s.rowid, s.nom as name, s.client, s.datec,s.tms";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE s.client IN (1, 2, 3)";
|
||||
@@ -376,15 +384,15 @@ if ($conf->societe->enabled && $user->rights->societe->lire)
|
||||
print '</tr>';
|
||||
if ($num)
|
||||
{
|
||||
$company=new Societe($db);
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
$company->id=$objp->rowid;
|
||||
$company->nom=$objp->nom;
|
||||
$company->client=$objp->client;
|
||||
$companystatic->id=$objp->rowid;
|
||||
$companystatic->name=$objp->name;
|
||||
$companystatic->client=$objp->client;
|
||||
$companystatic->canvas=$objp->canvas;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td nowrap="nowrap">'.$company->getNomUrl(1,'customer',48).'</td>';
|
||||
print '<td nowrap="nowrap">'.$companystatic->getNomUrl(1,'customer',48).'</td>';
|
||||
print '<td align="right" nowrap>';
|
||||
if ($objp->client == 2 || $objp->client == 3) print $langs->trans("Prospect");
|
||||
if ($objp->client == 3) print ' / ';
|
||||
@@ -412,7 +420,7 @@ if ($conf->fournisseur->enabled && $user->rights->societe->lire)
|
||||
{
|
||||
$langs->load("boxes");
|
||||
|
||||
$sql = "SELECT s.nom, s.rowid, s.datec as dc, s.tms as dm";
|
||||
$sql = "SELECT s.nom as name, s.rowid, s.datec as dc, s.canvas, s.tms as dm";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE s.fournisseur = 1";
|
||||
@@ -435,14 +443,14 @@ if ($conf->fournisseur->enabled && $user->rights->societe->lire)
|
||||
print '</tr>';
|
||||
if ($num)
|
||||
{
|
||||
$company=new Societe($db);
|
||||
while ($i < $num && $i < $max)
|
||||
{
|
||||
$objp = $db->fetch_object($result);
|
||||
$company->id=$objp->rowid;
|
||||
$company->nom=$objp->nom;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td nowrap="nowrap">'.$company->getNomUrl(1,'supplier',48).'</td>';
|
||||
$companystatic->id=$objp->rowid;
|
||||
$companystatic->name=$objp->name;
|
||||
$companystatic->canvas=$objp->canvas;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td nowrap="nowrap">'.$companystatic->getNomUrl(1,'supplier',44).'</td>';
|
||||
print '<td align="right">'.dol_print_date($db->jdate($objp->dm),'day').'</td>';
|
||||
print '</tr>';
|
||||
$var=!$var;
|
||||
@@ -485,7 +493,8 @@ if ($conf->contrat->enabled && $user->rights->contrat->lire && 0) // TODO A REFA
|
||||
{
|
||||
$langs->load("contracts");
|
||||
|
||||
$sql = "SELECT s.nom, s.rowid, c.statut, c.rowid as contratid, p.ref, c.mise_en_service as datemes, c.fin_validite as datefin, c.date_cloture as dateclo";
|
||||
$sql = "SELECT s.nom as name, s.rowid, s.canvas, ";
|
||||
$sql.= " c.statut, c.rowid as contratid, p.ref, c.mise_en_service as datemes, c.fin_validite as datefin, c.date_cloture as dateclo";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."contrat as c";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."product as p";
|
||||
@@ -517,7 +526,12 @@ if ($conf->contrat->enabled && $user->rights->contrat->lire && 0) // TODO A REFA
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
print "<tr ".$bc[$var]."><td><a href=\"../contrat/fiche.php?id=".$obj->contratid."\">".img_object($langs->trans("ShowContract","contract"))." ".$obj->ref."</a></td>";
|
||||
print "<td><a href=\"fiche.php?socid=".$obj->rowid."\">".img_object($langs->trans("ShowCompany","company"))." ".$obj->nom."</a></td>\n";
|
||||
print '<td>';
|
||||
$companystatic->id=$objp->rowid;
|
||||
$companystatic->name=$objp->name;
|
||||
$companystatic->canvas=$objp->canvas;
|
||||
print $companystatic->getNomUrl(1,'customer',44);
|
||||
print '</td>'."\n";
|
||||
print "<td align=\"right\">".$staticcontrat->LibStatut($obj->statut,3)."</td></tr>\n";
|
||||
$var=!$var;
|
||||
$i++;
|
||||
@@ -590,12 +604,12 @@ if ($conf->propal->enabled && $user->rights->propale->lire)
|
||||
|
||||
print "</td>";
|
||||
|
||||
print "<td align=\"left\"><a href=\"fiche.php?socid=".$obj->rowid."\">".img_object($langs->trans("ShowCompany"),"company")." ".dol_trunc($obj->nom,44)."</a></td>\n";
|
||||
print "<td align=\"right\">";
|
||||
print dol_print_date($db->jdate($obj->dp),'day')."</td>\n";
|
||||
print "<td align=\"right\">".price($obj->total_ttc)."</td>";
|
||||
print "<td align=\"center\" width=\"14\">".$propalstatic->LibStatut($obj->fk_statut,3)."</td>\n";
|
||||
print "</tr>\n";
|
||||
print '<td align="left"><a href="fiche.php?socid='.$obj->rowid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->nom,44).'</a></td>'."\n";
|
||||
print '<td align="right">';
|
||||
print dol_print_date($db->jdate($obj->dp),'day').'</td>'."\n";
|
||||
print '<td align="right">'.price($obj->total_ttc).'</td>';
|
||||
print '<td align="center" width="14">'.$propalstatic->LibStatut($obj->fk_statut,3).'</td>'."\n";
|
||||
print '</tr>'."\n";
|
||||
$i++;
|
||||
$total += $obj->total_ttc;
|
||||
}
|
||||
|
||||
@@ -101,6 +101,11 @@ if ($_REQUEST["action"] == 'sendallconfirmed' && $_REQUEST['confirm'] == 'yes')
|
||||
$message.='<br><br><div class="warning">'.$langs->trans("MailingNeedCommand2").'</div>';
|
||||
$_GET["action"]='';
|
||||
}
|
||||
else if ($conf->global->MAILING_LIMIT_SENDBYWEB < 0)
|
||||
{
|
||||
$message='<div class="warning">'.$langs->trans("NotEnoughPermissions").'</div>';
|
||||
$_GET["action"]='';
|
||||
}
|
||||
else
|
||||
{
|
||||
$mil=new Mailing($db);
|
||||
@@ -297,14 +302,18 @@ if ($_POST["action"] == 'send' && empty($_POST["cancel"]))
|
||||
$mil = new Mailing($db);
|
||||
$result=$mil->fetch($_POST["mailid"]);
|
||||
|
||||
$error=0;
|
||||
|
||||
$upload_dir = $conf->mailing->dir_output . "/" . get_exdir($mil->id,2,0,1);
|
||||
|
||||
$mil->sendto = $_POST["sendto"];
|
||||
$mil->sendto = $_POST["sendto"];
|
||||
if (! $mil->sendto)
|
||||
{
|
||||
$message='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->trans("MailTo")).'</div>';
|
||||
$error++;
|
||||
}
|
||||
if ($mil->sendto)
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
// Ajout CSS
|
||||
if (!empty($mil->bgcolor)) $arr_css['bgcolor'] = $mil->bgcolor;
|
||||
@@ -419,7 +428,7 @@ if ($_REQUEST["action"] == 'setdesc' || $_REQUEST["action"] == 'setfrom' || $_RE
|
||||
}
|
||||
|
||||
// Action update emailing
|
||||
if (! empty($_POST["removedfile"]))
|
||||
if (! empty($_POST["removedfileid"]))
|
||||
{
|
||||
$mil = new Mailing($db);
|
||||
$mil->fetch($_POST["id"]);
|
||||
@@ -429,7 +438,7 @@ if (! empty($_POST["removedfile"]))
|
||||
$listofpaths=dol_dir_list($upload_dir,'all',0,'','','name',SORT_ASC,0);
|
||||
|
||||
// Remove file
|
||||
$filenb=($_POST["removedfile"]-1);
|
||||
$filenb=($_POST["removedfileid"]-1);
|
||||
if (isset($listofpaths[$filenb]))
|
||||
{
|
||||
$result=dol_delete_file($listofpaths[$filenb]['fullname'],1);
|
||||
@@ -602,7 +611,7 @@ if ($_GET["action"] == 'create')
|
||||
|
||||
print_fiche_titre($langs->trans("NewMailing"));
|
||||
|
||||
if ($message) print "$message<br>";
|
||||
if ($message) print $message."<br>";
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td width="25%" class="fieldrequired">'.$langs->trans("MailTitle").'</td><td><input class="flat" name="titre" size="40" value="'.$_POST['titre'].'"></td></tr>';
|
||||
@@ -645,6 +654,8 @@ else
|
||||
|
||||
dol_fiche_head($head, 'card', $langs->trans("Mailing"), 0, 'email');
|
||||
|
||||
if ($message) print $message."<br>";
|
||||
|
||||
// Confirmation de la validation du mailing
|
||||
if ($_GET["action"] == 'valid')
|
||||
{
|
||||
@@ -691,7 +702,7 @@ else
|
||||
else
|
||||
{
|
||||
$text='';
|
||||
if (empty($conf->file->mailing_limit_sendbyweb))
|
||||
if ($conf->file->mailing_limit_sendbyweb == 0)
|
||||
{
|
||||
$text.=$langs->trans("MailingNeedCommand");
|
||||
$text.='<br><textarea cols="60" rows="'.ROWS_2.'" wrap="soft">php ./scripts/emailings/mailing-send.php '.$_GET["id"].'</textarea>';
|
||||
@@ -736,8 +747,17 @@ else
|
||||
$nbemail = ($mil->nbemail?$mil->nbemail:'<font class="error">'.$langs->trans("NoTargetYet").'</font>');
|
||||
if (!empty($conf->global->MAILING_LIMIT_SENDBYWEB) && is_numeric($nbemail) && $conf->global->MAILING_LIMIT_SENDBYWEB < $nbemail)
|
||||
{
|
||||
$text=$langs->trans('LimitSendingEmailing',$conf->global->MAILING_LIMIT_SENDBYWEB);
|
||||
print $html->textwithpicto($nbemail,$text,1,'warning');
|
||||
if ($conf->global->MAILING_LIMIT_SENDBYWEB > 0)
|
||||
{
|
||||
$text=$langs->trans('LimitSendingEmailing',$conf->global->MAILING_LIMIT_SENDBYWEB);
|
||||
print $html->textwithpicto($nbemail,$text,1,'warning');
|
||||
}
|
||||
else
|
||||
{
|
||||
$text=$langs->trans('NotEnoughPermissions');
|
||||
print $html->textwithpicto($nbemail,$text,1,'warning');
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -804,7 +824,14 @@ else
|
||||
|
||||
if (($mil->statut == 1 || $mil->statut == 2) && $mil->nbemail > 0 && $user->rights->mailing->valider)
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=sendall&id='.$mil->id.'">'.$langs->trans("SendMailing").'</a>';
|
||||
if ($conf->global->MAILING_LIMIT_SENDBYWEB < 0)
|
||||
{
|
||||
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("SendMailing").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=sendall&id='.$mil->id.'">'.$langs->trans("SendMailing").'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($user->rights->mailing->creer)
|
||||
@@ -888,7 +915,6 @@ else
|
||||
foreach($listofpaths as $key => $val)
|
||||
{
|
||||
print img_mime($listofpaths[$key]['name']).' '.$listofpaths[$key]['name'];
|
||||
//print ' <input type="image" style="border: 0px;" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/delete.png" value="'.($key+1).'" name="removedfile">';
|
||||
print '<br>';
|
||||
}
|
||||
}
|
||||
@@ -975,7 +1001,8 @@ else
|
||||
foreach($listofpaths as $key => $val)
|
||||
{
|
||||
print img_mime($listofpaths[$key]['name']).' '.$listofpaths[$key]['name'];
|
||||
print ' <input type="image" style="border: 0px;" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/delete.png" value="'.($key+1).'" name="removedfile">';
|
||||
print ' <input type="image" style="border: 0px;" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/delete.png" value="removedfile" name="removedfile" />';
|
||||
print '<input type="hidden" name="removedfileid" value="'.($key+1).'" />';
|
||||
print '<br>';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,12 +45,11 @@ $langs->load('bills');
|
||||
$langs->load('orders');
|
||||
$langs->load('products');
|
||||
|
||||
$sall=isset($_GET["sall"])?$_GET["sall"]:$_POST["sall"];
|
||||
if (isset($_GET["msg"])) { $mesg=$_GET["mesg"]; }
|
||||
$year=isset($_GET["year"])?$_GET["year"]:"";
|
||||
$month=isset($_GET["month"])?$_GET["month"]:"";
|
||||
$socid=isset($_GET['socid'])?$_GET['socid']:$_POST['socid'];
|
||||
$mesg=isset($_GET['mesg'])?$_GET['mesg']:'';
|
||||
$sall=GETPOST("sall");
|
||||
$mesg=(GETPOST("msg") ? GETPOST("msg") : GETPOST("mesg"));
|
||||
$year=GETPOST("year");
|
||||
$month=GETPOST("month");
|
||||
$socid=GETPOST('socid');
|
||||
|
||||
// Security check
|
||||
$module='propale';
|
||||
@@ -370,11 +369,11 @@ if ($_GET["action"] == 'classifybilled')
|
||||
/*
|
||||
* Cloture de la propale
|
||||
*/
|
||||
if ($_REQUEST['action'] == 'setstatut' && $user->rights->propale->cloturer)
|
||||
if (GETPOST('action') == 'setstatut' && $user->rights->propale->cloturer)
|
||||
{
|
||||
if (! $_POST['cancel'])
|
||||
{
|
||||
if (empty($_REQUEST['statut']))
|
||||
if (! GETPOST('statut'))
|
||||
{
|
||||
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("CloseAs")).'</div>';
|
||||
$_REQUEST['action']='statut';
|
||||
@@ -672,12 +671,14 @@ if ($_POST['action'] == "addline" && $user->rights->propale->creer)
|
||||
{
|
||||
$pu_ht = $prod->multiprices[$object->client->price_level];
|
||||
$pu_ttc = $prod->multiprices_ttc[$object->client->price_level];
|
||||
$price_min = $prod->multiprices_min[$object->client->price_level];
|
||||
$price_base_type = $prod->multiprices_base_type[$object->client->price_level];
|
||||
}
|
||||
else
|
||||
{
|
||||
$pu_ht = $prod->price;
|
||||
$pu_ttc = $prod->price_ttc;
|
||||
$price_min = $prod->price_min;
|
||||
$price_base_type = $prod->price_base_type;
|
||||
}
|
||||
|
||||
@@ -714,9 +715,9 @@ if ($_POST['action'] == "addline" && $user->rights->propale->creer)
|
||||
$info_bits=0;
|
||||
if ($tva_npr) $info_bits |= 0x01;
|
||||
|
||||
if ($prod->price_min && (price2num($pu_ht)*(1-price2num($_POST['remise_percent'])/100) < price2num($prod->price_min)))
|
||||
if ($price_min && (price2num($pu_ht)*(1-price2num($_POST['remise_percent'])/100) < price2num($price_min)))
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans("CantBeLessThanMinPrice",price2num($prod->price_min,'MU').' '.$langs->trans("Currency".$conf->monnaie)).'</div>' ;
|
||||
$mesg = '<div class="error">'.$langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').' '.$langs->trans("Currency".$conf->monnaie)).'</div>' ;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -794,10 +795,12 @@ if ($_POST['action'] == 'updateligne' && $user->rights->propale->creer && $_POST
|
||||
{
|
||||
$product = new Product($db) ;
|
||||
$res=$product->fetch($productid) ;
|
||||
$price_min = $product->price_min;
|
||||
if ($conf->global->PRODUIT_MULTIPRICES && $object->client->price_level) $price_min = $product->multiprices_min[$object->client->price_level];
|
||||
}
|
||||
if ($productid && $product->price_min && (price2num($up_ht)*(1-price2num($_POST['remise_percent'])/100) < price2num($product->price_min)))
|
||||
if ($productid && $price_min && (price2num($up_ht)*(1-price2num($_POST['remise_percent'])/100) < price2num($price_min)))
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans("CantBeLessThanMinPrice",price2num($product->price_min,'MU').' '.$langs->trans("Currency".$conf->monnaie)).'</div>' ;
|
||||
$mesg = '<div class="error">'.$langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').' '.$langs->trans("Currency".$conf->monnaie)).'</div>' ;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -960,8 +963,8 @@ $companystatic=new Societe($db);
|
||||
|
||||
$now=dol_now();
|
||||
|
||||
$id = $_REQUEST['id']?$_REQUEST['id']:$_REQUEST['id'];
|
||||
$ref= $_REQUEST['ref'];
|
||||
$id = GETPOST('id');
|
||||
$ref= GETPOST('ref');
|
||||
|
||||
if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
@@ -969,7 +972,7 @@ if ($id > 0 || ! empty($ref))
|
||||
* Show object in view mode
|
||||
*/
|
||||
|
||||
if ($mesg)
|
||||
if ($mesg)
|
||||
{
|
||||
if (! preg_match('/div class=/',$mesg)) print '<div class="ok">'.$mesg.'</div><br>';
|
||||
else print $mesg."<br>";
|
||||
@@ -1504,7 +1507,7 @@ if ($id > 0 || ! empty($ref))
|
||||
// Close
|
||||
if ($object->statut == 1 && $user->rights->propale->cloturer)
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=statut#close"';
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=statut'.(empty($conf->global->MAIN_JUMP_TAG)?'':'#close').'"';
|
||||
print '>'.$langs->trans('Close').'</a>';
|
||||
}
|
||||
|
||||
@@ -1555,7 +1558,13 @@ if ($id > 0 || ! empty($ref))
|
||||
|
||||
foreach($object->linked_object as $linked_object => $linked_objectid)
|
||||
{
|
||||
if($conf->$linked_object->enabled && $linked_object != $object->element)
|
||||
$element = $subelement = $linked_object;
|
||||
if (preg_match('/^([^_]+)_([^_]+)/i',$linked_object,$regs))
|
||||
{
|
||||
$element = $regs[1];
|
||||
$subelement = $regs[2];
|
||||
}
|
||||
if($conf->$element->enabled && $element != $object->element)
|
||||
{
|
||||
$somethingshown=$object->showLinkedObjectBlock($linked_object,$linked_objectid,$somethingshown);
|
||||
}
|
||||
|
||||
@@ -137,8 +137,8 @@ class Propal extends CommonObject
|
||||
$langs->load("propal");
|
||||
$this->labelstatut[0]=$langs->trans("PropalStatusDraft");
|
||||
$this->labelstatut[1]=$langs->trans("PropalStatusValidated");
|
||||
$this->labelstatut[2]=$langs->trans("PropalStatusSigned");
|
||||
$this->labelstatut[3]=$langs->trans("PropalStatusNotSigned");
|
||||
$this->labelstatut[2]=($conf->global->PROPAL_STATUS_SIGNED_LABEL ? $conf->global->PROPAL_STATUS_SIGNED_LABEL : $langs->trans("PropalStatusSigned"));
|
||||
$this->labelstatut[3]=($conf->global->PROPAL_STATUS_NOTSIGNED_LABEL ? $conf->global->PROPAL_STATUS_NOTSIGNED_LABEL : $langs->trans("PropalStatusNotSigned"));
|
||||
$this->labelstatut[4]=$langs->trans("PropalStatusBilled");
|
||||
$this->labelstatut_short[0]=$langs->trans("PropalStatusDraftShort");
|
||||
$this->labelstatut_short[1]=$langs->trans("Opened");
|
||||
@@ -484,7 +484,7 @@ class Propal extends CommonObject
|
||||
$sql.= " , tva_tx=".price2num($txtva);
|
||||
$sql.= " , localtax1_tx=".price2num($txlocaltax1);
|
||||
$sql.= " , localtax2_tx=".price2num($txlocaltax2);
|
||||
$sql.= " , description='".addslashes($desc)."'";
|
||||
$sql.= " , description='".$this->db->escape($desc)."'";
|
||||
$sql.= " , total_ht=".price2num($total_ht);
|
||||
$sql.= " , total_tva=".price2num($total_tva);
|
||||
$sql.= " , total_localtax1=".price2num($total_localtax1);
|
||||
@@ -631,13 +631,13 @@ class Propal extends CommonObject
|
||||
$sql.= ", '".$this->db->idate($now)."'";
|
||||
$sql.= ", '(PROV)'";
|
||||
$sql.= ", ".($user->id > 0 ? "'".$user->id."'":"null");
|
||||
$sql.= ", '".addslashes($this->note)."'";
|
||||
$sql.= ", '".addslashes($this->note_public)."'";
|
||||
$sql.= ", '".$this->db->escape($this->note)."'";
|
||||
$sql.= ", '".$this->db->escape($this->note_public)."'";
|
||||
$sql.= ", '".$this->modelpdf."'";
|
||||
$sql.= ", '".$this->db->idate($this->fin_validite)."'";
|
||||
$sql.= ", ".$this->cond_reglement_id;
|
||||
$sql.= ", ".$this->mode_reglement_id;
|
||||
$sql.= ", '".addslashes($this->ref_client)."'";
|
||||
$sql.= ", '".$this->db->escape($this->ref_client)."'";
|
||||
$sql.= ", ".($this->date_livraison!=''?"'".$this->db->idate($this->date_livraison)."'":'null');
|
||||
$sql.= ", ".$conf->entity;
|
||||
$sql.= ")";
|
||||
@@ -773,9 +773,10 @@ class Propal extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* \brief Insert en base un objet propal completement definie par ses donnees membres (resultant d'une copie par exemple).
|
||||
* \return int l'id du nouvel objet propal en base si ok, <0 si ko
|
||||
* \see create
|
||||
* Insert en base un objet propal completement definie par ses donnees membres (resultant d'une copie par exemple).
|
||||
* @param user Object user making creation
|
||||
* @return int Id of new created object if OK, <0 if KO
|
||||
* @see create
|
||||
*/
|
||||
function create_from($user)
|
||||
{
|
||||
@@ -785,10 +786,10 @@ class Propal extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Load an object from its id and create a new one in database
|
||||
* \param fromid Id of object to clone
|
||||
* \param invertdetail Reverse sign of amounts for lines
|
||||
* \return int New id of clone
|
||||
* Load an object from its id and create a new one in database
|
||||
* @param fromid Id of object to clone
|
||||
* @param invertdetail Reverse sign of amounts for lines
|
||||
* @return int New id of clone
|
||||
*/
|
||||
function createFromClone($fromid,$invertdetail=0)
|
||||
{
|
||||
@@ -800,14 +801,14 @@ class Propal extends CommonObject
|
||||
|
||||
$object=new Propal($this->db);
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
// Instantiate hooks of thirdparty module
|
||||
if (is_array($conf->hooks_modules) && !empty($conf->hooks_modules))
|
||||
{
|
||||
$object->callHooks('objectcard');
|
||||
}
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
// Load source object
|
||||
$object->fetch($fromid);
|
||||
$objFrom = $object;
|
||||
@@ -885,10 +886,10 @@ class Propal extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Load a proposal from database and its ligne array
|
||||
* \param rowid id of object to load
|
||||
* \param ref Ref of proposal
|
||||
* \return int >0 if OK, <0 if KO
|
||||
* Load a proposal from database and its ligne array
|
||||
* @param rowid id of object to load
|
||||
* @param ref Ref of proposal
|
||||
* @return int >0 if OK, <0 if KO
|
||||
*/
|
||||
function fetch($rowid,$ref='')
|
||||
{
|
||||
@@ -983,7 +984,7 @@ class Propal extends CommonObject
|
||||
*/
|
||||
$sql = "SELECT d.rowid, d.fk_propal, d.description, d.price, d.tva_tx, d.localtax1_tx, d.localtax2_tx, d.qty, d.fk_remise_except, d.remise_percent, d.subprice, d.fk_product,";
|
||||
$sql.= " d.info_bits, d.total_ht, d.total_tva, d.total_localtax1, d.total_localtax2, d.total_ttc, d.marge_tx, d.marque_tx, d.special_code, d.rang, d.product_type,";
|
||||
$sql.= " p.ref, p.label, p.description as product_desc";
|
||||
$sql.= ' p.ref as product_ref, p.description as product_desc, p.fk_product_type, p.label';
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."propaldet as d";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON d.fk_product = p.rowid";
|
||||
$sql.= " WHERE d.fk_propal = ".$this->id;
|
||||
@@ -1027,10 +1028,11 @@ class Propal extends CommonObject
|
||||
|
||||
$line->fk_product = $objp->fk_product;
|
||||
|
||||
$line->ref = $objp->product_ref;
|
||||
$line->libelle = $objp->label; // TODO deprecated
|
||||
$line->label = $objp->label; // Label produit
|
||||
$line->product_desc = $objp->product_desc; // Description produit
|
||||
$line->ref = $objp->ref;
|
||||
$line->fk_product_type = $objp->fk_product_type;
|
||||
|
||||
$this->lines[$i] = $line;
|
||||
//dol_syslog("1 ".$line->fk_product);
|
||||
@@ -1061,9 +1063,9 @@ class Propal extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Passe au statut valider une propale
|
||||
* \param user Objet utilisateur qui valide
|
||||
* \return int <0 si ko, >=0 si ok
|
||||
* Passe au statut valider une propale
|
||||
* @param user Objet utilisateur qui valide
|
||||
* @return int <0 si ko, >=0 si ok
|
||||
*/
|
||||
function valid($user, $notrigger=0)
|
||||
{
|
||||
@@ -1118,10 +1120,10 @@ class Propal extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* \brief Define proposal date
|
||||
* \param user Object user that modify
|
||||
* \param date Date
|
||||
* \return int <0 if KO, >0 if OK
|
||||
* Define proposal date
|
||||
* @param user Object user that modify
|
||||
* @param date Date
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function set_date($user, $date)
|
||||
{
|
||||
@@ -1237,7 +1239,7 @@ class Propal extends CommonObject
|
||||
{
|
||||
dol_syslog('Propale::set_ref_client this->id='.$this->id.', ref_client='.$ref_client);
|
||||
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.'propal SET ref_client = '.(empty($ref_client) ? 'NULL' : '\''.addslashes($ref_client).'\'');
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.'propal SET ref_client = '.(empty($ref_client) ? 'NULL' : '\''.$this->db->escape($ref_client).'\'');
|
||||
$sql.= ' WHERE rowid = '.$this->id;
|
||||
if ($this->db->query($sql) )
|
||||
{
|
||||
@@ -1340,7 +1342,7 @@ class Propal extends CommonObject
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."propal";
|
||||
$sql.= " SET fk_statut = ".$statut.", note = '".addslashes($note)."', date_cloture=".$this->db->idate(mktime()).", fk_user_cloture=".$user->id;
|
||||
$sql.= " SET fk_statut = ".$statut.", note = '".$this->db->escape($note)."', date_cloture=".$this->db->idate(mktime()).", fk_user_cloture=".$user->id;
|
||||
$sql.= " WHERE rowid = ".$this->id;
|
||||
|
||||
$resql=$this->db->query($sql);
|
||||
@@ -1540,45 +1542,49 @@ class Propal extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
$sql= "SELECT rowid as facid, facnumber, total, datef as df, fk_user_author, fk_statut, paye";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture";
|
||||
$sql.= " WHERE rowid IN (".implode(',',$linkedInvoices).")";
|
||||
if (sizeof($linkedInvoices) > 0)
|
||||
{
|
||||
$sql= "SELECT rowid as facid, facnumber, total, datef as df, fk_user_author, fk_statut, paye";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture";
|
||||
$sql.= " WHERE rowid IN (".implode(',',$linkedInvoices).")";
|
||||
|
||||
dol_syslog("Propal::InvoiceArrayList sql=".$sql);
|
||||
$resql=$this->db->query($sql);
|
||||
dol_syslog("Propal::InvoiceArrayList sql=".$sql);
|
||||
$resql=$this->db->query($sql);
|
||||
|
||||
if ($resql)
|
||||
{
|
||||
$tab_sqlobj=array();
|
||||
$nump = $this->db->num_rows($resql);
|
||||
for ($i = 0;$i < $nump;$i++)
|
||||
{
|
||||
$sqlobj = $this->db->fetch_object($resql);
|
||||
$tab_sqlobj[] = $sqlobj;
|
||||
}
|
||||
$this->db->free($resql);
|
||||
if ($resql)
|
||||
{
|
||||
$tab_sqlobj=array();
|
||||
$nump = $this->db->num_rows($resql);
|
||||
for ($i = 0;$i < $nump;$i++)
|
||||
{
|
||||
$sqlobj = $this->db->fetch_object($resql);
|
||||
$tab_sqlobj[] = $sqlobj;
|
||||
}
|
||||
$this->db->free($resql);
|
||||
|
||||
$nump = sizeOf($tab_sqlobj);
|
||||
$nump = sizeOf($tab_sqlobj);
|
||||
|
||||
if ($nump)
|
||||
{
|
||||
$i = 0;
|
||||
while ($i < $nump)
|
||||
{
|
||||
$obj = array_shift($tab_sqlobj);
|
||||
if ($nump)
|
||||
{
|
||||
$i = 0;
|
||||
while ($i < $nump)
|
||||
{
|
||||
$obj = array_shift($tab_sqlobj);
|
||||
|
||||
$ga[$i] = $obj;
|
||||
$ga[$i] = $obj;
|
||||
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
return $ga;
|
||||
}
|
||||
else
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
return $ga;
|
||||
}
|
||||
else
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else return $ga;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Efface propal
|
||||
@@ -2315,7 +2321,7 @@ class PropaleLigne
|
||||
$sql.= ' info_bits, ';
|
||||
$sql.= ' total_ht, total_tva, total_localtax1, total_localtax2, total_ttc, special_code, rang, marge_tx, marque_tx)';
|
||||
$sql.= " VALUES (".$this->fk_propal.",";
|
||||
$sql.= " '".addslashes($this->desc)."',";
|
||||
$sql.= " '".$this->db->escape($this->desc)."',";
|
||||
$sql.= " ".($this->fk_product?"'".$this->fk_product."'":"null").",";
|
||||
$sql.= " '".$this->product_type."',";
|
||||
$sql.= " ".($this->fk_remise_except?"'".$this->fk_remise_except."'":"null").",";
|
||||
@@ -2379,7 +2385,7 @@ class PropaleLigne
|
||||
|
||||
// Mise a jour ligne en base
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."propaldet SET";
|
||||
$sql.= " description='".addslashes($this->desc)."'";
|
||||
$sql.= " description='".$this->db->escape($this->desc)."'";
|
||||
if ($fk_remise_except) $sql.= ",fk_remise_except=".$this->fk_remise_except;
|
||||
else $sql.= ",fk_remise_except=null";
|
||||
$sql.= ",tva_tx='".price2num($this->tva_tx)."'";
|
||||
|
||||
@@ -88,13 +88,14 @@ class PropaleStats extends Stats
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE date_format(p.datep,'%Y') = ".$year;
|
||||
$sql.= " AND ".$this->where;
|
||||
$sql.= " GROUP BY dm DESC";
|
||||
$sql.= " GROUP BY dm";
|
||||
$sql.= $this->db->order('dm','DESC');
|
||||
|
||||
return $this->_getNbByMonth($year, $sql);
|
||||
}
|
||||
|
||||
/**
|
||||
* Renvoie le nombre de propale par ann<EFBFBD>e
|
||||
* Renvoie le nombre de propale par annee
|
||||
*
|
||||
*/
|
||||
function getNbByYear()
|
||||
@@ -105,12 +106,13 @@ class PropaleStats extends Stats
|
||||
$sql.= " FROM ".$this->from;
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE ".$this->where;
|
||||
$sql.= " GROUP BY dm DESC";
|
||||
$sql.= " GROUP BY dm";
|
||||
$sql.= $this->db->order('dm','DESC');
|
||||
|
||||
return $this->_getNbByYear($sql);
|
||||
}
|
||||
/**
|
||||
* Renvoie le nombre de propale par mois pour une ann<EFBFBD>e donn<EFBFBD>e
|
||||
* Renvoie le nombre de propale par mois pour une annee donnee
|
||||
*
|
||||
*/
|
||||
function getAmountByMonth($year)
|
||||
@@ -122,7 +124,8 @@ class PropaleStats extends Stats
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE date_format(p.datep,'%Y') = ".$year;
|
||||
$sql.= " AND ".$this->where;
|
||||
$sql.= " GROUP BY dm DESC";
|
||||
$sql.= " GROUP BY dm";
|
||||
$sql.= $this->db->order('dm','DESC');
|
||||
|
||||
return $this->_getAmountByMonth($year, $sql);
|
||||
}
|
||||
@@ -139,7 +142,8 @@ class PropaleStats extends Stats
|
||||
if (!$user->rights->societe->client->voir && !$this->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE date_format(p.datep,'%Y') = ".$year;
|
||||
$sql.= " AND ".$this->where;
|
||||
$sql.= " GROUP BY dm DESC";
|
||||
$sql.= " GROUP BY dm";
|
||||
$sql.= $this->db->order('dm','DESC');
|
||||
|
||||
return $this->_getAverageByMonth($year, $sql);
|
||||
}
|
||||
@@ -157,7 +161,8 @@ class PropaleStats extends Stats
|
||||
$sql.= " FROM ".$this->from;
|
||||
if (!$user->rights->societe->client->voir && !$this->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE ".$this->where;
|
||||
$sql.= " GROUP BY year DESC";
|
||||
$sql.= " GROUP BY year";
|
||||
$sql.= $this->db->order('year','DESC');
|
||||
|
||||
return $this->_getAllByYear($sql);
|
||||
}
|
||||
|
||||
@@ -809,6 +809,9 @@ class Commande extends CommonObject
|
||||
if (empty($qty)) $qty=0;
|
||||
if (empty($info_bits)) $info_bits=0;
|
||||
if (empty($rang)) $rang=0;
|
||||
if (empty($txtva)) $txtva=0;
|
||||
if (empty($txlocaltax1)) $txlocaltax1=0;
|
||||
if (empty($txlocaltax2)) $txlocaltax2=0;
|
||||
|
||||
$remise_percent=price2num($remise_percent);
|
||||
$qty=price2num($qty);
|
||||
@@ -1342,15 +1345,20 @@ class Commande extends CommonObject
|
||||
*/
|
||||
function nb_expedition()
|
||||
{
|
||||
$sql = 'SELECT count(*) FROM '.MAIN_DB_PREFIX.'expedition as e';
|
||||
$sql .=" WHERE e.fk_commande = ".$this->id;
|
||||
$sql = 'SELECT count(*)';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'expedition as e';
|
||||
$sql.= ', '.MAIN_DB_PREFIX.'element_element as el';
|
||||
$sql.= ' WHERE el.fk_source = '.$this->id;
|
||||
$sql.= " AND el.fk_target = e.rowid";
|
||||
$sql.= " AND el.targettype = 'shipping'";
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$row = $this->db->fetch_row($resql);
|
||||
return $row[0];
|
||||
}
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$row = $this->db->fetch_row($resql);
|
||||
return $row[0];
|
||||
}
|
||||
else dol_print_error($this->db);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1852,6 +1860,8 @@ class Commande extends CommonObject
|
||||
if (empty($txtva)) $txtva=0;
|
||||
if (empty($txlocaltax1)) $txlocaltax1=0;
|
||||
if (empty($txlocaltax2)) $txlocaltax2=0;
|
||||
if (empty($remise)) $remise=0;
|
||||
if (empty($remise_percent)) $remise_percent=0;
|
||||
$remise_percent=price2num($remise_percent);
|
||||
$qty=price2num($qty);
|
||||
$pu = price2num($pu);
|
||||
|
||||
@@ -100,13 +100,14 @@ class CommandeStats extends Stats
|
||||
if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE date_format(c.date_commande,'%Y') = ".$year;
|
||||
$sql.= " AND ".$this->where;
|
||||
$sql.= " GROUP BY dm DESC";
|
||||
$sql.= " GROUP BY dm";
|
||||
$sql.= $this->db->order('dm','DESC');
|
||||
|
||||
return $this->_getNbByMonth($year, $sql);
|
||||
}
|
||||
|
||||
/**
|
||||
* Renvoie le nombre de commande par ann<EFBFBD>e
|
||||
* Renvoie le nombre de commande par annee
|
||||
*
|
||||
*/
|
||||
function getNbByYear()
|
||||
@@ -118,13 +119,14 @@ class CommandeStats extends Stats
|
||||
$sql.= " FROM ".$this->from;
|
||||
if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE ".$this->where;
|
||||
$sql.= " GROUP BY dm DESC";
|
||||
$sql.= " GROUP BY dm";
|
||||
$sql.= $this->db->order('dm','DESC');
|
||||
|
||||
return $this->_getNbByYear($sql);
|
||||
}
|
||||
|
||||
/**
|
||||
* Renvoie le nombre de commande par mois pour une ann<EFBFBD>e donn<EFBFBD>e
|
||||
* Renvoie le nombre de commande par mois pour une annee donnee
|
||||
*
|
||||
*/
|
||||
function getAmountByMonth($year)
|
||||
@@ -137,13 +139,14 @@ class CommandeStats extends Stats
|
||||
if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE date_format(c.date_commande,'%Y') = ".$year;
|
||||
$sql.= " AND ".$this->where;
|
||||
$sql.= " GROUP BY dm DESC";
|
||||
$sql.= " GROUP BY dm";
|
||||
$sql.= $this->db->order('dm','DESC');
|
||||
|
||||
return $this->_getAmountByMonth($year, $sql);
|
||||
}
|
||||
|
||||
/**
|
||||
* Renvoie le nombre de commande par mois pour une ann<EFBFBD>e donn<EFBFBD>e
|
||||
* Renvoie le nombre de commande par mois pour une annee donnee
|
||||
*
|
||||
*/
|
||||
function getAverageByMonth($year)
|
||||
@@ -156,7 +159,8 @@ class CommandeStats extends Stats
|
||||
if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE date_format(c.date_commande,'%Y') = ".$year;
|
||||
$sql.= " AND ".$this->where;
|
||||
$sql.= " GROUP BY dm DESC";
|
||||
$sql.= " GROUP BY dm";
|
||||
$sql.= $this->db->order('dm','DESC');
|
||||
|
||||
return $this->_getAverageByMonth($year, $sql);
|
||||
}
|
||||
@@ -174,7 +178,8 @@ class CommandeStats extends Stats
|
||||
$sql.= " FROM ".$this->from;
|
||||
if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE ".$this->where;
|
||||
$sql.= " GROUP BY year DESC";
|
||||
$sql.= " GROUP BY year";
|
||||
$sql.= $this->db->order('year','DESC');
|
||||
|
||||
return $this->_getAllByYear($sql);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005 Patrick Rouillon <patrick@rouillon.net>
|
||||
* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* 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,11 +19,11 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
\file htdocs/commande/contact.php
|
||||
\ingroup commande
|
||||
\brief Onglet de gestion des contacts de commande
|
||||
\version $Id$
|
||||
*/
|
||||
* \file htdocs/commande/contact.php
|
||||
* \ingroup commande
|
||||
* \brief Onglet de gestion des contacts de commande
|
||||
* \version $Id$
|
||||
*/
|
||||
|
||||
require("../main.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php");
|
||||
@@ -31,7 +31,6 @@ require_once(DOL_DOCUMENT_ROOT."/contact/class/contact.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/order.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php');
|
||||
|
||||
$langs->load("facture");
|
||||
$langs->load("orders");
|
||||
$langs->load("sendings");
|
||||
$langs->load("companies");
|
||||
@@ -217,9 +216,9 @@ if ($id > 0 || ! empty($ref))
|
||||
|
||||
/*
|
||||
* Ajouter une ligne de contact
|
||||
* Non affich<EFBFBD> en mode modification de ligne
|
||||
* Non affiche en mode modification de ligne
|
||||
*/
|
||||
if ($_GET["action"] != 'editline' && $user->rights->facture->creer)
|
||||
if ($_GET["action"] != 'editline' && $user->rights->commande->creer)
|
||||
{
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Source").'</td>';
|
||||
|
||||
@@ -54,7 +54,7 @@ $comid = GETPOST("id");
|
||||
if (empty($comid)) $comid=GETPOST("orderid");
|
||||
|
||||
// Security check
|
||||
$socid=0;
|
||||
$socid=GETPOST('socid');
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result=restrictedArea($user,'commande',$comid,'');
|
||||
|
||||
@@ -402,12 +402,14 @@ if ($_POST['action'] == 'addline' && $user->rights->commande->creer)
|
||||
{
|
||||
$pu_ht = $prod->multiprices[$object->client->price_level];
|
||||
$pu_ttc = $prod->multiprices_ttc[$object->client->price_level];
|
||||
$price_min = $prod->multiprices_min[$object->client->price_level];
|
||||
$price_base_type = $prod->multiprices_base_type[$object->client->price_level];
|
||||
}
|
||||
else
|
||||
{
|
||||
$pu_ht = $prod->price;
|
||||
$pu_ttc = $prod->price_ttc;
|
||||
$price_min = $prod->price_min;
|
||||
$price_base_type = $prod->price_base_type;
|
||||
}
|
||||
|
||||
@@ -450,10 +452,10 @@ if ($_POST['action'] == 'addline' && $user->rights->commande->creer)
|
||||
|
||||
if ($result >= 0)
|
||||
{
|
||||
if($prod->price_min && (price2num($pu_ht)*(1-price2num($_POST['remise_percent'])/100) < price2num($prod->price_min)))
|
||||
if($price_min && (price2num($pu_ht)*(1-price2num($_POST['remise_percent'])/100) < price2num($price_min)))
|
||||
{
|
||||
//print "CantBeLessThanMinPrice ".$up_ht." - ".GETPOST('remise_percent')." - ".$product->price_min;
|
||||
$mesg = '<div class="error">'.$langs->trans("CantBeLessThanMinPrice",price2num($prod->price_min,'MU').' '.$langs->trans("Currency".$conf->monnaie)).'</div>' ;
|
||||
$mesg = '<div class="error">'.$langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').' '.$langs->trans("Currency".$conf->monnaie)).'</div>' ;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -548,10 +550,12 @@ if ($_POST['action'] == 'updateligne' && $user->rights->commande->creer && $_POS
|
||||
$product = new Product($db);
|
||||
$product->fetch($productid);
|
||||
$type=$product->type;
|
||||
$price_min = $product->price_min;
|
||||
if ($conf->global->PRODUIT_MULTIPRICES && $object->client->price_level) $price_min = $product->multiprices_min[$object->client->price_level];
|
||||
}
|
||||
if ($product->price_min && GETPOST('productid') && (price2num($up_ht)*(1-price2num($_POST['elremise_percent'])/100) < price2num($product->price_min)))
|
||||
if ($price_min && GETPOST('productid') && (price2num($up_ht)*(1-price2num($_POST['elremise_percent'])/100) < price2num($price_min)))
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans("CantBeLessThanMinPrice",price2num($product->price_min,'MU').' '.$langs->trans("Currency".$conf->monnaie)).'</div>' ;
|
||||
$mesg = '<div class="error">'.$langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').' '.$langs->trans("Currency".$conf->monnaie)).'</div>' ;
|
||||
$result=-1;
|
||||
}
|
||||
|
||||
@@ -1856,7 +1860,13 @@ else
|
||||
|
||||
foreach($object->linked_object as $linked_object => $linked_objectid)
|
||||
{
|
||||
if($conf->$linked_object->enabled && $linked_object != $object->element)
|
||||
$element = $subelement = $linked_object;
|
||||
if (preg_match('/^([^_]+)_([^_]+)/i',$linked_object,$regs))
|
||||
{
|
||||
$element = $regs[1];
|
||||
$subelement = $regs[2];
|
||||
}
|
||||
if($conf->$element->enabled && $element != $object->element)
|
||||
{
|
||||
$somethingshown=$object->showLinkedObjectBlock($linked_object,$linked_objectid,$somethingshown);
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ for ($i = 0 ; $i < $num ; $i++)
|
||||
$linkedObjectBlock->fetch($objectid[$i]);
|
||||
$var=!$var;
|
||||
?>
|
||||
<tr <?php echo $bc[$var]; ?> ><td>
|
||||
<tr <?php echo $GLOBALS['bc'][$var]; ?> ><td>
|
||||
<a href="<?php echo DOL_URL_ROOT.'/commande/fiche.php?id='.$linkedObjectBlock->id ?>"><?php echo img_object($langs->trans("ShowOrder"),"order").' '.$linkedObjectBlock->ref; ?></a></td>
|
||||
<td align="center"><?php echo dol_print_date($linkedObjectBlock->date,'day'); ?></td>
|
||||
<td align="right"><?php echo price($linkedObjectBlock->total_ht); ?></td>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copytight (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -34,6 +34,8 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/html.formcompany.class.php");
|
||||
$langs->load("banks");
|
||||
$langs->load("companies");
|
||||
|
||||
$action=GETPOST("action");
|
||||
|
||||
// Security check
|
||||
if (isset($_GET["id"]) || isset($_GET["ref"]))
|
||||
{
|
||||
@@ -49,7 +51,9 @@ $result=restrictedArea($user,'banque',$id,'bank_account','','',$fieldid);
|
||||
*/
|
||||
if ($_POST["action"] == 'add')
|
||||
{
|
||||
// Creation compte
|
||||
$error=0;
|
||||
|
||||
// Create account
|
||||
$account = new Account($db,0);
|
||||
|
||||
$account->ref = dol_sanitizeFileName(trim($_POST["ref"]));
|
||||
@@ -73,7 +77,21 @@ if ($_POST["action"] == 'add')
|
||||
$account->min_desired = $_POST["account_min_desired"];
|
||||
$account->comment = trim($_POST["account_comment"]);
|
||||
|
||||
if ($account->label)
|
||||
if ($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED && empty($account->account_number))
|
||||
{
|
||||
$message='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("AccountancyCode")).'</div>';
|
||||
$action='create'; // Force chargement page en mode creation
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (empty($account->label))
|
||||
{
|
||||
$message='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("LabelBankCashAccount")).'</div>';
|
||||
$action='create'; // Force chargement page en mode creation
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$id = $account->create($user->id);
|
||||
if ($id > 0)
|
||||
@@ -82,17 +100,16 @@ if ($_POST["action"] == 'add')
|
||||
}
|
||||
else {
|
||||
$message='<div class="error">'.$account->error().'</div>';
|
||||
$_REQUEST["action"]='create'; // Force chargement page en mode creation
|
||||
$action='create'; // Force chargement page en mode creation
|
||||
}
|
||||
} else {
|
||||
$message='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("LabelBankCashAccount")).'</div>';
|
||||
$_REQUEST["action"]='create'; // Force chargement page en mode creation
|
||||
}
|
||||
}
|
||||
|
||||
if ($_POST["action"] == 'update' && ! $_POST["cancel"])
|
||||
{
|
||||
// Modification
|
||||
$error=0;
|
||||
|
||||
// Update account
|
||||
$account = new Account($db, $_POST["id"]);
|
||||
$account->fetch($_POST["id"]);
|
||||
|
||||
@@ -127,7 +144,21 @@ if ($_POST["action"] == 'update' && ! $_POST["cancel"])
|
||||
$account->min_desired = $_POST["account_min_desired"];
|
||||
$account->comment = trim($_POST["account_comment"]);
|
||||
|
||||
if ($account->label)
|
||||
if ($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED && empty($account->account_number))
|
||||
{
|
||||
$message='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("AccountancyCode")).'</div>';
|
||||
$action='edit'; // Force chargement page en mode creation
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (empty($account->label))
|
||||
{
|
||||
$message='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("LabelBankCashAccount")).'</div>';
|
||||
$action='edit'; // Force chargement page en mode creation
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$result = $account->update($user);
|
||||
if ($result >= 0)
|
||||
@@ -137,11 +168,8 @@ if ($_POST["action"] == 'update' && ! $_POST["cancel"])
|
||||
else
|
||||
{
|
||||
$message='<div class="error">'.$account->error().'</div>';
|
||||
$_REQUEST["action"]='edit'; // Force chargement page edition
|
||||
$action='edit'; // Force chargement page edition
|
||||
}
|
||||
} else {
|
||||
$message='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("LabelBankCashAccount")).'</div>';
|
||||
$_REQUEST["action"]='create'; // Force chargement page en mode creation
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,7 +201,7 @@ $htmlcompany = new FormCompany($db);
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
if ($_REQUEST["action"] == 'create')
|
||||
if ($action == 'create')
|
||||
{
|
||||
$account=new Account($db);
|
||||
|
||||
@@ -214,17 +242,6 @@ if ($_REQUEST["action"] == 'create')
|
||||
print $form->select_type_comptes_financiers(isset($_POST["type"])?$_POST["type"]:1,"type");
|
||||
print '</td></tr>';
|
||||
|
||||
// Code compta
|
||||
if ($conf->global->MAIN_BANCK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED)
|
||||
{
|
||||
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("AccountancyCode").'</td>';
|
||||
print '<td colspan="3"><input type="text" name="account_number" value="'.$account->account_number.'"></td></tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<input type="hidden" name="account_number" value="'.$account->account_number.'">';
|
||||
}
|
||||
|
||||
// Currency
|
||||
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("Currency").'</td>';
|
||||
print '<td colspan="3">';
|
||||
@@ -266,6 +283,26 @@ if ($_REQUEST["action"] == 'create')
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Conciliable
|
||||
/*print '<tr><td valign="top">'.$langs->trans("Conciliable").'</td>';
|
||||
print '<td colspan="3">';
|
||||
if ($account->type == 0 || $account->type == 1) print '<input type="checkbox" class="flat" name="norappro" '.($account->rappro?'':'checked="true"').'"> '.$langs->trans("DisableConciliation");
|
||||
if ($account->type == 2) print $langs->trans("No").' ('.$langs->trans("CashAccount").')';
|
||||
print '</td></tr>';
|
||||
*/
|
||||
|
||||
// Accountancy code
|
||||
if ($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED)
|
||||
{
|
||||
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("AccountancyCode").'</td>';
|
||||
print '<td colspan="3"><input type="text" name="account_number" value="'.$account->account_number.'"></td></tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<tr><td valign="top">'.$langs->trans("AccountancyCode").'</td>';
|
||||
print '<td colspan="3"><input type="text" name="account_number" value="'.$account->account_number.'"></td></tr>';
|
||||
}
|
||||
|
||||
// Web
|
||||
print '<tr><td valign="top">'.$langs->trans("Web").'</td>';
|
||||
print '<td colspan="3"><input size="50" type="text" class="flat" name="url" value="'.$_POST["url"].'"></td></tr>';
|
||||
@@ -307,7 +344,7 @@ if ($_REQUEST["action"] == 'create')
|
||||
/* ************************************************************************** */
|
||||
else
|
||||
{
|
||||
if (($_GET["id"] || $_GET["ref"]) && $_REQUEST["action"] != 'edit')
|
||||
if (($_GET["id"] || $_GET["ref"]) && $action != 'edit')
|
||||
{
|
||||
$account = new Account($db);
|
||||
if ($_GET["id"])
|
||||
@@ -331,7 +368,7 @@ else
|
||||
/*
|
||||
* Confirmation to delete
|
||||
*/
|
||||
if ($_REQUEST["action"] == 'delete')
|
||||
if ($action == 'delete')
|
||||
{
|
||||
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$account->id,$langs->trans("DeleteAccount"),$langs->trans("ConfirmDeleteAccount"),"confirm_delete");
|
||||
if ($ret == 'html') print '<br>';
|
||||
@@ -387,12 +424,9 @@ else
|
||||
if ($account->type == 2) print $langs->trans("No").' ('.$langs->trans("CashAccount").')';
|
||||
print '</td></tr>';
|
||||
|
||||
// Code compta
|
||||
if ($conf->accounting->enabled)
|
||||
{
|
||||
// Accountancy code
|
||||
print '<tr><td valign="top">'.$langs->trans("AccountancyCode").'</td>';
|
||||
print '<td colspan="3">'.$account->account_number.'</td></tr>';
|
||||
}
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("BalanceMinimalAllowed").'</td>';
|
||||
print '<td colspan="3">'.$account->min_allowed.'</td></tr>';
|
||||
@@ -416,7 +450,6 @@ else
|
||||
|
||||
/*
|
||||
* Barre d'actions
|
||||
*
|
||||
*/
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
@@ -441,10 +474,10 @@ else
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
if ($_REQUEST["id"] && $_REQUEST["action"] == 'edit' && $user->rights->banque->configurer)
|
||||
if (GETPOST("id") && $action == 'edit' && $user->rights->banque->configurer)
|
||||
{
|
||||
$account = new Account($db, $_REQUEST["id"]);
|
||||
$account->fetch($_REQUEST["id"]);
|
||||
$account = new Account($db);
|
||||
$account->fetch(GETPOST("id"));
|
||||
|
||||
print_fiche_titre($langs->trans("EditFinancialAccount"));
|
||||
print "<br>";
|
||||
@@ -525,21 +558,23 @@ else
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Conciliable
|
||||
print '<tr><td valign="top">'.$langs->trans("Conciliable").'</td>';
|
||||
print '<td colspan="3">';
|
||||
if ($account->type == 0 || $account->type == 1) print '<input type="checkbox" class="flat" name="norappro" '.($account->rappro?'':'checked="true"').'"> '.$langs->trans("DisableConciliation");
|
||||
if ($account->type == 2) print $langs->trans("No").' ('.$langs->trans("CashAccount").')';
|
||||
print '</td></tr>';
|
||||
|
||||
// Code compta
|
||||
if ($conf->accounting->enabled)
|
||||
// Accountancy code
|
||||
if ($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED)
|
||||
{
|
||||
print '<tr><td valign="top">'.$langs->trans("AccountancyCode").'</td>';
|
||||
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("AccountancyCode").'</td>';
|
||||
print '<td colspan="3"><input type="text" name="account_number" value="'.(isset($_POST["account_number"])?$_POST["account_number"]:$account->account_number).'"></td></tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<input type="hidden" name="account_number" value="'.(isset($_POST["account_number"])?$_POST["account_number"]:$account->account_number).'">';
|
||||
print '<tr><td valign="top">'.$langs->trans("AccountancyCode").'</td>';
|
||||
print '<td colspan="3"><input type="text" name="account_number" value="'.(isset($_POST["account_number"])?$_POST["account_number"]:$account->account_number).'"></td></tr>';
|
||||
}
|
||||
|
||||
// Balance
|
||||
|
||||
@@ -846,7 +846,7 @@ if ($mode == 'showalltime')
|
||||
{
|
||||
print '<tr><td align="center">';
|
||||
$file = "balance".$account.".png";
|
||||
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=bank_temp&file='.$file.'" alt="" title="">';
|
||||
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=banque_temp&file='.$file.'" alt="" title="">';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
@@ -292,7 +292,7 @@ if ($result)
|
||||
print '</a>';
|
||||
}
|
||||
else if ($links[$key]['type']=='company') {
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$links[$key]['url_id'].'">';
|
||||
print '<a href="'.DOL_URL_ROOT.'/societe/soc.php?socid='.$links[$key]['url_id'].'">';
|
||||
print img_object($langs->trans('ShowCustomer'),'company').' ';
|
||||
print $links[$key]['label'];
|
||||
print '</a>';
|
||||
|
||||
@@ -60,6 +60,7 @@ function llxHeader($head = '', $title='', $help_url='', $target='', $disablejs=0
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account";
|
||||
$sql.= " WHERE entity = ".$conf->entity;
|
||||
$sql.= " AND clos = 0";
|
||||
$sql.= " ORDER BY label";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
|
||||
@@ -102,7 +102,7 @@ $sql.= ", st.libelle as stcomm, s.prefix_comm, s.code_client, s.code_compta ";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user ";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."c_stcomm as st";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE s.fk_stcomm = st.id AND s.client=1";
|
||||
$sql.= " WHERE s.fk_stcomm = st.id AND s.client in (1,3)";
|
||||
$sql.= " AND s.entity = ".$conf->entity;
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
|
||||
|
||||
@@ -271,26 +271,26 @@ class Deplacement extends CommonObject
|
||||
{
|
||||
return $langs->trans($this->statuts_short[$statut]);
|
||||
}
|
||||
if ($mode == 2)
|
||||
{
|
||||
if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts_short[$statut]);
|
||||
if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts_short[$statut]);
|
||||
}
|
||||
if ($mode == 3)
|
||||
{
|
||||
if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0');
|
||||
if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6');
|
||||
}
|
||||
if ($mode == 4)
|
||||
{
|
||||
if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]);
|
||||
if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]);
|
||||
}
|
||||
if ($mode == 5)
|
||||
{
|
||||
if ($statut==0) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut0');
|
||||
if ($statut==1) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut6');
|
||||
}
|
||||
if ($mode == 2)
|
||||
{
|
||||
//if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts_short[$statut]);
|
||||
if ($statut==0 || $statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts_short[$statut]);
|
||||
}
|
||||
if ($mode == 3)
|
||||
{
|
||||
//if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0');
|
||||
if ($statut==0 || $statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4');
|
||||
}
|
||||
if ($mode == 4)
|
||||
{
|
||||
//if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]);
|
||||
if ($statut==0 || $statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts[$statut]);
|
||||
}
|
||||
if ($mode == 5)
|
||||
{
|
||||
//if ($statut==0) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut0');
|
||||
if ($statut==0 || $statut==1) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut4');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -94,7 +94,8 @@ class DeplacementStats extends Stats
|
||||
$sql.= " FROM ".$this->from;
|
||||
$sql.= " WHERE YEAR(dated) = ".$year;
|
||||
$sql.= " AND ".$this->where;
|
||||
$sql.= " GROUP BY dm DESC";
|
||||
$sql.= " GROUP BY dm";
|
||||
$sql.= $this->db->order('dm','DESC');
|
||||
|
||||
$res=$this->_getNbByMonth($year, $sql);
|
||||
//var_dump($res);print '<br>';
|
||||
@@ -113,7 +114,8 @@ class DeplacementStats extends Stats
|
||||
$sql.= " FROM ".$this->from;
|
||||
$sql.= " WHERE date_format(dated,'%Y') = ".$year;
|
||||
$sql.= " AND ".$this->where;
|
||||
$sql.= " GROUP BY dm DESC";
|
||||
$sql.= " GROUP BY dm";
|
||||
$sql.= $this->db->order('dm','DESC');
|
||||
|
||||
$res=$this->_getAmountByMonth($year, $sql);
|
||||
//var_dump($res);print '<br>';
|
||||
@@ -131,7 +133,8 @@ class DeplacementStats extends Stats
|
||||
$sql.= " FROM ".$this->from;
|
||||
$sql.= " WHERE date_format(dated,'%Y') = ".$year;
|
||||
$sql.= " AND ".$this->where;
|
||||
$sql.= " GROUP BY dm DESC";
|
||||
$sql.= " GROUP BY dm";
|
||||
$sql.= $this->db->order('dm','DESC');
|
||||
|
||||
return $this->_getAverageByMonth($year, $sql);
|
||||
}
|
||||
@@ -145,7 +148,8 @@ class DeplacementStats extends Stats
|
||||
$sql = "SELECT date_format(dated,'%Y') as year, count(*) as nb, sum(".$this->field.") as total, avg(".$this->field.") as avg";
|
||||
$sql.= " FROM ".$this->from;
|
||||
$sql.= " WHERE ".$this->where;
|
||||
$sql.= " GROUP BY year DESC";
|
||||
$sql.= " GROUP BY year";
|
||||
$sql.= $this->db->order('year','DESC');
|
||||
|
||||
return $this->_getAllByYear($sql);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* 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
|
||||
@@ -20,10 +20,10 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
\file htdocs/compta/deplacement/index.php
|
||||
\brief Page liste des deplacements
|
||||
\version $Id$
|
||||
*/
|
||||
* \file htdocs/compta/deplacement/index.php
|
||||
* \brief Page liste des deplacements
|
||||
* \version $Id$
|
||||
*/
|
||||
|
||||
require("../../main.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/compta/tva/class/tva.class.php");
|
||||
@@ -58,7 +58,7 @@ $sql.= " u.name, u.firstname"; // Qui
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."deplacement as d";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on d.fk_soc = s.rowid";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc";
|
||||
$sql.= " WHERE d.fk_user = u.rowid";
|
||||
$sql.= " AND d.entity = ".$conf->entity;
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND sc.fk_user = " .$user->id;
|
||||
|
||||
@@ -87,7 +87,7 @@ for ($i = 0 ; $i < 3 ; $i++)
|
||||
print '<td><a href="liste.php?statut='.$i.'">'.$donstatic->LibStatut($i,4).'</a></td>';
|
||||
print '<td align="right">'.$nb[$i].'</td>';
|
||||
print '<td align="right">'.($nb[$i]?price($somme[$i],'MT'):' ').'</td>';
|
||||
print '<td align="right">'.($nb[$i]?price($somme[$i]/$nb[$i],'MT'):' ').'</td>';
|
||||
print '<td align="right">'.($nb[$i]?price(price2num($somme[$i]/$nb[$i],'MT')):' ').'</td>';
|
||||
$totalnb += $nb[$i];
|
||||
$total += $somme[$i];
|
||||
print "</tr>";
|
||||
@@ -97,7 +97,7 @@ print '<tr class="liste_total">';
|
||||
print '<td>'.$langs->trans("Total").'</td>';
|
||||
print '<td align="right">'.$totalnb.'</td>';
|
||||
print '<td align="right">'.price($total,'MT').'</td>';
|
||||
print '<td align="right">'.($totalnb?price($total/$totalnb,'MT'):' ').'</td>';
|
||||
print '<td align="right">'.($totalnb?price(price2num($total/$totalnb,'MT')):' ').'</td>';
|
||||
print '</tr>';
|
||||
print "</table>";
|
||||
|
||||
|
||||
@@ -76,7 +76,9 @@ if ($result)
|
||||
|
||||
if ($statut >= 0)
|
||||
{
|
||||
print_barre_liste($libelle[$statut], $page, "liste.php", "&statut=$statut&sortorder=$sortorder&sortfield=$sortfield");
|
||||
$donationstatic->statut=$statut;
|
||||
$label=$donationstatic->getLibStatut(0);
|
||||
print_barre_liste($label, $page, "liste.php", "&statut=$statut&sortorder=$sortorder&sortfield=$sortfield");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -54,7 +54,7 @@ $sall=isset($_GET['sall'])?trim($_GET['sall']):trim($_POST['sall']);
|
||||
$projectid=isset($_GET['projectid'])?$_GET['projectid']:0;
|
||||
|
||||
// Security check
|
||||
$socid=isset($_GET['socid'])?$_GET['socid']:$_POST['socid'];
|
||||
$socid=GETPOST("socid");
|
||||
$facid=GETPOST("id");
|
||||
if (empty($facid)) $facid=GETPOST("facid"); // For backward compatibility
|
||||
$ref=GETPOST("ref");
|
||||
@@ -851,12 +851,14 @@ if (($_POST['action'] == 'addline' || $_POST['action'] == 'addline_predef') && $
|
||||
{
|
||||
$pu_ht = $prod->multiprices[$object->client->price_level];
|
||||
$pu_ttc = $prod->multiprices_ttc[$object->client->price_level];
|
||||
$price_min = $prod->multiprices_min[$object->client->price_level];
|
||||
$price_base_type = $prod->multiprices_base_type[$object->client->price_level];
|
||||
}
|
||||
else
|
||||
{
|
||||
$pu_ht = $prod->price;
|
||||
$pu_ttc = $prod->price_ttc;
|
||||
$price_min = $prod->price_min;
|
||||
$price_base_type = $prod->price_base_type;
|
||||
}
|
||||
|
||||
@@ -905,9 +907,9 @@ if (($_POST['action'] == 'addline' || $_POST['action'] == 'addline_predef') && $
|
||||
|
||||
if ($result >= 0)
|
||||
{
|
||||
if($prod->price_min && (price2num($pu_ht)*(1-price2num($_POST['remise_percent'])/100) < price2num($prod->price_min)))
|
||||
if($price_min && (price2num($pu_ht)*(1-price2num($_POST['remise_percent'])/100) < price2num($price_min)))
|
||||
{
|
||||
$object->error = $langs->trans("CantBeLessThanMinPrice",price2num($prod->price_min,'MU').' '.$langs->trans("Currency".$conf->monnaie)) ;
|
||||
$object->error = $langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').' '.$langs->trans("Currency".$conf->monnaie)) ;
|
||||
$result = -1 ;
|
||||
}
|
||||
else
|
||||
@@ -1003,11 +1005,13 @@ if ($_POST['action'] == 'updateligne' && $user->rights->facture->creer && $_POST
|
||||
$product = new Product($db);
|
||||
$product->fetch($productid);
|
||||
$type=$product->type;
|
||||
$price_min = $product->price_min;
|
||||
if ($conf->global->PRODUIT_MULTIPRICES && $object->client->price_level) $price_min = $product->multiprices_min[$object->client->price_level];
|
||||
}
|
||||
if ($object->type!=2 && $product->price_min && GETPOST('productid') && (price2num($up_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($product->price_min)))
|
||||
if ($object->type!=2 && $price_min && GETPOST('productid') && (price2num($up_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min)))
|
||||
{
|
||||
//print "CantBeLessThanMinPrice ".$up_ht." - ".GETPOST('remise_percent')." - ".$product->price_min;
|
||||
$mesg = '<div class="error">'.$langs->trans("CantBeLessThanMinPrice",price2num($product->price_min,'MU').' '.$langs->trans("Currency".$conf->monnaie)).'</div>';
|
||||
$mesg = '<div class="error">'.$langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').' '.$langs->trans("Currency".$conf->monnaie)).'</div>';
|
||||
$result=-1;
|
||||
}
|
||||
|
||||
@@ -1310,20 +1314,20 @@ if (($_POST['action'] == 'send' || $_POST['action'] == 'relance') && ! $_POST['a
|
||||
/*
|
||||
* Generate document
|
||||
*/
|
||||
if ($_REQUEST['action'] == 'builddoc') // En get ou en post
|
||||
if (GETPOST('action') == 'builddoc') // En get ou en post
|
||||
{
|
||||
$object->fetch($facid);
|
||||
$object->fetch_thirdparty();
|
||||
|
||||
if ($_REQUEST['model'])
|
||||
if (GETPOST('model'))
|
||||
{
|
||||
$object->setDocModel($user, $_REQUEST['model']);
|
||||
$object->setDocModel($user, GETPOST('model'));
|
||||
}
|
||||
|
||||
// Define output language
|
||||
$outputlangs = $langs;
|
||||
$newlang='';
|
||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id'];
|
||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id');
|
||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
|
||||
if (! empty($newlang))
|
||||
{
|
||||
@@ -2776,7 +2780,13 @@ else
|
||||
|
||||
foreach($object->linked_object as $linked_object => $linked_objectid)
|
||||
{
|
||||
if($conf->$linked_object->enabled && $linked_object != $object->element)
|
||||
$element = $subelement = $linked_object;
|
||||
if (preg_match('/^([^_]+)_([^_]+)/i',$linked_object,$regs))
|
||||
{
|
||||
$element = $regs[1];
|
||||
$subelement = $regs[2];
|
||||
}
|
||||
if($conf->$element->enabled && $element != $object->element)
|
||||
{
|
||||
$somethingshown=$object->showLinkedObjectBlock($linked_object,$linked_objectid,$somethingshown);
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -44,6 +44,7 @@ class Facture extends CommonObject
|
||||
{
|
||||
var $db;
|
||||
var $error;
|
||||
var $errors=array();
|
||||
var $element='facture';
|
||||
var $table_element='facture';
|
||||
var $table_element_line = 'facturedet';
|
||||
@@ -293,7 +294,7 @@ class Facture extends CommonObject
|
||||
else
|
||||
{
|
||||
dol_syslog("There is ".sizeof($this->lines)." lines that are array lines");
|
||||
for ($i = 0 ; $i < sizeof($this->lines) ; $i++)
|
||||
foreach ($this->lines as $i => $val)
|
||||
{
|
||||
if (($this->lines[$i]->info_bits & 0x01) == 0) // We keep only lines with first bit = 0
|
||||
{
|
||||
@@ -464,6 +465,11 @@ class Facture extends CommonObject
|
||||
dol_syslog("Facture::createFromCurrent invertdetail=".$invertdetail." socid=".$this->socid." nboflines=".sizeof($facture->lines));
|
||||
|
||||
$facid = $facture->create($user);
|
||||
if ($facid <= 0)
|
||||
{
|
||||
$this->error=$facture->error;
|
||||
$this->errors=$facture->errors;
|
||||
}
|
||||
|
||||
return $facid;
|
||||
}
|
||||
@@ -1676,7 +1682,10 @@ class Facture extends CommonObject
|
||||
if (empty($info_bits)) $info_bits=0;
|
||||
if (empty($rang)) $rang=0;
|
||||
if (empty($ventil)) $ventil=0;
|
||||
|
||||
if (empty($txtva)) $txtva=0;
|
||||
if (empty($txlocaltax1)) $txlocaltax1=0;
|
||||
if (empty($txlocaltax2)) $txlocaltax2=0;
|
||||
|
||||
$remise_percent=price2num($remise_percent);
|
||||
$qty=price2num($qty);
|
||||
$pu_ht=price2num($pu_ht);
|
||||
|
||||
@@ -91,7 +91,7 @@ class FactureStats extends Stats
|
||||
$sql.= " FROM ".$this->from;
|
||||
$sql.= " WHERE ".$this->where;
|
||||
$sql.= " GROUP BY dm";
|
||||
$sql.= " ORDER BY dm DESC";
|
||||
$sql.= $this->db->order('dm','DESC');
|
||||
|
||||
return $this->_getNbByYear($sql);
|
||||
}
|
||||
@@ -109,7 +109,7 @@ class FactureStats extends Stats
|
||||
$sql.= " WHERE 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";
|
||||
$sql.= " ORDER BY dm DESC";
|
||||
$sql.= $this->db->order('dm','DESC');
|
||||
|
||||
$res=$this->_getNbByMonth($year, $sql);
|
||||
//var_dump($res);print '<br>';
|
||||
@@ -129,7 +129,7 @@ class FactureStats extends Stats
|
||||
$sql.= " WHERE date_format(datef,'%Y') = ".$year;
|
||||
$sql.= " AND ".$this->where;
|
||||
$sql.= " GROUP BY dm";
|
||||
$sql.= " ORDER BY dm DESC";
|
||||
$sql.= $this->db->order('dm','DESC');
|
||||
|
||||
$res=$this->_getAmountByMonth($year, $sql);
|
||||
//var_dump($res);print '<br>';
|
||||
@@ -148,7 +148,7 @@ class FactureStats extends Stats
|
||||
$sql.= " WHERE 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";
|
||||
$sql.= " ORDER BY dm DESC";
|
||||
$sql.= $this->db->order('dm','DESC');
|
||||
|
||||
return $this->_getAverageByMonth($year, $sql);
|
||||
}
|
||||
@@ -163,7 +163,7 @@ class FactureStats extends Stats
|
||||
$sql.= " FROM ".$this->from;
|
||||
$sql.= " WHERE ".$this->where;
|
||||
$sql.= " GROUP BY year";
|
||||
$sql.= " ORDER BY year DESC";
|
||||
$sql.= $this->db->order('year','DESC');
|
||||
|
||||
return $this->_getAllByYear($sql);
|
||||
}
|
||||
|
||||
@@ -55,9 +55,11 @@ if ($_POST["action"] == "builddoc" && $user->rights->facture->lire)
|
||||
{
|
||||
require_once(DOL_DOCUMENT_ROOT."/includes/fpdf/fpdfi/fpdi.php");
|
||||
require_once(DOL_DOCUMENT_ROOT.'/lib/pdf.lib.php');
|
||||
|
||||
$factures = dol_dir_list($conf->facture->dir_output,'all',1,implode('\.pdf|',$_POST['toGenerate']).'\.pdf','\.meta$|\.png','date',SORT_DESC) ;
|
||||
|
||||
|
||||
$arrayofexclusion=array();
|
||||
foreach($_POST['toGenerate'] as $tmppdf) $arrayofexclusion[]=preg_quote($tmppdf.'.pdf','/');
|
||||
$factures = dol_dir_list($conf->facture->dir_output,'all',1,implode('|',$arrayofexclusion),'\.meta$|\.png','date',SORT_DESC) ;
|
||||
|
||||
// liste les fichiers
|
||||
$files = array() ;
|
||||
$factures_bak = $factures ;
|
||||
|
||||
@@ -48,7 +48,7 @@ for ($i = 0 ; $i < $num ; $i++)
|
||||
$linkedObjectBlock->fetch($objectid[$i]);
|
||||
$var=!$var;
|
||||
?>
|
||||
<tr <?php echo $bc[$var]; ?> ><td>
|
||||
<tr <?php echo $GLOBALS['bc'][$var]; ?> ><td>
|
||||
<a href="<?php echo DOL_URL_ROOT.'/compta/facture.php?facid='.$linkedObjectBlock->id ?>"><?php echo img_object($langs->trans("ShowBill"),"bill").' '.$linkedObjectBlock->ref; ?></a></td>
|
||||
<td align="center"><?php echo dol_print_date($linkedObjectBlock->date,'day'); ?></td>
|
||||
<td align="right"><?php echo price($linkedObjectBlock->total_ht); ?></td>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copytight (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -24,14 +25,24 @@
|
||||
* \version $Id$
|
||||
*/
|
||||
|
||||
require("../../../main.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php');
|
||||
require_once("../../../main.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/compta/bank/class/account.class.php");
|
||||
|
||||
$langs->load("bills");
|
||||
$langs->load("compta");
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
|
||||
|
||||
/**
|
||||
* Replace the default llxHeader function
|
||||
* @param $head
|
||||
* @param $title
|
||||
* @param $help_url
|
||||
* @param $target
|
||||
* @param $disablejs
|
||||
* @param $disablehead
|
||||
* @param $arrayofjs
|
||||
* @param $arrayofcss
|
||||
*/
|
||||
function llxHeader($head = '', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='')
|
||||
{
|
||||
global $db, $user, $conf, $langs;
|
||||
@@ -44,10 +55,11 @@ function llxHeader($head = '', $title='', $help_url='', $target='', $disablejs=0
|
||||
// Entry for each bank account
|
||||
if ($user->rights->banque->lire)
|
||||
{
|
||||
$sql = "SELECT rowid, label, courant";
|
||||
$sql = "SELECT rowid, label, courant, rappro, courant";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account";
|
||||
$sql.= " WHERE entity = ".$conf->entity;
|
||||
$sql.= " AND clos = 0";
|
||||
$sql.= " ORDER BY label";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
@@ -55,12 +67,16 @@ function llxHeader($head = '', $title='', $help_url='', $target='', $disablejs=0
|
||||
$numr = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
if ($numr > 0) $menu->add("/compta/bank/index.php",$langs->trans("BankAccounts"),0,$user->rights->banque->lire);
|
||||
if ($numr > 0) $menu->add('/compta/bank/index.php',$langs->trans("BankAccounts"),0,$user->rights->banque->lire);
|
||||
|
||||
while ($i < $numr)
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
$menu->add_submenu("/compta/bank/fiche.php?id=".$objp->rowid,$objp->label,1,$user->rights->banque->lire);
|
||||
$menu->add_submenu('/compta/bank/fiche.php?id='.$objp->rowid,$objp->label,1,$user->rights->banque->lire);
|
||||
if ($objp->rappro && $objp->courant != 2) // If not cash account and can be reconciliate
|
||||
{
|
||||
$menu->add_submenu('/compta/bank/rappro.php?account='.$objp->rowid,$langs->trans("Conciliate"),2,$user->rights->banque->consolidate);
|
||||
}
|
||||
/*
|
||||
$menu->add_submenu("/compta/bank/annuel.php?account=".$objp->rowid ,$langs->trans("IOMonthlyReporting"));
|
||||
$menu->add_submenu("/compta/bank/graph.php?account=".$objp->rowid ,$langs->trans("Graph"));
|
||||
@@ -69,11 +85,12 @@ function llxHeader($head = '', $title='', $help_url='', $target='', $disablejs=0
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
else dol_print_error($db);
|
||||
$db->free($resql);
|
||||
}
|
||||
|
||||
left_menu('', $help_url, '', $menu->liste, 1);
|
||||
main_area();
|
||||
main_area();
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -386,7 +386,7 @@ class Paiement
|
||||
if (! in_array($fac->thirdparty->id,$linkaddedforthirdparty)) // Not yet done for this thirdparty
|
||||
{
|
||||
$result=$acc->add_url_line($bank_line_id, $fac->thirdparty->id,
|
||||
DOL_URL_ROOT.'/compta/fiche.php?socid=', $fac->thirdparty->nom, 'company');
|
||||
DOL_URL_ROOT.'/comm/fiche.php?socid=', $fac->thirdparty->nom, 'company');
|
||||
if ($result <= 0) dol_print_error($this->db);
|
||||
$linkaddedforthirdparty[$fac->thirdparty->id]=$fac->thirdparty->id; // Mark as done for this thirdparty
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ print '<br>';
|
||||
|
||||
clearstatcache();
|
||||
|
||||
// Affiche lien sur autres annees
|
||||
// Show link on other years
|
||||
$linkforyear=array();
|
||||
$found=0;
|
||||
if (is_dir($dir))
|
||||
@@ -138,7 +138,7 @@ if (is_dir($dir))
|
||||
{
|
||||
while (($file = readdir($handle))!==false)
|
||||
{
|
||||
if (is_dir($dir.'/'.$file) && ! preg_match('/^\./',$file))
|
||||
if (is_dir($dir.'/'.$file) && ! preg_match('/^\./',$file) && is_numeric($file))
|
||||
{
|
||||
$found=1;
|
||||
$linkforyear[]=$file;
|
||||
|
||||
@@ -46,7 +46,7 @@ if ($_GET["id"])
|
||||
|
||||
if ($bon->fetch($_GET["id"]) == 0)
|
||||
{
|
||||
$head = prelevement_prepare_head($bon);
|
||||
$head = prelevement_prepare_head($bon);
|
||||
dol_fiche_head($head, 'invoices', $langs->trans("WithdrawalReceipt"), '', 'payment');
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
@@ -65,7 +65,7 @@ if ($_GET["id"])
|
||||
print '<tr><td width="20%">'.$langs->trans('Status').'</td>';
|
||||
print '<td>'.$bon->getLibStatut(1).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
if($bon->date_trans <> 0)
|
||||
{
|
||||
$muser = new User($db);
|
||||
@@ -84,7 +84,7 @@ if ($_GET["id"])
|
||||
print dol_print_date($bon->date_credit,'day');
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
@@ -157,7 +157,7 @@ if ($result)
|
||||
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$obj->facid.'">'.$obj->ref."</a></td>\n";
|
||||
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$obj->socid.'">';
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->socid.'">';
|
||||
print img_object($langs->trans("ShowCompany"),"company"). ' '.stripslashes($obj->nom)."</a></td>\n";
|
||||
|
||||
print '<td align="center">'.price($obj->total_ttc)."</td>\n";
|
||||
|
||||
@@ -131,7 +131,7 @@ if ($result)
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$obj->facid.'">'.$obj->facnumber."</a></td>\n";
|
||||
|
||||
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$obj->socid.'">'.stripslashes($obj->nom)."</a></td>\n";
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->socid.'">'.stripslashes($obj->nom)."</a></td>\n";
|
||||
|
||||
print '<td align="center">'.price($obj->total_ttc)."</td>\n";
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ if ($_GET["id"])
|
||||
print '<tr><td width="20%">'.$langs->trans('Status').'</td>';
|
||||
print '<td>'.$bon->getLibStatut(1).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
if($bon->date_trans <> 0)
|
||||
{
|
||||
$muser = new User($db);
|
||||
@@ -87,7 +87,7 @@ if ($_GET["id"])
|
||||
print dol_print_date($bon->date_credit,'day');
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
@@ -136,7 +136,7 @@ if ($resql)
|
||||
|
||||
$var=True;
|
||||
$total = 0;
|
||||
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
@@ -147,7 +147,7 @@ if ($resql)
|
||||
|
||||
print substr('000000'.$obj->rowid, -6);
|
||||
print '</a></td>';
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$obj->socid.'">'.stripslashes($obj->nom)."</a></td>\n";
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->socid.'">'.stripslashes($obj->nom)."</a></td>\n";
|
||||
|
||||
print '<td align="right">'.price($obj->amount)."</td>\n";
|
||||
print '<td>'.$rej->motifs[$obj->motif].'</td>';
|
||||
|
||||
@@ -187,7 +187,7 @@ if ($_GET["id"])
|
||||
print '</td></tr>';
|
||||
print '<tr><td width="20%">'.$langs->trans("File").'</td><td>';
|
||||
print '<input type="hidden" name="max_file_size" value="'.$conf->maxfilesize.'">';
|
||||
print '<input class="flat" type="file" name="userfile" size="80"><br>';
|
||||
print '<input class="flat" type="file" name="userfile"><br>';
|
||||
print '</td></tr>';
|
||||
print '</table><br>';
|
||||
print '<center><input type="submit" class="button" value="'.$langs->trans("Send").'">';
|
||||
|
||||
@@ -72,7 +72,7 @@ if ($_GET["id"])
|
||||
print '<tr><td width="20%">'.$langs->trans('Status').'</td>';
|
||||
print '<td>'.$bon->getLibStatut(1).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
if($bon->date_trans <> 0)
|
||||
{
|
||||
$muser = new User($db);
|
||||
@@ -91,7 +91,7 @@ if ($_GET["id"])
|
||||
print dol_print_date($bon->date_credit,'day');
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
@@ -164,15 +164,15 @@ if ($result)
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
print "<tr $bc[$var]><td>";
|
||||
|
||||
|
||||
print $ligne->LibStatut($obj->statut,2);
|
||||
print " ";
|
||||
|
||||
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/ligne.php?id='.$obj->rowid.'">';
|
||||
print substr('000000'.$obj->rowid, -6);
|
||||
print '</a></td>';
|
||||
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$obj->socid.'">'.stripslashes($obj->nom)."</a></td>\n";
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->socid.'">'.stripslashes($obj->nom)."</a></td>\n";
|
||||
|
||||
print '<td align="center">'.price($obj->amount)."</td>\n";
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ if ($result)
|
||||
|
||||
print substr('000000'.$obj->rowid, -6)."</a></td>";
|
||||
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$obj->socid.'">'.stripslashes($obj->nom)."</a></td>\n";
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->socid.'">'.stripslashes($obj->nom)."</a></td>\n";
|
||||
|
||||
print '<td>'.$rej->motifs[$obj->motif].'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
@@ -482,7 +482,7 @@ if ($mysoc->tva_assuj == 'franchise') // Non assujeti
|
||||
|
||||
print '<tr class="liste_total"><td align="left" colspan="2">'.$langs->trans("Profit").'</td>';
|
||||
if ($modecompta == 'CREANCES-DETTES') print '<td class="border" align="right">'.price($total_ht).'</td>';
|
||||
print '<td class="border" align="right">'.price($total_ttc).'</td>';
|
||||
print '<td align="right">'.price($total_ttc).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr>';
|
||||
|
||||
@@ -20,10 +20,10 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/compta/tva/clients.php
|
||||
* \file htdocs/compta/tva/clients.php
|
||||
* \ingroup tax
|
||||
* \brief Page des societes
|
||||
* \version $Id$
|
||||
* \brief Page des societes
|
||||
* \version $Id$
|
||||
*/
|
||||
|
||||
require('../../main.inc.php');
|
||||
@@ -41,31 +41,31 @@ $langs->load("products");
|
||||
$year=$_REQUEST["year"];
|
||||
if (empty($year))
|
||||
{
|
||||
$year_current = strftime("%Y",dol_now());
|
||||
$year_start = $year_current;
|
||||
$year_current = strftime("%Y",dol_now());
|
||||
$year_start = $year_current;
|
||||
} else {
|
||||
$year_current = $year;
|
||||
$year_start = $year;
|
||||
$year_current = $year;
|
||||
$year_start = $year;
|
||||
}
|
||||
$date_start=dol_mktime(0,0,0,$_REQUEST["date_startmonth"],$_REQUEST["date_startday"],$_REQUEST["date_startyear"]);
|
||||
$date_end=dol_mktime(23,59,59,$_REQUEST["date_endmonth"],$_REQUEST["date_endday"],$_REQUEST["date_endyear"]);
|
||||
// Quarter
|
||||
if (empty($date_start) || empty($date_end)) // We define date_start and date_end
|
||||
{
|
||||
$q=(! empty($_REQUEST["q"]))?$_REQUEST["q"]:0;
|
||||
if ($q==0)
|
||||
{
|
||||
if (isset($_REQUEST["month"])) { $date_start=dol_get_first_day($year_start,$_REQUEST["month"],false); $date_end=dol_get_last_day($year_start,$_REQUEST["month"],false); }
|
||||
else $q=1;
|
||||
}
|
||||
if ($q==1) { $date_start=dol_get_first_day($year_start,1,false); $date_end=dol_get_last_day($year_start,3,false); }
|
||||
if ($q==2) { $date_start=dol_get_first_day($year_start,4,false); $date_end=dol_get_last_day($year_start,6,false); }
|
||||
if ($q==3) { $date_start=dol_get_first_day($year_start,7,false); $date_end=dol_get_last_day($year_start,9,false); }
|
||||
if ($q==4) { $date_start=dol_get_first_day($year_start,10,false); $date_end=dol_get_last_day($year_start,12,false); }
|
||||
$q=(! empty($_REQUEST["q"]))?$_REQUEST["q"]:0;
|
||||
if ($q==0)
|
||||
{
|
||||
if (isset($_REQUEST["month"])) { $date_start=dol_get_first_day($year_start,$_REQUEST["month"],false); $date_end=dol_get_last_day($year_start,$_REQUEST["month"],false); }
|
||||
else $q=1;
|
||||
}
|
||||
if ($q==1) { $date_start=dol_get_first_day($year_start,1,false); $date_end=dol_get_last_day($year_start,3,false); }
|
||||
if ($q==2) { $date_start=dol_get_first_day($year_start,4,false); $date_end=dol_get_last_day($year_start,6,false); }
|
||||
if ($q==3) { $date_start=dol_get_first_day($year_start,7,false); $date_end=dol_get_last_day($year_start,9,false); }
|
||||
if ($q==4) { $date_start=dol_get_first_day($year_start,10,false); $date_end=dol_get_last_day($year_start,12,false); }
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO We define q
|
||||
// TODO We define q
|
||||
|
||||
}
|
||||
|
||||
@@ -89,11 +89,16 @@ $result = restrictedArea($user, 'tax', '', '', 'charges');
|
||||
*/
|
||||
|
||||
$html=new Form($db);
|
||||
|
||||
llxHeader();
|
||||
|
||||
$company_static=new Societe($db);
|
||||
|
||||
$morequerystring='';
|
||||
$listofparams=array('date_startmonth','date_startyear','date_startday','date_endmonth','date_endyear','date_endday');
|
||||
foreach($listofparams as $param)
|
||||
{
|
||||
if (GETPOST($param)!='') $morequerystring.=($morequerystring?'&':'').$param.'='.GETPOST($param);
|
||||
}
|
||||
|
||||
llxHeader('','','','',0,0,'','',$morequerystring);
|
||||
|
||||
$fsearch.='<br>';
|
||||
$fsearch.=' <input type="hidden" name="year" value="'.$year.'">';
|
||||
@@ -102,7 +107,7 @@ $fsearch.=' '.$langs->trans("SalesTurnover").' '.$langs->trans("Minimum").': ';
|
||||
$fsearch.=' <input type="text" name="min" value="'.$min.'">';
|
||||
|
||||
// Affiche en-tete du rapport
|
||||
if ($modetax==1) // Calculate on invoice for goods and services
|
||||
if ($modetax==1) // Calculate on invoice for goods and services
|
||||
{
|
||||
$nom=$langs->trans("VATReportByCustomersInDueDebtMode");
|
||||
//$nom.='<br>('.$langs->trans("SeeVATReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&modetax=0">','</a>').')';
|
||||
@@ -110,41 +115,41 @@ if ($modetax==1) // Calculate on invoice for goods and services
|
||||
//$periodlink=($year_start?"<a href='".$_SERVER["PHP_SELF"]."?year=".($year_start-1)."&modetax=".$modetax."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".($year_start+1)."&modetax=".$modetax."'>".img_next()."</a>":"");
|
||||
$description=$langs->trans("RulesVATDue");
|
||||
//if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='<br>'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite');
|
||||
$description.=$fsearch;
|
||||
$description.=$fsearch;
|
||||
$description.='<br>('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')';
|
||||
$builddate=time();
|
||||
$builddate=time();
|
||||
//$exportlink=$langs->trans("NotYetAvailable");
|
||||
|
||||
$elementcust=$langs->trans("CustomersInvoices");
|
||||
$productcust=$langs->trans("Description");
|
||||
$amountcust=$langs->trans("AmountHT");
|
||||
if ($mysoc->tva_assuj) $vatcust.=' ('.$langs->trans("ToPay").')';
|
||||
$elementsup=$langs->trans("SuppliersInvoices");
|
||||
$productsup=$langs->trans("Description");
|
||||
$amountsup=$langs->trans("AmountHT");
|
||||
if ($mysoc->tva_assuj) $vatsup.=' ('.$langs->trans("ToGetBack").')';
|
||||
$elementcust=$langs->trans("CustomersInvoices");
|
||||
$productcust=$langs->trans("Description");
|
||||
$amountcust=$langs->trans("AmountHT");
|
||||
if ($mysoc->tva_assuj) $vatcust.=' ('.$langs->trans("ToPay").')';
|
||||
$elementsup=$langs->trans("SuppliersInvoices");
|
||||
$productsup=$langs->trans("Description");
|
||||
$amountsup=$langs->trans("AmountHT");
|
||||
if ($mysoc->tva_assuj) $vatsup.=' ('.$langs->trans("ToGetBack").')';
|
||||
}
|
||||
if ($modetax==0) // Invoice for goods, payment for services
|
||||
if ($modetax==0) // Invoice for goods, payment for services
|
||||
{
|
||||
$nom=$langs->trans("VATReportByCustomersInInputOutputMode");
|
||||
//$nom.='<br>('.$langs->trans("SeeVATReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&modetax=1">','</a>').')';
|
||||
$period=$html->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$html->select_date($date_end,'date_end',0,0,0,'',1,0,1);
|
||||
//$periodlink=($year_start?"<a href='".$_SERVER["PHP_SELF"]."?year=".($year_start-1)."&modetax=".$modetax."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".($year_start+1)."&modetax=".$modetax."'>".img_next()."</a>":"");
|
||||
$description=$langs->trans("RulesVATIn");
|
||||
if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='<br>'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite');
|
||||
$description.=$fsearch;
|
||||
//if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='<br>'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite');
|
||||
$description.=$fsearch;
|
||||
$description.='<br>('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')';
|
||||
$builddate=time();
|
||||
$builddate=time();
|
||||
//$exportlink=$langs->trans("NotYetAvailable");
|
||||
|
||||
$elementcust=$langs->trans("CustomersInvoices");
|
||||
$productcust=$langs->trans("Description");
|
||||
$amountcust=$langs->trans("AmountHT");
|
||||
if ($mysoc->tva_assuj) $vatcust.=' ('.$langs->trans("ToPay").')';
|
||||
$elementsup=$langs->trans("SuppliersInvoices");
|
||||
$productsup=$langs->trans("Description");
|
||||
$amountsup=$langs->trans("AmountHT");
|
||||
if ($mysoc->tva_assuj) $vatsup.=' ('.$langs->trans("ToGetBack").')';
|
||||
$elementcust=$langs->trans("CustomersInvoices");
|
||||
$productcust=$langs->trans("Description");
|
||||
$amountcust=$langs->trans("AmountHT");
|
||||
if ($mysoc->tva_assuj) $vatcust.=' ('.$langs->trans("ToPay").')';
|
||||
$elementsup=$langs->trans("SuppliersInvoices");
|
||||
$productsup=$langs->trans("Description");
|
||||
$amountsup=$langs->trans("AmountHT");
|
||||
if ($mysoc->tva_assuj) $vatsup.=' ('.$langs->trans("ToGetBack").')';
|
||||
}
|
||||
report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink);
|
||||
|
||||
@@ -169,54 +174,54 @@ print "</tr>\n";
|
||||
$coll_list = vat_by_thirdparty($db,0,$date_start,$date_end,$modetax,'sell');
|
||||
if (is_array($coll_list))
|
||||
{
|
||||
$var=true;
|
||||
$total = 0; $subtotal = 0;
|
||||
$i = 1;
|
||||
foreach($coll_list as $coll)
|
||||
{
|
||||
if($min == 0 or ($min>0 and $coll[2]>$min))
|
||||
{
|
||||
$var=!$var;
|
||||
$intra = str_replace($find,$replace,$coll[1]);
|
||||
if(empty($intra))
|
||||
{
|
||||
if($coll[4] == '1')
|
||||
{
|
||||
$intra = $langs->trans('Unknown');
|
||||
}
|
||||
else
|
||||
{
|
||||
$intra = $langs->trans('NotRegistered');
|
||||
}
|
||||
}
|
||||
print "<tr $bc[$var]>";
|
||||
print "<td nowrap>".$i."</td>";
|
||||
$company_static->id=$coll[5];
|
||||
$company_static->nom=$coll[0];
|
||||
print '<td nowrap>'.$company_static->getNomUrl(1).'</td>';
|
||||
$find = array(' ','.');
|
||||
$replace = array('','');
|
||||
print "<td nowrap>".$intra."</td>";
|
||||
print "<td nowrap align=\"right\">".price($coll[2])."</td>";
|
||||
print "<td nowrap align=\"right\">".price($coll[3])."</td>";
|
||||
$total = $total + $coll[3];
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
$var=true;
|
||||
$total = 0; $subtotal = 0;
|
||||
$i = 1;
|
||||
foreach($coll_list as $coll)
|
||||
{
|
||||
if($min == 0 or ($min > 0 && $coll->amount > $min))
|
||||
{
|
||||
$var=!$var;
|
||||
$intra = str_replace($find,$replace,$coll->tva_intra);
|
||||
if(empty($intra))
|
||||
{
|
||||
if($coll->assuj == '1')
|
||||
{
|
||||
$intra = $langs->trans('Unknown');
|
||||
}
|
||||
else
|
||||
{
|
||||
$intra = $langs->trans('NotRegistered');
|
||||
}
|
||||
}
|
||||
print "<tr $bc[$var]>";
|
||||
print "<td nowrap>".$i."</td>";
|
||||
$company_static->id=$coll->socid;
|
||||
$company_static->nom=$coll->nom;
|
||||
print '<td nowrap>'.$company_static->getNomUrl(1).'</td>';
|
||||
$find = array(' ','.');
|
||||
$replace = array('','');
|
||||
print "<td nowrap>".$intra."</td>";
|
||||
print "<td nowrap align=\"right\">".price($coll->amount)."</td>";
|
||||
print "<td nowrap align=\"right\">".price($coll->tva)."</td>";
|
||||
$total = $total + $coll->tva;
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
print '<tr class="liste_total"><td align="right" colspan="4">'.$langs->trans("Total").':</td><td nowrap align="right"><b>'.price($total).'</b></td>';
|
||||
print '</tr>';
|
||||
print '<tr class="liste_total"><td align="right" colspan="4">'.$langs->trans("Total").':</td><td nowrap align="right"><b>'.price($total).'</b></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
if ($coll_list == -1)
|
||||
print '<tr><td colspan="5">'.$langs->trans("ErrorNoAccountancyModuleLoaded").'</td></tr>';
|
||||
else if ($coll_list == -2)
|
||||
print '<tr><td colspan="5">'.$langs->trans("FeatureNotYetAvailable").'</td></tr>';
|
||||
else
|
||||
print '<tr><td colspan="5">'.$langs->trans("Error").'</td></tr>';
|
||||
$langs->load("errors");
|
||||
if ($coll_list == -1)
|
||||
print '<tr><td colspan="5">'.$langs->trans("ErrorNoAccountancyModuleLoaded").'</td></tr>';
|
||||
else if ($coll_list == -2)
|
||||
print '<tr><td colspan="5">'.$langs->trans("FeatureNotYetAvailable").'</td></tr>';
|
||||
else
|
||||
print '<tr><td colspan="5">'.$langs->trans("Error").'</td></tr>';
|
||||
}
|
||||
|
||||
//print '</table>';
|
||||
@@ -241,54 +246,54 @@ $company_static=new Societe($db);
|
||||
$coll_list = vat_by_thirdparty($db,0,$date_start,$date_end,$modetax,'buy');
|
||||
if (is_array($coll_list))
|
||||
{
|
||||
$var=true;
|
||||
$total = 0; $subtotal = 0;
|
||||
$i = 1;
|
||||
foreach($coll_list as $coll)
|
||||
{
|
||||
if($min == 0 or ($min>0 and $coll[2]>$min))
|
||||
{
|
||||
$var=!$var;
|
||||
$intra = str_replace($find,$replace,$coll[1]);
|
||||
if(empty($intra))
|
||||
{
|
||||
if($coll[4] == '1')
|
||||
{
|
||||
$intra = $langs->trans('Unknown');
|
||||
}
|
||||
else
|
||||
{
|
||||
$intra = $langs->trans('NotRegistered');
|
||||
}
|
||||
}
|
||||
print "<tr $bc[$var]>";
|
||||
print "<td nowrap>".$i."</td>";
|
||||
$company_static->id=$coll[5];
|
||||
$company_static->nom=$coll[0];
|
||||
print '<td nowrap>'.$company_static->getNomUrl(1).'</td>';
|
||||
$find = array(' ','.');
|
||||
$replace = array('','');
|
||||
print "<td nowrap>".$intra."</td>";
|
||||
print "<td nowrap align=\"right\">".price($coll[2])."</td>";
|
||||
print "<td nowrap align=\"right\">".price($coll[3])."</td>";
|
||||
$total = $total + $coll[3];
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
$var=true;
|
||||
$total = 0; $subtotal = 0;
|
||||
$i = 1;
|
||||
foreach($coll_list as $coll)
|
||||
{
|
||||
if($min == 0 or ($min > 0 && $coll->amount > $min))
|
||||
{
|
||||
$var=!$var;
|
||||
$intra = str_replace($find,$replace,$coll->tva_intra);
|
||||
if(empty($intra))
|
||||
{
|
||||
if($coll->assuj == '1')
|
||||
{
|
||||
$intra = $langs->trans('Unknown');
|
||||
}
|
||||
else
|
||||
{
|
||||
$intra = $langs->trans('NotRegistered');
|
||||
}
|
||||
}
|
||||
print "<tr $bc[$var]>";
|
||||
print "<td nowrap>".$i."</td>";
|
||||
$company_static->id=$coll->socid;
|
||||
$company_static->nom=$coll->nom;
|
||||
print '<td nowrap>'.$company_static->getNomUrl(1).'</td>';
|
||||
$find = array(' ','.');
|
||||
$replace = array('','');
|
||||
print "<td nowrap>".$intra."</td>";
|
||||
print "<td nowrap align=\"right\">".price($coll->amount)."</td>";
|
||||
print "<td nowrap align=\"right\">".price($coll->tva)."</td>";
|
||||
$total = $total + $coll->tva;
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
print '<tr class="liste_total"><td align="right" colspan="4">'.$langs->trans("Total").':</td><td nowrap align="right"><b>'.price($total).'</b></td>';
|
||||
print '</tr>';
|
||||
print '<tr class="liste_total"><td align="right" colspan="4">'.$langs->trans("Total").':</td><td nowrap align="right"><b>'.price($total).'</b></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
if ($coll_list == -1)
|
||||
print '<tr><td colspan="5">'.$langs->trans("ErrorNoAccountancyModuleLoaded").'</td></tr>';
|
||||
else if ($coll_list == -2)
|
||||
print '<tr><td colspan="5">'.$langs->trans("FeatureNotYetAvailable").'</td></tr>';
|
||||
else
|
||||
print '<tr><td colspan="5">'.$langs->trans("Error").'</td></tr>';
|
||||
$langs->load("errors");
|
||||
if ($coll_list == -1)
|
||||
print '<tr><td colspan="5">'.$langs->trans("ErrorNoAccountancyModuleLoaded").'</td></tr>';
|
||||
else if ($coll_list == -2)
|
||||
print '<tr><td colspan="5">'.$langs->trans("FeatureNotYetAvailable").'</td></tr>';
|
||||
else
|
||||
print '<tr><td colspan="5">'.$langs->trans("Error").'</td></tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
@@ -156,7 +156,7 @@ if ($modetax==0) // Invoice for goods, payment for services
|
||||
else { $nextquarter=1; $nextyear++; }
|
||||
//$periodlink=($prevyear?"<a href='".$_SERVER["PHP_SELF"]."?year=".$prevyear."&q=".$prevquarter."&modetax=".$modetax."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".$nextyear."&q=".$nextquarter."&modetax=".$modetax."'>".img_next()."</a>":"");
|
||||
$description=$langs->trans("RulesVATIn");
|
||||
if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='<br>'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite');
|
||||
//if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='<br>'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite');
|
||||
$description.=$fsearch;
|
||||
$description.='<br>('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')';
|
||||
$builddate=time();
|
||||
|
||||
1
htdocs/conf/.gitignore
vendored
Normal file
1
htdocs/conf/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/conf.php
|
||||
@@ -183,8 +183,7 @@ $dolibarr_main_authentication='dolibarr';
|
||||
|
||||
# dolibarr_main_demo
|
||||
# Login and pass to use in a demo mode
|
||||
# Default value: 0
|
||||
# Possible values: 0 or 1
|
||||
# Default value: ''
|
||||
# Examples:
|
||||
# $dolibarr_main_demo='autologin,autopass'
|
||||
|
||||
|
||||
@@ -107,16 +107,24 @@ class Contact extends CommonObject
|
||||
$this->name=trim($this->name);
|
||||
if (! $this->socid) $this->socid = 0;
|
||||
if (! $this->priv) $this->priv = 0;
|
||||
if (! $this->canvas) $this->canvas = 'default';
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."socpeople (datec, fk_soc, name, fk_user_creat, priv, canvas)";
|
||||
$sql.= " VALUES ('".$this->db->idate($now)."',";
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."socpeople (";
|
||||
$sql.= " datec";
|
||||
$sql.= ", fk_soc";
|
||||
$sql.= ", name";
|
||||
$sql.= ", fk_user_creat";
|
||||
$sql.= ", priv";
|
||||
$sql.= ", canvas";
|
||||
$sql.= ", entity";
|
||||
$sql.= ") VALUES (";
|
||||
$sql.= "'".$this->db->idate($now)."',";
|
||||
if ($this->socid > 0) $sql.= " ".$this->socid.",";
|
||||
else $sql.= "null,";
|
||||
$sql.= "'".addslashes($this->name)."',";
|
||||
$sql.= "'".$this->db->escape($this->name)."',";
|
||||
$sql.= " ".($user->id > 0 ? "'".$user->id."'":"null").",";
|
||||
$sql.= " ".$this->priv.",";
|
||||
$sql.= "'".$this->canvas."'";
|
||||
$sql.= " ".($this->canvas?"'".$this->canvas."'":"null").",";
|
||||
$sql.= " ".$conf->entity;
|
||||
$sql.= ")";
|
||||
|
||||
dol_syslog("Contact::create sql=".$sql);
|
||||
@@ -205,24 +213,24 @@ class Contact extends CommonObject
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."socpeople SET ";
|
||||
if ($this->socid > 0) $sql .= " fk_soc='".addslashes($this->socid)."',";
|
||||
if ($this->socid > 0) $sql .= " fk_soc='".$this->db->escape($this->socid)."',";
|
||||
if ($this->socid == -1) $sql .= " fk_soc=null,";
|
||||
$sql .= " civilite='".addslashes($this->civilite_id)."'";
|
||||
$sql .= ", name='".addslashes($this->name)."'";
|
||||
$sql .= ", firstname='".addslashes($this->firstname)."'";
|
||||
$sql .= ", address='".addslashes($this->address)."'";
|
||||
$sql .= ", cp='".addslashes($this->cp)."'";
|
||||
$sql .= ", ville='".addslashes($this->ville)."'";
|
||||
$sql .= " civilite='".$this->db->escape($this->civilite_id)."'";
|
||||
$sql .= ", name='".$this->db->escape($this->name)."'";
|
||||
$sql .= ", firstname='".$this->db->escape($this->firstname)."'";
|
||||
$sql .= ", address='".$this->db->escape($this->address)."'";
|
||||
$sql .= ", cp='".$this->db->escape($this->cp)."'";
|
||||
$sql .= ", ville='".$this->db->escape($this->ville)."'";
|
||||
$sql .= ", fk_pays=".($this->fk_pays>0?$this->fk_pays:'NULL');
|
||||
$sql .= ", fk_departement=".($this->fk_departement>0?$this->fk_departement:'NULL');
|
||||
$sql .= ", poste='".addslashes($this->poste)."'";
|
||||
$sql .= ", fax='".addslashes($this->fax)."'";
|
||||
$sql .= ", email='".addslashes($this->email)."'";
|
||||
$sql .= ", note='".addslashes($this->note)."'";
|
||||
$sql .= ", phone = '".addslashes($this->phone_pro)."'";
|
||||
$sql .= ", phone_perso = '".addslashes($this->phone_perso)."'";
|
||||
$sql .= ", phone_mobile = '".addslashes($this->phone_mobile)."'";
|
||||
$sql .= ", jabberid = '".addslashes($this->jabberid)."'";
|
||||
$sql .= ", poste='".$this->db->escape($this->poste)."'";
|
||||
$sql .= ", fax='".$this->db->escape($this->fax)."'";
|
||||
$sql .= ", email='".$this->db->escape($this->email)."'";
|
||||
$sql .= ", note='".$this->db->escape($this->note)."'";
|
||||
$sql .= ", phone = '".$this->db->escape($this->phone_pro)."'";
|
||||
$sql .= ", phone_perso = '".$this->db->escape($this->phone_perso)."'";
|
||||
$sql .= ", phone_mobile = '".$this->db->escape($this->phone_mobile)."'";
|
||||
$sql .= ", jabberid = '".$this->db->escape($this->jabberid)."'";
|
||||
$sql .= ", priv = '".$this->priv."'";
|
||||
$sql .= ", fk_user_modif=".($user->id > 0 ? "'".$user->id."'":"null");
|
||||
$sql .= ", default_lang=".($this->default_lang?"'".$this->default_lang."'":"null");
|
||||
@@ -453,50 +461,53 @@ class Contact extends CommonObject
|
||||
{
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
||||
$this->id = $obj->rowid;
|
||||
$this->ref = $obj->rowid;
|
||||
$this->civilite_id = $obj->civilite_id;
|
||||
$this->name = $obj->name;
|
||||
$this->firstname = $obj->firstname;
|
||||
$this->nom = $obj->name;
|
||||
$this->prenom = $obj->firstname;
|
||||
$this->id = $obj->rowid;
|
||||
$this->ref = $obj->rowid;
|
||||
$this->civilite_id = $obj->civilite_id;
|
||||
$this->name = $obj->name;
|
||||
$this->firstname = $obj->firstname;
|
||||
$this->nom = $obj->name; // TODO deprecated
|
||||
$this->prenom = $obj->firstname; // TODO deprecated
|
||||
|
||||
$this->address = $obj->address;
|
||||
$this->adresse = $obj->address; // TODO obsolete
|
||||
$this->cp = $obj->cp;
|
||||
$this->ville = $obj->ville;
|
||||
$this->address = $obj->address;
|
||||
$this->adresse = $obj->address; // TODO deprecated
|
||||
$this->cp = $obj->cp; // TODO deprecated
|
||||
$this->zip = $obj->cp;
|
||||
$this->ville = $obj->ville; // TODO deprecated
|
||||
$this->town = $obj->ville;
|
||||
|
||||
$this->fk_departement = $obj->fk_departement;
|
||||
$this->fk_departement = $obj->fk_departement;
|
||||
$this->departement_code = $obj->departement_code;
|
||||
$this->departement = $obj->departement;
|
||||
$this->departement = $obj->departement; // TODO deprecated
|
||||
$this->state = $obj->departement;
|
||||
|
||||
$this->fk_pays = $obj->fk_pays;
|
||||
$this->pays_code = $obj->fk_pays?$obj->pays_code:'';
|
||||
$this->pays = ($obj->fk_pays > 0)?$langs->transnoentities("Country".$obj->pays_code):$langs->transnoentities("SelectCountry");
|
||||
$this->fk_pays = $obj->fk_pays;
|
||||
$this->pays_code = $obj->fk_pays?$obj->pays_code:'';
|
||||
$this->pays = ($obj->fk_pays > 0)?$langs->transnoentities("Country".$obj->pays_code):$langs->transnoentities("SelectCountry");
|
||||
|
||||
$this->societeid = $obj->fk_soc;
|
||||
$this->socid = $obj->fk_soc;
|
||||
$this->socname = $obj->socname;
|
||||
$this->poste = $obj->poste;
|
||||
$this->societeid = $obj->fk_soc;
|
||||
$this->socid = $obj->fk_soc;
|
||||
$this->socname = $obj->socname;
|
||||
$this->poste = $obj->poste;
|
||||
|
||||
$this->phone_pro = trim($obj->phone);
|
||||
$this->fax = trim($obj->fax);
|
||||
$this->phone_perso = trim($obj->phone_perso);
|
||||
$this->phone_mobile = trim($obj->phone_mobile);
|
||||
$this->phone_pro = trim($obj->phone);
|
||||
$this->fax = trim($obj->fax);
|
||||
$this->phone_perso = trim($obj->phone_perso);
|
||||
$this->phone_mobile = trim($obj->phone_mobile);
|
||||
|
||||
$this->email = $obj->email;
|
||||
$this->jabberid = $obj->jabberid;
|
||||
$this->priv = $obj->priv;
|
||||
$this->mail = $obj->email;
|
||||
$this->email = $obj->email;
|
||||
$this->jabberid = $obj->jabberid;
|
||||
$this->priv = $obj->priv;
|
||||
$this->mail = $obj->email;
|
||||
|
||||
$this->birthday = dol_stringtotime($obj->birthday);
|
||||
$this->birthday = dol_stringtotime($obj->birthday);
|
||||
//print "fetch: ".$obj->birthday.'-'.$this->birthday;
|
||||
$this->birthday_alert = $obj->birthday_alert;
|
||||
$this->note = $obj->note;
|
||||
$this->default_lang = $obj->default_lang;
|
||||
$this->user_id = $obj->user_id;
|
||||
$this->user_login = $obj->user_login;
|
||||
$this->canvas = $obj->canvas;
|
||||
$this->birthday_alert = $obj->birthday_alert;
|
||||
$this->note = $obj->note;
|
||||
$this->default_lang = $obj->default_lang;
|
||||
$this->user_id = $obj->user_id;
|
||||
$this->user_login = $obj->user_login;
|
||||
$this->canvas = $obj->canvas;
|
||||
|
||||
// Recherche le user Dolibarr lie a ce contact
|
||||
$sql = "SELECT u.rowid ";
|
||||
@@ -753,7 +764,7 @@ class Contact extends CommonObject
|
||||
{
|
||||
$sql = "SELECT count(mc.email) as nb";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."mailing_cibles as mc";
|
||||
$sql.= " WHERE mc.email = '".addslashes($this->email)."'";
|
||||
$sql.= " WHERE mc.email = '".$this->db->escape($this->email)."'";
|
||||
$sql.= " AND mc.statut=1"; // -1 erreur, 0 non envoye, 1 envoye avec succes
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
@@ -801,8 +812,8 @@ class Contact extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* \brief Retourne le libelle de civilite du contact
|
||||
* \return string Nom traduit de la civilite
|
||||
* Return label of a civility contact
|
||||
* @return string Translated name of civility
|
||||
*/
|
||||
function getCivilityLabel()
|
||||
{
|
||||
|
||||
@@ -40,7 +40,7 @@ $result = restrictedArea($user, 'contact', $contactid, 'socpeople');
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader('',$langs->trans("Contact"),'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas');
|
||||
llxHeader('',$langs->trans("ContactsAddresses"),'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas');
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
@@ -50,7 +50,7 @@ $contact->fetch($_GET["id"], $user);
|
||||
|
||||
$head = contact_prepare_head($contact);
|
||||
|
||||
dol_fiche_head($head, 'exportimport', $langs->trans("Contact"), 0, 'contact');
|
||||
dol_fiche_head($head, 'exportimport', $langs->trans("ContactsAddresses"), 0, 'contact');
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -37,6 +37,7 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/html.formcompany.class.php");
|
||||
$langs->load("companies");
|
||||
$langs->load("users");
|
||||
$langs->load("other");
|
||||
$langs->load("commercial");
|
||||
|
||||
$errors = array();
|
||||
$socid = GETPOST("socid");
|
||||
@@ -247,7 +248,7 @@ else
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader('',$langs->trans("Contacts"),'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas');
|
||||
llxHeader('',$langs->trans("ContactsAddresses"),'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas');
|
||||
|
||||
$form = new Form($db);
|
||||
$formcompany = new FormCompany($db);
|
||||
@@ -340,7 +341,7 @@ if (! empty($canvas))
|
||||
// display_canvas. All output should be processed by template so
|
||||
// showHead and dol_htmloutput_errors should be moved into
|
||||
// display_canvas.
|
||||
|
||||
|
||||
// Card header
|
||||
$objcanvas->showHead();
|
||||
|
||||
@@ -399,7 +400,7 @@ else
|
||||
*/
|
||||
$head = contact_prepare_head($object);
|
||||
|
||||
dol_fiche_head($head, 'card', $langs->trans("Contact"), 0, 'contact');
|
||||
dol_fiche_head($head, 'card', $langs->trans("ContactsAddresses"), 0, 'contact');
|
||||
}
|
||||
|
||||
if ($user->rights->societe->contact->creer)
|
||||
|
||||
@@ -100,7 +100,7 @@ if ($search_priv < 0) $search_priv='';
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader('',$langs->trans("Contacts"),'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas');
|
||||
llxHeader('',$langs->trans("ContactsAddresses"),'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas');
|
||||
|
||||
$form=new Form($db);
|
||||
|
||||
@@ -136,19 +136,19 @@ else
|
||||
|
||||
if ($search_nom) // filtre sur le nom
|
||||
{
|
||||
$sql .= " AND p.name like '%".addslashes($search_nom)."%'";
|
||||
$sql .= " AND p.name like '%".$db->escape($search_nom)."%'";
|
||||
}
|
||||
if ($search_prenom) // filtre sur le prenom
|
||||
{
|
||||
$sql .= " AND p.firstname like '%".addslashes($search_prenom)."%'";
|
||||
$sql .= " AND p.firstname like '%".$db->escape($search_prenom)."%'";
|
||||
}
|
||||
if ($search_societe) // filtre sur la societe
|
||||
{
|
||||
$sql .= " AND s.nom like '%".addslashes($search_societe)."%'";
|
||||
$sql .= " AND s.nom like '%".$db->escape($search_societe)."%'";
|
||||
}
|
||||
if ($search_email) // filtre sur l'email
|
||||
{
|
||||
$sql .= " AND p.email like '%".addslashes($search_email)."%'";
|
||||
$sql .= " AND p.email like '%".$db->escape($search_email)."%'";
|
||||
}
|
||||
if ($type == "o") // filtre sur type
|
||||
{
|
||||
@@ -168,7 +168,7 @@ if ($type == "p") // filtre sur type
|
||||
}
|
||||
if ($sall)
|
||||
{
|
||||
$sql .= " AND (p.name like '%".addslashes($sall)."%' OR p.firstname like '%".addslashes($sall)."%' OR p.email like '%".addslashes($sall)."%') ";
|
||||
$sql .= " AND (p.name like '%".$db->escape($sall)."%' OR p.firstname like '%".$db->escape($sall)."%' OR p.email like '%".$db->escape($sall)."%') ";
|
||||
}
|
||||
if ($socid)
|
||||
{
|
||||
@@ -337,8 +337,10 @@ if ($result)
|
||||
// Private/Public
|
||||
print '<td align="center">'.$contactstatic->LibPubPriv($obj->priv).'</td>';
|
||||
|
||||
// Link export vcard
|
||||
// Links Add action and Export vcard
|
||||
print '<td align="right">';
|
||||
print '<a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&backtopage=1&contactid='.$obj->cidp.'&socid='.$obj->socid.'">'.img_object($langs->trans("AddAction"),"calendar").'</a>';
|
||||
print ' ';
|
||||
print '<a href="'.DOL_URL_ROOT.'/contact/vcard.php?id='.$obj->cidp.'">';
|
||||
print img_picto($langs->trans("VCard"),'vcard.png').' ';
|
||||
print '</a></td>';
|
||||
|
||||
@@ -42,7 +42,7 @@ $result = restrictedArea($user, 'contact',$contactid,'socpeople');
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader('',$langs->trans("Contacts"),'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas');
|
||||
llxHeader('',$langs->trans("ContactsAddresses"),'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas');
|
||||
|
||||
|
||||
$contact = new Contact($db);
|
||||
@@ -51,7 +51,7 @@ $contact->fetch($_GET["id"], $user);
|
||||
|
||||
$head = contact_prepare_head($contact);
|
||||
|
||||
dol_fiche_head($head, 'info', $langs->trans("Contact"), 0, 'contact');
|
||||
dol_fiche_head($head, 'info', $langs->trans("ContactsAddresses"), 0, 'contact');
|
||||
|
||||
|
||||
print '<table width="100%"><tr><td>';
|
||||
|
||||
@@ -79,13 +79,13 @@ if ($_GET["action"] == 'dolibarr2ldap')
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader('',$langs->trans("Contacts"),'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas');
|
||||
llxHeader('',$langs->trans("ContactsAddresses"),'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas');
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
$head = contact_prepare_head($contact);
|
||||
|
||||
dol_fiche_head($head, 'ldap', $langs->trans("Contact"), 0, 'contact');
|
||||
dol_fiche_head($head, 'ldap', $langs->trans("ContactsAddresses"), 0, 'contact');
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
@@ -71,7 +71,7 @@ if ($user->rights->societe->contact->creer)
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader('',$langs->trans("Contacts"),'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas');
|
||||
llxHeader('',$langs->trans("ContactsAddresses"),'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas');
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
@@ -80,7 +80,7 @@ $contact->fetch($_GET["id"], $user);
|
||||
|
||||
$head = contact_prepare_head($contact);
|
||||
|
||||
dol_fiche_head($head, 'perso', $langs->trans("Contact"), 0, 'contact');
|
||||
dol_fiche_head($head, 'perso', $langs->trans("ContactsAddresses"), 0, 'contact');
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -351,6 +351,8 @@ class Contrat extends CommonObject
|
||||
|
||||
$now=dol_now();
|
||||
|
||||
$this->lines=array();
|
||||
|
||||
// Selectionne les lignes contrats liees a un produit
|
||||
$sql = "SELECT p.label, p.description as product_desc, p.ref,";
|
||||
$sql.= " d.rowid, d.fk_contrat, d.statut, d.description, d.price_ht, d.tva_tx, d.localtax1_tx, d.localtax2_tx, d.qty, d.remise_percent, d.subprice,";
|
||||
@@ -422,9 +424,9 @@ class Contrat extends CommonObject
|
||||
$line->date_debut_reel = $this->db->jdate($objp->date_ouverture);
|
||||
$line->date_fin_prevue = $this->db->jdate($objp->date_fin_validite);
|
||||
$line->date_fin_reel = $this->db->jdate($objp->date_cloture);
|
||||
|
||||
|
||||
$this->lines[] = $line;
|
||||
|
||||
|
||||
//dol_syslog("1 ".$line->desc);
|
||||
//dol_syslog("2 ".$line->product_desc);
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user