mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-10 01:42:33 +01:00
Compare commits
377 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f32bc24285 | ||
|
|
e8400afeba | ||
|
|
c24659b3a5 | ||
|
|
dc5ad1a0f3 | ||
|
|
f4428c8a8a | ||
|
|
1561062285 | ||
|
|
469e700895 | ||
|
|
2af8f295b1 | ||
|
|
187feff7d5 | ||
|
|
ad49f965d5 | ||
|
|
d6d7665e65 | ||
|
|
9518cb7836 | ||
|
|
ee1e266774 | ||
|
|
76d9ba6a43 | ||
|
|
676191c1f9 | ||
|
|
c92471d40b | ||
|
|
fb0a99cb55 | ||
|
|
49dcc32374 | ||
|
|
e13974b5f3 | ||
|
|
2c71c898eb | ||
|
|
a4841dacda | ||
|
|
94d1f23721 | ||
|
|
880a27f827 | ||
|
|
4f0758f9b1 | ||
|
|
c8c9ea797d | ||
|
|
cf1d269f15 | ||
|
|
8ae0939ae5 | ||
|
|
694eef9386 | ||
|
|
f6057bd794 | ||
|
|
7ecafc2e54 | ||
|
|
8b2dc49734 | ||
|
|
7ab46b8e7b | ||
|
|
6d2db1c09f | ||
|
|
b4ae479a69 | ||
|
|
2e8d2b884f | ||
|
|
c66304e217 | ||
|
|
f543f00024 | ||
|
|
56556ba222 | ||
|
|
b8c51e3760 | ||
|
|
389d64c25b | ||
|
|
5b02a3a67c | ||
|
|
5de7f77a09 | ||
|
|
b89b7405f8 | ||
|
|
b96bff4770 | ||
|
|
ee84457104 | ||
|
|
7856b7f613 | ||
|
|
469ae91e70 | ||
|
|
d5d4bc33ba | ||
|
|
1109527528 | ||
|
|
992600664e | ||
|
|
b36a16ed43 | ||
|
|
f08ce6d96a | ||
|
|
416cdd2f9c | ||
|
|
f8ca842685 | ||
|
|
fea0e6de54 | ||
|
|
347fc6d714 | ||
|
|
e2f2ad30ae | ||
|
|
2879a09a03 | ||
|
|
7efe39495a | ||
|
|
e3615d43bd | ||
|
|
047aa8ea29 | ||
|
|
5fe70e0bee | ||
|
|
8a90598b23 | ||
|
|
e4dda125d8 | ||
|
|
526a80dd20 | ||
|
|
cb3b0996ce | ||
|
|
9992fc803d | ||
|
|
9427e32e2e | ||
|
|
661071286e | ||
|
|
3aa049b661 | ||
|
|
934657cc2f | ||
|
|
0bb9ee158a | ||
|
|
8bd7c6a763 | ||
|
|
bdb81803bd | ||
|
|
95e4474906 | ||
|
|
1c9caeb0d3 | ||
|
|
c8ef07a889 | ||
|
|
723bd6f750 | ||
|
|
a35a44b23e | ||
|
|
7428c11489 | ||
|
|
c65620ab62 | ||
|
|
f8f4fd3a6f | ||
|
|
4687350337 | ||
|
|
3a531f048a | ||
|
|
36479db0fd | ||
|
|
7e47b37ade | ||
|
|
97478ccbf2 | ||
|
|
95f63a8171 | ||
|
|
a9e63610ae | ||
|
|
f3480bf502 | ||
|
|
7f27801c3c | ||
|
|
8d844a1094 | ||
|
|
7d71be2227 | ||
|
|
c84427bd22 | ||
|
|
3933fb318c | ||
|
|
e9f02ebacf | ||
|
|
440912a4d3 | ||
|
|
ac6e56f058 | ||
|
|
f8b133dad4 | ||
|
|
59f218ab42 | ||
|
|
114ace6499 | ||
|
|
74abde0233 | ||
|
|
4a9ed428f0 | ||
|
|
947bda1af8 | ||
|
|
4274a1aa21 | ||
|
|
fd85755461 | ||
|
|
00adb1b9ab | ||
|
|
63c474e2cc | ||
|
|
c4a064d104 | ||
|
|
1d52d50ac1 | ||
|
|
0661f9f1f8 | ||
|
|
647956576d | ||
|
|
89eec9bfbd | ||
|
|
54fc731df7 | ||
|
|
de1f53db45 | ||
|
|
f8e0f40ffa | ||
|
|
ab668f0f07 | ||
|
|
0672d10a3f | ||
|
|
bd2b363e40 | ||
|
|
8e7b72d09e | ||
|
|
7a115a9216 | ||
|
|
ecaea4c575 | ||
|
|
1065645fb6 | ||
|
|
24309a7f17 | ||
|
|
3203283fe9 | ||
|
|
b1cf0b9a76 | ||
|
|
44a1120c06 | ||
|
|
652e0c1b5f | ||
|
|
c0a3271d76 | ||
|
|
c969d17e48 | ||
|
|
36e6269b24 | ||
|
|
b67faf1eb1 | ||
|
|
4ff5922a55 | ||
|
|
9e1487fc61 | ||
|
|
016b4a2baa | ||
|
|
ed5a00a79d | ||
|
|
d162a61d41 | ||
|
|
2f72bbca5a | ||
|
|
733ff62ec8 | ||
|
|
bc7015a431 | ||
|
|
521929b740 | ||
|
|
4badcf5a75 | ||
|
|
cd7f94d515 | ||
|
|
b2129a519d | ||
|
|
436b6259c0 | ||
|
|
026195689b | ||
|
|
08808c58cd | ||
|
|
fb1c306b31 | ||
|
|
57637d3a07 | ||
|
|
23a7aae084 | ||
|
|
52a1e81147 | ||
|
|
ba0e9c0c19 | ||
|
|
365a5e18e8 | ||
|
|
57ab4fb798 | ||
|
|
624a039eaf | ||
|
|
8f502b8cfc | ||
|
|
dbc2eddcba | ||
|
|
3f1f065d4e | ||
|
|
ff3b2933a8 | ||
|
|
c8b2ce3d8e | ||
|
|
83e873dd24 | ||
|
|
f8ddd69ccb | ||
|
|
7217d91f13 | ||
|
|
ccf809b14a | ||
|
|
5ccb4108d4 | ||
|
|
7883e4f0eb | ||
|
|
63a5aee80e | ||
|
|
88fe3e86f2 | ||
|
|
b9dab6d059 | ||
|
|
6adaf2fa8f | ||
|
|
6b8c4fc3f2 | ||
|
|
4202c8fc91 | ||
|
|
880659af3a | ||
|
|
fa69f693db | ||
|
|
6a9ebcac7b | ||
|
|
95ca8db9eb | ||
|
|
d90a0acbec | ||
|
|
40a9ab9772 | ||
|
|
458b1cdf60 | ||
|
|
de2a5a8872 | ||
|
|
8030b39536 | ||
|
|
becd40a825 | ||
|
|
a3c5bef381 | ||
|
|
50ec96d368 | ||
|
|
17d5ab9774 | ||
|
|
df0b0ebf51 | ||
|
|
3e9a8677c6 | ||
|
|
52a0df3424 | ||
|
|
21a1441a80 | ||
|
|
5c50b1db57 | ||
|
|
03e57c229a | ||
|
|
e7cec6d410 | ||
|
|
e2156b5df7 | ||
|
|
3a474a22ca | ||
|
|
a5deb8e9d7 | ||
|
|
90a2a86dbb | ||
|
|
1602fcf7bc | ||
|
|
7d6c89169c | ||
|
|
7177e59ea4 | ||
|
|
21056d2b78 | ||
|
|
76132206bf | ||
|
|
67b803243f | ||
|
|
6d896a8558 | ||
|
|
deaa63960e | ||
|
|
e27e5e9c44 | ||
|
|
e934614fce | ||
|
|
cb8cbecbde | ||
|
|
0e34df43b1 | ||
|
|
b6ce386513 | ||
|
|
90b9e7c136 | ||
|
|
6b031616fa | ||
|
|
6ebeb53a2c | ||
|
|
486425d258 | ||
|
|
7e48e341ad | ||
|
|
8d4da9df1e | ||
|
|
7c4b901b0a | ||
|
|
418921f360 | ||
|
|
a6ed2551fb | ||
|
|
580881c205 | ||
|
|
85866ff9a6 | ||
|
|
404ad18425 | ||
|
|
b3a035951f | ||
|
|
3ed4d7bfbf | ||
|
|
d6b42ac879 | ||
|
|
1409b2b81a | ||
|
|
ac0cd975cd | ||
|
|
b6f765ef3c | ||
|
|
9596134e47 | ||
|
|
85e09a953f | ||
|
|
4910871180 | ||
|
|
9ec74194a0 | ||
|
|
662d9cfa6e | ||
|
|
76c180aaaf | ||
|
|
d570aa02d4 | ||
|
|
3bcd506e73 | ||
|
|
43d4bb6155 | ||
|
|
72f0ca194c | ||
|
|
c4d0c4c3e5 | ||
|
|
5d94b0c576 | ||
|
|
19e902ef8f | ||
|
|
b80d4874e3 | ||
|
|
057365b69e | ||
|
|
eb78de1981 | ||
|
|
38e30836a5 | ||
|
|
8118332dfb | ||
|
|
f17ba4814e | ||
|
|
98aaec18a7 | ||
|
|
f3bbfe375c | ||
|
|
4ce7a70411 | ||
|
|
19c8336e6e | ||
|
|
303cf3bc41 | ||
|
|
6013916d45 | ||
|
|
b678183ff2 | ||
|
|
29124649bd | ||
|
|
8f67606685 | ||
|
|
35279f6520 | ||
|
|
515c5e58ca | ||
|
|
64a9689473 | ||
|
|
4ceeea4a1c | ||
|
|
56f48245f1 | ||
|
|
6252857440 | ||
|
|
c10f2dd327 | ||
|
|
bbb0854517 | ||
|
|
5736cf0144 | ||
|
|
09d1e56ca5 | ||
|
|
81b34f9918 | ||
|
|
ef5c03fc99 | ||
|
|
992ec308d2 | ||
|
|
61b28274f7 | ||
|
|
5af232d936 | ||
|
|
be01297403 | ||
|
|
9572eebae0 | ||
|
|
e0baa0fe46 | ||
|
|
1e3b26a104 | ||
|
|
888da9f3e9 | ||
|
|
3c3c0b456e | ||
|
|
e0bf4faa4c | ||
|
|
0108ee2bd8 | ||
|
|
c36f52c47a | ||
|
|
a701cbd77c | ||
|
|
4fe94b800b | ||
|
|
dff74667c2 | ||
|
|
33a82c396e | ||
|
|
7f4fd06f19 | ||
|
|
c7666cbc3d | ||
|
|
f4996b4054 | ||
|
|
e2f28b6c51 | ||
|
|
8a6adb8a49 | ||
|
|
f8291a9efe | ||
|
|
e59084cafc | ||
|
|
d2d0f83fa0 | ||
|
|
54f963f8ae | ||
|
|
013b7eca10 | ||
|
|
d590aa56eb | ||
|
|
1a62cdfbe8 | ||
|
|
c0e5cacafc | ||
|
|
ed85869394 | ||
|
|
a5181a06e4 | ||
|
|
36e99e100b | ||
|
|
63e3b5742c | ||
|
|
1ac78d0e83 | ||
|
|
95c9d19d5e | ||
|
|
010207532f | ||
|
|
72effa3f25 | ||
|
|
d6c18c1789 | ||
|
|
55856bdc36 | ||
|
|
6fc57fb90d | ||
|
|
96013ba9a6 | ||
|
|
82297f52c9 | ||
|
|
2d09eb6f8c | ||
|
|
5ed94ae9be | ||
|
|
d4621c3921 | ||
|
|
c83691e35a | ||
|
|
bb2776f4cc | ||
|
|
9c1f70996a | ||
|
|
b88d261c90 | ||
|
|
5c4b537a65 | ||
|
|
fe072d992c | ||
|
|
dd248e9d58 | ||
|
|
979a36e941 | ||
|
|
06e931632d | ||
|
|
710ea872a9 | ||
|
|
633a15f10d | ||
|
|
f620e6948f | ||
|
|
a6ce7bb428 | ||
|
|
44698fcde0 | ||
|
|
63e1b724cb | ||
|
|
e97ca67c4a | ||
|
|
668249a195 | ||
|
|
a0803e758e | ||
|
|
a3244a4b47 | ||
|
|
25fa2254c1 | ||
|
|
9d047d740b | ||
|
|
1f0dbc698c | ||
|
|
617a71478b | ||
|
|
d5822b7fbd | ||
|
|
ae2355fda5 | ||
|
|
555b3a1199 | ||
|
|
f86cad0580 | ||
|
|
c0d2ee19f5 | ||
|
|
f793ed83f6 | ||
|
|
ae1e0dff87 | ||
|
|
931b556b69 | ||
|
|
b0212fc8e6 | ||
|
|
924d01249c | ||
|
|
0f576181be | ||
|
|
81a06507fa | ||
|
|
b16b8f9ff3 | ||
|
|
b2763bab15 | ||
|
|
0cb5b3f50c | ||
|
|
ac1ff205a4 | ||
|
|
e98b2e2ee1 | ||
|
|
9106a74426 | ||
|
|
0d0c1e8c14 | ||
|
|
7952a1f1a5 | ||
|
|
dcf76d7bcb | ||
|
|
16ad99f8c5 | ||
|
|
d9b7886ef9 | ||
|
|
d190e924b3 | ||
|
|
8b244b0d61 | ||
|
|
47c89dfd8e | ||
|
|
f2371be191 | ||
|
|
283aeb2945 | ||
|
|
18aff92366 | ||
|
|
c4948ea3db | ||
|
|
af6bb94ff3 | ||
|
|
44b5b98308 | ||
|
|
ae154ed9a3 | ||
|
|
b5d2a378fa | ||
|
|
6b50ddf6ec | ||
|
|
dd7411593e | ||
|
|
3b45cffafa | ||
|
|
20522148f2 | ||
|
|
aa473fa3e3 | ||
|
|
fbff66a907 | ||
|
|
723c46ec42 | ||
|
|
3687b29a7b |
47
ChangeLog
47
ChangeLog
@@ -2,6 +2,53 @@
|
||||
English Dolibarr ChangeLog
|
||||
--------------------------------------------------------------
|
||||
|
||||
***** ChangeLog for 3.3.3 compared to 3.3.2 *****
|
||||
|
||||
- Fix: [ bug #903 ] Fatal error: Call to undefined function dol_get_first_day() in htdocs/commande/liste.php
|
||||
- Fix: [ bug #934 ] Error on proformat invoice creation (pgsql)
|
||||
- Fix: [ bug #947 ] Can't create proposal lines with unit price = 0
|
||||
|
||||
***** ChangeLog for 3.3.2 compared to 3.3.1 *****
|
||||
|
||||
- Fix: Dutch (nl_NL) translation
|
||||
- Generalize fix: file with a specific mask not found, again
|
||||
- Fix: translations and BILL_SUPPLIER_BUILDDOC trigger
|
||||
- Fix: Can't reset payment due date
|
||||
- Fix: Orderstoinvoice didn't act as expected when no order was checked
|
||||
- Fix: Bad link to all proposals into Third party card if customer is prospect
|
||||
- Fix: Some bugs on withdrawal rejects
|
||||
- Fix: [ bug #774 ] Bug on creating event with box "all day" crossed
|
||||
- Fix: [ bug #787 ] Invoice supplier box incorrect tooltip when delay on payment
|
||||
- Fix: [ bug #789 ] VAT not being calculated in POS
|
||||
- Fix: [ bug #790 ] Spanish localtax RE not being correctly calculated
|
||||
- Fix: [ bug #794 ] Lost filter on zipcode in prospect list
|
||||
- Fix: [ bug #806 ] Margins module with orders2invoice does not respect cost price
|
||||
- Fix: [ bug #810 ] Cannot update ODT template path
|
||||
- Fix: [ bug #816 ] Sales journal does not reflect localtaxes
|
||||
- Fix: [ bug #817 ] Purchases journal does not reflect localtaxes
|
||||
- Fix: [ bug #824 ] MAIN_DB_PREFIX not use into dictionnary
|
||||
- Fix: [ bug #828 ] Error when code_region is not a number in llx_c_regions (with postgres)
|
||||
- Fix: [ bug #855 ] Holiday approval email in French
|
||||
- Fix: [ bug #856 ] (Holidays module) Mail error if destination user doesn't have an email
|
||||
- Fix: [ bug #857 ] Invoice created from shipment does not have the order discount
|
||||
- Fix: [ bug #861 ] Impossible to create a new event in agenda
|
||||
- Fix: [ bug #827 ] AJAX search does not respect multiprice level
|
||||
- Fix: [ bug #865 ] Dolibarr navigation array in project/task do not work
|
||||
- Fix: [ bug #866 ] Standing order from an invoice suggests invoice total amount instead of remaining to pay
|
||||
- Fix: [ bug #788 ] Date of linked interventions are not shown
|
||||
- Fix: external users should not see costprice and margin infos
|
||||
- Fix: [ bug #806 ] Tasks are ordered alphabetically instead of chronological order
|
||||
|
||||
***** ChangeLog for 3.3.1 compared to 3.3 *****
|
||||
|
||||
- Fix: [ bug #733 ] Mass emailing tools do not support <style HTML tag
|
||||
- Fix: Package for launchpad
|
||||
- Fix: [ bug #736 ] Missing column in llx_c_chargesociales
|
||||
- Fix: Localtax2 for Spain must be based into buyer
|
||||
- Fix: [ bug #762 ] Bad profit calculation in Reporting
|
||||
- Fix: bug dictionnary with wrong prefix table
|
||||
|
||||
|
||||
|
||||
***** ChangeLog for 3.3 compared to 3.2.3 *****
|
||||
For users:
|
||||
|
||||
2
README
2
README
@@ -108,7 +108,7 @@ Other modules:
|
||||
- RSS
|
||||
|
||||
Miscellanous:
|
||||
- Mutli-user, with several permissions levels for each feature.
|
||||
- Multi-user, with several permissions levels for each feature.
|
||||
- Serveral menu managers (can be used by internal users, as a back-office,
|
||||
with a particular menu, or by external users, as a front-office, with
|
||||
another menu and permissions).
|
||||
|
||||
@@ -122,7 +122,7 @@ V - CE QUE DOLIBARR NE PEUT PAS FAIRE (TACHES A FAIRE)
|
||||
Voici un liste de fonctionnalites pas encore gérées par Dolibarr:
|
||||
- Pas de compta analytique (uniquement gestion de trésorerie).
|
||||
- Dolibarr ne gère qu'une seule monnaie à la fois (mono-devise).
|
||||
- Dolibarr ne gère en standard qu'une société/institution/association (mono-société). Pour en gérer plusieurs (comme vos filiales), il faut, soit faire plusieurs installations de Dolibarr, soit installer le module MutliCompany qui permet de gérer n société/institutions/associations dans une seule instance par une isolation logique des données.
|
||||
- Dolibarr ne gère en standard qu'une société/institution/association (mono-société). Pour en gérer plusieurs (comme vos filiales), il faut, soit faire plusieurs installations de Dolibarr, soit installer le module MultiCompany qui permet de gérer n société/institutions/associations dans une seule instance par une isolation logique des données.
|
||||
- Ne gère pas la double tva (Fédérale / provinciale) du canada.
|
||||
- Dolibarr ne contient pas de module de Gestion de la paie.
|
||||
- Les taches du module de gestion de projets n'ont pas de dépendance entre elle.
|
||||
|
||||
@@ -105,7 +105,7 @@ See ChangeLog file found into package.
|
||||
|
||||
### Miscellanous:
|
||||
|
||||
- Mutli-user, with several permissions levels for each feature.
|
||||
- Multi-user, with several permissions levels for each feature.
|
||||
- Serveral menu managers (can be used by internal users, as a back-office, with a particular menu, or by external users, as a front-office, with another menu and permissions).
|
||||
- Very user friendly and easy to use.
|
||||
- Optional WYSIWYG forms, optional Ajax forms.
|
||||
|
||||
@@ -13,7 +13,7 @@ with format .DEB (for Debian, Ubuntu, ...).
|
||||
|
||||
# This is standard command to work on Debian packaging:
|
||||
#
|
||||
# gpg --gen-key Generate a GPG key
|
||||
# gpg --gen-key Generate a GPG key (-> pubring.gpg + secring.gpg)
|
||||
#
|
||||
# debconf-updatepo To run into po dir to regenate templates.pot
|
||||
# podebconf-report-po --from email@email.com To send email to ask translations
|
||||
@@ -43,10 +43,11 @@ To submit a package to Debian:
|
||||
See page http://www.debian.org/devel/wnpp/#l1 for example of ITP requests contents.
|
||||
|
||||
- Wait until you received bug number.
|
||||
For first ITP submission of Dolibarr, bug id was 634783.
|
||||
For first ITP submission of Dolibarr, bug id was 634783.
|
||||
|
||||
- Check bug is into database by searching with id on http://www.debian.org/Bugs/
|
||||
|
||||
- Check bug is into database by searching with id on
|
||||
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=634783
|
||||
|
||||
- Add a line for upstream into file changelog with bug number
|
||||
|
||||
- Call for a mentor on ML debian-mentors to upload packages
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
dolibarr (3.3.0+nmu1) unstable; urgency=low
|
||||
dolibarr (3.3.3+nmu1) unstable; urgency=low
|
||||
|
||||
* Non-maintainer upload.
|
||||
* New upstream release.
|
||||
closes: bug#634783
|
||||
|
||||
-- Dolibarr team <contact@dolibarr.org> Mon, 10 Aug 2011 12:00:00 +0100
|
||||
-- Dolibarr team <contact@dolibarr.org> Mon, 22 Apr 2013 12:00:00 +0100
|
||||
|
||||
# For a changelog file dedicated to end users, see /usr/share/doc/dolibarr/ChangeLog.gz
|
||||
# For a changelog file dedicated to end users, see /usr/share/doc/dolibarr/ChangeLog.gz
|
||||
@@ -14,8 +14,8 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: 1.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2011-08-01 18:17+0200\n"
|
||||
"Report-Msgid-Bugs-To: dolibarr@packages.debian.org\n"
|
||||
"POT-Creation-Date: 2013-04-23 12:16+0200\n"
|
||||
"PO-Revision-Date: 2011-07-29 22:45+0100\n"
|
||||
"Last-Translator: Laurent Destailleur <eldy@users.sourceforge.net>\n"
|
||||
"Language-Team: Laurent Destailleur <eldy@users.sourceforge.net>\n"
|
||||
@@ -27,13 +27,13 @@ msgstr ""
|
||||
|
||||
#. Type: multiselect
|
||||
#. Description
|
||||
#: ../templates:1001
|
||||
#: ../dolibarr.templates:1001
|
||||
msgid "Web server to reconfigure automatically:"
|
||||
msgstr "Seveur web à reconfigurer automatiquement:"
|
||||
|
||||
#. Type: multiselect
|
||||
#. Description
|
||||
#: ../templates:1001
|
||||
#: ../dolibarr.templates:1001
|
||||
msgid ""
|
||||
"Please choose the web server that should be automatically configured to run "
|
||||
"dolibarr."
|
||||
@@ -44,14 +44,14 @@ msgstr ""
|
||||
#
|
||||
#. Type: boolean
|
||||
#. Description
|
||||
#: ../templates:2001
|
||||
#: ../dolibarr.templates:2001
|
||||
msgid "Delete database and uploaded files ?"
|
||||
msgstr "Effacer la base de donnée et les fichiers uploadés ?"
|
||||
|
||||
#
|
||||
#. Type: boolean
|
||||
#. Description
|
||||
#: ../templates:2001
|
||||
#: ../dolibarr.templates:2001
|
||||
msgid ""
|
||||
"Answer if you want to removed the Dolibarr MySQL database and all other "
|
||||
"datas (datas related to this question are the Dolibarr DBMS account, all "
|
||||
|
||||
15
build/debian/po/templates.pot
Executable file → Normal file
15
build/debian/po/templates.pot
Executable file → Normal file
@@ -3,11 +3,12 @@
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2011-08-01 18:17+0200\n"
|
||||
"Project-Id-Version: dolibarr\n"
|
||||
"Report-Msgid-Bugs-To: dolibarr@packages.debian.org\n"
|
||||
"POT-Creation-Date: 2013-04-23 12:16+0200\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
@@ -18,13 +19,13 @@ msgstr ""
|
||||
|
||||
#. Type: multiselect
|
||||
#. Description
|
||||
#: ../templates:1001
|
||||
#: ../dolibarr.templates:1001
|
||||
msgid "Web server to reconfigure automatically:"
|
||||
msgstr ""
|
||||
|
||||
#. Type: multiselect
|
||||
#. Description
|
||||
#: ../templates:1001
|
||||
#: ../dolibarr.templates:1001
|
||||
msgid ""
|
||||
"Please choose the web server that should be automatically configured to run "
|
||||
"dolibarr."
|
||||
@@ -32,13 +33,13 @@ msgstr ""
|
||||
|
||||
#. Type: boolean
|
||||
#. Description
|
||||
#: ../templates:2001
|
||||
#: ../dolibarr.templates:2001
|
||||
msgid "Delete database and uploaded files ?"
|
||||
msgstr ""
|
||||
|
||||
#. Type: boolean
|
||||
#. Description
|
||||
#: ../templates:2001
|
||||
#: ../dolibarr.templates:2001
|
||||
msgid ""
|
||||
"Answer if you want to removed the Dolibarr MySQL database and all other "
|
||||
"datas (datas related to this question are the Dolibarr DBMS account, all "
|
||||
|
||||
@@ -112,6 +112,9 @@ clean:
|
||||
rm -fr htdocs/includes/tcpdf/fonts/freefont-20100919
|
||||
rm -fr htdocs/includes/tcpdf/fonts/utils
|
||||
|
||||
# clean from files to avoid warning of missing dependencies
|
||||
rm -fr htdocs/includes/jquery/plugins/jqueryFileTree/connectors/jqueryFileTree.py
|
||||
|
||||
# Licence files are included into copyright file.
|
||||
rm -fr htdocs/includes/phpexcel/license.txt
|
||||
rm -f htdocs/includes/tcpdf/LICENSE.TXT
|
||||
|
||||
@@ -31,7 +31,7 @@ PROJECT_NAME = dolibarr
|
||||
# This could be handy for archiving the generated documentation or
|
||||
# if some version control system is used.
|
||||
|
||||
PROJECT_NUMBER = 3.3.0
|
||||
PROJECT_NUMBER = 3.3.2
|
||||
|
||||
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
|
||||
# base path where the generated documentation will be put.
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
; ----- Change this -----
|
||||
AppName=DoliWamp
|
||||
; DoliWamp-x.x.x or DoliWamp-x.x.x-alpha or DoliWamp-x.x.x-beta or DoliWamp-x.x.x-rc or DoliWamp-x.x.x
|
||||
AppVerName=DoliWamp-3.3.0
|
||||
AppVerName=DoliWamp-3.3.3
|
||||
; DoliWamp-x.x x or DoliWamp-x.x.x-alpha or DoliWamp-x.x.x-beta or DoliWamp-x.x.x-rc or DoliWamp-x.x.x
|
||||
OutputBaseFilename=DoliWamp-3.3.0
|
||||
OutputBaseFilename=DoliWamp-3.3.3
|
||||
; Define full path from wich all relative path are defined
|
||||
; You must modify this to put here your dolibarr root directory
|
||||
;SourceDir=C:\Documents and Settings\ldestailleur\git\dolibarr_old
|
||||
@@ -33,7 +33,7 @@ AppPublisherURL=http://www.nltechno.com
|
||||
AppSupportURL=http://www.dolibarr.org
|
||||
AppUpdatesURL=http://www.dolibarr.org
|
||||
AppComments=DoliWamp includes Dolibarr, Apache, PHP and Mysql softwares.
|
||||
AppCopyright=Copyright (C) 2008-2012 Laurent Destailleur, NLTechno
|
||||
AppCopyright=Copyright (C) 2008-2013 Laurent Destailleur, NLTechno
|
||||
DefaultDirName=c:\dolibarr
|
||||
DefaultGroupName=Dolibarr
|
||||
;LicenseFile=COPYING
|
||||
|
||||
@@ -28,6 +28,8 @@ a package onto LaunchPad
|
||||
- Edit file ~/.bashrc to add
|
||||
DEBFULLNAME="<Your name>"
|
||||
DEBEMAIL="<Your email address>"
|
||||
- Create a Bazaar directory
|
||||
mkdir bzr
|
||||
|
||||
If you want to build/test package locally:
|
||||
- Create a file ~/.pbuilderrc with content
|
||||
@@ -36,24 +38,43 @@ If you want to build/test package locally:
|
||||
sudo pbuilder create [--distribution sid|squeeze]
|
||||
|
||||
|
||||
# Push/declare sources to Launchpad
|
||||
# Push/declare Dolibarr sources to Launchpad
|
||||
#----------------------------------
|
||||
|
||||
- Create a Bazaar directory
|
||||
mkdir bzr
|
||||
- Create a series
|
||||
Call it 'dev' or 'stable'
|
||||
For stable: Add file with *: http://www.dolibarr.org/files/stable/package_debian-ubuntu/dolibarr_3.2.*.tar.gz
|
||||
For dev: Configure Series branch - Link to series
|
||||
- From Launchpad project (https://launchpad.net/dolibarr), register a series:
|
||||
Call it 'trunk' or 'beta' or 'stable'
|
||||
Use branch (dev):
|
||||
~eldy/dolibarr/develop
|
||||
~eldy/dolibarr/beta
|
||||
~eldy/dolibarr/stable
|
||||
or
|
||||
Use URL pattern (beta or stable):
|
||||
http://www.dolibarr.org/files/lastbuild/package_debian-ubuntu/dolibarr_x.z.*.tar.gz
|
||||
http://www.dolibarr.org/files/stable/package_debian-ubuntu/dolibarr_x.y.*.tar.gz
|
||||
|
||||
- For Dev, you can also add link serie to GIT HEAD.
|
||||
- For beta and stable, you can init from command line
|
||||
cd bzr/dolibarr-[beta|stable]
|
||||
bzr init
|
||||
bzr add
|
||||
bzr commit -m "Init"
|
||||
bzr push lp:~yourlogin/dolibarr/stable
|
||||
bzr push lp:~yourlogin/dolibarr/[beta|stable]
|
||||
|
||||
# Init repository of sources into launchpad (when repository for sources does not exist)
|
||||
- List of series are visible here: https://launchpad.net/dolibarr/+series
|
||||
|
||||
# To update Dolibarr into launchpad (when repository for sources already exists)
|
||||
#----------------------------------
|
||||
cd bzr
|
||||
bzr branch lp:~yourlogin/dolibarr/[dev|beta|stable]
|
||||
cd dolibarr-[dev|beta|stable]
|
||||
bzr status
|
||||
-- Update files here --
|
||||
bzr commit -m "Description of change"
|
||||
bzr push
|
||||
|
||||
- Create debian directory and upload it onto bzr branch ~yourlogin/+junk/debian-[dev|stable]
|
||||
|
||||
# Init debian dir repository into launchpad (when repository for sources does not exist)
|
||||
#----------------------------------
|
||||
- Create debian directory and upload it onto bzr branch lp:~yourlogin/+junk/debian-[dev|beta|stable]
|
||||
cd bzr
|
||||
mkdir debian
|
||||
cd debian
|
||||
@@ -61,24 +82,29 @@ If you want to build/test package locally:
|
||||
bzr init
|
||||
bzr add
|
||||
bzr commit -m "Init control files"
|
||||
bzr push lp:~yourlogin/+junk/debian-[dev|stable] (put here any branch name)
|
||||
or download it from launchpad bazaar:
|
||||
bzr push lp:~yourlogin/+junk/debian-[dev|beta|stable] (put here any branch name)
|
||||
- or download it from launchpad bazaar:
|
||||
cd bzr
|
||||
bzr branch lp:~yourlogin/+junk/debian-[dev|stable]
|
||||
- To update this debian directory, edit files into the bzr dir and run
|
||||
bzr status
|
||||
bzr commit -m "Description of change"
|
||||
bzr push lp:~yourlogin/+junk/debian-[dev|stable]
|
||||
bzr branch lp:~yourlogin/+junk/debian-[dev|beta|stable]
|
||||
|
||||
# Get repository of sources from launchpad (when repository for sources already exists)
|
||||
# Get debian dir repository from launchpad (when repository for sources already exists)
|
||||
#----------------------------------
|
||||
cd bzr
|
||||
bzr branch lp:~yourlogin/+junk/debian-[dev|stable]
|
||||
bzr branch lp:~yourlogin/+junk/debian-[dev|beta|stable]
|
||||
|
||||
# To update debian dir into launchpad (when repository for sources already exists)
|
||||
#----------------------------------
|
||||
cd bzr
|
||||
bzr branch lp:~yourlogin/+junk/debian-[dev|beta|stable]
|
||||
cd debian-[dev|beta|stable]
|
||||
bzr status
|
||||
-- Update files here --
|
||||
bzr commit -m "Description of change"
|
||||
bzr push lp:~yourlogin/+junk/debian-[dev|beta|stable]
|
||||
|
||||
|
||||
# Define a recipe into launchpad (a rule to build packages into a PPA)
|
||||
#----------------------------------
|
||||
|
||||
- Create a file dolibarr.recipe with content
|
||||
cd bzr
|
||||
vi dolibarr.recipe
|
||||
@@ -101,11 +127,11 @@ If you want to build/test package locally:
|
||||
# To get/download package from PPA:
|
||||
#----------------------------------
|
||||
|
||||
Add signing key of the Launchpad repository:
|
||||
- Add signing key of the Launchpad repository:
|
||||
> gpg --keyserver keyserver.ubuntu.com --recv-key A38BF8FD
|
||||
> sudo apt-key add ~/.gnupg/pubring.gpg
|
||||
|
||||
Add Dolibarr Launchpad repository to your system setup by adding the two lines to /etc/apt/sources.list
|
||||
- Add Dolibarr Launchpad repository to your system setup by adding the two lines to /etc/apt/sources.list
|
||||
For the development snapshot version:
|
||||
deb http://ppa.launchpad.net/yourlogin/dolibarr-dev/ubuntu precise main
|
||||
deb-src http://ppa.launchpad.net/yourlogin/dolibarr-dev/ubuntu precise main
|
||||
@@ -113,12 +139,10 @@ For the stable version:
|
||||
deb http://ppa.launchpad.net/yourlogin/dolibarr-stable/ubuntu precise main
|
||||
deb-src http://ppa.launchpad.net/yourlogin/dolibarr-stable/ubuntu precise main
|
||||
|
||||
Update your package cache:
|
||||
- Update your package cache:
|
||||
> apt-get update
|
||||
|
||||
Install Dolibarr:
|
||||
- Install Dolibarr:
|
||||
> apt-get install dolibarr
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ use Cwd;
|
||||
$PROJECT="dolibarr";
|
||||
$MAJOR="3";
|
||||
$MINOR="3";
|
||||
$BUILD="0"; # Mettre x pour release, x-dev pour dev, x-beta pour beta, x-rc pour release candidate
|
||||
$BUILD="3"; # Mettre x pour release, x-dev pour dev, x-beta pour beta, x-rc pour release candidate
|
||||
$RPMSUBVERSION="auto"; # auto use value found into BUILD
|
||||
|
||||
@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","APS","EXEDOLIWAMP","SNAPSHOT"); # Possible packages
|
||||
@@ -656,6 +656,8 @@ if ($nboftargetok) {
|
||||
$ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/dev/skeletons/skeleton_webservice_server.php`;
|
||||
$cmd="find $BUILDROOT/$PROJECT.tmp/scripts -name '*.php' -type f -exec chmod 755 {} \\; ";
|
||||
$ret=`$cmd`;
|
||||
$cmd="find $BUILDROOT/$PROJECT.tmp/scripts -name '*.sh' -type f -exec chmod 755 {} \\; ";
|
||||
$ret=`$cmd`;
|
||||
|
||||
|
||||
print "Rename directory $BUILDROOT/$PROJECT.tmp into $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build\n";
|
||||
|
||||
@@ -32,7 +32,7 @@ This files describe steps made by Dolibarr packaging team to make a
|
||||
complete release of Dolibarr, step by step.
|
||||
|
||||
- Check all files are commited.
|
||||
- Update version/info in /ChangeLog and /filefunc.inc.php
|
||||
- Update version/info in ChangeLog
|
||||
- Update version number with x.x.x in htdocs/filefunc.inc.php
|
||||
- Update version number with x.x.x in build/makepack-dolibarr.pl
|
||||
- Update version number with x.x.x in build/debian/changelog
|
||||
|
||||
@@ -23,10 +23,13 @@ To submit a snapshot for building, we should have a service file with content
|
||||
<service name="download_src_package">
|
||||
<param name="host">www.dolibarr.org</param>
|
||||
<param name="protocol">http</param>
|
||||
<param name="path">/files/lastbuild/package_rpm_generic/dolibarr-3.3.0-0.2.beta1.src.rpm</param>
|
||||
<param name="path">/files/stable/package_rpm_generic/dolibarr-3.3.2-3.src.rpm</param>
|
||||
</service>
|
||||
</services>
|
||||
|
||||
How to have such a service ?
|
||||
Try to make "Add file" and select Remote URL and enter http://www.dolibarr.org/files/lastbuild/package_rpm_generic/dolibarr-3.3.0-0.2.beta1.src.rpm
|
||||
Try to make "Add file" and select Remote URL and enter http://www.dolibarr.org/files/stable/package_rpm_generic/dolibarr-3.3.2-3.src.rpm
|
||||
|
||||
Then add into advanded - attributes
|
||||
OBS:Screenshots http://www.dolibarr.org/images/phocagallery/dolibarr_screenshot1.png
|
||||
OBS:QualityCategory Testing
|
||||
@@ -34,8 +34,8 @@
|
||||
</Company_Info>
|
||||
<Program_Info>
|
||||
<Program_Name>Dolibarr</Program_Name>
|
||||
<Program_Version>3.3.0</Program_Version>
|
||||
<Program_Release_Month>02</Program_Release_Month>
|
||||
<Program_Version>3.3.2</Program_Version>
|
||||
<Program_Release_Month>05</Program_Release_Month>
|
||||
<Program_Release_Day>17</Program_Release_Day>
|
||||
<Program_Release_Year>2013</Program_Release_Year>
|
||||
<Program_Cost_Dollars />
|
||||
|
||||
@@ -34,8 +34,8 @@
|
||||
</Company_Info>
|
||||
<Program_Info>
|
||||
<Program_Name>DoliWamp</Program_Name>
|
||||
<Program_Version>3.3.0</Program_Version>
|
||||
<Program_Release_Month>02</Program_Release_Month>
|
||||
<Program_Version>3.3.2</Program_Version>
|
||||
<Program_Release_Month>05</Program_Release_Month>
|
||||
<Program_Release_Day>17</Program_Release_Day>
|
||||
<Program_Release_Year>2013</Program_Release_Year>
|
||||
<Program_Cost_Dollars />
|
||||
|
||||
@@ -30,7 +30,7 @@ return "Regis Houssin";
|
||||
# script_dolibarr_versions()
|
||||
sub script_dolibarr_versions
|
||||
{
|
||||
return ( "3.3.0", "3.2.1", "3.1.1" );
|
||||
return ( "3.3.3", "3.3.2", "3.3.1", "3.3.0", "3.2.1", "3.1.1" );
|
||||
}
|
||||
|
||||
sub script_dolibarr_category
|
||||
|
||||
@@ -165,7 +165,6 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/categories
|
||||
%_datadir/dolibarr/htdocs/comm
|
||||
%_datadir/dolibarr/htdocs/commande
|
||||
%_datadir/dolibarr/htdocs/commissions
|
||||
%_datadir/dolibarr/htdocs/compta
|
||||
%_datadir/dolibarr/htdocs/conf
|
||||
%_datadir/dolibarr/htdocs/contact
|
||||
@@ -303,35 +302,38 @@ echo "-------------------------------------------------------"
|
||||
echo
|
||||
|
||||
|
||||
#---- postun (after uninstall)
|
||||
#---- postun (after upgrade or uninstall)
|
||||
%postun
|
||||
|
||||
# Define vars
|
||||
export apachelink="%{_sysconfdir}/httpd/conf.d/dolibarr.conf"
|
||||
|
||||
# Remove apache link
|
||||
if [ -L $apachelink ] ;
|
||||
if [ "x$1" = "x0" ] ;
|
||||
then
|
||||
echo "Delete apache config link for Dolibarr ($apachelink)"
|
||||
%{__rm} -f $apachelink
|
||||
status=purge
|
||||
fi
|
||||
# Remove
|
||||
echo "Removed package"
|
||||
|
||||
# Restart web servers if required
|
||||
if [ "x$status" = "xpurge" ] ;
|
||||
then
|
||||
# Restart web server
|
||||
echo Restart web server
|
||||
if [ -f %{_sysconfdir}/init.d/httpd ]; then
|
||||
%{_sysconfdir}/init.d/httpd restart
|
||||
fi
|
||||
if [ -f %{_sysconfdir}/init.d/apache2 ]; then
|
||||
%{_sysconfdir}/init.d/apache2 restart
|
||||
fi
|
||||
# Define vars
|
||||
export apachelink="%{_sysconfdir}/httpd/conf.d/dolibarr.conf"
|
||||
|
||||
# Remove apache link
|
||||
if [ -L $apachelink ] ;
|
||||
then
|
||||
echo "Delete apache config link for Dolibarr ($apachelink)"
|
||||
%{__rm} -f $apachelink
|
||||
status=purge
|
||||
fi
|
||||
|
||||
# Restart web servers if required
|
||||
if [ "x$status" = "xpurge" ] ;
|
||||
then
|
||||
# Restart web server
|
||||
echo Restart web server
|
||||
/sbin/service httpd restart
|
||||
fi
|
||||
else
|
||||
# Upgrade
|
||||
echo "No remove ation done (this is an upgrade)"
|
||||
fi
|
||||
|
||||
|
||||
|
||||
%changelog
|
||||
* Sun Feb 17 2013 Laurent Destailleur 3.3.0-0.3
|
||||
* Mon Apr 22 2013 Laurent Destailleur 3.3.3-0.3
|
||||
- Initial version (#723326)
|
||||
|
||||
@@ -241,7 +241,6 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/categories
|
||||
%_datadir/dolibarr/htdocs/comm
|
||||
%_datadir/dolibarr/htdocs/commande
|
||||
%_datadir/dolibarr/htdocs/commissions
|
||||
%_datadir/dolibarr/htdocs/compta
|
||||
%_datadir/dolibarr/htdocs/conf
|
||||
%_datadir/dolibarr/htdocs/contact
|
||||
@@ -449,11 +448,22 @@ if [ -f %{_sysconfdir}/init.d/apache2 ]; then
|
||||
%{_sysconfdir}/init.d/apache2 restart
|
||||
fi
|
||||
|
||||
# Restart mysql
|
||||
echo Restart mysql
|
||||
# Restart mysql server
|
||||
echo Restart mysql server
|
||||
%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} || 0%{?mdkversion}
|
||||
/sbin/service mysqld restart
|
||||
%else
|
||||
%if 0%{?suse_version}
|
||||
/sbin/service mysql restart
|
||||
%else
|
||||
if [ -f /etc/init.d/mysqld ]; then
|
||||
/etc/init.d/mysqld restart
|
||||
fi
|
||||
if [ -f /etc/init.d/mysql ]; then
|
||||
/etc/init.d/mysql restart
|
||||
fi
|
||||
%endif
|
||||
%endif
|
||||
|
||||
# Show result
|
||||
echo
|
||||
@@ -468,59 +478,71 @@ echo
|
||||
|
||||
|
||||
|
||||
#---- postun (after uninstall)
|
||||
#---- postun (after upgrade or uninstall)
|
||||
%postun
|
||||
|
||||
# Define vars
|
||||
os='unknown';
|
||||
%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} || 0%{?mdkversion}
|
||||
export apachelink="%{_sysconfdir}/httpd/conf.d/dolibarr.conf"
|
||||
%else
|
||||
%if 0%{?suse_version}
|
||||
export apachelink="%{_sysconfdir}/apache2/conf.d/dolibarr.conf"
|
||||
%else
|
||||
if [ -d %{_sysconfdir}/httpd/conf.d ]; then
|
||||
export os='fedora-redhat';
|
||||
export apachelink="%{_sysconfdir}/httpd/conf.d/dolibarr.conf"
|
||||
fi
|
||||
if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^wwwrun /etc/passwd | wc -l` -ge 1 ]; then
|
||||
export os='opensuse';
|
||||
export apachelink="%{_sysconfdir}/apache2/conf.d/dolibarr.conf"
|
||||
fi
|
||||
if [ -d %{_sysconfdir}/httpd/conf.d -a `grep -i "^mageia\|mandriva" /etc/issue | wc -l` -ge 1 ]; then
|
||||
export os='mageia-mandriva';
|
||||
export apachelink="%{_sysconfdir}/httpd/conf.d/dolibarr.conf"
|
||||
fi
|
||||
if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^www-data /etc/passwd | wc -l` -ge 1 ]; then
|
||||
export os='ubuntu-debian';
|
||||
export apachelink="%{_sysconfdir}/apache2/conf.d/dolibarr.conf"
|
||||
fi
|
||||
%endif
|
||||
%endif
|
||||
|
||||
# Remove apache link
|
||||
if [ -L $apachelink ] ;
|
||||
if [ "x$1" = "x0" ] ;
|
||||
then
|
||||
echo "Delete apache config link for Dolibarr ($apachelink)"
|
||||
%{__rm} -f $apachelink
|
||||
status=purge
|
||||
fi
|
||||
# Remove
|
||||
echo "Removed package"
|
||||
|
||||
# Restart web servers if required
|
||||
if [ "x$status" = "xpurge" ] ;
|
||||
then
|
||||
# Restart web server
|
||||
echo Restart web server
|
||||
if [ -f %{_sysconfdir}/init.d/httpd ]; then
|
||||
%{_sysconfdir}/init.d/httpd restart
|
||||
fi
|
||||
if [ -f %{_sysconfdir}/init.d/apache2 ]; then
|
||||
%{_sysconfdir}/init.d/apache2 restart
|
||||
fi
|
||||
# Define vars
|
||||
os='unknown';
|
||||
%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} || 0%{?mdkversion}
|
||||
export apachelink="%{_sysconfdir}/httpd/conf.d/dolibarr.conf"
|
||||
%else
|
||||
%if 0%{?suse_version}
|
||||
export apachelink="%{_sysconfdir}/apache2/conf.d/dolibarr.conf"
|
||||
%else
|
||||
if [ -d %{_sysconfdir}/httpd/conf.d ]; then
|
||||
export os='fedora-redhat';
|
||||
export apachelink="%{_sysconfdir}/httpd/conf.d/dolibarr.conf"
|
||||
fi
|
||||
if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^wwwrun /etc/passwd | wc -l` -ge 1 ]; then
|
||||
export os='opensuse';
|
||||
export apachelink="%{_sysconfdir}/apache2/conf.d/dolibarr.conf"
|
||||
fi
|
||||
if [ -d %{_sysconfdir}/httpd/conf.d -a `grep -i "^mageia\|mandriva" /etc/issue | wc -l` -ge 1 ]; then
|
||||
export os='mageia-mandriva';
|
||||
export apachelink="%{_sysconfdir}/httpd/conf.d/dolibarr.conf"
|
||||
fi
|
||||
if [ -d %{_sysconfdir}/apache2/conf.d -a `grep ^www-data /etc/passwd | wc -l` -ge 1 ]; then
|
||||
export os='ubuntu-debian';
|
||||
export apachelink="%{_sysconfdir}/apache2/conf.d/dolibarr.conf"
|
||||
fi
|
||||
%endif
|
||||
%endif
|
||||
|
||||
# Remove apache link
|
||||
if [ -L $apachelink ] ;
|
||||
then
|
||||
echo "Delete apache config link for Dolibarr ($apachelink)"
|
||||
%{__rm} -f $apachelink
|
||||
status=purge
|
||||
fi
|
||||
|
||||
# Restart web servers if required
|
||||
if [ "x$status" = "xpurge" ] ;
|
||||
then
|
||||
# Restart web server
|
||||
echo Restart web server
|
||||
%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} || 0%{?mdkversion}
|
||||
/sbin/service httpd restart
|
||||
%else
|
||||
if [ -f %{_sysconfdir}/init.d/httpd ]; then
|
||||
%{_sysconfdir}/init.d/httpd restart
|
||||
fi
|
||||
if [ -f %{_sysconfdir}/init.d/apache2 ]; then
|
||||
%{_sysconfdir}/init.d/apache2 restart
|
||||
fi
|
||||
%endif
|
||||
fi
|
||||
else
|
||||
# Upgrade
|
||||
echo "No remove ation done (this is an upgrade)"
|
||||
fi
|
||||
|
||||
|
||||
|
||||
%changelog
|
||||
* Sun Feb 17 2013 Laurent Destailleur 3.3.0-0.3
|
||||
* Mon Apr 22 2013 Laurent Destailleur 3.3.3-0.3
|
||||
- Initial version (#723326)
|
||||
|
||||
@@ -162,7 +162,6 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/categories
|
||||
%_datadir/dolibarr/htdocs/comm
|
||||
%_datadir/dolibarr/htdocs/commande
|
||||
%_datadir/dolibarr/htdocs/commissions
|
||||
%_datadir/dolibarr/htdocs/compta
|
||||
%_datadir/dolibarr/htdocs/conf
|
||||
%_datadir/dolibarr/htdocs/contact
|
||||
@@ -279,6 +278,9 @@ echo Restart mysql
|
||||
if [ -f /etc/init.d/mysqld ]; then
|
||||
/etc/init.d/mysqld restart
|
||||
fi
|
||||
if [ -f /etc/init.d/mysql ]; then
|
||||
/etc/init.d/mysql restart
|
||||
fi
|
||||
|
||||
# Show result
|
||||
echo
|
||||
@@ -292,35 +294,44 @@ echo "-------------------------------------------------------"
|
||||
echo
|
||||
|
||||
|
||||
#---- postun (after uninstall)
|
||||
#---- postun (after upgrade or uninstall)
|
||||
%postun
|
||||
|
||||
# Define vars
|
||||
export apachelink="%{_sysconfdir}/httpd/conf.d/dolibarr.conf"
|
||||
|
||||
# Remove apache link
|
||||
if [ -L $apachelink ] ;
|
||||
if [ "x$1" = "x0" ] ;
|
||||
then
|
||||
echo "Delete apache config link for Dolibarr ($apachelink)"
|
||||
%{__rm} -f $apachelink
|
||||
status=purge
|
||||
fi
|
||||
# Remove
|
||||
echo "Removed package"
|
||||
|
||||
# Restart web servers if required
|
||||
if [ "x$status" = "xpurge" ] ;
|
||||
then
|
||||
# Restart web server
|
||||
echo Restart web server
|
||||
if [ -f %{_sysconfdir}/init.d/httpd ]; then
|
||||
%{_sysconfdir}/init.d/httpd restart
|
||||
fi
|
||||
if [ -f %{_sysconfdir}/init.d/apache2 ]; then
|
||||
%{_sysconfdir}/init.d/apache2 restart
|
||||
fi
|
||||
# Define vars
|
||||
export apachelink="%{_sysconfdir}/httpd/conf.d/dolibarr.conf"
|
||||
|
||||
# Remove apache link
|
||||
if [ -L $apachelink ] ;
|
||||
then
|
||||
echo "Delete apache config link for Dolibarr ($apachelink)"
|
||||
%{__rm} -f $apachelink
|
||||
status=purge
|
||||
fi
|
||||
|
||||
# Restart web servers if required
|
||||
if [ "x$status" = "xpurge" ] ;
|
||||
then
|
||||
# Restart web server
|
||||
echo Restart web server
|
||||
if [ -f %{_sysconfdir}/init.d/httpd ]; then
|
||||
%{_sysconfdir}/init.d/httpd restart
|
||||
fi
|
||||
if [ -f %{_sysconfdir}/init.d/apache2 ]; then
|
||||
%{_sysconfdir}/init.d/apache2 restart
|
||||
fi
|
||||
fi
|
||||
else
|
||||
# Upgrade
|
||||
echo "No remove ation done (this is an upgrade)"
|
||||
fi
|
||||
|
||||
|
||||
|
||||
%changelog
|
||||
* Sun Feb 17 2013 Laurent Destailleur 3.3.0-0.3
|
||||
* Mon Apr 22 2013 Laurent Destailleur 3.3.3-0.3
|
||||
- Initial version (#723326)
|
||||
|
||||
@@ -173,7 +173,6 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/categories
|
||||
%_datadir/dolibarr/htdocs/comm
|
||||
%_datadir/dolibarr/htdocs/commande
|
||||
%_datadir/dolibarr/htdocs/commissions
|
||||
%_datadir/dolibarr/htdocs/compta
|
||||
%_datadir/dolibarr/htdocs/conf
|
||||
%_datadir/dolibarr/htdocs/contact
|
||||
@@ -287,9 +286,7 @@ fi
|
||||
|
||||
# Restart mysql
|
||||
echo Restart mysql
|
||||
if [ -f /etc/init.d/mysqld ]; then
|
||||
/etc/init.d/mysqld restart
|
||||
fi
|
||||
/sbin/service mysql restart
|
||||
|
||||
# Show result
|
||||
echo
|
||||
@@ -303,35 +300,43 @@ echo "-------------------------------------------------------"
|
||||
echo
|
||||
|
||||
|
||||
#---- postun (after uninstall)
|
||||
#---- postun (after upgrade or uninstall)
|
||||
%postun
|
||||
|
||||
# Define vars
|
||||
export apachelink="%{_sysconfdir}/apache2/conf.d/dolibarr.conf"
|
||||
|
||||
# Remove apache link
|
||||
if [ -L $apachelink ] ;
|
||||
if [ "x$1" = "x0" ] ;
|
||||
then
|
||||
echo "Delete apache config link for Dolibarr ($apachelink)"
|
||||
%{__rm} -f $apachelink
|
||||
status=purge
|
||||
# Remove
|
||||
echo "Removed package"
|
||||
|
||||
# Define vars
|
||||
export apachelink="%{_sysconfdir}/apache2/conf.d/dolibarr.conf"
|
||||
|
||||
# Remove apache link
|
||||
if [ -L $apachelink ] ;
|
||||
then
|
||||
echo "Delete apache config link for Dolibarr ($apachelink)"
|
||||
%{__rm} -f $apachelink
|
||||
status=purge
|
||||
fi
|
||||
|
||||
# Restart web servers if required
|
||||
if [ "x$status" = "xpurge" ] ;
|
||||
then
|
||||
# Restart web server
|
||||
echo Restart web server
|
||||
if [ -f %{_sysconfdir}/init.d/httpd ]; then
|
||||
%{_sysconfdir}/init.d/httpd restart
|
||||
fi
|
||||
if [ -f %{_sysconfdir}/init.d/apache2 ]; then
|
||||
%{_sysconfdir}/init.d/apache2 restart
|
||||
fi
|
||||
fi
|
||||
else
|
||||
# Upgrade
|
||||
echo "No remove ation done (this is an upgrade)"
|
||||
fi
|
||||
|
||||
# Restart web servers if required
|
||||
if [ "x$status" = "xpurge" ] ;
|
||||
then
|
||||
# Restart web server
|
||||
echo Restart web server
|
||||
if [ -f %{_sysconfdir}/init.d/httpd ]; then
|
||||
%{_sysconfdir}/init.d/httpd restart
|
||||
fi
|
||||
if [ -f %{_sysconfdir}/init.d/apache2 ]; then
|
||||
%{_sysconfdir}/init.d/apache2 restart
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
|
||||
%changelog
|
||||
* Sun Feb 17 2013 Laurent Destailleur 3.3.0-0.3
|
||||
* Mon Apr 22 2013 Laurent Destailleur 3.3.3-0.3
|
||||
- Initial version (#723326)
|
||||
|
||||
@@ -178,7 +178,7 @@ class modMyModule extends DolibarrModules
|
||||
|
||||
|
||||
// Main menu entries
|
||||
$this->menus = array(); // List of menus to add
|
||||
$this->menu = array(); // List of menus to add
|
||||
$r=0;
|
||||
|
||||
// Add here entries to declare new menus
|
||||
@@ -228,6 +228,7 @@ class modMyModule extends DolibarrModules
|
||||
// $this->export_sql_end[$r] =' FROM ('.MAIN_DB_PREFIX.'facture as f, '.MAIN_DB_PREFIX.'facturedet as fd, '.MAIN_DB_PREFIX.'societe as s)';
|
||||
// $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)';
|
||||
// $this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid AND f.rowid = fd.fk_facture';
|
||||
// $this->export_sql_order[$r] .=' ORDER BY s.nom';
|
||||
// $r++;
|
||||
}
|
||||
|
||||
|
||||
@@ -58,8 +58,6 @@ require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php';
|
||||
* View
|
||||
*/
|
||||
|
||||
$textobject=$langs->transnoentitiesnoconv("Members");
|
||||
|
||||
$help_url='EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros';
|
||||
llxHeader('',$langs->trans("MembersSetup"),$help_url);
|
||||
|
||||
@@ -73,7 +71,7 @@ $head = member_admin_prepare_head();
|
||||
dol_fiche_head($head, 'attributes', $langs->trans("Member"), 0, 'user');
|
||||
|
||||
|
||||
print $langs->trans("DefineHereComplementaryAttributes",$textobject).'<br>'."\n";
|
||||
print $langs->trans("DefineHereComplementaryAttributes", $langs->transnoentitiesnoconv("Members")).'<br>'."\n";
|
||||
print '<br>';
|
||||
|
||||
dol_htmloutput_errors($mesg);
|
||||
|
||||
@@ -958,10 +958,11 @@ else
|
||||
$adht = new AdherentType($db);
|
||||
$adht->fetch($object->typeid);
|
||||
|
||||
$country=GETPOST('pays','int');
|
||||
// We set country_id, and country_code, country of the chosen country
|
||||
if (isset($_POST["pays"]) || $object->country_id)
|
||||
if (!empty($country) || $object->country_id)
|
||||
{
|
||||
$sql = "SELECT rowid, code, libelle as label from ".MAIN_DB_PREFIX."c_pays where rowid = ".(isset($_POST["pays"])?$_POST["pays"]:$object->country_id);
|
||||
$sql = "SELECT rowid, code, libelle as label from ".MAIN_DB_PREFIX."c_pays where rowid = ".(!empty($country)?$country:$object->country_id);
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
|
||||
@@ -76,8 +76,7 @@ $head=agenda_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'attributes', $langs->trans("Agenda"));
|
||||
|
||||
|
||||
print $langs->trans("DefineHereComplementaryAttributes",$textobject).'<br>'."\n";
|
||||
print $langs->trans("DefineHereComplementaryAttributes", $langs->transnoentitiesnoconv("Agenda")).'<br>'."\n";
|
||||
print '<br>';
|
||||
|
||||
dol_htmloutput_errors($mesg);
|
||||
|
||||
@@ -66,7 +66,7 @@ if ($action == 'updateMask')
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'specimen')
|
||||
else if ($action == 'specimen')
|
||||
{
|
||||
$modele=GETPOST('module','alpha');
|
||||
|
||||
@@ -111,7 +111,8 @@ if ($action == 'specimen')
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'set')
|
||||
// Activate a model
|
||||
else if ($action == 'set')
|
||||
{
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
@@ -128,7 +129,7 @@ if ($action == 'set')
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'del')
|
||||
else if ($action == 'del')
|
||||
{
|
||||
$type='order';
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
|
||||
@@ -142,7 +143,8 @@ if ($action == 'del')
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'setdoc')
|
||||
// Set default model
|
||||
else if ($action == 'setdoc')
|
||||
{
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
@@ -182,7 +184,7 @@ if ($action == 'setdoc')
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'setmod')
|
||||
else if ($action == 'setmod')
|
||||
{
|
||||
// TODO Verifier si module numerotation choisi peut etre active
|
||||
// par appel methode canBeActivated
|
||||
@@ -190,7 +192,7 @@ if ($action == 'setmod')
|
||||
dolibarr_set_const($db, "COMMANDE_ADDON",$value,'chaine',0,'',$conf->entity);
|
||||
}
|
||||
|
||||
if ($action == 'set_COMMANDE_DRAFT_WATERMARK')
|
||||
else if ($action == 'set_COMMANDE_DRAFT_WATERMARK')
|
||||
{
|
||||
$draft = GETPOST("COMMANDE_DRAFT_WATERMARK");
|
||||
$res = dolibarr_set_const($db, "COMMANDE_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity);
|
||||
@@ -207,7 +209,7 @@ if ($action == 'set_COMMANDE_DRAFT_WATERMARK')
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'set_COMMANDE_FREE_TEXT')
|
||||
else if ($action == 'set_COMMANDE_FREE_TEXT')
|
||||
{
|
||||
$freetext = GETPOST("COMMANDE_FREE_TEXT"); // No alpha here, we want exact string
|
||||
|
||||
@@ -224,6 +226,14 @@ if ($action == 'set_COMMANDE_FREE_TEXT')
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
}
|
||||
}
|
||||
else if ($action=='setModuleOptions') {
|
||||
if (dolibarr_set_const($db, "COMMANDE_ADDON_PDF_ODT_PATH",GETPOST('value1'),'chaine',0,'',$conf->entity))
|
||||
{
|
||||
// La constante qui a ete lue en avant du nouveau set
|
||||
// on passe donc par une variable pour avoir un affichage coherent
|
||||
$conf->global->COMMANDE_ADDON_PDF_ODT_PATH = GETPOST('value1');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -157,7 +157,7 @@ jQuery(document).ready(function() {
|
||||
jQuery("#delconst").show();
|
||||
jQuery("#action").val('delete');
|
||||
});
|
||||
jQuery(".inputforupdate").keypress(function() {
|
||||
jQuery(".inputforupdate").keyup(function() { // keypress does not support back
|
||||
var field_id = jQuery(this).attr("id");
|
||||
var row_num = field_id.split("_");
|
||||
jQuery("#updateconst").show();
|
||||
|
||||
@@ -139,7 +139,7 @@ $tabsql[6] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.t
|
||||
$tabsql[7] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.accountancy_code as accountancy_code, a.deductible, p.code as pays_code, p.libelle as pays, a.fk_pays as pays_id, a.active FROM ".MAIN_DB_PREFIX."c_chargesociales AS a, ".MAIN_DB_PREFIX."c_pays as p WHERE a.fk_pays=p.rowid and p.active=1";
|
||||
$tabsql[8] = "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_typent";
|
||||
$tabsql[9] = "SELECT code_iso as code, label as libelle, unicode, active FROM ".MAIN_DB_PREFIX."c_currencies";
|
||||
$tabsql[10]= "SELECT t.rowid, t.taux, t.localtax1_type, t.localtax1, t.localtax2_type, t.localtax2, p.libelle as pays, p.code as pays_code, t.fk_pays as pays_id, t.recuperableonly, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_tva as t, llx_c_pays as p WHERE t.fk_pays=p.rowid";
|
||||
$tabsql[10]= "SELECT t.rowid, t.taux, t.localtax1_type, t.localtax1, t.localtax2_type, t.localtax2, p.libelle as pays, p.code as pays_code, t.fk_pays as pays_id, t.recuperableonly, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p WHERE t.fk_pays=p.rowid";
|
||||
$tabsql[11]= "SELECT t.rowid as rowid, element, source, code, libelle, active FROM ".MAIN_DB_PREFIX."c_type_contact AS t";
|
||||
$tabsql[12]= "SELECT c.rowid as rowid, code, sortorder, c.libelle, c.libelle_facture, nbjour, fdm, decalage, active FROM ".MAIN_DB_PREFIX.'c_payment_term AS c';
|
||||
$tabsql[13]= "SELECT id as rowid, code, c.libelle, type, active FROM ".MAIN_DB_PREFIX."c_paiement AS c";
|
||||
@@ -383,7 +383,7 @@ if ($id == 11)
|
||||
|
||||
// Define localtax_typeList (used for dictionnary "c_tva")
|
||||
$localtax_typeList = array();
|
||||
if (GETPOST("id") == 10)
|
||||
if ($id == 10)
|
||||
{
|
||||
$localtax_typeList = array(
|
||||
"0" => $langs->trans("No"),
|
||||
@@ -392,9 +392,9 @@ if (GETPOST("id") == 10)
|
||||
"3" => $langs->trans("Yes").' ('.$langs->trans("Type")." 3)", //$langs->trans("%ageOnProductsWithoutVAT"),
|
||||
"4" => $langs->trans("Yes").' ('.$langs->trans("Type")." 4)", //$langs->trans("%ageOnProductsBeforeVAT"),
|
||||
"5" => $langs->trans("Yes").' ('.$langs->trans("Type")." 5)", //$langs->trans("%ageOnServiceWithoutVAT"),
|
||||
"6" => $langs->trans("Yes").' ('.$langs->trans("Type")." 6)", //$langs->trans("%ageOnServiceBeforeVAT"),
|
||||
"7" => $langs->trans("Yes").' ('.$langs->trans("Type")." 7)" //$langs->trans("AmountOnOrder") // We will enable this later. For the moment, work only of invoice localtype
|
||||
"6" => $langs->trans("Yes").' ('.$langs->trans("Type")." 6)" //$langs->trans("%ageOnServiceBeforeVAT"),
|
||||
);
|
||||
if (! empty($conf->global->MAIN_USE_LOCALTAX_TYPE_7)) $localtax_typeList["7"]= $langs->trans("Yes").' ('.$langs->trans("Type")." 7)"; //$langs->trans("AmountOnOrder") // We will enable this later. For the moment, work only of invoice localtype
|
||||
}
|
||||
$msg='';
|
||||
|
||||
@@ -433,22 +433,33 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
||||
if ($fieldnamekey == 'position') $fieldnamekey = 'Position';
|
||||
if ($fieldnamekey == 'unicode') $fieldnamekey = 'Unicode';
|
||||
|
||||
$msg.=$langs->trans("ErrorFieldRequired",$langs->transnoentities($fieldnamekey)).'<br>';
|
||||
$msg.=$langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)).'<br>';
|
||||
}
|
||||
}
|
||||
// Other checks
|
||||
if ($tabname[$id] == MAIN_DB_PREFIX."c_actioncomm" && isset($_POST["type"]) && in_array($_POST["type"],array('system','systemauto'))) {
|
||||
$ok=0;
|
||||
$msg.="Value 'system' and 'systemauto' for type is reserved. You can use 'user' as value to add your own record.<br>";
|
||||
$msg.= $langs->transnoentities('ErrorReservedTypeSystemSystemAuto').'<br>';
|
||||
}
|
||||
if (isset($_POST["code"]) && $_POST["code"]=='0') {
|
||||
$ok=0;
|
||||
$msg.="Code can't contains value 0<br>";
|
||||
if (isset($_POST["code"]))
|
||||
{
|
||||
if ($_POST["code"]=='0')
|
||||
{
|
||||
$ok=0;
|
||||
$msg.= $langs->transnoentities('ErrorCodeCantContainZero').'<br>';
|
||||
}
|
||||
// FIXME regresion if code with not in numeric base
|
||||
/*if (!is_numeric($_POST['code']))
|
||||
{
|
||||
$ok = 0;
|
||||
$msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'<br />';
|
||||
}*/
|
||||
}
|
||||
if (isset($_POST["pays"]) && $_POST["pays"]=='0') {
|
||||
$ok=0;
|
||||
$msg.=$langs->trans("ErrorFieldRequired",$langs->trans("Country")).'<br>';
|
||||
$msg.=$langs->transnoentities("ErrorFieldRequired",$langs->transnoentities("Country")).'<br>';
|
||||
}
|
||||
|
||||
// Clean some parameters
|
||||
if (isset($_POST["localtax1"]) && empty($_POST["localtax1"])) $_POST["localtax1"]='0'; // If empty, we force to 0
|
||||
if (isset($_POST["localtax2"]) && empty($_POST["localtax2"])) $_POST["localtax2"]='0'; // If empty, we force to 0
|
||||
@@ -510,7 +521,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
||||
else
|
||||
{
|
||||
if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
|
||||
$msg=$langs->trans("ErrorRecordAlreadyExists").'<br>';
|
||||
$msg=$langs->transnoentities("ErrorRecordAlreadyExists").'<br>';
|
||||
}
|
||||
else {
|
||||
dol_print_error($db);
|
||||
@@ -580,7 +591,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes') // delete
|
||||
{
|
||||
if ($db->errno() == 'DB_ERROR_CHILD_EXISTS')
|
||||
{
|
||||
$msg='<div class="error">'.$langs->trans("ErrorRecordIsUsedByChild").'</div>';
|
||||
$msg='<div class="error">'.$langs->transnoentities("ErrorRecordIsUsedByChild").'</div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -978,6 +989,7 @@ if ($id)
|
||||
$valuetoshow=($obj->code && $key != "Civility".strtoupper($obj->code)?$key:$obj->$fieldlist[$field]);
|
||||
}
|
||||
else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_type_contact') {
|
||||
$langs->load('agenda');
|
||||
$key=$langs->trans("TypeContact_".$obj->element."_".$obj->source."_".strtoupper($obj->code));
|
||||
$valuetoshow=($obj->code && $key != "TypeContact_".$obj->element."_".$obj->source."_".strtoupper($obj->code)?$key:$obj->$fieldlist[$field]);
|
||||
}
|
||||
@@ -1292,4 +1304,4 @@ function fieldList($fieldlist,$obj='',$tabname='')
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -65,9 +65,9 @@ if ($action == 'updateMask')
|
||||
if (isset($res))
|
||||
{
|
||||
if ($res < 0)
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
else
|
||||
setEventMessage($langs->trans("Error"), 'errors');
|
||||
else
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,9 +77,9 @@ else if ($action == 'set_SHIPPING_FREE_TEXT')
|
||||
$res = dolibarr_set_const($db, "SHIPPING_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
|
||||
|
||||
if ($res < 0)
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
else
|
||||
setEventMessage($langs->trans("Error"), 'errors');
|
||||
else
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
|
||||
else if ($action == 'set_SHIPPING_DRAFT_WATERMARK')
|
||||
@@ -88,9 +88,9 @@ else if ($action == 'set_SHIPPING_DRAFT_WATERMARK')
|
||||
$res = dolibarr_set_const($db, "SHIPPING_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity);
|
||||
|
||||
if ($res < 0)
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
else
|
||||
setEventMessage($langs->trans("Error"), 'errors');
|
||||
else
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
|
||||
else if ($action == 'specimen')
|
||||
@@ -173,7 +173,12 @@ else if ($action == 'setdoc')
|
||||
|
||||
else if ($action == 'setmodel')
|
||||
{
|
||||
dolibarr_set_const($db, "EXPEDITION_ADDON_NUMBER",$value,'chaine',0,'',$conf->entity);
|
||||
$res = dolibarr_set_const($db, "EXPEDITION_ADDON_NUMBER",$value,'chaine',0,'',$conf->entity);
|
||||
|
||||
if ($res < 0)
|
||||
setEventMessage($langs->trans("Error"), 'errors');
|
||||
else
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -118,12 +118,12 @@ print '<br>';
|
||||
|
||||
print $langs->trans("NoteOnPathLocation").'<br>';
|
||||
|
||||
$url1='http://www.maxmind.com/app/perl?rId=awstats';
|
||||
$url1='http://www.maxmind.com/en/city?rId=awstats';
|
||||
print $langs->trans("YouCanDownloadFreeDatFileTo",'<a href="'.$url1.'" target="_blank">'.$url1.'</a>');
|
||||
|
||||
print '<br>';
|
||||
|
||||
$url2='http://www.maxmind.com/app/perl?rId=awstats';
|
||||
$url2='http://www.maxmind.com/en/city?rId=awstats';
|
||||
print $langs->trans("YouCanDownloadAdvancedDatFileTo",'<a href="'.$url2.'" target="_blank">'.$url2.'</a>');
|
||||
|
||||
if ($geoip)
|
||||
|
||||
@@ -68,7 +68,7 @@ print '<br>';
|
||||
print '<br>';
|
||||
//print '<hr style="color: #DDDDDD;">';
|
||||
print img_picto('','puce').' '.$langs->trans("SetupDescription4",DOL_URL_ROOT.'/admin/modules.php?mainmenu=home');
|
||||
if (count($conf->modules) <= 1) // If only user module enabled
|
||||
if (count($conf->modules) <= (empty($conf->global->MAIN_MINNB_MODULE)?1:$conf->global->MAIN_MINNB_MODULE)) // If only user module enabled
|
||||
{
|
||||
$langs->load("errors");
|
||||
$warnpicto=img_warning($langs->trans("WarningMandatorySetupNotComplete"));
|
||||
|
||||
@@ -140,6 +140,9 @@ if (($action == 'send' || $action == 'sendhtml') && GETPOST('cancel'))
|
||||
if (($action == 'send' || $action == 'sendhtml') && ! GETPOST('addfile') && ! GETPOST('addfilehtml') && ! GETPOST('removedfile') && ! GETPOST('cancel'))
|
||||
{
|
||||
$error=0;
|
||||
|
||||
|
||||
|
||||
|
||||
$email_from='';
|
||||
if (! empty($_POST["fromname"])) $email_from=$_POST["fromname"].' ';
|
||||
@@ -152,7 +155,12 @@ if (($action == 'send' || $action == 'sendhtml') && ! GETPOST('addfile') && ! GE
|
||||
$subject = $_POST['subject'];
|
||||
$body = $_POST['message'];
|
||||
$deliveryreceipt= $_POST["deliveryreceipt"];
|
||||
|
||||
|
||||
//Check if we have to decode HTML
|
||||
if (!empty($conf->global->FCKEDITOR_ENABLE_MAILING) && dol_textishtml(dol_html_entity_decode($body, ENT_COMPAT | ENT_HTML401))) {
|
||||
$body=dol_html_entity_decode($body, ENT_COMPAT | ENT_HTML401);
|
||||
}
|
||||
|
||||
// Create form object
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
||||
$formmail = new FormMail($db);
|
||||
|
||||
@@ -29,6 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php';
|
||||
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->load('other');
|
||||
|
||||
if (! $user->admin) accessforbidden();
|
||||
|
||||
|
||||
@@ -162,6 +162,36 @@ if ($action == 'setdefaultduration')
|
||||
}
|
||||
}
|
||||
|
||||
// Define constants for submodules that contains parameters (forms with param1, param2, ... and value1, value2, ...)
|
||||
if ($action == 'setModuleOptions')
|
||||
{
|
||||
$post_size=count($_POST);
|
||||
|
||||
$db->begin();
|
||||
|
||||
for($i=0;$i < $post_size;$i++)
|
||||
{
|
||||
if (array_key_exists('param'.$i,$_POST))
|
||||
{
|
||||
$param=GETPOST("param".$i,'alpha');
|
||||
$value=GETPOST("value".$i,'alpha');
|
||||
if ($param) $res = dolibarr_set_const($db,$param,$value,'chaine',0,'',$conf->entity);
|
||||
if (! $res > 0) $error++;
|
||||
}
|
||||
}
|
||||
if (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*if ($action == 'setusecustomercontactasrecipient')
|
||||
{
|
||||
dolibarr_set_const($db, "PROPALE_USE_CUSTOMER_CONTACT_AS_RECIPIENT",$_POST["value"],'chaine',0,'',$conf->entity);
|
||||
|
||||
@@ -161,7 +161,7 @@ if ($action == 'edit')
|
||||
{
|
||||
$form=new Form($db);
|
||||
|
||||
if (! count($listofmethods)) print '<div class="warning">'.$langs->trans("NoSmsEngine",'<a href="http://www.dolistore.com/search.php?orderby=position&orderway=desc&search_query=sms_manager">DoliStore</a>').'</div>';
|
||||
if (! count($listofmethods)) print '<div class="warning">'.$langs->trans("NoSmsEngine",'<a href="http://www.dolistore.com/search.php?orderby=position&orderway=desc&search_query=smsmanager">DoliStore</a>').'</div>';
|
||||
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
@@ -217,7 +217,7 @@ else
|
||||
{
|
||||
$var=true;
|
||||
|
||||
if (! count($listofmethods)) print '<div class="warning">'.$langs->trans("NoSmsEngine",'<a href="http://www.dolistore.com/search.php?orderby=position&orderway=desc&search_query=sms_manager">DoliStore</a>').'</div>';
|
||||
if (! count($listofmethods)) print '<div class="warning">'.$langs->trans("NoSmsEngine",'<a href="http://www.dolistore.com/search.php?orderby=position&orderway=desc&search_query=smsmanager">DoliStore</a>').'</div>';
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
@@ -98,14 +98,14 @@ if ($action == 'set')
|
||||
if ($_POST[$option['constant']])
|
||||
{
|
||||
dolibarr_del_const($db, $option['constant'], 0);
|
||||
dolibarr_set_const($db, $option['constant'], $_POST[$option['constant']], 'chaine');
|
||||
dolibarr_set_const($db, $option['constant'], $_POST[$option['constant']], 'chaine',0, '', 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dolibarr_set_const($db, 'SYSLOG_HANDLERS', json_encode($activeModules), 'chaine');
|
||||
dolibarr_set_const($db, 'SYSLOG_HANDLERS', json_encode($activeModules), 'chaine',0,'',0);
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
|
||||
@@ -118,7 +118,7 @@ class Facturation
|
||||
}
|
||||
|
||||
// Define part of HT, VAT, TTC
|
||||
$resultarray=calcul_price_total($this->qte,$this->prix(),$this->remisePercent(),$vat_rate,0,0,0,'HT',$product->type);
|
||||
$resultarray=calcul_price_total($this->qte,$this->prix(),$this->remisePercent(),$vat_rate,0,0,0,'HT',0,$product->type,0);
|
||||
|
||||
// Calcul du total ht sans remise
|
||||
$total_ht = $resultarray[0];
|
||||
|
||||
@@ -35,7 +35,7 @@ class ActionComm extends CommonObject
|
||||
public $element='action';
|
||||
public $table_element = 'actioncomm';
|
||||
public $table_rowid = 'id';
|
||||
protected $ismultientitymanaged = 2; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
||||
protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
||||
|
||||
var $id;
|
||||
var $type_id;
|
||||
@@ -459,7 +459,8 @@ class ActionComm extends CommonObject
|
||||
|
||||
//print 'eeea'.$this->datep.'-'.(strval($this->datep) != '').'-'.$this->db->idate($this->datep);
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."actioncomm ";
|
||||
$sql.= " SET percent='".$this->percentage."'";
|
||||
$sql.= " SET percent = '".$this->percentage."'";
|
||||
if ($this->fk_action > 0) $sql.= ", fk_action = '".$this->fk_action."'";
|
||||
$sql.= ", label = ".($this->label ? "'".$this->db->escape($this->label)."'":"null");
|
||||
$sql.= ", datep = ".(strval($this->datep)!='' ? "'".$this->db->idate($this->datep)."'" : 'null');
|
||||
$sql.= ", datep2 = ".(strval($this->datef)!='' ? "'".$this->db->idate($this->datef)."'" : 'null');
|
||||
|
||||
@@ -51,6 +51,21 @@ if ($user->societe_id > 0)
|
||||
$socid = $user->societe_id;
|
||||
}
|
||||
|
||||
$result = restrictedArea($user, 'agenda', $objectid, 'actioncomm&societe', 'myactions&allactions', '', 'id');
|
||||
|
||||
$act = new ActionComm($db);
|
||||
|
||||
if ($objectid > 0)
|
||||
{
|
||||
$ret = $act->fetch($objectid);
|
||||
if ($ret > 0) {
|
||||
$company=new Societe($db);
|
||||
$company->fetch($act->societe->id);
|
||||
$act->societe=$company; // For backward compatibility
|
||||
$act->thirdparty=$company;
|
||||
}
|
||||
}
|
||||
|
||||
// Get parameters
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
@@ -79,7 +94,7 @@ if ($action == 'delete')
|
||||
{
|
||||
$upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($objectid);
|
||||
$file = $upload_dir . '/' . $_GET['urlfile']; // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
||||
$ret=dol_delete_file($file);
|
||||
$ret=dol_delete_file($file,0,0,0,$act);
|
||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
||||
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
|
||||
$action='';
|
||||
@@ -96,184 +111,172 @@ $help_url='EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda';
|
||||
llxHeader('',$langs->trans("Agenda"),$help_url);
|
||||
|
||||
|
||||
if ($objectid > 0)
|
||||
if ($act->id > 0)
|
||||
{
|
||||
$act = new ActionComm($db);
|
||||
if ($act->fetch($objectid))
|
||||
$upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($objectid);
|
||||
|
||||
$author=new User($db);
|
||||
$author->fetch($act->author->id);
|
||||
$act->author=$author;
|
||||
|
||||
if ($act->contact->id) $act->fetch_contact($act->contact->id);
|
||||
|
||||
$head=actions_prepare_head($act);
|
||||
dol_fiche_head($head, 'documents', $langs->trans("Action"),0,'action');
|
||||
|
||||
// Affichage fiche action en mode visu
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/comm/action/index.php">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
// Ref
|
||||
print '<tr><td width="30%">'.$langs->trans("Ref").'</td><td colspan="3">';
|
||||
print $form->showrefnav($act, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', '');
|
||||
print '</td></tr>';
|
||||
|
||||
// Type
|
||||
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
|
||||
{
|
||||
$upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($objectid);
|
||||
print '<tr><td>'.$langs->trans("Type").'</td><td colspan="3">'.$act->type.'</td></tr>';
|
||||
}
|
||||
|
||||
$company=new Societe($db);
|
||||
$company->fetch($act->societe->id);
|
||||
$act->societe=$company;
|
||||
// Title
|
||||
print '<tr><td>'.$langs->trans("Title").'</td><td colspan="3">'.$act->label.'</td></tr>';
|
||||
|
||||
$author=new User($db);
|
||||
$author->fetch($act->author->id);
|
||||
$act->author=$author;
|
||||
// Full day event
|
||||
print '<tr><td>'.$langs->trans("EventOnFullDay").'</td><td colspan="3">'.yn($act->fulldayevent).'</td></tr>';
|
||||
|
||||
if ($act->contact->id) $act->fetch_contact($act->contact->id);
|
||||
// Date start
|
||||
print '<tr><td width="30%">'.$langs->trans("DateActionStart").'</td><td colspan="2">';
|
||||
if (! $act->fulldayevent) print dol_print_date($act->datep,'dayhour');
|
||||
else print dol_print_date($act->datep,'day');
|
||||
if ($act->percentage == 0 && $act->datep && $act->datep < ($now - $delay_warning)) print img_warning($langs->trans("Late"));
|
||||
print '</td>';
|
||||
print '<td rowspan="4" align="center" valign="middle" width="180">'."\n";
|
||||
print '<form name="listactionsfiltermonth" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="show_month">';
|
||||
print '<input type="hidden" name="year" value="'.dol_print_date($act->datep,'%Y').'">';
|
||||
print '<input type="hidden" name="month" value="'.dol_print_date($act->datep,'%m').'">';
|
||||
print '<input type="hidden" name="day" value="'.dol_print_date($act->datep,'%d').'">';
|
||||
//print '<input type="hidden" name="day" value="'.dol_print_date($act->datep,'%d').'">';
|
||||
print img_picto($langs->trans("ViewCal"),'object_calendar').' <input type="submit" style="width: 120px" class="button" name="viewcal" value="'.$langs->trans("ViewCal").'">';
|
||||
print '</form>'."\n";
|
||||
print '<form name="listactionsfilterweek" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="show_week">';
|
||||
print '<input type="hidden" name="year" value="'.dol_print_date($act->datep,'%Y').'">';
|
||||
print '<input type="hidden" name="month" value="'.dol_print_date($act->datep,'%m').'">';
|
||||
print '<input type="hidden" name="day" value="'.dol_print_date($act->datep,'%d').'">';
|
||||
//print '<input type="hidden" name="day" value="'.dol_print_date($act->datep,'%d').'">';
|
||||
print img_picto($langs->trans("ViewCal"),'object_calendarweek').' <input type="submit" style="width: 120px" class="button" name="viewweek" value="'.$langs->trans("ViewWeek").'">';
|
||||
print '</form>'."\n";
|
||||
print '<form name="listactionsfilterday" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="show_day">';
|
||||
print '<input type="hidden" name="year" value="'.dol_print_date($act->datep,'%Y').'">';
|
||||
print '<input type="hidden" name="month" value="'.dol_print_date($act->datep,'%m').'">';
|
||||
print '<input type="hidden" name="day" value="'.dol_print_date($act->datep,'%d').'">';
|
||||
//print '<input type="hidden" name="day" value="'.dol_print_date($act->datep,'%d').'">';
|
||||
print img_picto($langs->trans("ViewCal"),'object_calendarday').' <input type="submit" style="width: 120px" class="button" name="viewday" value="'.$langs->trans("ViewDay").'">';
|
||||
print '</form>'."\n";
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
$head=actions_prepare_head($act);
|
||||
dol_fiche_head($head, 'documents', $langs->trans("Action"),0,'action');
|
||||
// Date end
|
||||
print '<tr><td>'.$langs->trans("DateActionEnd").'</td><td colspan="2">';
|
||||
if (! $act->fulldayevent) print dol_print_date($act->datef,'dayhour');
|
||||
else print dol_print_date($act->datef,'day');
|
||||
if ($act->percentage > 0 && $act->percentage < 100 && $act->datef && $act->datef < ($now- $delay_warning)) print img_warning($langs->trans("Late"));
|
||||
print '</td></tr>';
|
||||
|
||||
// Affichage fiche action en mode visu
|
||||
print '<table class="border" width="100%">';
|
||||
// Status
|
||||
print '<tr><td nowrap>'.$langs->trans("Status").' / '.$langs->trans("Percentage").'</td><td colspan="2">';
|
||||
print $act->getLibStatut(4);
|
||||
print '</td></tr>';
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/comm/action/index.php">'.$langs->trans("BackToList").'</a>';
|
||||
// Location
|
||||
print '<tr><td>'.$langs->trans("Location").'</td><td colspan="2">'.$act->location.'</td></tr>';
|
||||
|
||||
// Ref
|
||||
print '<tr><td width="30%">'.$langs->trans("Ref").'</td><td colspan="3">';
|
||||
print $form->showrefnav($act, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', '');
|
||||
print '</td></tr>';
|
||||
|
||||
// Type
|
||||
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
|
||||
print '</table><br><br><table class="border" width="100%">';
|
||||
|
||||
|
||||
// Third party - Contact
|
||||
print '<tr><td width="30%">'.$langs->trans("ActionOnCompany").'</td><td>'.($act->societe->id?$act->societe->getNomUrl(1):$langs->trans("None"));
|
||||
if ($act->societe->id && $act->type_code == 'AC_TEL')
|
||||
{
|
||||
if ($act->societe->fetch($act->societe->id))
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("Type").'</td><td colspan="3">'.$act->type.'</td></tr>';
|
||||
print "<br>".dol_print_phone($act->societe->tel);
|
||||
}
|
||||
|
||||
// Title
|
||||
print '<tr><td>'.$langs->trans("Title").'</td><td colspan="3">'.$act->label.'</td></tr>';
|
||||
|
||||
// Full day event
|
||||
print '<tr><td>'.$langs->trans("EventOnFullDay").'</td><td colspan="3">'.yn($act->fulldayevent).'</td></tr>';
|
||||
|
||||
// Date start
|
||||
print '<tr><td width="30%">'.$langs->trans("DateActionStart").'</td><td colspan="2">';
|
||||
if (! $act->fulldayevent) print dol_print_date($act->datep,'dayhour');
|
||||
else print dol_print_date($act->datep,'day');
|
||||
if ($act->percentage == 0 && $act->datep && $act->datep < ($now - $delay_warning)) print img_warning($langs->trans("Late"));
|
||||
print '</td>';
|
||||
print '<td rowspan="4" align="center" valign="middle" width="180">'."\n";
|
||||
print '<form name="listactionsfiltermonth" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="show_month">';
|
||||
print '<input type="hidden" name="year" value="'.dol_print_date($act->datep,'%Y').'">';
|
||||
print '<input type="hidden" name="month" value="'.dol_print_date($act->datep,'%m').'">';
|
||||
print '<input type="hidden" name="day" value="'.dol_print_date($act->datep,'%d').'">';
|
||||
//print '<input type="hidden" name="day" value="'.dol_print_date($act->datep,'%d').'">';
|
||||
print img_picto($langs->trans("ViewCal"),'object_calendar').' <input type="submit" style="width: 120px" class="button" name="viewcal" value="'.$langs->trans("ViewCal").'">';
|
||||
print '</form>'."\n";
|
||||
print '<form name="listactionsfilterweek" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="show_week">';
|
||||
print '<input type="hidden" name="year" value="'.dol_print_date($act->datep,'%Y').'">';
|
||||
print '<input type="hidden" name="month" value="'.dol_print_date($act->datep,'%m').'">';
|
||||
print '<input type="hidden" name="day" value="'.dol_print_date($act->datep,'%d').'">';
|
||||
//print '<input type="hidden" name="day" value="'.dol_print_date($act->datep,'%d').'">';
|
||||
print img_picto($langs->trans("ViewCal"),'object_calendarweek').' <input type="submit" style="width: 120px" class="button" name="viewweek" value="'.$langs->trans("ViewWeek").'">';
|
||||
print '</form>'."\n";
|
||||
print '<form name="listactionsfilterday" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="show_day">';
|
||||
print '<input type="hidden" name="year" value="'.dol_print_date($act->datep,'%Y').'">';
|
||||
print '<input type="hidden" name="month" value="'.dol_print_date($act->datep,'%m').'">';
|
||||
print '<input type="hidden" name="day" value="'.dol_print_date($act->datep,'%d').'">';
|
||||
//print '<input type="hidden" name="day" value="'.dol_print_date($act->datep,'%d').'">';
|
||||
print img_picto($langs->trans("ViewCal"),'object_calendarday').' <input type="submit" style="width: 120px" class="button" name="viewday" value="'.$langs->trans("ViewDay").'">';
|
||||
print '</form>'."\n";
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Date end
|
||||
print '<tr><td>'.$langs->trans("DateActionEnd").'</td><td colspan="2">';
|
||||
if (! $act->fulldayevent) print dol_print_date($act->datef,'dayhour');
|
||||
else print dol_print_date($act->datef,'day');
|
||||
if ($act->percentage > 0 && $act->percentage < 100 && $act->datef && $act->datef < ($now- $delay_warning)) print img_warning($langs->trans("Late"));
|
||||
print '</td></tr>';
|
||||
|
||||
// Status
|
||||
print '<tr><td nowrap>'.$langs->trans("Status").' / '.$langs->trans("Percentage").'</td><td colspan="2">';
|
||||
print $act->getLibStatut(4);
|
||||
print '</td></tr>';
|
||||
|
||||
// Location
|
||||
print '<tr><td>'.$langs->trans("Location").'</td><td colspan="2">'.$act->location.'</td></tr>';
|
||||
|
||||
|
||||
print '</table><br><br><table class="border" width="100%">';
|
||||
|
||||
|
||||
// Third party - Contact
|
||||
print '<tr><td width="30%">'.$langs->trans("ActionOnCompany").'</td><td>'.($act->societe->id?$act->societe->getNomUrl(1):$langs->trans("None"));
|
||||
if ($act->societe->id && $act->type_code == 'AC_TEL')
|
||||
{
|
||||
if ($act->societe->fetch($act->societe->id))
|
||||
{
|
||||
print "<br>".dol_print_phone($act->societe->tel);
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
print '<td>'.$langs->trans("Contact").'</td>';
|
||||
print '<td>';
|
||||
if ($act->contact->id > 0)
|
||||
{
|
||||
print $act->contact->getNomUrl(1);
|
||||
if ($act->contact->id && $act->type_code == 'AC_TEL')
|
||||
{
|
||||
if ($act->contact->fetch($act->contact->id))
|
||||
{
|
||||
print "<br>".dol_print_phone($act->contact->phone_pro);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("None");
|
||||
}
|
||||
|
||||
print '</td></tr>';
|
||||
|
||||
// Project
|
||||
if (! empty($conf->projet->enabled))
|
||||
{
|
||||
print '<tr><td valign="top">'.$langs->trans("Project").'</td><td colspan="3">';
|
||||
if ($act->fk_project)
|
||||
{
|
||||
$project=new Project($db);
|
||||
$project->fetch($act->fk_project);
|
||||
print $project->getNomUrl(1);
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Priority
|
||||
print '<tr><td nowrap>'.$langs->trans("Priority").'</td><td colspan="3">';
|
||||
print ($act->priority?$act->priority:'');
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
print '</table><br><br><table class="border" width="100%">';
|
||||
|
||||
// Construit liste des fichiers
|
||||
$filearray=dol_dir_list($upload_dir,"files",0,'','\.meta$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
|
||||
$totalsize=0;
|
||||
foreach($filearray as $key => $file)
|
||||
}
|
||||
print '</td>';
|
||||
print '<td>'.$langs->trans("Contact").'</td>';
|
||||
print '<td>';
|
||||
if ($act->contact->id > 0)
|
||||
{
|
||||
print $act->contact->getNomUrl(1);
|
||||
if ($act->contact->id && $act->type_code == 'AC_TEL')
|
||||
{
|
||||
$totalsize+=$file['size'];
|
||||
if ($act->contact->fetch($act->contact->id))
|
||||
{
|
||||
print "<br>".dol_print_phone($act->contact->phone_pro);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
print '<tr><td width="30%" nowrap>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>';
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
|
||||
// Affiche formulaire upload
|
||||
$formfile=new FormFile($db);
|
||||
$formfile->form_attach_new_file(DOL_URL_ROOT.'/comm/action/document.php?id='.$act->id,'',0,0,($user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create));
|
||||
|
||||
|
||||
// List of document
|
||||
$param='&id='.$act->id;
|
||||
$formfile->list_of_documents($filearray,$act,'actions',$param,0,'',$user->rights->agenda->myactions->create);
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
print $langs->trans("None");
|
||||
}
|
||||
|
||||
print '</td></tr>';
|
||||
|
||||
// Project
|
||||
if (! empty($conf->projet->enabled))
|
||||
{
|
||||
print '<tr><td valign="top">'.$langs->trans("Project").'</td><td colspan="3">';
|
||||
if ($act->fk_project)
|
||||
{
|
||||
$project=new Project($db);
|
||||
$project->fetch($act->fk_project);
|
||||
print $project->getNomUrl(1);
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Priority
|
||||
print '<tr><td nowrap>'.$langs->trans("Priority").'</td><td colspan="3">';
|
||||
print ($act->priority?$act->priority:'');
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
print '</table><br><br><table class="border" width="100%">';
|
||||
|
||||
// Construit liste des fichiers
|
||||
$filearray=dol_dir_list($upload_dir,"files",0,'','\.meta$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
|
||||
$totalsize=0;
|
||||
foreach($filearray as $key => $file)
|
||||
{
|
||||
$totalsize+=$file['size'];
|
||||
}
|
||||
|
||||
|
||||
print '<tr><td width="30%" nowrap>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>';
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
|
||||
// Affiche formulaire upload
|
||||
$formfile=new FormFile($db);
|
||||
$formfile->form_attach_new_file(DOL_URL_ROOT.'/comm/action/document.php?id='.$act->id,'',0,0,($user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create),50,$act);
|
||||
|
||||
|
||||
// List of document
|
||||
$param='&id='.$act->id;
|
||||
$formfile->list_of_documents($filearray,$act,'actions',$param,0,'',$user->rights->agenda->myactions->create);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -53,7 +53,7 @@ $contactid=GETPOST('contactid','int');
|
||||
$socid = GETPOST('socid','int');
|
||||
$id = GETPOST('id','int');
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
//$result = restrictedArea($user, 'agenda', $id, 'actioncomm', 'actions', '', 'id');
|
||||
$result = restrictedArea($user, 'agenda', $id, 'actioncomm&societe', 'myactions&allactions', '', 'id');
|
||||
|
||||
$error=GETPOST("error");
|
||||
$mesg='';
|
||||
@@ -311,6 +311,7 @@ if ($action == 'update')
|
||||
$datep=dol_mktime($fulldayevent?'00':$aphour, $fulldayevent?'00':$apmin, 0, $_POST["apmonth"], $_POST["apday"], $_POST["apyear"]);
|
||||
$datef=dol_mktime($fulldayevent?'23':$p2hour, $fulldayevent?'59':$p2min, $fulldayevent?'59':'0', $_POST["p2month"], $_POST["p2day"], $_POST["p2year"]);
|
||||
|
||||
$actioncomm->fk_action = dol_getIdFromCode($db, $_POST["actioncode"], 'c_actioncomm');
|
||||
$actioncomm->label = $_POST["label"];
|
||||
$actioncomm->datep = $datep;
|
||||
$actioncomm->datef = $datef;
|
||||
@@ -426,7 +427,7 @@ if ($action == 'create')
|
||||
$(".fulldaystartmin").attr("disabled","disabled").val("00");
|
||||
$(".fulldayendhour").attr("disabled","disabled").val("23");
|
||||
$(".fulldayendmin").attr("disabled","disabled").val("59");
|
||||
$("#p2").attr("disabled","disabled").val("");
|
||||
$("#p2").removeAttr("disabled");
|
||||
}
|
||||
}
|
||||
setdatefields();
|
||||
@@ -467,16 +468,7 @@ if ($action == 'create')
|
||||
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
|
||||
{
|
||||
print '<tr><td width="30%"><span class="fieldrequired">'.$langs->trans("Type").'</span></b></td><td>';
|
||||
if (GETPOST("actioncode"))
|
||||
{
|
||||
print '<input type="hidden" name="actioncode" value="'.GETPOST("actioncode").'">'."\n";
|
||||
$cactioncomm->fetch(GETPOST("actioncode"));
|
||||
print $cactioncomm->getNomUrl();
|
||||
}
|
||||
else
|
||||
{
|
||||
$htmlactions->select_type_actions($actioncomm->type_code, "actioncode","systemauto");
|
||||
}
|
||||
$htmlactions->select_type_actions(GETPOST("actioncode")?GETPOST("actioncode"):$actioncomm->type_code, "actioncode","systemauto");
|
||||
print '</td></tr>';
|
||||
}
|
||||
else print '<input type="hidden" name="actioncode" value="AC_OTH">';
|
||||
@@ -739,7 +731,9 @@ if ($id > 0)
|
||||
// Type
|
||||
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
|
||||
{
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Type").'</td><td colspan="3">'.$act->type.'</td></tr>';
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Type").'</td><td colspan="3">';
|
||||
$htmlactions->select_type_actions(GETPOST("actioncode")?GETPOST("actioncode"):$act->type_code, "actioncode","systemauto");
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Title
|
||||
|
||||
@@ -88,6 +88,7 @@ if (GETPOST('viewday')) {
|
||||
$action='show_day'; $day=($day?$day:date("d"));
|
||||
} // View by day
|
||||
|
||||
$langs->load("agenda");
|
||||
$langs->load("other");
|
||||
$langs->load("commercial");
|
||||
|
||||
|
||||
@@ -31,6 +31,8 @@ require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
|
||||
|
||||
$langs->load("commercial");
|
||||
|
||||
$id = GETPOST('id','int');
|
||||
|
||||
// Security check
|
||||
if ($user->societe_id > 0)
|
||||
{
|
||||
@@ -38,6 +40,7 @@ if ($user->societe_id > 0)
|
||||
$socid = $user->societe_id;
|
||||
}
|
||||
|
||||
$result = restrictedArea($user, 'agenda', $id, 'actioncomm&societe', 'myactions&allactions', '', 'id');
|
||||
|
||||
|
||||
/*
|
||||
@@ -48,8 +51,8 @@ $help_url='EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda';
|
||||
llxHeader('',$langs->trans("Agenda"),$help_url);
|
||||
|
||||
$act = new ActionComm($db);
|
||||
$act->fetch($_GET["id"]);
|
||||
$act->info($_GET["id"]);
|
||||
$act->fetch($id);
|
||||
$act->info($act->id);
|
||||
|
||||
$head=actions_prepare_head($act);
|
||||
dol_fiche_head($head, 'info', $langs->trans("Action"),0,'action');
|
||||
|
||||
@@ -153,9 +153,9 @@ $sql.= " ua.login as loginauthor, ua.rowid as useridauthor,";
|
||||
$sql.= " ut.login as logintodo, ut.rowid as useridtodo,";
|
||||
$sql.= " ud.login as logindone, ud.rowid as useriddone,";
|
||||
$sql.= " sp.name, sp.firstname";
|
||||
$sql.= " FROM (".MAIN_DB_PREFIX."c_actioncomm as c,";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm as c,";
|
||||
$sql.= " ".MAIN_DB_PREFIX.'user as u,';
|
||||
$sql.= " ".MAIN_DB_PREFIX."actioncomm as a)";
|
||||
$sql.= " ".MAIN_DB_PREFIX."actioncomm as a";
|
||||
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
|
||||
|
||||
@@ -30,7 +30,8 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/modules/action/rapport.pdf.php';
|
||||
|
||||
$langs->load("commercial");
|
||||
$langs->load("agenda");
|
||||
$langs->load("commercial");
|
||||
|
||||
$action=GETPOST('action','alpha');
|
||||
$month=GETPOST('month');
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -179,6 +179,8 @@ class Mailing extends CommonObject
|
||||
*/
|
||||
function fetch($rowid)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$sql = "SELECT m.rowid, m.titre, m.sujet, m.body, m.bgcolor, m.bgimage";
|
||||
$sql.= ", m.email_from, m.email_replyto, m.email_errorsto";
|
||||
$sql.= ", m.statut, m.nbemail";
|
||||
@@ -203,8 +205,14 @@ class Mailing extends CommonObject
|
||||
$this->statut = $obj->statut;
|
||||
$this->nbemail = $obj->nbemail;
|
||||
$this->titre = $obj->titre;
|
||||
$this->sujet = $obj->sujet;
|
||||
$this->body = $obj->body;
|
||||
|
||||
$this->sujet = $obj->sujet;
|
||||
if (!empty($conf->global->FCKEDITOR_ENABLE_MAILING) && dol_textishtml(dol_html_entity_decode($obj->body, ENT_COMPAT | ENT_HTML401))) {
|
||||
$this->body = dol_html_entity_decode($obj->body, ENT_COMPAT | ENT_HTML401);
|
||||
}else {
|
||||
$this->body = $obj->body;
|
||||
}
|
||||
|
||||
$this->bgcolor = $obj->bgcolor;
|
||||
$this->bgimage = $obj->bgimage;
|
||||
|
||||
|
||||
@@ -63,8 +63,8 @@ $object->substitutionarray=array(
|
||||
'__OTHER3__' => 'Other3',
|
||||
'__OTHER4__' => 'Other4',
|
||||
'__OTHER5__' => 'Other5',
|
||||
'__SIGNATURE__' => 'TagSignature',
|
||||
//'__PERSONALIZED__' => 'Personalized' // Hidden because not used yet
|
||||
'__SIGNATURE__' => 'TagSignature'
|
||||
//,'__PERSONALIZED__' => 'Personalized' // Hidden because not used yet
|
||||
);
|
||||
if (! empty($conf->global->MAILING_EMAIL_UNSUBSCRIBE))
|
||||
{
|
||||
@@ -88,8 +88,8 @@ $object->substitutionarrayfortest=array(
|
||||
'__OTHER3__' => 'TESTOther3',
|
||||
'__OTHER4__' => 'TESTOther4',
|
||||
'__OTHER5__' => 'TESTOther5',
|
||||
'__SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))?$user->signature:''),
|
||||
//'__PERSONALIZED__' => 'TESTPersonalized' // Not used yet
|
||||
'__SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))?$user->signature:'')
|
||||
//,'__PERSONALIZED__' => 'TESTPersonalized' // Not used yet
|
||||
);
|
||||
if (!empty($conf->global->MAILING_EMAIL_UNSUBSCRIBE))
|
||||
{
|
||||
|
||||
@@ -176,7 +176,7 @@ if ($result)
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td nowrap="nowrap"><a href="fiche.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowEMail"),"email").' '.$obj->rowid.'</a></td>';
|
||||
print '<td>'.dol_trunc($obj->titre,38).'</td>';
|
||||
print '<td align="center">'.dol_print_date($obj->date_creat,'day').'</td>';
|
||||
print '<td align="center">'.dol_print_date($db->jdate($obj->date_creat),'day').'</td>';
|
||||
print '<td align="center">'.($obj->nbemail?$obj->nbemail:"0").'</td>';
|
||||
$mailstatic=new Mailing($db);
|
||||
print '<td align="right">'.$mailstatic->LibStatut($obj->statut,5).'</td>';
|
||||
|
||||
@@ -641,7 +641,8 @@ else if ($action == "addline" && $user->rights->propal->creer)
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")), 'errors');
|
||||
$error++;
|
||||
}
|
||||
if ((empty($idprod) || GETPOST('usenewaddlineform')) && (!($price_ht >= 0) || $price_ht == '')) // Unit price can be 0 but not ''
|
||||
|
||||
if ((empty($idprod) || GETPOST('usenewaddlineform')) && $price_ht == '') // Unit price can be 0 but not ''. Also price can be negative for proposal.
|
||||
{
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("UnitPriceHT")), 'errors');
|
||||
$error++;
|
||||
@@ -737,16 +738,16 @@ else if ($action == "addline" && $user->rights->propal->creer)
|
||||
|
||||
$desc=dol_concatdesc($desc,$product_desc);
|
||||
|
||||
// Add custom code and origin country into description
|
||||
if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code)))
|
||||
{
|
||||
$tmptxt='(';
|
||||
if (! empty($prod->customcode)) $tmptxt.=$langs->transnoentitiesnoconv("CustomCode").': '.$prod->customcode;
|
||||
if (! empty($prod->customcode) && ! empty($prod->country_code)) $tmptxt.=' - ';
|
||||
if (! empty($prod->country_code)) $tmptxt.=$langs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code,0,$db,$langs,0);
|
||||
$tmptxt.=')';
|
||||
$desc.= dol_concatdesc($desc, $tmptxt);
|
||||
}
|
||||
// Add custom code and origin country into description
|
||||
if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code)))
|
||||
{
|
||||
$tmptxt='(';
|
||||
if (! empty($prod->customcode)) $tmptxt.=$langs->transnoentitiesnoconv("CustomCode").': '.$prod->customcode;
|
||||
if (! empty($prod->customcode) && ! empty($prod->country_code)) $tmptxt.=' - ';
|
||||
if (! empty($prod->country_code)) $tmptxt.=$langs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code,0,$db,$langs,0);
|
||||
$tmptxt.=')';
|
||||
$desc= dol_concatdesc($desc, $tmptxt);
|
||||
}
|
||||
}
|
||||
|
||||
$type = $prod->type;
|
||||
@@ -919,7 +920,7 @@ else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('sa
|
||||
GETPOST('fk_parent_line'),
|
||||
0,
|
||||
$fournprice,
|
||||
$buying_price,
|
||||
$buyingprice,
|
||||
$label,
|
||||
$type
|
||||
);
|
||||
@@ -1828,7 +1829,7 @@ if ($action == 'presend')
|
||||
{
|
||||
$ref = dol_sanitizeFileName($object->ref);
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
$fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($object->ref,'/'));
|
||||
$fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($ref,'/'));
|
||||
$file=$fileparams['fullname'];
|
||||
|
||||
// Build document if it not exists
|
||||
@@ -1851,7 +1852,7 @@ if ($action == 'presend')
|
||||
dol_print_error($db,$result);
|
||||
exit;
|
||||
}
|
||||
$fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($object->ref,'/'));
|
||||
$fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($ref,'/'));
|
||||
$file=$fileparams['fullname'];
|
||||
}
|
||||
|
||||
@@ -1904,4 +1905,4 @@ if ($action == 'presend')
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
?>
|
||||
?>
|
||||
@@ -310,7 +310,7 @@ class Propal extends CommonObject
|
||||
*
|
||||
* @see add_product
|
||||
*/
|
||||
function addline($propalid, $desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $price_base_type='HT', $pu_ttc=0, $info_bits=0, $type=0, $rang=-1, $special_code=0, $fk_parent_line=0, $fk_fournprice=null, $pa_ht=0, $label='')
|
||||
function addline($propalid, $desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $price_base_type='HT', $pu_ttc=0, $info_bits=0, $type=0, $rang=-1, $special_code=0, $fk_parent_line=0, $fk_fournprice=0, $pa_ht=0, $label='')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@@ -466,7 +466,7 @@ class Propal extends CommonObject
|
||||
* @param int $type 0/1=Product/service
|
||||
* @return int 0 if OK, <0 if KO
|
||||
*/
|
||||
function updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0, $txlocaltax2=0, $desc='', $price_base_type='HT', $info_bits=0, $special_code=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='', $type=0)
|
||||
function updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0, $txlocaltax2=0, $desc='', $price_base_type='HT', $info_bits=0, $special_code=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=0, $pa_ht=0, $label='', $type=0)
|
||||
{
|
||||
global $conf,$user,$langs;
|
||||
|
||||
@@ -2615,6 +2615,7 @@ class PropaleLigne
|
||||
if (empty($this->info_bits)) $this->info_bits=0;
|
||||
if (empty($this->special_code)) $this->special_code=0;
|
||||
if (empty($this->fk_parent_line)) $this->fk_parent_line=0;
|
||||
if (empty($this->fk_fournprice)) $this->fk_fournprice=0;
|
||||
|
||||
if (empty($this->pa_ht)) $this->pa_ht=0;
|
||||
|
||||
@@ -2631,10 +2632,13 @@ class PropaleLigne
|
||||
|
||||
// Insert line into database
|
||||
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'propaldet';
|
||||
$sql.= ' (fk_propal, fk_parent_line, label, description, fk_product, product_type, fk_remise_except, qty, tva_tx, localtax1_tx, localtax2_tx,';
|
||||
$sql.= ' (fk_propal, fk_parent_line, label, description, fk_product, product_type,';
|
||||
$sql.= ' fk_remise_except, qty, tva_tx, localtax1_tx, localtax2_tx,';
|
||||
$sql.= ' subprice, remise_percent, ';
|
||||
$sql.= ' info_bits, ';
|
||||
$sql.= ' total_ht, total_tva, total_localtax1, total_localtax2, total_ttc, fk_product_fournisseur_price, buy_price_ht, special_code, rang)';
|
||||
$sql.= ' total_ht, total_tva, total_localtax1, total_localtax2,';
|
||||
$sql.= ' total_ttc, fk_product_fournisseur_price, buy_price_ht,';
|
||||
$sql.= ' special_code, rang)';
|
||||
$sql.= " VALUES (".$this->fk_propal.",";
|
||||
$sql.= " ".($this->fk_parent_line>0?"'".$this->fk_parent_line."'":"null").",";
|
||||
$sql.= " ".(! empty($this->label)?"'".$this->db->escape($this->label)."'":"null").",";
|
||||
@@ -2648,13 +2652,13 @@ class PropaleLigne
|
||||
$sql.= " ".price2num($this->localtax2_tx).",";
|
||||
$sql.= " ".($this->subprice?price2num($this->subprice):'null').",";
|
||||
$sql.= " ".price2num($this->remise_percent).",";
|
||||
$sql.= " '".$this->info_bits."',";
|
||||
$sql.= " ".(isset($this->info_bits)?"'".$this->info_bits."'":"null").",";
|
||||
$sql.= " ".price2num($this->total_ht).",";
|
||||
$sql.= " ".price2num($this->total_tva).",";
|
||||
$sql.= " ".price2num($this->total_localtax1).",";
|
||||
$sql.= " ".price2num($this->total_localtax2).",";
|
||||
$sql.= " ".price2num($this->total_ttc).",";
|
||||
$sql.= " ".(isset($this->fk_fournprice)?"'".$this->fk_fournprice."'":"null").",";
|
||||
$sql.= " ".(!empty($this->fk_fournprice)?"'".$this->fk_fournprice."'":"null").",";
|
||||
$sql.= " ".(isset($this->pa_ht)?"'".price2num($this->pa_ht)."'":"null").",";
|
||||
$sql.= ' '.$this->special_code.',';
|
||||
$sql.= ' '.$this->rang;
|
||||
@@ -2752,6 +2756,7 @@ class PropaleLigne
|
||||
if (empty($this->info_bits)) $this->info_bits=0;
|
||||
if (empty($this->special_code)) $this->special_code=0;
|
||||
if (empty($this->fk_parent_line)) $this->fk_parent_line=0;
|
||||
if (empty($this->fk_parent_line)) $this->fk_fournprice=0;
|
||||
|
||||
if (empty($this->pa_ht)) $this->pa_ht=0;
|
||||
|
||||
@@ -2784,13 +2789,13 @@ class PropaleLigne
|
||||
$sql.= " , total_localtax1=".price2num($this->total_localtax1)."";
|
||||
$sql.= " , total_localtax2=".price2num($this->total_localtax2)."";
|
||||
}
|
||||
$sql.= " , fk_product_fournisseur_price='".$this->fk_fournprice."'";
|
||||
$sql.= " , buy_price_ht='".price2num($this->pa_ht)."'";
|
||||
$sql.= " , fk_product_fournisseur_price=".(! empty($this->fk_fournprice)?"'".$this->fk_fournprice."'":"null");
|
||||
$sql.= " , buy_price_ht=".price2num($this->pa_ht);
|
||||
if (strlen($this->special_code)) $sql.= " , special_code=".$this->special_code;
|
||||
$sql.= " , fk_parent_line=".($this->fk_parent_line>0?$this->fk_parent_line:"null");
|
||||
if (! empty($this->rang)) $sql.= ", rang=".$this->rang;
|
||||
$sql.= " WHERE rowid = ".$this->rowid;
|
||||
|
||||
|
||||
dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG);
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
||||
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2010-2011 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
@@ -167,7 +167,7 @@ if ($search_societe)
|
||||
}
|
||||
if ($search_montant_ht)
|
||||
{
|
||||
$sql.= " AND p.total_ht='".$db->escape(trim($search_montant_ht))."'";
|
||||
$sql.= " AND p.total_ht='".$db->escape(price2num(trim($search_montant_ht)))."'";
|
||||
}
|
||||
if ($sall) $sql.= " AND (s.nom LIKE '%".$db->escape($sall)."%' OR p.note LIKE '%".$db->escape($sall)."%' OR pd.description LIKE '%".$db->escape($sall)."%')";
|
||||
if ($socid) $sql.= ' AND s.rowid = '.$socid;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* 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
|
||||
@@ -52,19 +53,19 @@ $object = new Prospect($db);
|
||||
|
||||
if ($action == 'cstc')
|
||||
{
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_stcomm = ".$_GET["stcomm"];
|
||||
$sql .= " WHERE rowid = ".$socid;
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_stcomm = ".$db->escape(GETPOST('stcomm'));
|
||||
$sql.= " WHERE rowid = ".$socid;
|
||||
$db->query($sql);
|
||||
}
|
||||
// set prospect level
|
||||
if ($action == 'setprospectlevel' && $user->rights->societe->creer)
|
||||
{
|
||||
$object->fetch($socid);
|
||||
$object->fk_prospectlevel=$_POST['prospect_level_id'];
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_prospectlevel='".$_POST['prospect_level_id'];
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_prospectlevel='".$db->escape(GETPOST('prospect_level_id'))."'";
|
||||
$sql.= " WHERE rowid = ".$socid;
|
||||
$result = $db->query($sql);
|
||||
if (! $result) dol_print_error($result);
|
||||
else $object->fk_prospectlevel=GETPOST('prospect_level_id');
|
||||
}
|
||||
|
||||
|
||||
@@ -249,7 +250,7 @@ if ($socid > 0)
|
||||
{
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastPropals",($num<=$MAXLIST?"":$MAXLIST)).'</td><td align="right"><a href="'.DOL_URL_ROOT.'/comm/propal.php?socid='.$object->id.'">'.$langs->trans("AllPropals").' ('.$num.')</a></td>';
|
||||
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastPropals",($num<=$MAXLIST?"":$MAXLIST)).'</td><td align="right"><a href="'.DOL_URL_ROOT.'/comm/propal/list.php?socid='.$object->id.'">'.$langs->trans("AllPropals").' ('.$num.')</a></td>';
|
||||
print '<td width="20px" align="right"><a href="'.DOL_URL_ROOT.'/comm/propal/stats/index.php?socid='.$object->id.'">'.img_picto($langs->trans("Statistics"),'stats').'</a></td>';
|
||||
print '</tr></table></td>';
|
||||
print '</tr>';
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
*
|
||||
* 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
|
||||
@@ -244,7 +245,7 @@ if ($resql)
|
||||
llxHeader('',$langs->trans("ThirdParty"),$help_url);
|
||||
}
|
||||
|
||||
$param='&stcomm='.$stcomm.'&search_nom='.urlencode($search_nom).'&search_zipcode='.urlencode($search_code).'&search_ville='.urlencode($search_ville);
|
||||
$param='&stcomm='.$stcomm.'&search_nom='.urlencode($search_nom).'&search_zipcode='.urlencode($search_zipcode).'&search_ville='.urlencode($search_ville);
|
||||
// Added by Matelli
|
||||
// Store the status filter in the URL
|
||||
if (isSet($search_cstc))
|
||||
|
||||
@@ -914,6 +914,12 @@ class Commande extends CommonOrder
|
||||
$line->special_code = $object->lines[$i]->special_code;
|
||||
$line->fk_parent_line = $object->lines[$i]->fk_parent_line;
|
||||
|
||||
$line->fk_fournprice = $object->lines[$i]->fk_fournprice;
|
||||
$marginInfos = getMarginInfos($object->lines[$i]->subprice, $object->lines[$i]->remise_percent, $object->lines[$i]->tva_tx, $object->lines[$i]->localtax1_tx, $object->lines[$i]->localtax2_tx, $object->lines[$i]->fk_fournprice, $object->lines[$i]->pa_ht);
|
||||
$line->pa_ht = $marginInfos[0];
|
||||
$line->marge_tx = $marginInfos[1];
|
||||
$line->marque_tx = $marginInfos[2];
|
||||
|
||||
$this->lines[$i] = $line;
|
||||
}
|
||||
|
||||
|
||||
@@ -660,7 +660,7 @@ else if ($action == 'addline' && $user->rights->commande->creer)
|
||||
if (! empty($prod->customcode) && ! empty($prod->country_code)) $tmptxt.=' - ';
|
||||
if (! empty($prod->country_code)) $tmptxt.=$langs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code,0,$db,$langs,0);
|
||||
$tmptxt.=')';
|
||||
$desc.= dol_concatdesc($desc, $tmptxt);
|
||||
$desc= dol_concatdesc($desc, $tmptxt);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -725,6 +725,8 @@ else if ($action == 'addline' && $user->rights->commande->creer)
|
||||
|
||||
if ($result > 0)
|
||||
{
|
||||
$ret=$object->fetch($object->id); // Reload to get new records
|
||||
|
||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
|
||||
{
|
||||
// Define output language
|
||||
@@ -737,7 +739,6 @@ else if ($action == 'addline' && $user->rights->commande->creer)
|
||||
$outputlangs->setDefaultLang($newlang);
|
||||
}
|
||||
|
||||
$ret=$object->fetch($object->id); // Reload to get new records
|
||||
commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager);
|
||||
}
|
||||
|
||||
@@ -2358,7 +2359,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
|
||||
{
|
||||
$ref = dol_sanitizeFileName($object->ref);
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
$fileparams = dol_most_recent_file($conf->commande->dir_output . '/' . $ref, preg_quote($object->ref,'/'));
|
||||
$fileparams = dol_most_recent_file($conf->commande->dir_output . '/' . $ref, preg_quote($ref,'/'));
|
||||
$file=$fileparams['fullname'];
|
||||
|
||||
// Build document if it not exists
|
||||
@@ -2381,7 +2382,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
|
||||
dol_print_error($db,$result);
|
||||
exit;
|
||||
}
|
||||
$fileparams = dol_most_recent_file($conf->commande->dir_output . '/' . $ref, preg_quote($object->ref,'/'));
|
||||
$fileparams = dol_most_recent_file($conf->commande->dir_output . '/' . $ref, preg_quote($ref,'/'));
|
||||
$file=$fileparams['fullname'];
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
||||
@@ -129,7 +130,8 @@ if ($viewstatut <> '')
|
||||
{
|
||||
if ($viewstatut < 4 && $viewstatut > -3)
|
||||
{
|
||||
$sql.= ' AND c.fk_statut ='.$viewstatut; // brouillon, validee, en cours, annulee
|
||||
if ($viewstatut == 1 && empty($conf->expedition->enabled)) $sql.= ' AND c.fk_statut IN (1,2)'; // If module expedition disabled, we include order with status 'sending in process' into 'validated'
|
||||
else $sql.= ' AND c.fk_statut = '.$viewstatut; // brouillon, validee, en cours, annulee
|
||||
if ($viewstatut == 3)
|
||||
{
|
||||
$sql.= ' AND c.facture = 0'; // need to create invoice
|
||||
@@ -222,7 +224,7 @@ if ($resql)
|
||||
if ($viewstatut == -2)
|
||||
$title.=' - '.$langs->trans('StatusOrderToProcessShort');
|
||||
if ($viewstatut == -3)
|
||||
$title.=' - '.$langs->trans('StatusOrderValidated').', '.$langs->trans("StatusOrderSent").', '.$langs->trans('StatusOrderToBill');
|
||||
$title.=' - '.$langs->trans('StatusOrderValidated').', '.(empty($conf->expedition->enabled)?'':$langs->trans("StatusOrderSent").', ').$langs->trans('StatusOrderToBill');
|
||||
|
||||
$param='&socid='.$socid.'&viewstatut='.$viewstatut;
|
||||
if ($ordermonth) $param.='&ordermonth='.$ordermonth;
|
||||
|
||||
@@ -28,9 +28,9 @@
|
||||
*/
|
||||
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php';
|
||||
@@ -51,37 +51,32 @@ $sref = GETPOST('sref');
|
||||
$sref_client = GETPOST('sref_client');
|
||||
$sall = GETPOST('sall');
|
||||
$socid = GETPOST('socid','int');
|
||||
$selected = GETPOST('orders_to_invoice');
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$viewstatut = GETPOST('viewstatut');
|
||||
|
||||
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
if (! $sortfield) $sortfield='c.rowid';
|
||||
if (! $sortorder) $sortorder='DESC';
|
||||
|
||||
$date_start=dol_mktime(0,0,0,$_REQUEST["date_startmonth"],$_REQUEST["date_startday"],$_REQUEST["date_startyear"]); // Date for local PHP server
|
||||
$date_end=dol_mktime(23,59,59,$_REQUEST["date_endmonth"],$_REQUEST["date_endday"],$_REQUEST["date_endyear"]);
|
||||
$date_starty=dol_mktime(0,0,0,$_REQUEST["date_start_delymonth"],$_REQUEST["date_start_delyday"],$_REQUEST["date_start_delyyear"]); // Date for local PHP server
|
||||
$date_endy=dol_mktime(23,59,59,$_REQUEST["date_end_delymonth"],$_REQUEST["date_end_delyday"],$_REQUEST["date_end_delyyear"]);
|
||||
$selected=GETPOST('orders_to_invoice');
|
||||
$action=GETPOST('action','alpha');
|
||||
$now = dol_now();
|
||||
$date_start = dol_mktime(0,0,0,$_REQUEST["date_startmonth"],$_REQUEST["date_startday"],$_REQUEST["date_startyear"]); // Date for local PHP server
|
||||
$date_end = dol_mktime(23,59,59,$_REQUEST["date_endmonth"],$_REQUEST["date_endday"],$_REQUEST["date_endyear"]);
|
||||
$date_starty = dol_mktime(0,0,0,$_REQUEST["date_start_delymonth"],$_REQUEST["date_start_delyday"],$_REQUEST["date_start_delyyear"]); // Date for local PHP server
|
||||
$date_endy = dol_mktime(23,59,59,$_REQUEST["date_end_delymonth"],$_REQUEST["date_end_delyday"],$_REQUEST["date_end_delyyear"]);
|
||||
|
||||
if ($action == 'create')
|
||||
{
|
||||
if (! is_array($selected))
|
||||
if (is_array($selected) == false)
|
||||
{
|
||||
$mesgs[]='<div class="error">'.$langs->trans('Error_OrderNotChecked').'</div>';
|
||||
$mesgs = array('<div class="error">'.$langs->trans('Error_OrderNotChecked').'</div>');
|
||||
}
|
||||
else
|
||||
{
|
||||
$socid=GETPOST('socid');
|
||||
$action=GETPOST('action');
|
||||
$origin=GETPOST('origin');
|
||||
$originid=GETPOST('originid');
|
||||
$origin = GETPOST('origin');
|
||||
$originid = GETPOST('originid');
|
||||
}
|
||||
}
|
||||
$now=dol_now();
|
||||
|
||||
$viewstatut=GETPOST('viewstatut');
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@@ -89,17 +84,12 @@ $viewstatut=GETPOST('viewstatut');
|
||||
|
||||
if (($action == 'create' || $action == 'add') && empty($mesgs))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
if (! empty($conf->projet->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
|
||||
}
|
||||
$langs->load('bills');
|
||||
$langs->load('products');
|
||||
@@ -292,7 +282,9 @@ if (($action == 'create' || $action == 'add') && empty($mesgs))
|
||||
$lines[$i]->special_code,
|
||||
$object->origin,
|
||||
$lines[$i]->rowid,
|
||||
$fk_parent_line
|
||||
$fk_parent_line,
|
||||
$lines[$i]->fk_fournprice,
|
||||
$lines[$i]->pa_ht
|
||||
);
|
||||
if ($result > 0)
|
||||
{
|
||||
@@ -358,7 +350,7 @@ $formfile = new FormFile($db);
|
||||
$companystatic = new Societe($db);
|
||||
|
||||
// Mode creation
|
||||
if ($action == 'create')
|
||||
if ($action == 'create' && empty($mesgs))
|
||||
{
|
||||
$facturestatic=new Facture($db);
|
||||
|
||||
|
||||
@@ -1,192 +0,0 @@
|
||||
<?php
|
||||
/* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.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
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file /htdocs/admin/commissions.php
|
||||
* \ingroup commissions
|
||||
* \brief Page to setup advanced commissions module
|
||||
*/
|
||||
|
||||
include '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/commissions/lib/commissions.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php');
|
||||
require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php");
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->load("bills");
|
||||
$langs->load("commissions");
|
||||
|
||||
if (! $user->admin) accessforbidden();
|
||||
|
||||
|
||||
/*
|
||||
* Action
|
||||
*/
|
||||
if (GETPOST('commissionBase'))
|
||||
{
|
||||
if (dolibarr_set_const($db, 'COMMISSION_BASE', GETPOST('commissionBase'), 'string', 0, '', $conf->entity) > 0)
|
||||
{
|
||||
$conf->global->COMMISSION_BASE = GETPOST('commissionBase');
|
||||
setEventMessage($langs->trans("RecordModifiedSuccessfully"));
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
if (GETPOST('productCommissionRate'))
|
||||
{
|
||||
if (dolibarr_set_const($db, 'PRODUCT_COMMISSION_RATE', GETPOST('productCommissionRate'), 'rate', 0, '', $conf->entity) > 0)
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
if (GETPOST('serviceCommissionRate'))
|
||||
{
|
||||
if (dolibarr_set_const($db, 'SERVICE_COMMISSION_RATE', GETPOST('serviceCommissionRate'), 'rate', 0, '', $conf->entity) > 0)
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
if (GETPOST('AGENT_CONTACT_TYPE'))
|
||||
{
|
||||
if (dolibarr_set_const($db, 'AGENT_CONTACT_TYPE', GETPOST('AGENT_CONTACT_TYPE'), 'chaine', 0, '', $conf->entity) > 0)
|
||||
{
|
||||
$conf->global->AGENT_CONTACT_TYPE = GETPOST('AGENT_CONTACT_TYPE');
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader('',$langs->trans("CommissionsSetup"));
|
||||
|
||||
|
||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print_fiche_titre($langs->trans("commissionsSetup"),$linkback,'setup');
|
||||
|
||||
|
||||
$head = commissions_admin_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'parameters', $langs->trans("Commissions"), 0, 'commissions');
|
||||
|
||||
print "<br>";
|
||||
|
||||
|
||||
print_fiche_titre($langs->trans("MemberMainOptions"),'','');
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Description").'</td>';
|
||||
print '<td align="left">'.$langs->trans("Value").'</td>'."\n";
|
||||
print '<td align="left">'.$langs->trans("Details").'</td>'."\n";
|
||||
print '</tr>';
|
||||
|
||||
$var=true;
|
||||
$form = new Form($db);
|
||||
|
||||
print '<form method="post">';
|
||||
|
||||
// COMMISSION BASE (TURNOVER / MARGIN)
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td>'.$langs->trans("CommissionBase").'</td>';
|
||||
print '<td align="left">';
|
||||
print '<input type="radio" name="commissionBase" value="TURNOVER" ';
|
||||
if (isset($conf->global->COMMISSION_BASE) && $conf->global->COMMISSION_BASE == "TURNOVER")
|
||||
print 'checked';
|
||||
print ' />';
|
||||
print $langs->trans("CommissionBasedOnTurnover");
|
||||
print '<br/>';
|
||||
print '<input type="radio" name="commissionBase" value="MARGIN" ';
|
||||
if (empty($conf->margin->enabled))
|
||||
print 'disabled';
|
||||
elseif (isset($conf->global->COMMISSION_BASE) && $conf->global->COMMISSION_BASE == "MARGIN")
|
||||
print 'checked';
|
||||
print ' />';
|
||||
print $langs->trans("CommissionBasedOnMargins");
|
||||
print '</td>';
|
||||
print '<td>'.$langs->trans('CommissionBaseDetails');
|
||||
print '<br/>';
|
||||
print $langs->trans('CommissionBasedOnMarginsDetails');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// PRODUCT COMMISSION RATE
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td>'.$langs->trans("ProductCommissionRate").'</td>';
|
||||
print '<td align="left">';
|
||||
print '<input type="text" name="productCommissionRate" value="'.(! empty($conf->global->PRODUCT_COMMISSION_RATE)?$conf->global->PRODUCT_COMMISSION_RATE:'').'" size=6 /> %';
|
||||
print '</td>';
|
||||
print '<td>'.$langs->trans('ProductCommissionRateDetails').'</td>';
|
||||
print '</tr>';
|
||||
|
||||
// SERVICE COMMISSION RATE
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td>'.$langs->trans("ServiceCommissionRate").'</td>';
|
||||
print '<td align="left">';
|
||||
print '<input type="text" name="serviceCommissionRate" value="'.(! empty($conf->global->SERVICE_COMMISSION_RATE)?$conf->global->SERVICE_COMMISSION_RATE:'').'" size=6 /> %';
|
||||
print '</td>';
|
||||
print '<td>'.$langs->trans('ServiceCommissionRateDetails').'</td>';
|
||||
print '</tr>';
|
||||
|
||||
// INTERNAL CONTACT TYPE USED AS COMMERCIAL AGENT
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td>'.$langs->trans("AgentContactType").'</td>';
|
||||
print '<td align="left">';
|
||||
$formcompany = new FormCompany($db);
|
||||
$facture = new Facture($db);
|
||||
print $formcompany->selectTypeContact($facture, $conf->global->AGENT_CONTACT_TYPE, "AGENT_CONTACT_TYPE","internal","code",1);
|
||||
print '</td>';
|
||||
print '<td>'.$langs->trans('AgentContactTypeDetails').'</td>';
|
||||
print '</tr>';
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td align="center" colspan="3">';
|
||||
print '<input type="submit" class="button" />';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '<br>';
|
||||
|
||||
llxFooter();
|
||||
$db->close();
|
||||
?>
|
||||
@@ -1,329 +0,0 @@
|
||||
<?php
|
||||
/* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.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
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/commissions/index.php
|
||||
* \ingroup commissions
|
||||
* \brief Page des commissions par agent commercial
|
||||
*/
|
||||
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
if (! empty($conf->margin->enabled))
|
||||
require_once DOL_DOCUMENT_ROOT.'/margin/lib/margins.lib.php';
|
||||
|
||||
$langs->load("companies");
|
||||
$langs->load("bills");
|
||||
$langs->load("products");
|
||||
$langs->load("commissions");
|
||||
if (! empty($conf->margin->enabled))
|
||||
$langs->load("margins");
|
||||
|
||||
// Security check
|
||||
$agentid = GETPOST('agentid','int');
|
||||
|
||||
$mesg = '';
|
||||
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$page = GETPOST("page",'int');
|
||||
if ($page == -1) { $page = 0; }
|
||||
$offset = $conf->liste_limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
|
||||
$startdate=$enddate='';
|
||||
|
||||
if (!empty($_POST['startdatemonth']))
|
||||
$startdate = date('Y-m-d', dol_mktime(12, 0, 0, $_POST['startdatemonth'], $_POST['startdateday'], $_POST['startdateyear']));
|
||||
if (!empty($_POST['enddatemonth']))
|
||||
$enddate = date('Y-m-d', dol_mktime(12, 0, 0, $_POST['enddatemonth'], $_POST['enddateday'], $_POST['enddateyear']));
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$userstatic = new User($db);
|
||||
$companystatic = new Societe($db);
|
||||
$invoicestatic=new Facture($db);
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
llxHeader('',$langs->trans("Commissions"));
|
||||
|
||||
$text=$langs->trans("Commissions");
|
||||
print_fiche_titre($text);
|
||||
|
||||
print '<form method="post" name="sel">';
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
if ($agentid > 0) {
|
||||
|
||||
print '<tr><td width="20%">'.$langs->trans('CommercialAgent').'</td>';
|
||||
print '<td colspan="4">';
|
||||
print $form->select_dolusers($agentid,'agentid',1,'',0,'','');
|
||||
print '</td></tr>';
|
||||
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
if (! $sortfield) $sortfield="s.nom";
|
||||
}
|
||||
else {
|
||||
print '<tr><td width="20%">'.$langs->trans('CommercialAgent').'</td>';
|
||||
print '<td colspan="4">';
|
||||
print $form->select_dolusers('','agentid',1,'',0,'','');
|
||||
print '</td></tr>';
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
if (! $sortfield) $sortfield="u.login";
|
||||
}
|
||||
|
||||
// Start date
|
||||
print '<td>'.$langs->trans('StartDate').'</td>';
|
||||
print '<td width="20%">';
|
||||
$form->select_date($startdate,'startdate','','',1,"sel",1,1);
|
||||
print '</td>';
|
||||
print '<td width="20%">'.$langs->trans('EndDate').'</td>';
|
||||
print '<td width="20%">';
|
||||
$form->select_date($enddate,'enddate','','',1,"sel",1,1);
|
||||
print '</td>';
|
||||
print '<td style="text-align: center;">';
|
||||
print '<input type="submit" value="'.$langs->trans('Launch').'" />';
|
||||
print '</td></tr>';
|
||||
|
||||
// Include unpayed invoices
|
||||
print '<tr><td>'.$langs->trans("IncludeUnpayedInvoices").'</td><td colspan="4">';
|
||||
print '<input id="selIncluded" type="checkbox" name="unpayed" ';
|
||||
if (GETPOST('unpayed') == 'on')
|
||||
print 'checked ';
|
||||
print '/>';
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
// Total Margin
|
||||
if ($conf->global->COMMISSION_BASE == "MARGIN") {
|
||||
print '<tr style="font-weight: bold"><td>'.$langs->trans("TotalMargin").'</td><td colspan="4">';
|
||||
print '<span id="totalBase"></span>'; // set by jquery (see below)
|
||||
print '</td></tr>';
|
||||
}
|
||||
elseif ($conf->global->COMMISSION_BASE == "TURNOVER") {
|
||||
print '<tr style="font-weight: bold"><td>'.$langs->trans("TurnoverTotal").'</td><td colspan="4">';
|
||||
print '<span id="totalBase"></span>'; // set by jquery (see below)
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Total Commission
|
||||
print '<tr style="font-weight: bold"><td>'.$langs->trans("TotalCommission").'</td><td colspan="4">';
|
||||
print '<span id="totalCommission"></span>'; // set by jquery (see below)
|
||||
print '</td></tr>';
|
||||
|
||||
print "</table>";
|
||||
print '</form>';
|
||||
|
||||
$sql = "SELECT s.nom, s.rowid as socid, s.code_client, s.client, sc.fk_user as agent,";
|
||||
$sql.= " u.login,";
|
||||
if ($conf->global->COMMISSION_BASE == "MARGIN") {
|
||||
$sql.= " sum(case d.product_type when 1 then 0 else (((d.subprice * (1 - d.remise_percent / 100)) - d.buy_price_ht) * d.qty) end) as productBase," ;
|
||||
$sql.= " sum(case d.product_type when 1 then (((d.subprice * (1 - d.remise_percent / 100)) - d.buy_price_ht) * d.qty) else 0 end) as serviceBase" ;
|
||||
}
|
||||
elseif ($conf->global->COMMISSION_BASE == "TURNOVER") {
|
||||
$sql.= " sum(case d.product_type when 1 then 0 else (((d.subprice * (1 - d.remise_percent / 100))) * d.qty) end) as productBase," ;
|
||||
$sql.= " sum(case d.product_type when 1 then (((d.subprice * (1 - d.remise_percent / 100))) * d.qty) else 0 end) as serviceBase" ;
|
||||
}
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."facture as f";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."element_contact e ON e.element_id = f.rowid and e.statut = 4 and e.fk_c_type_contact = ".(empty($conf->global->AGENT_CONTACT_TYPE)?-1:$conf->global->AGENT_CONTACT_TYPE);
|
||||
$sql.= ", ".MAIN_DB_PREFIX."facturedet as d";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."user as u";
|
||||
$sql.= " WHERE f.fk_soc = s.rowid";
|
||||
$sql.= " AND sc.fk_soc = f.fk_soc";
|
||||
if (! empty($conf->global->AGENT_CONTACT_TYPE))
|
||||
$sql.= " AND ((e.fk_socpeople IS NULL AND sc.fk_user = u.rowid) OR (e.fk_socpeople IS NOT NULL AND e.fk_socpeople = u.rowid))";
|
||||
else
|
||||
$sql .= " AND sc.fk_user = u.rowid";
|
||||
if (GETPOST('unpayed') == 'on')
|
||||
$sql.= " AND f.fk_statut > 0";
|
||||
else
|
||||
$sql.= " AND f.fk_statut > 1";
|
||||
$sql.= " AND s.entity = ".$conf->entity;
|
||||
$sql.= " AND d.fk_facture = f.rowid";
|
||||
if ($agentid > 0) {
|
||||
if (! empty($conf->global->AGENT_CONTACT_TYPE))
|
||||
$sql.= " AND ((e.fk_socpeople IS NULL AND sc.fk_user = ".$agentid.") OR (e.fk_socpeople IS NOT NULL AND e.fk_socpeople = ".$agentid."))";
|
||||
else
|
||||
$sql .= " AND sc.fk_user = ".$agentid;
|
||||
}
|
||||
if (!empty($startdate))
|
||||
$sql.= " AND f.datef >= '".$startdate."'";
|
||||
if (!empty($enddate))
|
||||
$sql.= " AND f.datef <= '".$enddate."'";
|
||||
if ($conf->global->COMMISSION_BASE == "MARGIN")
|
||||
$sql .= " AND d.buy_price_ht IS NOT NULL";
|
||||
if (($conf->global->COMMISSION_BASE == "MARGIN") && isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1)
|
||||
$sql .= " AND d.buy_price_ht <> 0";
|
||||
if ($agentid > 0)
|
||||
$sql.= " GROUP BY s.rowid";
|
||||
else
|
||||
$sql.= " GROUP BY u.rowid";
|
||||
$sql.= " ORDER BY $sortfield $sortorder ";
|
||||
//$sql.= $db->plimit($conf->liste_limit +1, $offset);
|
||||
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
|
||||
print '<br>';
|
||||
print_barre_liste($langs->trans("CommissionDetails"),$page,$_SERVER["PHP_SELF"],"",$sortfield,$sortorder,'',$num,0,'');
|
||||
|
||||
$i = 0;
|
||||
print "<table class=\"noborder\" width=\"100%\">";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
if ($agentid > 0)
|
||||
print_liste_field_titre($langs->trans("Customer"),$_SERVER["PHP_SELF"],"s.nom","","&agentid=".$agentid,'align="center"',$sortfield,$sortorder);
|
||||
else
|
||||
print_liste_field_titre($langs->trans("CommercialAgent"),$_SERVER["PHP_SELF"],"u.login","","&agentid=".$agentid,'align="center"',$sortfield,$sortorder);
|
||||
|
||||
// product commission
|
||||
if ($conf->global->COMMISSION_BASE == "MARGIN")
|
||||
print_liste_field_titre($langs->trans("ProductMargin"),$_SERVER["PHP_SELF"],"productBase","","&agentid=".$agentid,'align="right"',$sortfield,$sortorder);
|
||||
elseif ($conf->global->COMMISSION_BASE == "TURNOVER")
|
||||
print_liste_field_titre($langs->trans("ProductTurnover"),$_SERVER["PHP_SELF"],"productBase","","&agentid=".$agentid,'align="right"',$sortfield,$sortorder);
|
||||
|
||||
print_liste_field_titre($langs->trans("CommissionRate"),$_SERVER["PHP_SELF"],"","","&agentid=".$agentid,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("ProductCommission"),$_SERVER["PHP_SELF"],"","","&agentid=".$agentid,'align="right"',$sortfield,$sortorder);
|
||||
|
||||
// service commission
|
||||
if ($conf->global->COMMISSION_BASE == "MARGIN")
|
||||
print_liste_field_titre($langs->trans("ServiceMargin"),$_SERVER["PHP_SELF"],"serviceBase","","&agentid=".$agentid,'align="right"',$sortfield,$sortorder);
|
||||
elseif ($conf->global->COMMISSION_BASE == "TURNOVER")
|
||||
print_liste_field_titre($langs->trans("ServiceTurnover"),$_SERVER["PHP_SELF"],"serviceBase","","&agentid=".$agentid,'align="right"',$sortfield,$sortorder);
|
||||
|
||||
print_liste_field_titre($langs->trans("CommissionRate"),$_SERVER["PHP_SELF"],"","","&agentid=".$agentid,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("ServiceCommission"),$_SERVER["PHP_SELF"],"","","&agentid=".$agentid,'align="right"',$sortfield,$sortorder);
|
||||
|
||||
// total commission
|
||||
print_liste_field_titre($langs->trans("TotalCommission"),$_SERVER["PHP_SELF"],"","","&agentid=".$agentid,'align="right"',$sortfield,$sortorder);
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
$cumul_base_produit = 0;
|
||||
$cumul_base_service = 0;
|
||||
$cumul_commission_produit = 0;
|
||||
$cumul_commission_service = 0;
|
||||
$rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT);
|
||||
if ($num > 0)
|
||||
{
|
||||
$var=True;
|
||||
while ($i < $num && $i < $conf->liste_limit)
|
||||
{
|
||||
$objp = $db->fetch_object($result);
|
||||
|
||||
$var=!$var;
|
||||
|
||||
print "<tr $bc[$var]>";
|
||||
if ($agentid > 0) {
|
||||
$companystatic->id=$objp->socid;
|
||||
$companystatic->nom=$objp->nom;
|
||||
$companystatic->client=$objp->client;
|
||||
print "<td>".$companystatic->getNomUrl(1,'customer')."</td>\n";
|
||||
}
|
||||
else {
|
||||
$userstatic->id=$objp->agent;
|
||||
$userstatic->login=$objp->login;
|
||||
print "<td>".$userstatic->getLoginUrl(1)."</td>\n";
|
||||
}
|
||||
|
||||
// product commission
|
||||
$productCommissionRate=(! empty($conf->global->PRODUCT_COMMISSION_RATE)?$conf->global->PRODUCT_COMMISSION_RATE:0);
|
||||
$productBase=(! empty($objp->productBase)?$objp->productBase:0);
|
||||
$productCommission = (! empty($productBase)?($productCommissionRate * $productBase / 100):0);
|
||||
print "<td align=\"right\">".price($productBase)."</td>\n";
|
||||
print "<td align=\"right\">".price($productCommissionRate)."</td>\n";
|
||||
print "<td align=\"right\">".price($productCommission)."</td>\n";
|
||||
|
||||
// service commission
|
||||
$serviceCommissionRate=(! empty($conf->global->SERVICE_COMMISSION_RATE)?$conf->global->SERVICE_COMMISSION_RATE:0);
|
||||
$serviceBase=(! empty($objp->serviceBase)?$objp->serviceBase:0);
|
||||
$serviceCommission = (! empty($serviceBase)?($serviceCommissionRate * $serviceBase / 100):0);
|
||||
print "<td align=\"right\">".price($serviceBase)."</td>\n";
|
||||
print "<td align=\"right\">".price($serviceCommissionRate)."</td>\n";
|
||||
print "<td align=\"right\">".price($serviceCommission)."</td>\n";
|
||||
|
||||
// total commission
|
||||
print "<td align=\"right\">".price($productCommission + $serviceCommission)."</td>\n";
|
||||
print "</tr>\n";
|
||||
|
||||
$i++;
|
||||
|
||||
$cumul_base_produit += round($productBase, $rounding);
|
||||
$cumul_base_service += round($serviceBase, $rounding);
|
||||
$cumul_commission_produit += round($productCommission, $rounding);
|
||||
$cumul_commission_service += round($serviceCommission, $rounding);
|
||||
}
|
||||
}
|
||||
|
||||
// affichage totaux commission
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].' style="border-top: 1px solid #ccc; font-weight: bold">';
|
||||
print '<td>';
|
||||
print $langs->trans('Total');
|
||||
print "</td>";
|
||||
// product commission
|
||||
print "<td align=\"right\">".price($cumul_base_produit)."</td>\n";
|
||||
print "<td align=\"right\">".price((! empty($conf->global->PRODUCT_COMMISSION_RATE)?$conf->global->PRODUCT_COMMISSION_RATE:0))."</td>\n";
|
||||
print "<td align=\"right\">".price($cumul_commission_produit)."</td>\n";
|
||||
// service commission
|
||||
print "<td align=\"right\">".price($cumul_base_service)."</td>\n";
|
||||
print "<td align=\"right\">".price((! empty($conf->global->SERVICE_COMMISSION_RATE)?$conf->global->SERVICE_COMMISSION_RATE:0))."</td>\n";
|
||||
print "<td align=\"right\">".price($cumul_commission_service)."</td>\n";
|
||||
// total commission
|
||||
print "<td align=\"right\">".price($cumul_commission_produit + $cumul_commission_service)."</td>\n";
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
print "</td>";
|
||||
print "</table>";
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
$db->free($result);
|
||||
|
||||
|
||||
llxFooter();
|
||||
$db->close();
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
|
||||
$("#agentid").change(function() {
|
||||
$("div.fiche form").submit();
|
||||
});
|
||||
|
||||
$("#selIncluded").change(function() {
|
||||
$("div.fiche form").submit();
|
||||
});
|
||||
|
||||
$("#totalBase").html("<?php echo price($cumul_base_produit + $cumul_base_service); ?>");
|
||||
$("#totalCommission").html("<?php echo price($cumul_commission_produit + $cumul_commission_service); ?>");
|
||||
|
||||
});
|
||||
</script>
|
||||
@@ -1,52 +0,0 @@
|
||||
<?php
|
||||
/* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.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
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file /htdocs/commissions/lib/commissions.lib.php
|
||||
* \ingroup commissions
|
||||
* \brief Library for common commissions functions
|
||||
*/
|
||||
|
||||
/**
|
||||
* Define head array for tabs of marges tools setup pages
|
||||
*
|
||||
* @return Array of head
|
||||
*/
|
||||
function commissions_admin_prepare_head()
|
||||
{
|
||||
global $langs, $conf;
|
||||
|
||||
$h = 0;
|
||||
$head = array();
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/commissions/admin/commissions.php';
|
||||
$head[$h][1] = $langs->trans("Parameters");
|
||||
$head[$h][2] = 'parameters';
|
||||
$h++;
|
||||
|
||||
// Show more tabs from modules
|
||||
// Entries must be declared in modules descriptor with line
|
||||
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
||||
// $this->tabs = array('entity:-tabname); to remove a tab
|
||||
complete_head_from_modules($conf,$langs,'',$head,$h,'commissionsadmin');
|
||||
|
||||
complete_head_from_modules($conf,$langs,'',$head,$h,'commissionsadmin','remove');
|
||||
|
||||
return $head;
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -84,7 +84,7 @@ if ($id > 0 || ! empty($ref))
|
||||
$acct->fetch($id, $ref);
|
||||
}
|
||||
|
||||
if (! isset($num))
|
||||
if (empty($num))
|
||||
{
|
||||
/*
|
||||
* Vue liste tous releves confondus
|
||||
|
||||
@@ -140,6 +140,8 @@ if ($resql)
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
$langs->load('commercial');
|
||||
|
||||
print_barre_liste($langs->trans("ListOfCustomers"), $page, $_SERVER["PHP_SELF"],"",$sortfield,$sortorder,'',$num);
|
||||
|
||||
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
|
||||
@@ -29,13 +29,13 @@
|
||||
*/
|
||||
|
||||
require '../main.inc.php';
|
||||
require DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
|
||||
require DOL_DOCUMENT_ROOT . '/compta/paiement/class/paiement.class.php';
|
||||
require DOL_DOCUMENT_ROOT . '/core/modules/facture/modules_facture.php';
|
||||
require DOL_DOCUMENT_ROOT . '/core/class/discount.class.php';
|
||||
require DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php';
|
||||
require DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
|
||||
require DOL_DOCUMENT_ROOT . '/core/lib/invoice.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/compta/paiement/class/paiement.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/modules/facture/modules_facture.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/discount.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/invoice.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||
|
||||
@@ -1100,7 +1100,7 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights-
|
||||
if (! empty($prod->customcode) && ! empty($prod->country_code)) $tmptxt.=' - ';
|
||||
if (! empty($prod->country_code)) $tmptxt.=$langs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code,0,$db,$langs,0);
|
||||
$tmptxt.=')';
|
||||
$desc.= dol_concatdesc($desc, $tmptxt);
|
||||
$desc= dol_concatdesc($desc, $tmptxt);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2082,7 +2082,10 @@ if ($action == 'create')
|
||||
print '<input type="hidden" name="originid" value="'.$objectsrc->id.'">';
|
||||
|
||||
$newclassname=$classname;
|
||||
if ($newclassname=='Propal') $newclassname='CommercialProposal';
|
||||
if ($newclassname == 'Propal') $newclassname = 'CommercialProposal';
|
||||
elseif ($newclassname == 'Commande') $newclassname = 'Order';
|
||||
elseif ($newclassname == 'Expedition') $newclassname = 'Sending';
|
||||
|
||||
print '<tr><td>'.$langs->trans($newclassname).'</td><td colspan="2">'.$objectsrc->getNomUrl(1).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans('TotalHT').'</td><td colspan="2">'.price($objectsrc->total_ht).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans('TotalVAT').'</td><td colspan="2">'.price($objectsrc->total_tva)."</td></tr>";
|
||||
@@ -2787,7 +2790,7 @@ else if ($id > 0 || ! empty($ref))
|
||||
if (($object->statut == 2 || $object->statut == 3) && $object->close_code == 'discount_vat')
|
||||
{
|
||||
print '<tr><td colspan="'.$nbcols.'" align="right" nowrap="1">';
|
||||
print $form->textwithpicto($langs->trans("Escompte").':',$langs->trans("HelpEscompte"),-1);
|
||||
print $form->textwithpicto($langs->trans("Discount").':',$langs->trans("HelpEscompte"),-1);
|
||||
print '</td><td align="right">'.price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye).'</td><td> </td></tr>';
|
||||
$resteapayeraffiche=0;
|
||||
}
|
||||
@@ -3350,7 +3353,7 @@ else if ($id > 0 || ! empty($ref))
|
||||
|
||||
$ref = dol_sanitizeFileName($object->ref);
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
$fileparams = dol_most_recent_file($conf->facture->dir_output . '/' . $ref, preg_quote($object->ref,'/'));
|
||||
$fileparams = dol_most_recent_file($conf->facture->dir_output . '/' . $ref, preg_quote($ref,'/'));
|
||||
$file=$fileparams['fullname'];
|
||||
|
||||
// Build document if it not exists
|
||||
@@ -3373,7 +3376,7 @@ else if ($id > 0 || ! empty($ref))
|
||||
dol_print_error($db,$result);
|
||||
exit;
|
||||
}
|
||||
$fileparams = dol_most_recent_file($conf->facture->dir_output . '/' . $ref, preg_quote($object->ref,'/'));
|
||||
$fileparams = dol_most_recent_file($conf->facture->dir_output . '/' . $ref, preg_quote($ref,'/'));
|
||||
$file=$fileparams['fullname'];
|
||||
}
|
||||
|
||||
|
||||
@@ -122,8 +122,8 @@ class FactureRec extends Facture
|
||||
$sql.= ", '".$facsrc->socid."'";
|
||||
$sql.= ", ".$conf->entity;
|
||||
$sql.= ", ".$this->db->idate($now);
|
||||
$sql.= ", '".$facsrc->amount."'";
|
||||
$sql.= ", '".$facsrc->remise."'";
|
||||
$sql.= ", ".(!empty($facsrc->amount)?$facsrc->amount:'0');
|
||||
$sql.= ", ".(!empty($facsrc->remise)?$this->remise:'0');
|
||||
$sql.= ", '".$this->db->escape($this->note)."'";
|
||||
$sql.= ", '".$user->id."'";
|
||||
$sql.= ", ".(! empty($facsrc->fk_project)?"'".$facsrc->fk_project."'":"null");
|
||||
|
||||
@@ -1576,7 +1576,7 @@ class Facture extends CommonInvoice
|
||||
$now=dol_now();
|
||||
|
||||
$error=0;
|
||||
dol_syslog(get_class($this).'::validate user='.$user->id.', force_number='.$force_number.', idwarehouse='.$idwarehouse, LOG_WARNING);
|
||||
dol_syslog(get_class($this).'::validate user='.$user->id.', force_number='.$force_number.', idwarehouse='.$idwarehouse);
|
||||
|
||||
// Check parameters
|
||||
if (! $this->brouillon)
|
||||
@@ -2554,11 +2554,10 @@ class Facture extends CommonInvoice
|
||||
{
|
||||
$maxfacnumber = $this->getNextNumRef($this->client,'last');
|
||||
$ventilExportCompta = $this->getVentilExportCompta();
|
||||
// Si derniere facture et si non ventilee, on peut supprimer
|
||||
if ($maxfacnumber == $this->ref && $ventilExportCompta == 0)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
// If there is no invoice into the reset range and not already dispatched, we can delete
|
||||
if ($maxfacnumber == '' && $ventilExportCompta == 0) return 1;
|
||||
// If invoice to delete is last one and not already dispatched, we can delete
|
||||
if ($maxfacnumber == $this->ref && $ventilExportCompta == 0) return 1;
|
||||
}
|
||||
else if ($this->statut == 0 && $facref == 'PROV') // Si facture brouillon et provisoire
|
||||
{
|
||||
@@ -2702,10 +2701,21 @@ class Facture extends CommonInvoice
|
||||
{
|
||||
$now=dol_now();
|
||||
|
||||
$totalpaye = $this->getSommePaiement();
|
||||
$totalcreditnotes = $this->getSumCreditNotesUsed();
|
||||
$totaldeposits = $this->getSumDepositsUsed();
|
||||
//print "totalpaye=".$totalpaye." totalcreditnotes=".$totalcreditnotes." totaldeposts=".$totaldeposits;
|
||||
|
||||
// We can also use bcadd to avoid pb with floating points
|
||||
// For example print 239.2 - 229.3 - 9.9; does not return 0.
|
||||
//$resteapayer=bcadd($this->total_ttc,$totalpaye,$conf->global->MAIN_MAX_DECIMALS_TOT);
|
||||
//$resteapayer=bcadd($resteapayer,$totalavoir,$conf->global->MAIN_MAX_DECIMALS_TOT);
|
||||
$resteapayer = price2num($this->total_ttc - $totalpaye - $totalcreditnotes - $totaldeposits,'MT');
|
||||
|
||||
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'prelevement_facture_demande';
|
||||
$sql .= ' (fk_facture, amount, date_demande, fk_user_demande, code_banque, code_guichet, number, cle_rib)';
|
||||
$sql .= ' VALUES ('.$this->id;
|
||||
$sql .= ",'".price2num($this->total_ttc)."'";
|
||||
$sql .= ",'".price2num($resteapayer)."'";
|
||||
$sql .= ",".$this->db->idate($now).",".$user->id;
|
||||
$sql .= ",'".$soc->bank_account->code_banque."'";
|
||||
$sql .= ",'".$soc->bank_account->code_guichet."'";
|
||||
@@ -3458,7 +3468,7 @@ class FactureLigne
|
||||
$sql.= ",total_localtax1=".price2num($this->total_localtax1)."";
|
||||
$sql.= ",total_localtax2=".price2num($this->total_localtax2)."";
|
||||
}
|
||||
$sql.= " , fk_product_fournisseur_price='".$this->fk_fournprice."'";
|
||||
$sql.= " , fk_product_fournisseur_price=".(! empty($this->fk_fournprice)?"'".$this->db->escape($this->fk_fournprice)."'":"null");
|
||||
$sql.= " , buy_price_ht='".price2num($this->pa_ht)."'";
|
||||
$sql.= ",fk_parent_line=".($this->fk_parent_line>0?$this->fk_parent_line:"null");
|
||||
if (! empty($this->rang)) $sql.= ", rang=".$this->rang;
|
||||
|
||||
@@ -227,7 +227,7 @@ if ($search_societe) $sql .= " AND s.nom LIKE '%".$search_societe."%'";
|
||||
if ($search_montant_ht) $sql .= " AND f.total = '".$search_montant_ht."'";
|
||||
if ($search_montant_ttc) $sql .= " AND f.total_ttc = '".$search_montant_ttc."'";
|
||||
if (GETPOST('sf_ref')) $sql .= " AND f.facnumber LIKE '%".GETPOST('sf_ref') . "%'";
|
||||
$sql.= " GROUP BY f.facnumber,f.increment,f.total,f.total_ttc,f.datef, f.date_lim_reglement,f.paye, f.rowid, f.fk_statut, f.type,s.nom, s.rowid";
|
||||
$sql.= " GROUP BY s.nom, s.rowid, f.facnumber, f.increment, f.total, f.tva, f.total_ttc, f.datef, f.date_lim_reglement, f.paye, f.rowid, f.fk_statut, f.type ";
|
||||
if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user ";
|
||||
$sql.= " ORDER BY ";
|
||||
$listfield=explode(',',$sortfield);
|
||||
@@ -400,7 +400,7 @@ if ($resql)
|
||||
print '<td align="right"><b>'.price($total_tva).' '.getCurrencySymbol($conf->currency).'</b></td>';
|
||||
print '<td align="right"><b>'.price($total_ttc).' '.getCurrencySymbol($conf->currency).'</b></td>';
|
||||
print '<td align="right"><b>'.price($total_paid).' '.getCurrencySymbol($conf->currency).'</b></td>';
|
||||
print '<td align="center"> </td>';
|
||||
print '<td align="right"><b>'.price($total_ttc - $total_paid).' '.getCurrencySymbol($conf->currency).'</b></td>';
|
||||
print '<td align="center"> </td>';
|
||||
print '<td align="center"> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
||||
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
@@ -184,11 +184,11 @@ if ($search_societe)
|
||||
}
|
||||
if ($search_montant_ht)
|
||||
{
|
||||
$sql.= ' AND f.total = \''.$db->escape(trim($search_montant_ht)).'\'';
|
||||
$sql.= ' AND f.total = \''.$db->escape(price2num(trim($search_montant_ht))).'\'';
|
||||
}
|
||||
if ($search_montant_ttc)
|
||||
{
|
||||
$sql.= ' AND f.total_ttc = \''.$db->escape(trim($search_montant_ttc)).'\'';
|
||||
$sql.= ' AND f.total_ttc = \''.$db->escape(price2num(trim($search_montant_ttc))).'\'';
|
||||
}
|
||||
if ($month > 0)
|
||||
{
|
||||
@@ -210,7 +210,7 @@ if ($search_user > 0)
|
||||
}
|
||||
if (! $sall)
|
||||
{
|
||||
$sql.= ' GROUP BY f.rowid, f.facnumber, f.type, f.increment, f.total, f.total_ttc,';
|
||||
$sql.= ' GROUP BY f.rowid, f.facnumber, f.type, f.increment, f.total,f.tva, f.total_ttc,';
|
||||
$sql.= ' f.datef, f.date_lim_reglement,';
|
||||
$sql.= ' f.paye, f.fk_statut, f.note,';
|
||||
$sql.= ' s.nom, s.rowid';
|
||||
|
||||
@@ -404,6 +404,15 @@ if ($object->id > 0)
|
||||
print '<tr><td>'.$langs->trans('AmountTTC').'</td><td align="right" colspan="2" nowrap>'.price($object->total_ttc).'</td>';
|
||||
print '<td>'.$langs->trans('Currency'.$conf->currency).'</td></tr>';
|
||||
|
||||
// We can also use bcadd to avoid pb with floating points
|
||||
// For example print 239.2 - 229.3 - 9.9; does not return 0.
|
||||
//$resteapayer=bcadd($object->total_ttc,$totalpaye,$conf->global->MAIN_MAX_DECIMALS_TOT);
|
||||
//$resteapayer=bcadd($resteapayer,$totalavoir,$conf->global->MAIN_MAX_DECIMALS_TOT);
|
||||
$resteapayer = price2num($object->total_ttc - $totalpaye - $totalcreditnotes - $totaldeposits,'MT');
|
||||
|
||||
print '<tr><td>'.$langs->trans('RemainderToPay').'</td><td align="right" colspan="2" nowrap>'.price($resteapayer).'</td>';
|
||||
print '<td>'.$langs->trans('Currency'.$conf->currency).'</td></tr>';
|
||||
|
||||
// Statut
|
||||
print '<tr><td>'.$langs->trans('Status').'</td>';
|
||||
print '<td align="left" colspan="3">'.($object->getLibStatut(4,$totalpaye)).'</td></tr>';
|
||||
|
||||
@@ -941,7 +941,8 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
|
||||
$sql.= " AND ff.fk_statut = 1";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||
if ($socid) $sql.= " AND ff.fk_soc = ".$socid;
|
||||
$sql.= " GROUP BY ff.rowid, ff.facnumber, ff.fk_statut, ff.libelle, ff.total_ht, ff.total_ttc, s.nom, s.rowid";
|
||||
$sql.= " GROUP BY ff.rowid, ff.facnumber, ff.fk_statut, ff.libelle, ff.total_ht, ff.total_ttc, ff.paye,";
|
||||
$sql.= " s.nom, s.rowid";
|
||||
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
* \ingroup societe, fournisseur, facture
|
||||
* \brief Page with purchases journal
|
||||
*/
|
||||
global $mysoc;
|
||||
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
@@ -58,7 +60,7 @@ if (! empty($conf->accounting->enabled)) $result=restrictedArea($user,'accountin
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader('','','');
|
||||
llxHeader('',$langs->trans("PurchasesJournal"),'');
|
||||
|
||||
$form=new Form($db);
|
||||
|
||||
@@ -94,12 +96,14 @@ $p = explode(":", $conf->global->MAIN_INFO_SOCIETE_PAYS);
|
||||
$idpays = $p[0];
|
||||
|
||||
$sql = "SELECT f.rowid, f.facnumber, f.type, f.datef, f.libelle,";
|
||||
$sql.= " fd.total_ttc, fd.tva_tx, fd.total_ht, fd.tva as total_tva, fd.product_type,";
|
||||
$sql.= " fd.total_ttc, fd.tva_tx, fd.total_ht, fd.tva as total_tva, fd.product_type, fd.localtax1_tx, fd.localtax2_tx, fd.total_localtax1, fd.total_localtax2,";
|
||||
$sql.= " s.rowid as socid, s.nom as name, s.code_compta_fournisseur,";
|
||||
$sql.= " p.rowid as pid, p.ref as ref, p.accountancy_code_buy,";
|
||||
$sql.= " ct.accountancy_code_buy as account_tva";
|
||||
$sql.= " ct.accountancy_code_buy as account_tva, ctl1.accountancy_code_buy as account_localtax1, ctl2.accountancy_code_buy as account_localtax2";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn_det fd";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_tva ct ON fd.tva_tx = ct.taux AND ct.fk_pays = '".$idpays."'";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_tva ctl1 ON fd.localtax1_tx = ctl1.localtax1 AND ctl1.fk_pays = '".$idpays."'";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_tva ctl2 ON fd.localtax2_tx = ctl2.localtax2 AND ctl2.fk_pays = '".$idpays."'";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product p ON p.rowid = fd.fk_product";
|
||||
$sql.= " JOIN ".MAIN_DB_PREFIX."facture_fourn f ON f.rowid = fd.fk_facture_fourn";
|
||||
$sql.= " JOIN ".MAIN_DB_PREFIX."societe s ON s.rowid = f.fk_soc" ;
|
||||
@@ -120,6 +124,8 @@ if ($result)
|
||||
$tabht = array();
|
||||
$tabtva = array();
|
||||
$tabttc = array();
|
||||
$tablocaltax1 = array();
|
||||
$tablocaltax2 = array();
|
||||
$tabcompany = array();
|
||||
|
||||
$i=0;
|
||||
@@ -135,6 +141,8 @@ if ($result)
|
||||
else $compta_prod = (! empty($conf->global->COMPTA_SERVICE_BUY_ACCOUNT)?$conf->global->COMPTA_SERVICE_BUY_ACCOUNT:$langs->trans("CodeNotDef"));
|
||||
}
|
||||
$compta_tva = (! empty($obj->account_tva)?$obj->account_tva:$cpttva);
|
||||
$compta_localtax1 = (! empty($obj->account_localtax1)?$obj->account_localtax1:$langs->trans("CodeNotDef"));
|
||||
$compta_localtax2 = (! empty($obj->account_localtax2)?$obj->account_localtax2:$langs->trans("CodeNotDef"));
|
||||
|
||||
$tabfac[$obj->rowid]["date"] = $obj->datef;
|
||||
$tabfac[$obj->rowid]["ref"] = $obj->facnumber;
|
||||
@@ -143,6 +151,8 @@ if ($result)
|
||||
$tabttc[$obj->rowid][$compta_soc] += $obj->total_ttc;
|
||||
$tabht[$obj->rowid][$compta_prod] += $obj->total_ht;
|
||||
$tabtva[$obj->rowid][$compta_tva] += $obj->total_tva;
|
||||
$tablocaltax1[$obj->rowid][$compta_localtax1] += $obj->total_localtax1;
|
||||
$tablocaltax2[$obj->rowid][$compta_localtax2] += $obj->total_localtax2;
|
||||
$tabcompany[$obj->rowid]=array('id'=>$obj->socid,'name'=>$obj->name);
|
||||
|
||||
$i++;
|
||||
@@ -193,7 +203,6 @@ foreach ($tabfac as $key => $val)
|
||||
}
|
||||
}
|
||||
// vat
|
||||
//var_dump($tabtva);
|
||||
foreach ($tabtva[$key] as $k => $mt)
|
||||
{
|
||||
if ($mt)
|
||||
@@ -202,12 +211,42 @@ foreach ($tabfac as $key => $val)
|
||||
//print "<td>".$conf->global->COMPTA_JOURNAL_BUY."</td>";
|
||||
print "<td>".$val["date"]."</td>";
|
||||
print "<td>".$invoicestatic->getNomUrl(1)."</td>";
|
||||
print "<td>".$k."</td><td>".$langs->trans("VAT")." ".$key."</td>";
|
||||
print "<td>".$k."</td><td>".$langs->trans("VAT")."</td>";
|
||||
print '<td align="right">'.($mt>=0?price($mt):'')."</td>";
|
||||
print '<td align="right">'.($mt<0?price(-$mt):'')."</td>";
|
||||
print "</tr>";
|
||||
}
|
||||
}
|
||||
// localtax1
|
||||
foreach ($tablocaltax1[$key] as $k => $mt)
|
||||
{
|
||||
if ($mt)
|
||||
{
|
||||
print "<tr ".$bc[$var].">";
|
||||
//print "<td>".$conf->global->COMPTA_JOURNAL_BUY."</td>";
|
||||
print "<td>".$val["date"]."</td>";
|
||||
print "<td>".$invoicestatic->getNomUrl(1)."</td>";
|
||||
print "<td>".$k."</td><td>".$langs->transcountrynoentities("LT1",$mysoc->country_code)."</td>";
|
||||
print "<td align='right'>".($mt>=0?price($mt):'')."</td>";
|
||||
print "<td align='right'>".($mt<0?price(-$mt):'')."</td>";
|
||||
print "</tr>";
|
||||
}
|
||||
}
|
||||
// localtax2
|
||||
foreach ($tablocaltax2[$key] as $k => $mt)
|
||||
{
|
||||
if ($mt)
|
||||
{
|
||||
print "<tr ".$bc[$var].">";
|
||||
//print "<td>".$conf->global->COMPTA_JOURNAL_BUY."</td>";
|
||||
print "<td>".$val["date"]."</td>";
|
||||
print "<td>".$invoicestatic->getNomUrl(1)."</td>";
|
||||
print "<td>".$k."</td><td>".$langs->transcountrynoentities("LT2",$mysoc->country_code)."</td>";
|
||||
print "<td align='right'>".($mt>=0?price($mt):'')."</td>";
|
||||
print "<td align='right'>".($mt<0?price(-$mt):'')."</td>";
|
||||
print "</tr>";
|
||||
}
|
||||
}
|
||||
print "<tr ".$bc[$var].">";
|
||||
// third party
|
||||
//print "<td>".$conf->global->COMPTA_JOURNAL_BUY."</td>";
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2011-2012 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
||||
* Copyright (C) 2013 Marcos García <marcosgdf@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -24,6 +25,8 @@
|
||||
* \ingroup societe, facture
|
||||
* \brief Page with sells journal
|
||||
*/
|
||||
global $mysoc;
|
||||
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
@@ -42,10 +45,10 @@ $date_endmonth=GETPOST('date_endmonth');
|
||||
$date_endday=GETPOST('date_endday');
|
||||
$date_endyear=GETPOST('date_endyear');
|
||||
|
||||
// Security check
|
||||
if ($user->societe_id > 0) $socid = $user->societe_id;
|
||||
if (! empty($conf->comptabilite->enabled)) $result=restrictedArea($user,'compta','','','resultat');
|
||||
if (! empty($conf->accounting->enabled)) $result=restrictedArea($user,'accounting','','','comptarapport');
|
||||
// Security check
|
||||
if ($user->societe_id > 0) $socid = $user->societe_id;
|
||||
if (! empty($conf->comptabilite->enabled)) $result=restrictedArea($user,'compta','','','resultat');
|
||||
if (! empty($conf->accounting->enabled)) $result=restrictedArea($user,'accounting','','','comptarapport');
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@@ -96,15 +99,17 @@ $p = explode(":", $conf->global->MAIN_INFO_SOCIETE_PAYS);
|
||||
$idpays = $p[0];
|
||||
|
||||
$sql = "SELECT f.rowid, f.facnumber, f.type, f.datef, f.ref_client,";
|
||||
$sql.= " fd.product_type, fd.total_ht, fd.total_tva, fd.tva_tx, fd.total_ttc,";
|
||||
$sql.= " fd.product_type, fd.total_ht, fd.total_tva, fd.tva_tx, fd.total_ttc, fd.localtax1_tx, fd.localtax2_tx, fd.total_localtax1, fd.total_localtax2,";
|
||||
$sql.= " s.rowid as socid, s.nom as name, s.code_compta, s.client,";
|
||||
$sql.= " p.rowid as pid, p.ref as pref, p.accountancy_code_sell,";
|
||||
$sql.= " ct.accountancy_code_sell as account_tva";
|
||||
$sql.= " ct.accountancy_code_sell as account_tva, ctl1.accountancy_code_sell as account_localtax1, ctl2.accountancy_code_sell as account_localtax2";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facturedet fd";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product p ON p.rowid = fd.fk_product";
|
||||
$sql.= " JOIN ".MAIN_DB_PREFIX."facture f ON f.rowid = fd.fk_facture";
|
||||
$sql.= " JOIN ".MAIN_DB_PREFIX."societe s ON s.rowid = f.fk_soc";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_tva ct ON fd.tva_tx = ct.taux AND ct.fk_pays = '".$idpays."'";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_tva ctl1 ON fd.localtax1_tx = ctl1.localtax1 AND ctl1.fk_pays = '".$idpays."'";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_tva ctl2 ON fd.localtax2_tx = ctl2.localtax2 AND ctl2.fk_pays = '".$idpays."'";
|
||||
$sql.= " WHERE f.entity = ".$conf->entity;
|
||||
$sql.= " AND f.fk_statut > 0";
|
||||
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.type IN (0,1,2)";
|
||||
@@ -119,6 +124,8 @@ if ($result)
|
||||
$tabfac = array();
|
||||
$tabht = array();
|
||||
$tabtva = array();
|
||||
$tablocaltax1 = array();
|
||||
$tablocaltax2 = array();
|
||||
$tabttc = array();
|
||||
$tabcompany = array();
|
||||
|
||||
@@ -139,6 +146,8 @@ if ($result)
|
||||
}
|
||||
$cpttva = (! empty($conf->global->COMPTA_VAT_ACCOUNT)?$conf->global->COMPTA_VAT_ACCOUNT:$langs->trans("CodeNotDef"));
|
||||
$compta_tva = (! empty($obj->account_tva)?$obj->account_tva:$cpttva);
|
||||
$compta_localtax1 = (! empty($obj->account_localtax1)?$obj->account_localtax1:$langs->trans("CodeNotDef"));
|
||||
$compta_localtax2 = (! empty($obj->account_localtax2)?$obj->account_localtax2:$langs->trans("CodeNotDef"));
|
||||
|
||||
//la ligne facture
|
||||
$tabfac[$obj->rowid]["date"] = $obj->datef;
|
||||
@@ -147,9 +156,13 @@ if ($result)
|
||||
if (! isset($tabttc[$obj->rowid][$compta_soc])) $tabttc[$obj->rowid][$compta_soc]=0;
|
||||
if (! isset($tabht[$obj->rowid][$compta_prod])) $tabht[$obj->rowid][$compta_prod]=0;
|
||||
if (! isset($tabtva[$obj->rowid][$compta_tva])) $tabtva[$obj->rowid][$compta_tva]=0;
|
||||
if (! isset($tablocaltax1[$obj->rowid][$compta_localtax1])) $tablocaltax1[$obj->rowid][$compta_localtax1]=0;
|
||||
if (! isset($tablocaltax2[$obj->rowid][$compta_localtax2])) $tablocaltax2[$obj->rowid][$compta_localtax2]=0;
|
||||
$tabttc[$obj->rowid][$compta_soc] += $obj->total_ttc;
|
||||
$tabht[$obj->rowid][$compta_prod] += $obj->total_ht;
|
||||
$tabtva[$obj->rowid][$compta_tva] += $obj->total_tva;
|
||||
$tablocaltax1[$obj->rowid][$compta_localtax1] += $obj->total_localtax1;
|
||||
$tablocaltax2[$obj->rowid][$compta_localtax2] += $obj->total_localtax2;
|
||||
$tabcompany[$obj->rowid]=array('id'=>$obj->socid, 'name'=>$obj->name, 'client'=>$obj->client);
|
||||
$i++;
|
||||
}
|
||||
@@ -215,7 +228,6 @@ foreach ($tabfac as $key => $val)
|
||||
}
|
||||
}
|
||||
// vat
|
||||
//var_dump($tabtva);
|
||||
foreach ($tabtva[$key] as $k => $mt)
|
||||
{
|
||||
if ($mt)
|
||||
@@ -228,6 +240,32 @@ foreach ($tabfac as $key => $val)
|
||||
print "</td><td>".$langs->trans("VAT")."</td><td align='right'>".($mt<0?price(-$mt):'')."</td><td align='right'>".($mt>=0?price($mt):'')."</td></tr>";
|
||||
}
|
||||
}
|
||||
// localtax1
|
||||
foreach ($tablocaltax1[$key] as $k => $mt)
|
||||
{
|
||||
if ($mt)
|
||||
{
|
||||
print "<tr ".$bc[$var].">";
|
||||
//print "<td>".$conf->global->COMPTA_JOURNAL_SELL."</td>";
|
||||
print "<td>".$val["date"]."</td>";
|
||||
print "<td>".$invoicestatic->getNomUrl(1)."</td>";
|
||||
print "<td>".$k;
|
||||
print "</td><td>".$langs->transcountrynoentities("LT1",$mysoc->country_code)."</td><td align='right'>".($mt<0?price(-$mt):'')."</td><td align='right'>".($mt>=0?price($mt):'')."</td></tr>";
|
||||
}
|
||||
}
|
||||
// localtax2
|
||||
foreach ($tablocaltax2[$key] as $k => $mt)
|
||||
{
|
||||
if ($mt)
|
||||
{
|
||||
print "<tr ".$bc[$var].">";
|
||||
//print "<td>".$conf->global->COMPTA_JOURNAL_SELL."</td>";
|
||||
print "<td>".$val["date"]."</td>";
|
||||
print "<td>".$invoicestatic->getNomUrl(1)."</td>";
|
||||
print "<td>".$k;
|
||||
print "</td><td>".$langs->transcountrynoentities("LT2",$mysoc->country_code)."</td><td align='right'>".($mt<0?price(-$mt):'')."</td><td align='right'>".($mt>=0?price($mt):'')."</td></tr>";
|
||||
}
|
||||
}
|
||||
|
||||
$var = !$var;
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
require '../bank/pre.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
|
||||
|
||||
$langs->load("widthdrawals");
|
||||
$langs->load("withdrawals");
|
||||
$langs->load("categories");
|
||||
|
||||
// Security check
|
||||
|
||||
@@ -426,14 +426,14 @@ class BonPrelevement extends CommonObject
|
||||
$facs = array();
|
||||
$amounts = array();
|
||||
|
||||
$facs = $this->getListInvoices();
|
||||
$facs = $this->getListInvoices(1);
|
||||
|
||||
$num=count($facs);
|
||||
for ($i = 0; $i < $num; $i++)
|
||||
{
|
||||
$fac = new Facture($this->db);
|
||||
$fac->fetch($facs[$i]);
|
||||
$amounts[$fac->id] = $fac->total_ttc;
|
||||
$fac->fetch($facs[$i][0]);
|
||||
$amounts[$fac->id] = $facs[$i][1];
|
||||
$result = $fac->set_paid($user);
|
||||
}
|
||||
$paiement = new Paiement($this->db);
|
||||
@@ -576,9 +576,10 @@ class BonPrelevement extends CommonObject
|
||||
/**
|
||||
* Get invoice list
|
||||
*
|
||||
* @param $amounts If you want to get the amount of the order for each invoice
|
||||
* @return array id of invoices
|
||||
*/
|
||||
private function getListInvoices()
|
||||
private function getListInvoices($amounts=0)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@@ -589,6 +590,7 @@ class BonPrelevement extends CommonObject
|
||||
* dans un bon de prelevement
|
||||
*/
|
||||
$sql = "SELECT fk_facture";
|
||||
if ($amounts) $sql .= ", SUM(pl.amount)";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
|
||||
$sql.= " , ".MAIN_DB_PREFIX."prelevement_lignes as pl";
|
||||
$sql.= " , ".MAIN_DB_PREFIX."prelevement_facture as pf";
|
||||
@@ -596,6 +598,7 @@ class BonPrelevement extends CommonObject
|
||||
$sql.= " AND pl.fk_prelevement_bons = p.rowid";
|
||||
$sql.= " AND p.rowid = ".$this->id;
|
||||
$sql.= " AND p.entity = ".$conf->entity;
|
||||
if ($amounts) $sql.= " GROUP BY fk_facture";
|
||||
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
@@ -608,7 +611,14 @@ class BonPrelevement extends CommonObject
|
||||
while ($i < $num)
|
||||
{
|
||||
$row = $this->db->fetch_row($resql);
|
||||
$arr[$i] = $row[0];
|
||||
if (!$amounts) $arr[$i] = $row[0];
|
||||
else
|
||||
{
|
||||
$arr[$i] = array(
|
||||
$row[0],
|
||||
$row[1]
|
||||
);
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* 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
|
||||
@@ -50,7 +50,7 @@ class RejetPrelevement
|
||||
$this->motifs = array();
|
||||
$this->facturer = array();
|
||||
|
||||
$this->motifs[0] = $langs->trans("StatusMotif0");
|
||||
$this->motifs[0] = ""; //$langs->trans("StatusMotif0");
|
||||
$this->motifs[1] = $langs->trans("StatusMotif1");
|
||||
$this->motifs[2] = $langs->trans("StatusMotif2");
|
||||
$this->motifs[3] = $langs->trans("StatusMotif3");
|
||||
|
||||
@@ -33,6 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
|
||||
$langs->load("companies");
|
||||
$langs->load("categories");
|
||||
$langs->load('withdrawals');
|
||||
$langs->load('bills');
|
||||
|
||||
// Securite acces client
|
||||
if ($user->societe_id > 0) accessforbidden();
|
||||
|
||||
@@ -32,6 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
|
||||
|
||||
$langs->load("categories");
|
||||
$langs->load('withdrawals');
|
||||
$langs->load('bills');
|
||||
|
||||
// Securite acces client
|
||||
if ($user->societe_id > 0) accessforbidden();
|
||||
|
||||
@@ -33,6 +33,7 @@ if ($user->societe_id > 0) accessforbidden();
|
||||
|
||||
$langs->load("withdrawals");
|
||||
$langs->load("categories");
|
||||
$langs->load('bills');
|
||||
|
||||
// Get supervariables
|
||||
$prev_id = GETPOST('id','int');
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* 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
|
||||
@@ -50,29 +50,49 @@ if ($action == 'confirm_rejet')
|
||||
{
|
||||
if ( GETPOST("confirm") == 'yes')
|
||||
{
|
||||
$daterej = mktime(2, 0, 0, GETPOST('remonth','int'), GETPOST('reday','int'), GETPOST('reyear','int'));
|
||||
|
||||
$lipre = new LignePrelevement($db, $user);
|
||||
|
||||
if ($lipre->fetch($id) == 0)
|
||||
if (GETPOST('remonth','int'))
|
||||
{
|
||||
$daterej = mktime(2, 0, 0, GETPOST('remonth','int'), GETPOST('reday','int'), GETPOST('reyear','int'));
|
||||
}
|
||||
|
||||
if (GETPOST('motif','alpha') > 0 && $daterej < time())
|
||||
if (empty($daterej))
|
||||
{
|
||||
$error++;
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Date")),'errors');
|
||||
}
|
||||
|
||||
elseif ($daterej > dol_now())
|
||||
{
|
||||
$error++;
|
||||
$langs->load("error");
|
||||
setEventMessage($langs->transnoentities("ErrorDateMustBeBeforeToday"),'errors');
|
||||
}
|
||||
|
||||
if (GETPOST('motif','alpha') == 0)
|
||||
{
|
||||
$error++;
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("RefusedReason")),'errors');
|
||||
}
|
||||
|
||||
if ( ! $error )
|
||||
{
|
||||
$lipre = new LignePrelevement($db, $user);
|
||||
|
||||
if ($lipre->fetch($id) == 0)
|
||||
|
||||
{
|
||||
$rej = new RejetPrelevement($db, $user);
|
||||
|
||||
|
||||
$rej->create($user, $id, GETPOST('motif','alpha'), $daterej, $lipre->bon_rowid, GETPOST('facturer','int'));
|
||||
|
||||
header("Location: ligne.php?id=".$id);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_syslog("Motif : ".GETPOST('motif','alpha'));
|
||||
dol_syslog("$daterej $time ");
|
||||
header("Location: ligne.php?id=".$id."&action=rejet");
|
||||
exit;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$action="rejet";
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -173,13 +193,13 @@ if ($id)
|
||||
print '</td></tr>';
|
||||
|
||||
//Date
|
||||
print '<tr><td class="valid">'.$langs->trans("RefusedData").'</td>';
|
||||
print '<tr><td class="fieldrequired" class="valid">'.$langs->trans("RefusedData").'</td>';
|
||||
print '<td colspan="2" class="valid">';
|
||||
print $form->select_date('','','','','',"confirm_rejet");
|
||||
print '</td></tr>';
|
||||
|
||||
//Reason
|
||||
print '<tr><td class="valid">'.$langs->trans("RefusedReason").'</td>';
|
||||
print '<tr><td class="fieldrequired" class="valid">'.$langs->trans("RefusedReason").'</td>';
|
||||
print '<td class="valid">';
|
||||
print $form->selectarray("motif", $rej->motifs);
|
||||
print '</td></tr>';
|
||||
@@ -303,8 +323,9 @@ if ($id)
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
$db->close();
|
||||
}
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
?>
|
||||
|
||||
@@ -36,6 +36,7 @@ if ($user->societe_id > 0) accessforbidden();
|
||||
|
||||
$langs->load("categories");
|
||||
$langs->load('withdrawals');
|
||||
$langs->load('bills');
|
||||
|
||||
// Get supervariables
|
||||
$prev_id = GETPOST('id','int');
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -26,6 +26,7 @@
|
||||
|
||||
require '../bank/pre.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/rejetprelevement.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/ligneprelevement.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
|
||||
|
||||
$langs->load("withdrawals");
|
||||
@@ -56,6 +57,7 @@ if ($sortorder == "") $sortorder="DESC";
|
||||
if ($sortfield == "") $sortfield="p.datec";
|
||||
|
||||
$rej = new RejetPrelevement($db, $user);
|
||||
$ligne = new LignePrelevement($db, $user);
|
||||
|
||||
/*
|
||||
* Liste des factures
|
||||
@@ -84,7 +86,7 @@ if ($result)
|
||||
print"\n<!-- debut table -->\n";
|
||||
print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Nb"),"rejets.php","p.ref",'',$urladd);
|
||||
print_liste_field_titre($langs->trans("Line"),"rejets.php","p.ref",'',$urladd);
|
||||
print_liste_field_titre($langs->trans("ThirdParty"),"rejets.php","s.nom",'',$urladd);
|
||||
print_liste_field_titre($langs->trans("Reason"),"rejets.php","pr.motif","",$urladd);
|
||||
print '</tr>';
|
||||
@@ -98,7 +100,7 @@ if ($result)
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
print "<tr $bc[$var]><td>";
|
||||
print '<img border="0" src="./img/statut'.$obj->statut.'.png"></a> ';
|
||||
print $ligne->LibStatut($obj->statut,2).' ';
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/ligne.php?id='.$obj->rowid.'">';
|
||||
|
||||
print substr('000000'.$obj->rowid, -6)."</a></td>";
|
||||
|
||||
@@ -555,7 +555,7 @@ for ($annee = $year_start ; $annee <= $year_end ; $annee++)
|
||||
if (isset($totentrees[$annee]) || isset($totsorties[$annee]))
|
||||
{
|
||||
$in=(isset($totentrees[$annee])?price2num($totentrees[$annee], 'MT'):0);
|
||||
$out=(isset($totsorties[$annee])?price2num($totsorties[$annee],' MT'):0);
|
||||
$out=(isset($totsorties[$annee])?price2num($totsorties[$annee],'MT'):0);
|
||||
print price($in-$out).'</td>';
|
||||
// print '<td> </td>';
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
|
||||
*/
|
||||
class ChargeSociales extends CommonObject
|
||||
{
|
||||
public $element='rowid';
|
||||
public $element='chargesociales';
|
||||
public $table='chargesociales';
|
||||
public $table_element='chargesociales';
|
||||
|
||||
@@ -115,6 +115,8 @@ class ChargeSociales extends CommonObject
|
||||
*/
|
||||
function create($user)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
// Nettoyage parametres
|
||||
$newamount=price2num($this->amount,'MT');
|
||||
|
||||
@@ -127,10 +129,11 @@ class ChargeSociales extends CommonObject
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."chargesociales (fk_type, libelle, date_ech, periode, amount)";
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."chargesociales (fk_type, libelle, date_ech, periode, amount, entity)";
|
||||
$sql.= " VALUES (".$this->type.",'".$this->db->escape($this->lib)."',";
|
||||
$sql.= " '".$this->db->idate($this->date_ech)."','".$this->db->idate($this->periode)."',";
|
||||
$sql.= " ".price2num($newamount);
|
||||
$sql.= " '".price2num($newamount)."',";
|
||||
$sql.= " ".$conf->entity;
|
||||
$sql.= ")";
|
||||
|
||||
dol_syslog(get_class($this)."::create sql=".$sql);
|
||||
|
||||
@@ -79,7 +79,7 @@ if (GETPOST("sendit") && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
if ($action == 'delete')
|
||||
{
|
||||
$file = $upload_dir . '/' . GETPOST("urlfile"); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
||||
$ret=dol_delete_file($file);
|
||||
$ret=dol_delete_file($file,0,0,0,$object);
|
||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
||||
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
|
||||
}
|
||||
@@ -172,7 +172,7 @@ if ($object->id)
|
||||
|
||||
// Affiche formulaire upload
|
||||
$formfile=new FormFile($db);
|
||||
$formfile->form_attach_new_file(DOL_URL_ROOT.'/compta/sociales/document.php?id='.$object->id,'',0,0,$user->rights->tax->charges->creer);
|
||||
$formfile->form_attach_new_file(DOL_URL_ROOT.'/compta/sociales/document.php?id='.$object->id,'',0,0,$user->rights->tax->charges->creer,50,$object);
|
||||
|
||||
|
||||
// List of document
|
||||
|
||||
@@ -500,13 +500,13 @@ class Tva extends CommonObject
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."tva (datep, datev, amount";
|
||||
if ($this->note) $sql.=", note";
|
||||
if ($this->label) $sql.=", label";
|
||||
$sql.= ", fk_user_creat, fk_bank";
|
||||
$sql.= ", fk_user_creat, fk_bank, entity";
|
||||
$sql.= ") ";
|
||||
$sql.= " VALUES ('".$this->db->idate($this->datep)."',";
|
||||
$sql.= "'".$this->db->idate($this->datev)."'," . $this->amount;
|
||||
if ($this->note) $sql.=", '".$this->db->escape($this->note)."'";
|
||||
if ($this->label) $sql.=", '".$this->db->escape($this->label)."'";
|
||||
$sql.=", '".$user->id."', NULL";
|
||||
$sql.=", '".$user->id."', NULL, ".$conf->entity;
|
||||
$sql.= ")";
|
||||
|
||||
dol_syslog("Tva::addPayment sql=".$sql);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -35,6 +35,7 @@ class Contact extends CommonObject
|
||||
{
|
||||
public $element='contact';
|
||||
public $table_element='socpeople';
|
||||
protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
||||
|
||||
var $id;
|
||||
var $civilite_id; // In fact we stor civility_code
|
||||
@@ -245,15 +246,15 @@ class Contact extends CommonObject
|
||||
$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 .= ", note = ".(isset($this->note)?"'".$this->db->escape($this->note)."'":"null");
|
||||
$sql .= ", phone = ".(isset($this->phone_pro)?"'".$this->db->escape($this->phone_pro)."'":"null");
|
||||
$sql .= ", phone_perso = ".(isset($this->phone_perso)?"'".$this->db->escape($this->phone_perso)."'":"null");
|
||||
$sql .= ", phone_mobile = ".(isset($this->phone_mobile)?"'".$this->db->escape($this->phone_mobile)."'":"null");
|
||||
$sql .= ", jabberid = ".(isset($this->jabberid)?"'".$this->db->escape($this->jabberid)."'":"null");
|
||||
$sql .= ", priv = '".$this->priv."'";
|
||||
$sql .= ", fk_user_modif=".($user->id > 0 ? "'".$user->id."'":"null");
|
||||
$sql .= ", default_lang=".($this->default_lang?"'".$this->default_lang."'":"null");
|
||||
$sql .= ", no_email=".($this->no_email?"'".$this->no_email."'":"null");
|
||||
$sql .= ", no_email=".($this->no_email?"'".$this->no_email."'":"0");
|
||||
$sql .= " WHERE rowid=".$id;
|
||||
|
||||
dol_syslog(get_class($this)."::update sql=".$sql,LOG_DEBUG);
|
||||
@@ -745,7 +746,7 @@ class Contact extends CommonObject
|
||||
$this->error=$this->db->error().' sql='.$sql;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Removed extrafields
|
||||
if ((! $error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) { // For avoid conflicts if trigger used
|
||||
$result=$this->deleteExtraFields($this);
|
||||
|
||||
@@ -29,26 +29,28 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/contact.lib.php';
|
||||
$langs->load("companies");
|
||||
|
||||
// Security check
|
||||
$contactid = isset($_GET["id"])?$_GET["id"]:'';
|
||||
$id = GETPOST('id', 'int');
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result = restrictedArea($user, 'contact', $contactid, 'socpeople&societe');
|
||||
$result = restrictedArea($user, 'contact', $id, 'socpeople&societe');
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader('',$langs->trans("ContactsAddresses"),'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas');
|
||||
$title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses"));
|
||||
|
||||
llxHeader('',$title,'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas');
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
$contact = new Contact($db);
|
||||
$contact->fetch($_GET["id"], $user);
|
||||
$contact->fetch($id, $user);
|
||||
|
||||
|
||||
$head = contact_prepare_head($contact);
|
||||
|
||||
dol_fiche_head($head, 'exportimport', $langs->trans("ContactsAddresses"), 0, 'contact');
|
||||
dol_fiche_head($head, 'exportimport', $title, 0, 'contact');
|
||||
|
||||
|
||||
/*
|
||||
@@ -97,7 +99,7 @@ print '</div>';
|
||||
print '<br>';
|
||||
|
||||
print $langs->trans("ExportCardToFormat").': ';
|
||||
print '<a href="'.DOL_URL_ROOT.'/contact/vcard.php?id='.$_GET["id"].'">';
|
||||
print '<a href="'.DOL_URL_ROOT.'/contact/vcard.php?id='.$contact->id.'">';
|
||||
print img_picto($langs->trans("VCard"),'vcard.png').' ';
|
||||
print $langs->trans("VCard");
|
||||
print '</a>';
|
||||
|
||||
@@ -62,7 +62,7 @@ if (! empty($canvas))
|
||||
}
|
||||
|
||||
// Security check
|
||||
$result = restrictedArea($user, 'contact', $id, 'socpeople&societe', '', '', '', $objcanvas); // If we create a contact with no company (shared contacts), no check on write permission
|
||||
$result = restrictedArea($user, 'contact', $id, 'socpeople&societe', '', '', 'rowid', $objcanvas); // If we create a contact with no company (shared contacts), no check on write permission
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
||||
|
||||
@@ -35,12 +35,12 @@ $langs->load("admin");
|
||||
$action=GETPOST('action');
|
||||
|
||||
// Security check
|
||||
$contactid = isset($_GET["id"])?$_GET["id"]:'';
|
||||
$id = GETPOST('id', 'int');
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result = restrictedArea($user, 'contact', $contactid, 'socpeople&societe');
|
||||
$result = restrictedArea($user, 'contact', $id, 'socpeople&societe');
|
||||
|
||||
$contact = new Contact($db);
|
||||
$contact->fetch($_GET["id"], $user);
|
||||
$contact->fetch($id, $user);
|
||||
|
||||
|
||||
/*
|
||||
@@ -79,13 +79,15 @@ if ($action == 'dolibarr2ldap')
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader('',$langs->trans("ContactsAddresses"),'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas');
|
||||
$title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses"));
|
||||
|
||||
llxHeader('',$title,'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("ContactsAddresses"), 0, 'contact');
|
||||
dol_fiche_head($head, 'ldap', $title, 0, 'contact');
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
@@ -69,7 +69,9 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->societe->contact
|
||||
|
||||
$now=dol_now();
|
||||
|
||||
llxHeader('',$langs->trans("ContactsAddresses"),'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas');
|
||||
$title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses"));
|
||||
|
||||
llxHeader('',$title,'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas');
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
@@ -77,7 +79,7 @@ $object->fetch($id, $user);
|
||||
|
||||
$head = contact_prepare_head($object);
|
||||
|
||||
dol_fiche_head($head, 'perso', $langs->trans("ContactsAddresses"), 0, 'contact');
|
||||
dol_fiche_head($head, 'perso', $title, 0, 'contact');
|
||||
|
||||
if ($action == 'edit')
|
||||
{
|
||||
|
||||
@@ -29,8 +29,13 @@ require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/vcard.class.php';
|
||||
|
||||
|
||||
$id = GETPOST('id', 'int');
|
||||
|
||||
// Security check
|
||||
$result = restrictedArea($user, 'contact', $id, 'socpeople&societe');
|
||||
|
||||
$contact = new Contact($db);
|
||||
$result=$contact->fetch($_GET["id"]);
|
||||
$result=$contact->fetch($id);
|
||||
|
||||
$physicalperson=1;
|
||||
|
||||
|
||||
@@ -524,20 +524,20 @@ class Contrat extends CommonObject
|
||||
$objp = $this->db->fetch_object($result);
|
||||
|
||||
$line = new ContratLigne($this->db);
|
||||
$line->id = $objp->rowid;
|
||||
$line->id = $objp->rowid;
|
||||
$line->fk_contrat = $objp->fk_contrat;
|
||||
$line->libelle = $objp->description;
|
||||
$line->desc = $objp->description;
|
||||
$line->qty = $objp->qty;
|
||||
$line->statut = $objp->statut;
|
||||
$line->ref = $objp->ref;
|
||||
$line->statut = $objp->statut;
|
||||
$line->ref = (isset($objp->ref)?$objp->ref:NULL);
|
||||
$line->tva_tx = $objp->tva_tx;
|
||||
$line->localtax1_tx = $objp->localtax1_tx;
|
||||
$line->localtax2_tx = $objp->localtax2_tx;
|
||||
$line->subprice = $objp->subprice;
|
||||
$line->remise_percent = $objp->remise_percent;
|
||||
$line->price_ht = $objp->price_ht;
|
||||
$line->price = $objp->price; // For backward compatibility
|
||||
$line->price = (isset($objp->price)?$objp->price:NULL); // For backward compatibility
|
||||
$line->total_ht = $objp->total_ht;
|
||||
$line->total_tva = $objp->total_tva;
|
||||
$line->total_localtax1= $objp->total_localtax1;
|
||||
|
||||
@@ -299,7 +299,7 @@ else if ($action == 'addline' && $user->rights->contrat->creer)
|
||||
{
|
||||
$pu_ht=GETPOST('price_ht');
|
||||
$price_base_type = 'HT';
|
||||
$tva_tx=str_replace('*','',GETPOST('tva_tx'));
|
||||
$tva_tx=GETPOST('tva_tx')?str_replace('*','',GETPOST('tva_tx')):0; // tva_tx field may be disabled, so we use vat rate 0
|
||||
$tva_npr=preg_match('/\*/',GETPOST('tva_tx'))?1:0;
|
||||
$desc=GETPOST('dp_desc');
|
||||
}
|
||||
@@ -396,7 +396,7 @@ else if ($action == 'updateligne' && $user->rights->contrat->creer && ! GETPOST(
|
||||
$objectline->subprice=GETPOST('elprice');
|
||||
$objectline->qty=GETPOST('elqty');
|
||||
$objectline->remise_percent=GETPOST('elremise_percent');
|
||||
$objectline->tva_tx=GETPOST('eltva_tx');
|
||||
$objectline->tva_tx=GETPOST('eltva_tx')?GETPOST('eltva_tx'):0; // Field may be disabled, so we use vat rate 0
|
||||
$objectline->localtax1_tx=$localtax1_tx;
|
||||
$objectline->localtax2_tx=$localtax2_tx;
|
||||
$objectline->date_ouverture_prevue=$date_start_update;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -96,7 +96,7 @@ class box_factures_fourn extends ModeleBoxes
|
||||
$now=dol_now();
|
||||
|
||||
$i = 0;
|
||||
$l_due_date = $langs->trans('Late').' ('.strtolower($langs->trans('DateEcheance')).': %s)';
|
||||
$l_due_date = $langs->trans('Late').' ('.$langs->trans('DateEcheance').': %s)';
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
@@ -105,7 +105,7 @@ class box_factures_fourn extends ModeleBoxes
|
||||
$datec=$db->jdate($objp->datec);
|
||||
|
||||
$late = '';
|
||||
if ($objp->paye == 0 && $datelimite < ($now - $conf->facture->fournisseur->warning_delay)) $late=img_warning(sprintf($l_due_date, dol_print_date($datelimite,'day')));
|
||||
if ($objp->paye == 0 && $datelimite && $datelimite < ($now - $conf->facture->fournisseur->warning_delay)) $late=img_warning(sprintf($l_due_date, dol_print_date($datelimite,'day')));
|
||||
|
||||
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',
|
||||
'logo' => $this->boximg,
|
||||
|
||||
@@ -82,6 +82,7 @@ class box_produits_alerte_stock extends ModeleBoxes
|
||||
$sql.= " AND p.tosell = 1";
|
||||
if (empty($user->rights->produit->lire)) $sql.=' AND p.fk_product_type != 0';
|
||||
if (empty($user->rights->service->lire)) $sql.=' AND p.fk_product_type != 1';
|
||||
$sql.= " GROUP BY p.rowid, p.seuil_stock_alerte, s.reel";
|
||||
$sql.= " HAVING s.reel < p.seuil_stock_alerte";
|
||||
$sql.= $db->order('s.reel', 'DESC');
|
||||
$sql.= $db->plimit($max, 0);
|
||||
|
||||
@@ -722,9 +722,10 @@ abstract class CommonObject
|
||||
* @param string $table To force other table element or element line
|
||||
* @param int $id To force other object id
|
||||
* @param string $format Data format ('text' by default, 'date')
|
||||
* @param string $id_field To force rowid field name
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function setValueFrom($field, $value, $table='', $id='', $format='text')
|
||||
function setValueFrom($field, $value, $table='', $id='', $format='text', $id_field='rowid')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@@ -736,7 +737,7 @@ abstract class CommonObject
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX.$table." SET ";
|
||||
if ($format == 'text') $sql.= $field." = '".$this->db->escape($value)."'";
|
||||
else if ($format == 'date') $sql.= $field." = '".$this->db->idate($value)."'";
|
||||
$sql.= " WHERE rowid = ".$id;
|
||||
$sql.= " WHERE ".$id_field." = ".$id;
|
||||
|
||||
dol_syslog(get_class($this)."::setValueFrom sql=".$sql, LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
@@ -1067,7 +1068,13 @@ abstract class CommonObject
|
||||
// We frist search all lines that are parent lines (for multilevel details lines)
|
||||
$sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.$this->table_element_line;
|
||||
$sql.= ' WHERE '.$this->fk_element.' = '.$this->id;
|
||||
$sql.= ' AND fk_parent_line IS NULL';
|
||||
|
||||
//This test is to fix Fix [ bug #911 ] Reorder intervention do not work in 3.3
|
||||
//Do not merge in 3.4 'table column fk_parent_line already added into 3.4
|
||||
if ($this->table_element_line != 'fichinterdet') {
|
||||
$sql.= ' AND fk_parent_line IS NULL';
|
||||
}
|
||||
|
||||
$sql.= ' ORDER BY rang ASC, rowid '.$rowidorder;
|
||||
|
||||
dol_syslog(get_class($this)."::line_order search all parent lines sql=".$sql, LOG_DEBUG);
|
||||
@@ -2631,7 +2638,7 @@ abstract class CommonObject
|
||||
*/
|
||||
function printObjectLines($action, $seller, $buyer, $selected=0, $dateSelector=0, $hookmanager=false)
|
||||
{
|
||||
global $conf,$langs;
|
||||
global $conf,$langs,$user;
|
||||
|
||||
print '<tr class="liste_titre nodrag nodrop">';
|
||||
if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER))
|
||||
@@ -2645,7 +2652,7 @@ abstract class CommonObject
|
||||
print '<td align="right" width="80"> </td>';
|
||||
print '<td align="right" width="50">'.$langs->trans('Qty').'</td>';
|
||||
print '<td align="right" width="50">'.$langs->trans('ReductionShort').'</td>';
|
||||
if (! empty($conf->margin->enabled)) {
|
||||
if (! empty($conf->margin->enabled) && empty($user->societe_id)) {
|
||||
if ($conf->global->MARGIN_TYPE == "1")
|
||||
print '<td align="right" width="80">'.$langs->trans('BuyingPrice').'</td>';
|
||||
else
|
||||
@@ -3043,7 +3050,8 @@ abstract class CommonObject
|
||||
}
|
||||
|
||||
function displayMarginInfos($force_price=false) {
|
||||
global $langs, $conf;
|
||||
global $langs, $conf,$user;
|
||||
if (! empty($user->societe_id)) return;
|
||||
$marginInfo = $this->getMarginInfos($force_price);
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
@@ -341,7 +341,8 @@ class Conf
|
||||
|
||||
// societe
|
||||
if (empty($this->global->SOCIETE_CODECLIENT_ADDON)) $this->global->SOCIETE_CODECLIENT_ADDON="mod_codeclient_leopard";
|
||||
if (empty($this->global->SOCIETE_CODEFOURNISSEUR_ADDON)) $this->global->SOCIETE_CODEFOURNISSEUR_ADDON=$this->global->SOCIETE_CODECLIENT_ADDON;
|
||||
// Unused constant and for avoid problem with multicompany sharing
|
||||
//if (empty($this->global->SOCIETE_CODEFOURNISSEUR_ADDON)) $this->global->SOCIETE_CODEFOURNISSEUR_ADDON=$this->global->SOCIETE_CODECLIENT_ADDON;
|
||||
if (empty($this->global->SOCIETE_CODECOMPTA_ADDON)) $this->global->SOCIETE_CODECOMPTA_ADDON="mod_codecompta_panicum";
|
||||
|
||||
// Security
|
||||
@@ -409,7 +410,7 @@ class Conf
|
||||
$this->maxfilesize = (empty($this->global->MAIN_UPLOAD_DOC) ? 0 : $this->global->MAIN_UPLOAD_DOC * 1024);
|
||||
|
||||
// Define list of limited modules
|
||||
if (! isset($this->global->MAIN_MODULES_FOR_EXTERNAL)) $this->global->MAIN_MODULES_FOR_EXTERNAL='facture,commande,fournisseur,contact,propal,projet,contrat,societe,ficheinter,expedition,agenda'; // '' means 'all'. Note that contact is added here as it should be a module later.
|
||||
if (! isset($this->global->MAIN_MODULES_FOR_EXTERNAL)) $this->global->MAIN_MODULES_FOR_EXTERNAL='user,facture,commande,fournisseur,contact,propal,projet,contrat,societe,ficheinter,expedition,agenda'; // '' means 'all'. Note that contact is added here as it should be a module later.
|
||||
|
||||
// Timeouts
|
||||
if (empty($this->global->MAIN_USE_CONNECT_TIMEOUT)) $this->global->MAIN_USE_CONNECT_TIMEOUT=10;
|
||||
|
||||
@@ -169,6 +169,9 @@ class DolEditor
|
||||
//$skin='office2003';
|
||||
//$skin='v2';
|
||||
$skin='kama';
|
||||
|
||||
if ($this->toolbarname=='dolibarr_mailings') {$htmlencode_force='true';}
|
||||
else {$htmlencode_force='false';}
|
||||
|
||||
$out.= '<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
@@ -177,6 +180,7 @@ class DolEditor
|
||||
CKEDITOR.replace(\''.$this->htmlname.'\',
|
||||
{
|
||||
customConfig : ckeditorConfig,
|
||||
htmlEncodeOutput :'.$htmlencode_force.',
|
||||
toolbar: \''.$this->toolbarname.'\',
|
||||
toolbarStartupExpanded: '.($this->toolbarstartexpanded ? 'true' : 'false').',
|
||||
width: '.($this->width ? '\''.$this->width.'\'' : '\'\'').',
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user