Compare commits

...

263 Commits
3.6.2 ... 3.6.4

Author SHA1 Message Date
Laurent Destailleur
a4df49f6c8 Prepare packaging 2015-05-16 17:04:36 +02:00
Laurent Destailleur
5b00ba11fd Prepare packaging 2015-05-16 16:54:54 +02:00
Laurent Destailleur
cabbb9e421 Merge remote-tracking branch 'origin/3.5' into 3.6
Conflicts:
	build/debian/changelog
	build/exe/doliwamp/doliwamp.iss
	build/makepack-dolibarr.pl
	build/rpm/dolibarr_fedora.spec
	build/rpm/dolibarr_generic.spec
	build/rpm/dolibarr_mandriva.spec
	build/rpm/dolibarr_opensuse.spec
	htdocs/filefunc.inc.php
2015-05-16 16:49:03 +02:00
Laurent Destailleur
e8fb89f89f Prepare packaging 3.7 2015-05-16 16:38:47 +02:00
Laurent Destailleur
4dcdea5219 Prepare package 3.5.7
Removed hardcoded version from rpm spec files, so it will not be
necessary to update this files when making a new release.
2015-05-16 16:08:05 +02:00
Laurent Destailleur
1d8a3809f0 Merge branch '3.5' of git@github.com:Dolibarr/dolibarr.git into 3.5 2015-05-16 15:27:18 +02:00
Laurent Destailleur
80943111cc Prepare 3.5.7 2015-05-16 15:26:34 +02:00
Laurent Destailleur
f8e8fe6f34 Merge pull request #2816 from marcosgdf/bug-2757
Close bug #2757 Deleting product category photo gives "Forbidden access" error
2015-05-12 22:36:33 +02:00
Marcos García de La Fuente
190f12c4c4 Merge branch '3.5' into bug-2757
Conflicts:
	ChangeLog
2015-05-12 10:16:48 +02:00
Marcos García de La Fuente
ea7eb241e3 Close bug #2757 Deleting product category photo gives "Forbidden access" error 2015-05-12 10:15:43 +02:00
Laurent Destailleur
973e2253bf Merge pull request #2797 from hregis/3.6
Fix: add $object for use with triggers
2015-05-12 00:14:22 +02:00
Laurent Destailleur
2a486f471b Merge remote-tracking branch 'origin/3.5' into 3.6
Conflicts:
	htdocs/product/class/product.class.php
2015-05-11 23:39:45 +02:00
Laurent Destailleur
5f594d55ac Merge pull request #2805 from marcosgdf/bug-2758
FIX #2758 Product::update sets product note to "null" when $prod->note is null
2015-05-11 23:00:25 +02:00
Marcos García de La Fuente
f6616deef3 Removed debugging function 2015-05-10 01:28:40 +02:00
Marcos García de La Fuente
f8e8b39ff2 FIX #2758 Product::update sets product note to "null" when $prod->note is null 2015-05-10 01:27:28 +02:00
Juanjo Menent
b7228e191c Merge pull request #2801 from FHenry/3.6
FIX : [ bug #1926 ] [contract] Wrong Rights Checked
2015-05-07 20:21:05 +02:00
Florian HENRY
5395465cfd Merge branch '3.6' of git@github.com:Dolibarr/dolibarr.git into 3.6 2015-05-07 17:24:51 +02:00
Florian HENRY
29f562460a fix [ bug #1926 ] [contract] Wrong Rights Checked 2015-05-07 17:23:32 +02:00
Regis Houssin
9a32d7ec2f Fix: add $object for use with triggers 2015-05-07 12:02:24 +02:00
Regis Houssin
c976d32e7d Merge remote-tracking branch 'dolibarr/3.6' into 3.6 2015-05-07 11:46:05 +02:00
Regis Houssin
1b56144cb8 Revert "Fix: use global $object instead parameter"
This reverts commit 179309710c.
2015-05-07 11:41:14 +02:00
Juanjo Menent
5d65d666f7 Merge pull request #2778 from atm-maxime/3.6
Fix : shipment PDF was not using generation params
2015-05-06 21:00:49 +02:00
Regis Houssin
179309710c Fix: use global $object instead parameter 2015-05-06 16:44:47 +02:00
Maxime Kohlhaas
42455f771a Missing comments 2015-05-06 12:43:41 +02:00
Maxime Kohlhaas
d2603d5308 Fix : shipment was not considered as billed after classifybilled function 2015-05-06 12:39:10 +02:00
Maxime Kohlhaas
b203263e91 Fix : shipment PDF was not using generation params 2015-05-06 12:16:36 +02:00
Raphaël Doursenaud
a6b0f6cfac Allow exporting projects without a third party
FIX #2729
2015-05-01 15:56:39 +02:00
Juanjo Menent
6309d2133f Merge pull request #2731 from GPCsolutions/dolibarr-2729
Allow exporting projects without a third party
2015-05-01 15:55:40 +02:00
Raphaël Doursenaud
f1032baaab Allow exporting projects without a third party
FIX #2729
2015-04-30 11:48:32 +02:00
Laurent Destailleur
43efd76b24 Fix remove warnings 2015-04-29 23:39:34 +02:00
Laurent Destailleur
7419319c0f Protection into packager 2015-04-29 22:39:42 +02:00
Laurent Destailleur
290856db1c Fix remove warning 2015-04-29 22:37:04 +02:00
Juanjo Menent
cfaaf56428 Change bugtracker to github in all maintened versions 2015-04-27 20:34:26 +02:00
Laurent Destailleur
fdd34c582c Merge pull request #2665 from atm-maxime/3.6
Fix : include facture class for outstanding bill
2015-04-19 00:59:21 +02:00
Maxime Kohlhaas
5a66e1f98a Fix : include facture class for outstanding bill 2015-04-19 00:26:05 +02:00
Laurent Destailleur
ab77158757 Merge remote-tracking branch 'origin/3.5' into 3.6
Conflicts:
	htdocs/expedition/fiche.php
2015-04-18 23:55:17 +02:00
Laurent Destailleur
b8c512a3d5 Merge branch '3.5' of github.com:Dolibarr/dolibarr into 3.5 2015-04-18 23:34:42 +02:00
Laurent Destailleur
be9ddb7748 Merge pull request #2595 from marcosgdf/bug-2576
Close #2576 Bug: Unable to edit a dictionary entry that has # in its ref
2015-04-18 22:24:21 +02:00
Marcos García de La Fuente
37d8dafd40 Merge branch '3.5' into bug-2576
Conflicts:
	ChangeLog
2015-04-18 21:44:24 +02:00
Laurent Destailleur
4de4c66bb7 git push origin 3.5Merge branch 'marcosgdf-bug-2576' into 3.5 2015-04-18 20:56:40 +02:00
Laurent Destailleur
ed6abb0f79 Merge branch 'bug-2576' of https://github.com/marcosgdf/dolibarr into marcosgdf-bug-2576
Conflicts:
	ChangeLog
2015-04-18 20:56:27 +02:00
Laurent Destailleur
e49a46a386 Merge pull request #2653 from atm-maxime/3.6
Fix : menu financial was not displayed when only supplier module is acti...
2015-04-18 20:30:24 +02:00
Laurent Destailleur
5f49b2a9bb git push origin 3.5Merge branch 'marcosgdf-bug-2577' into 3.5 2015-04-18 20:12:49 +02:00
Laurent Destailleur
b7cf0ded00 Merge branch 'bug-2577' of https://github.com/marcosgdf/dolibarr into marcosgdf-bug-2577
Conflicts:
	ChangeLog
2015-04-18 20:12:27 +02:00
Maxime Kohlhaas
7b035d3b5f Fix : menu financial was not displayed when only supplier module is activated 2015-04-18 20:11:19 +02:00
Laurent Destailleur
b75722d450 git push origin 3.5Merge branch 'marcosgdf-bug-2583' into 3.5 2015-04-18 20:10:41 +02:00
Laurent Destailleur
9b69b64626 Merge branch 'bug-2583' of https://github.com/marcosgdf/dolibarr into marcosgdf-bug-2583
Conflicts:
	ChangeLog
2015-04-18 20:10:06 +02:00
Laurent Destailleur
4201cf9f7f Merge pull request #2638 from atm-maxime/fix_cust_outstanding
Fix cust outstanding
2015-04-18 18:56:23 +02:00
Laurent Destailleur
7375256b99 Merge pull request #2643 from atm-maxime/3.6
Fix : price in editkeyval function was forcing a price rounding
2015-04-18 18:49:40 +02:00
Maxime Kohlhaas
51522decf3 Fix : price in editkeyval function was forcing a price rounding 2015-04-18 18:33:46 +02:00
Maxime Kohlhaas
8b307aac56 Fix : customer outstanding was not calculated properly 2015-04-18 18:06:27 +02:00
Maxime Kohlhaas
e0af2feced Fix : on impayees remain to pay did not include deposits 2015-04-18 18:06:02 +02:00
Laurent Destailleur
0000043c96 Merge pull request #2629 from atm-maxime/3.5_fix_shipment_model
Fix : shipment model selection
2015-04-18 15:23:52 +02:00
Maxime Kohlhaas
2b8efc302a Fix : shipment model selection 2015-04-18 11:24:55 +02:00
Laurent Destailleur
ae41d38a96 Merge pull request #2616 from atm-maxime/3.6
Fix : discount were not working anymore on supplier order and bill
2015-04-18 03:34:14 +02:00
Maxime Kohlhaas
3073aab48b Fix : discount were not working anymore on supplier order and bill 2015-04-17 23:31:51 +02:00
Laurent Destailleur
0b6c3cada3 Merge pull request #2608 from GPCsolutions/3.6-2607
Fixed typo in task export
2015-04-14 20:02:41 +02:00
Raphaël Doursenaud
54b8aa8a0b Fixed typo in task export
Closes #2607, #2609
2015-04-14 19:14:16 +02:00
Laurent Destailleur
c0ddfbfab7 Merge pull request #2597 from marcosgdf/bug-1906
Fixes for bugs #1906 and #1905
2015-04-13 01:04:23 +02:00
Marcos García de La Fuente
8f0c41dbd2 Fix: [ bug #1905 ] Custom deplacement types do not get translated in deplacement card 2015-04-12 22:02:25 +02:00
Marcos García de La Fuente
6173706531 Fix: [ bug #1906 ] Deplacement does not allow translated decimal format 2015-04-12 21:55:20 +02:00
Marcos García de La Fuente
9cfb295675 Fix: Bug #2576 Unable to edit a dictionary entry that has # in its ref 2015-04-12 21:05:26 +02:00
Marcos García de La Fuente
bbd01c0c8d Fix: Bug #2577 Incorrect invoice status in "Linked objects" page of a project 2015-04-12 20:59:58 +02:00
Marcos García de La Fuente
728b64e334 Fix Bug #2583: Unable to create a bank transfer with localized numbers 2015-04-12 20:24:22 +02:00
Laurent Destailleur
aba83b6467 Merge pull request #2585 from aspangaro/3.6
Fix #2582 - Untranslated table header in /compta/bank/search.php
2015-04-09 21:37:53 +02:00
aspangaro
1f5ca497d3 Bug: Untranslated table header in /compta/bank/search.php 2015-04-09 20:50:19 +02:00
Laurent Destailleur
0e2bc5608d Merge pull request #2578 from braito4/patch-1
minor bug drag and drop total line in tasks list
2015-04-09 18:30:59 +02:00
braito4
914b324a67 minor bug drag and drop total line in tasks list 2015-04-09 10:37:54 +02:00
Laurent Destailleur
bb83eb0f68 Merge pull request #2561 from frederic34/patch-5
Fix #2559 Bug: Untranslated "Total" in Bank module
2015-04-07 23:50:17 +02:00
Juanjo Menent
9d8cb459f1 Fix: Bad permission assignments for stock movements actions 2015-04-07 20:28:45 +02:00
Juanjo Menent
35a6ed90a0 Solves #2542 Bug: Contracts store localtax preferences 2015-04-07 20:02:12 +02:00
Juanjo Menent
345b609ff0 Closes #2545 Bug: Missing object_margin.png in Amarok theme 2015-04-07 18:41:40 +02:00
Frédéric FRANCE
06c749942a Update index.php 2015-04-07 18:40:19 +02:00
Frédéric FRANCE
7a2942684c Fix #2559 Bug: Untranslated "Total" in Bank module 2015-04-07 12:45:25 +02:00
Laurent Destailleur
6afde94acf git push origin 3.6Merge branch 'marcosgdf-bug-2535' into 3.6 2015-04-06 12:52:49 +02:00
Laurent Destailleur
a42eb7b787 Merge branch 'bug-2535' of https://github.com/marcosgdf/dolibarr into marcosgdf-bug-2535
Conflicts:
	ChangeLog
2015-04-06 12:52:33 +02:00
Laurent Destailleur
a92c8ccbd5 git push origin 3.6Merge branch 'marcosgdf-bug-2534' into 3.6 2015-04-06 12:49:12 +02:00
Laurent Destailleur
8ce66aad79 Merge branch 'bug-2534' of https://github.com/marcosgdf/dolibarr into marcosgdf-bug-2534
Conflicts:
	ChangeLog
2015-04-06 12:48:55 +02:00
Laurent Destailleur
d8b50722f3 Merge pull request #2548 from marcosgdf/bug-2540
Close #2540 Bug: Incorrect HTML in "Bank account" tab of a Thirdparty
2015-04-06 12:41:38 +02:00
Laurent Destailleur
f9608bf41d Merge pull request #2547 from marcosgdf/bug-2543
Closes #2543: Untranslated "Contract" origin string when creating an invoice from a contract
2015-04-06 12:38:54 +02:00
Laurent Destailleur
54645f0a3b Merge pull request #2555 from FHenry/3.6
FIX : [ bug #1916 ] uniformize icon status4 in theme bureau2crea
2015-04-06 12:26:59 +02:00
Marcos García de La Fuente
5c8e92d52a Closes #2535 Bug: Untranslated string in "Linked objects" page of a project 2015-04-04 17:52:05 +02:00
Marcos García de La Fuente
50091dfe8b Closes #2534 SQL error when editing a supplier invoice line 2015-04-04 17:44:52 +02:00
Marcos García de La Fuente
611406b75e Closes #2540 Bug: Incorrect HTML in "Bank account" tab of a Thirdparty 2015-04-04 17:34:06 +02:00
Marcos García de La Fuente
65f4a818d4 Merge branch '3.6' into bug-2543 2015-04-04 17:29:17 +02:00
Marcos García de La Fuente
40860a84d1 Closes #2543: Untranslated "Contract" origin string when creating an invoice from a contract 2015-04-04 17:28:24 +02:00
Florian HENRY
092dd38851 FIX : [ bug #1916 ] problème d'icone pour l'état "clos" sur les projets 2015-04-03 15:33:41 +02:00
Florian HENRY
dfe4837dbc Merge branch '3.6' of git@github.com:Dolibarr/dolibarr.git into 3.6 2015-04-03 09:20:35 +02:00
Laurent Destailleur
f38212f20e Merge pull request #2508 from FHenry/3.6
FIX : [ bug #1913 ] [EXPORT] [PGSQL] Bug when filtering export on a specific year
2015-04-02 11:22:18 +02:00
Florian HENRY
104bbfdc1c Merge branch '3.6' of git@github.com:Dolibarr/dolibarr.git into 3.6 2015-03-30 19:14:49 +02:00
Florian HENRY
65ec02bae1 FIX : [ bug #1913 ] [EXPORT] [PGSQL] Bug when filtering export on a
specific year
2015-03-30 19:13:55 +02:00
Laurent Destailleur
fd8d09c8c0 Fix avoid warning 2015-03-29 17:53:05 +02:00
Laurent Destailleur
b5690142aa Prepare 3.6.3 2015-03-29 16:26:31 +02:00
Laurent Destailleur
253955dc31 Merge branch '3.6' of git@github.com:Dolibarr/dolibarr.git into 3.6 2015-03-28 17:13:05 +01:00
Laurent Destailleur
ffe1ee0d84 Target 98 to publish of dolibarr sevrer is now working 2015-03-28 17:12:31 +01:00
Laurent Destailleur
d0e4d8046b Merge pull request #2480 from marcosgdf/minor-2
Corrected search box alignment in Customer orders list
2015-03-27 01:09:06 +01:00
Laurent Destailleur
78638a30cd Merge pull request #2477 from atm-maxime/3.6
Fix : Quantity displayed for virtual stock explanations was wrong
2015-03-27 01:01:37 +01:00
Marcos García de La Fuente
e59fed9f38 Corrected search box alignment in Customer orders list 2015-03-26 11:08:34 +01:00
Maxime Kohlhaas
b250c5588e Fix : Quantity displayed for virtual stock explanations was wrong 2015-03-25 16:11:36 +01:00
Laurent Destailleur
2a4687834d Merge pull request #2474 from netfab/3.6
Fix displaying of the warning image.
2015-03-23 23:26:09 +01:00
Fab
ea7f00e777 Fix displaying of the warning image.
Since last commit, $objp->date_livraison returns nothing ; max() will
then returns wrong result, and the warning image will be displayed when it
should not.
2015-03-23 20:05:31 +01:00
Laurent Destailleur
b52ee1d069 Merge pull request #2465 from marcosgdf/bug-delivery_date
Fixed delivery date in order list not showing up
2015-03-21 01:24:17 +01:00
Marcos García de La Fuente
56295ed438 Fixed delivery date in order list not showing up 2015-03-20 11:28:23 +01:00
Laurent Destailleur
c4ff66c5d7 Merge remote-tracking branch 'origin/3.5' into 3.6 2015-03-14 13:46:18 +01:00
Laurent Destailleur
a9eebb33fd Merge branch '3.5' of git@github.com:Dolibarr/dolibarr.git into 3.5 2015-03-14 13:45:27 +01:00
Laurent Destailleur
89b22be063 FIXED: Allowed 0 to be used as an account mask. Required by CEGID. 2015-03-14 13:44:26 +01:00
Laurent Destailleur
da72cf387b Merge pull request #2451 from Dolibarr/revert-2318-3.5-accountingmask
Revert "FIXED Allowed 0 to be used as an account mask"
2015-03-14 13:43:04 +01:00
Laurent Destailleur
4a9a3ab04b Revert "FIXED Allowed 0 to be used as an account mask" 2015-03-14 13:42:58 +01:00
Laurent Destailleur
da042c1677 Merge pull request #2318 from GPCsolutions/3.5-accountingmask
FIXED Allowed 0 to be used as an account mask
2015-03-14 13:42:46 +01:00
Juanjo Menent
7cab558ed2 Fix: Showing system error if not enough stock of product into orders
creation with lines
2015-03-14 09:44:58 +01:00
Laurent Destailleur
41b09d8c70 Merge pull request #2448 from atm-maxime/3.6
Fix : display proposal date on proposal list
2015-03-11 02:50:26 +01:00
Laurent Destailleur
242a71e967 Merge pull request #2436 from marcosgdf/patch-1
Update ChangeLog
2015-03-11 02:31:24 +01:00
Laurent Destailleur
734a7dd5c7 Merge pull request #2443 from biznext/patch-4
Fix Anchor link for quick access when editing.
2015-03-11 02:13:29 +01:00
Laurent Destailleur
f484abe5ec Merge pull request #2446 from GPCsolutions/3.6-#1901
FIXED #1901: Inverted supplier order/invoice buttons in project referring objects
2015-03-11 02:12:01 +01:00
Maxime Kohlhaas
05a2a6af00 FIX : [bug #1900] Unable to remove a salary with enough permissions 2015-03-10 15:53:02 +01:00
Maxime Kohlhaas
154e1a7991 Merge branch '3.6' of github.com:Dolibarr/dolibarr into 3.6 2015-03-10 15:14:25 +01:00
Maxime Kohlhaas
978dc8170d Fix : display proposal date on proposal list 2015-03-10 14:56:58 +01:00
Raphaël Doursenaud
f8dfa61859 FIXED #1901: Inverted supplier order/invoice buttons in project referring objects 2015-03-09 16:20:51 +01:00
Estephe L.
9d320e4268 Fix Anchor link for quick access when editing.
This is a quick fix to make anchor link works well when editing a proposal, order or invoice ...
2015-03-08 23:29:09 +01:00
Marcos García
9a7346f889 Update ChangeLog 2015-03-06 12:09:23 +01:00
Laurent Destailleur
5f9f536f0b Merge pull request #2417 from marcosgdf/bug-1892
[ bug #1892 ] PHP Fatal error when using USER_UPDATE_SESSION trigger and adding a supplier invoice payment
2015-03-04 22:01:37 +01:00
Laurent Destailleur
4e144b6b76 Merge pull request #2416 from marcosgdf/bug-1825
Fixed bug with hide/show checkboxes reported by Ruben Almeida (aruben)
2015-03-04 20:38:47 +01:00
Marcos García de La Fuente
41c55d1913 Better fix for bug-1825. There are actually a lot to things to escape and escaped methods can make conflict with similar names so it is better to make a md5 to have a unique value 2015-03-04 11:55:17 +01:00
Marcos García de La Fuente
77605bce3e [ bug #1892 ] PHP Fatal error when using USER_UPDATE_SESSION trigger and adding a supplier invoice payment 2015-03-02 13:33:31 +01:00
Marcos García de La Fuente
7876238823 Fixed bug with hide/show checkboxes reported by Ruben Almeida (aruben)
When an external calendar was called "mytasks", Dolibarr events were also hidden too.
2015-03-02 01:36:27 +01:00
Laurent Destailleur
a421564b84 Fix phpcs 2015-03-01 13:52:58 +01:00
Juanjo Menent
7ca8fdb20c PHP norms 2015-02-27 17:58:19 +01:00
Juanjo Menent
bfe9bf7a47 Fix: Bad SEPA xml file creation 2015-02-27 17:55:15 +01:00
Laurent Destailleur
72da9b52af Merge pull request #2380 from marcosgdf/bug-1825
Better fix for bug 1825
2015-02-24 17:07:17 +01:00
Laurent Destailleur
d9ab05833f Merge pull request #2370 from braito4/patch-1
[FIX #1833] Permissions in contact/note.php wrong
2015-02-20 23:31:55 +01:00
Laurent Destailleur
29c39d61fb Merge branch 'marcosgdf-bug-1790' into 3.6 2015-02-20 23:24:05 +01:00
Laurent Destailleur
56635cea98 Merge branch 'bug-1790' of https://github.com/marcosgdf/dolibarr into
marcosgdf-bug-1790

Conflicts:
	ChangeLog
2015-02-20 23:23:57 +01:00
Laurent Destailleur
bd6b465ee1 Add phpunit for ie11 and ie10 2015-02-20 20:16:15 +01:00
Laurent Destailleur
e1e31de229 Merge remote-tracking branch 'origin/3.5' into 3.6 2015-02-20 20:15:04 +01:00
Laurent Destailleur
d549c00b2e Merge pull request #2365 from marcosgdf/3.5
Fix: [ bug #1846 ] Browser IE11 not detected
2015-02-20 20:02:11 +01:00
Marcos García de La Fuente
d46c76311c Correction 2015-02-20 10:23:17 +01:00
Marcos García de La Fuente
3a917a0d1f Merge branch '3.6' into bug-1825 2015-02-20 10:19:08 +01:00
Marcos García de La Fuente
fd18aa8717 Better fix for Bug #1825 2015-02-20 10:17:02 +01:00
Laurent Destailleur
cb32dbc7b8 Merge branch 'marcosgdf-bug-1825' into 3.6 2015-02-19 09:47:35 +01:00
Laurent Destailleur
639aaebacb Merge branch 'bug-1825' of https://github.com/marcosgdf/dolibarr into
marcosgdf-bug-1825

Conflicts:
	ChangeLog
2015-02-19 09:47:22 +01:00
Laurent Destailleur
ec56667f5e Fix: [ bug #1849 ] Broken flag image when a contact does not have a
country set
2015-02-19 09:44:22 +01:00
Laurent Destailleur
d1a4b6c2c5 phpcs 2015-02-19 00:04:35 +01:00
Laurent Destailleur
e7d95f553b Merge remote-tracking branch 'origin/3.5' into 3.6 2015-02-18 23:43:22 +01:00
Laurent Destailleur
ceb3920381 Merge pull request #2346 from aaujon/3.6-webservice-order
fix typo in createOrder
2015-02-18 23:00:06 +01:00
Laurent Destailleur
9ebd79f528 Merge branch 'marcosgdf-bug-1830' into 3.6 2015-02-18 22:50:25 +01:00
Laurent Destailleur
ead6b4bf95 Merge branch 'bug-1830' of https://github.com/marcosgdf/dolibarr into
marcosgdf-bug-1830

Conflicts:
	ChangeLog
2015-02-18 22:50:12 +01:00
Laurent Destailleur
231c3f57d3 Merge pull request #2342 from aspangaro/3.6
FIXED Correct typo on Changelog
2015-02-18 22:47:03 +01:00
Laurent Destailleur
50142a1e6c Merge branch 'bug-1826' of https://github.com/marcosgdf/dolibarr into
3.6

Conflicts:
	ChangeLog
2015-02-18 22:46:24 +01:00
Laurent Destailleur
fc415fc3c9 Fix: [ bug #1826 ] Supplier payment types are not translated in
fourn/facture/paiement.php
2015-02-18 22:44:42 +01:00
Laurent Destailleur
f831bdd231 Merge branch 'marcosgdf-bug-1832' into 3.6 2015-02-18 22:41:53 +01:00
Laurent Destailleur
6d25cf6f6a Merge branch 'bug-1832' of https://github.com/marcosgdf/dolibarr into
marcosgdf-bug-1832

Conflicts:
	ChangeLog
2015-02-18 22:41:32 +01:00
Laurent Destailleur
8f339712ab Merge pull request #2338 from aaujon/3.6-webservice-product-barcode
FIXED : product webservice can now save barcode
2015-02-18 22:24:20 +01:00
Laurent Destailleur
89b9364837 Merge pull request #2337 from marcosgdf/bug-1822
Fix: [ bug #1822 ] SQL error in clientfourn.php report with PostgreSQL
2015-02-18 22:23:07 +01:00
Laurent Destailleur
9eb26c66de Merge pull request #2336 from atm-maxime/3.6
FIX : Link to user was wrong on bank transaction card
2015-02-18 22:22:46 +01:00
Laurent Destailleur
9f8bee3501 Merge pull request #2331 from altatof/fix_natural_search
FIX: select DISTINCT for natural search on proposal list (in the same way it's done in invoices list)
2015-02-18 22:16:43 +01:00
braito4
ca64763440 Update note.php
Error in the security check
2015-02-17 18:09:16 +01:00
Maxime Kohlhaas
0a1ade22c8 Merge branch '3.6' of github.com:Dolibarr/dolibarr into 3.6 2015-02-17 15:15:46 +01:00
Marcos García de La Fuente
3efb737cbf Fix: [ bug #1845 ] Undefined "$conf->browser->ie" var in "functions.lib.php" 2015-02-16 12:30:10 +01:00
Marcos García de La Fuente
6f08893016 Fix: [ bug #1846 ] Browser IE11 not detected 2015-02-16 12:26:20 +01:00
Marcos García de La Fuente
0a81fe667f Fix: [ bug #1825 ] External agenda: hide/show checkbox doesn't work 2015-02-16 10:44:10 +01:00
Marcos García de La Fuente
5db4bb68a4 Updated bug name 2015-02-15 16:00:07 +01:00
Marcos García de La Fuente
2c074a94f3 Fix: [ bug #1790 ] Sending a test mail from admin page, gives "File already exists" error 2015-02-15 15:57:38 +01:00
Laurent Destailleur
6189db677d Fix package .exe 2015-02-14 11:25:26 +01:00
Laurent Destailleur
039a184d70 Merge remote-tracking branch 'origin/3.5' into 3.6
Conflicts:
	htdocs/core/tpl/objectline_edit.tpl.php
2015-02-10 21:13:12 +01:00
Raphaël Doursenaud
7dea799a9e FIXED Allowed 0 to be used as an account mask
0 is used by some accounting systems and software.
2015-02-10 17:18:32 +01:00
Arnaud Aujon Chevallier
863c1f7a13 fix typo in createOrder 2015-02-10 13:21:36 +01:00
Marcos García de La Fuente
6531a5c6c7 Fix: [ bug #1830 ] Salaries payment only allows checking accounts 2015-02-10 09:44:27 +01:00
aspangaro
f1d5e1ba7b FIXED Correct typo on Changelog 2015-02-10 07:14:55 +01:00
Marcos García de La Fuente
a9dc6bb3d7 Fix: [ bug #1826 ] Supplier payment types are not translated in fourn/facture/paiement.php 2015-02-10 00:55:22 +01:00
Marcos García de La Fuente
58a61e1294 Changed int typecast to float 2015-02-10 00:23:32 +01:00
Marcos García de La Fuente
949f9e40a0 Fix: [ bug #1832 ] SQL error when adding a product with no price defined to an object 2015-02-10 00:20:47 +01:00
Arnaud Aujon Chevallier
5747dbfe9b FIXED : product webservice can now save barcode 2015-02-09 13:55:43 +01:00
Marcos García de La Fuente
d9ac21ab82 Fix: [ bug #1822 ] SQL error in clientfourn.php report with PostgreSQL 2015-02-08 16:54:41 +01:00
Maxime Kohlhaas
db9d727eb8 FIX : Link to user was wrong on bank transaction card 2015-02-08 12:36:55 +01:00
Laurent Destailleur
07877bc381 Merge branch 'marcosgdf-bug-1827' into 3.6 2015-02-07 23:57:13 +01:00
Laurent Destailleur
e8b2b22c32 Merge branch 'bug-1827' of https://github.com/marcosgdf/dolibarr into
marcosgdf-bug-1827

Conflicts:
	ChangeLog
2015-02-07 23:56:38 +01:00
Laurent Destailleur
d10e28db36 Merge pull request #2326 from aaujon/3.6-webservice-order
FIXES Webservice : fk_delivery_address not saved
2015-02-07 23:49:31 +01:00
Laurent Destailleur
6eb0d34032 Merge pull request #2325 from aaujon/3.6-webservices-contact
FIXED #1824 Add ref_ext for Contact webservices
2015-02-07 23:47:19 +01:00
Christophe Battarel
3940abe7c1 FIX: select DISTINCT for natural search on proposal list (in the same
way it's done in invoices list)
2015-02-07 10:48:03 +01:00
Marcos García de La Fuente
b8b9df7b95 Fix: [ bug #1827 ] Tax reports gives incorrect amounts when using external modules that create lines with special codes 2015-02-06 12:36:09 +01:00
Arnaud Aujon
65efa7ddf7 FIXED #1824 Add ref_ext for Contact webservices
Add possibility to use ref_ext to reference contact using webservice, field was present but not saved and not used to fetch object
2015-02-05 14:28:16 +01:00
Arnaud Aujon Chevallier
eb2c5c29b7 FIXES Webservice : fk_delivery_address not saved 2015-02-05 13:33:58 +01:00
Laurent Destailleur
212319b1f8 Merge pull request #2313 from GPCsolutions/3.6-ssl
FIXED Removed deprecated forcing SSLv3 for CURL
2015-02-03 13:09:50 +01:00
Laurent Destailleur
3bb6a5e8af Merge branch '3.6' of git@github.com:Dolibarr/dolibarr.git into 3.6
Conflicts:
	ChangeLog
2015-02-03 12:42:24 +01:00
Laurent Destailleur
fd93e9f322 Merge branch 'marcosgdf-bug-1812' into 3.6 2015-02-03 12:41:33 +01:00
Laurent Destailleur
3ad61e4dc8 Merge pull request #2307 from marcosgdf/bug-1819
Fix: [ bug #1819 ] SQL error when searching for an invoice payment
2015-02-03 12:33:04 +01:00
Raphaël Doursenaud
fb865e8184 FIXED Removed deprecated forcing SSLv3 for CURL
Since the Poodle vulnerability, SSLv3 has been supersedded by TLS.
Many services do not offer SSLv3 anymore.
CURL has also been patched in PHP so it now auto-negociates the most appropriate protocol.
This prevented most API calls from working.
2015-02-02 17:13:11 +01:00
Marcos García de La Fuente
0c63644038 Fix: [ bug #1819 ] SQL error when searching for an invoice payment 2015-02-01 13:26:30 +01:00
Marcos García de La Fuente
ef35483494 Fix: [ bug #1819 ] SQL error when searching for an invoice payment 2015-02-01 12:58:54 +01:00
Laurent Destailleur
3ec5b46864 Merge pull request #2294 from altatof/fix_fournprice_visibility
FIX: always show fournprice select
2015-01-31 19:47:46 +01:00
Laurent Destailleur
87b75126aa Fix missing set into specimen 2015-01-31 16:52:34 +01:00
Laurent Destailleur
2581592441 Merge pull request #2287 from atm-maxime/3.6
FIXED Import module was not working with multi-company and importing eve...
2015-01-31 14:26:28 +01:00
Christophe Battarel
04f83ae4ff FIX: always show fournprice select 2015-01-28 16:19:56 +01:00
Maxime Kohlhaas
11dd32a8fd FIXED Import module was not working with multi-company and importing everything in entity 1 2015-01-26 23:37:25 +01:00
Laurent Destailleur
568d5cb5ba Fixed: Tracking number restored on PDF shipments
Fixed: Translation

Conflicts:
	htdocs/langs/en_US/agenda.lang
2015-01-23 18:47:47 +01:00
Laurent Destailleur
b7cff09ce6 Fixed travis errors 2015-01-22 21:46:22 +01:00
Laurent Destailleur
3af67b414e Merge pull request #2267 from tiaris/3.6
add left joins on llx_c_actioncomm
2015-01-21 00:00:00 +01:00
jean
b809f0aeb8 Merge remote-tracking branch 'origin/3.6' into 3.6 2015-01-20 17:31:17 +01:00
jean
5ec0b32ab0 add left joins on llx_c_actiocomm 2015-01-20 17:26:32 +01:00
Laurent Destailleur
08214999a7 Merge remote-tracking branch 'origin/3.5' into 3.6 2015-01-18 15:21:38 +01:00
Laurent Destailleur
5ed5a729d5 Merge branch 'marcosgdf-bug-1784' into 3.6 2015-01-18 15:13:38 +01:00
Laurent Destailleur
7b7b8f376f Merge branch 'bug-1784' of https://github.com/marcosgdf/dolibarr into
marcosgdf-bug-1784

Conflicts:
	ChangeLog
2015-01-18 15:13:26 +01:00
Laurent Destailleur
a696ad62c3 Merge branch 'marcosgdf-bug-1717' into 3.6 2015-01-18 15:12:30 +01:00
Laurent Destailleur
ff65035aee Merge branch 'bug-1717' of https://github.com/marcosgdf/dolibarr into
marcosgdf-bug-1717

Conflicts:
	ChangeLog
2015-01-18 15:12:00 +01:00
Laurent Destailleur
5ec7b10dc7 Merge branch 'marcosgdf-bug-1783' into 3.6 2015-01-18 15:10:47 +01:00
Laurent Destailleur
d1e2ab6f56 Merge branch 'bug-1783' of https://github.com/marcosgdf/dolibarr into
marcosgdf-bug-1783

Conflicts:
	ChangeLog
2015-01-18 15:10:30 +01:00
Laurent Destailleur
a0de75c727 Merge branch 'marcosgdf-bug-1796' into 3.6 2015-01-18 15:09:18 +01:00
Laurent Destailleur
7c5927ef93 Merge branch 'bug-1796' of https://github.com/marcosgdf/dolibarr into
marcosgdf-bug-1796

Conflicts:
	ChangeLog
2015-01-18 15:08:49 +01:00
Laurent Destailleur
abf961707d Merge branch 'marcosgdf-bug-1787' into 3.6 2015-01-18 15:07:15 +01:00
Laurent Destailleur
b3e216b8f1 Merge branch 'bug-1787' of https://github.com/marcosgdf/dolibarr into
marcosgdf-bug-1787

Conflicts:
	ChangeLog
	htdocs/comm/propal.php
2015-01-18 15:06:54 +01:00
Laurent Destailleur
ccaab5e183 Merge branch 'marcosgdf-bug-1803' into 3.6 2015-01-18 15:01:34 +01:00
Laurent Destailleur
c35de1aa06 Merge branch 'bug-1803' of https://github.com/marcosgdf/dolibarr into
marcosgdf-bug-1803

Conflicts:
	ChangeLog
2015-01-18 15:01:18 +01:00
Laurent Destailleur
c1f3d66686 Merge branch 'marcosgdf-bug-1804' into 3.6 2015-01-18 14:03:04 +01:00
Laurent Destailleur
cef48d1275 Merge branch 'bug-1804' of https://github.com/marcosgdf/dolibarr into
marcosgdf-bug-1804

Conflicts:
	ChangeLog
2015-01-18 14:02:52 +01:00
Laurent Destailleur
0513ce25e5 Merge branch '3.6' of git@github.com:Dolibarr/dolibarr.git into 3.6
Conflicts:
	ChangeLog
2015-01-18 13:51:45 +01:00
Laurent Destailleur
056c0b0ca1 Merge branch 'marcosgdf-bug-1788' into 3.6 2015-01-18 13:49:23 +01:00
Laurent Destailleur
a51ea308f5 Merge branch 'marcosgdf-bug-1762' into 3.5 2015-01-18 13:46:15 +01:00
Laurent Destailleur
05f08a7181 Merge branch 'bug-1762' of https://github.com/marcosgdf/dolibarr into
marcosgdf-bug-1762

Conflicts:
	ChangeLog
2015-01-18 13:43:57 +01:00
Laurent Destailleur
b1f889e1d1 Merge remote-tracking branch 'origin/3.5' into 3.6 2015-01-18 12:46:23 +01:00
Laurent Destailleur
896b924380 git push origin 3.6Merge branch 'marcosgdf-bug-1785' into 3.6 2015-01-18 12:45:29 +01:00
Laurent Destailleur
2f4352c759 Merge branch 'bug-1785' of https://github.com/marcosgdf/dolibarr into
marcosgdf-bug-1785

Conflicts:
	ChangeLog
2015-01-18 12:45:05 +01:00
Laurent Destailleur
1a552cf643 git push origin 3.6Merge branch 'marcosgdf-bug-1802' into 3.6 2015-01-18 12:37:44 +01:00
Laurent Destailleur
4639ce3364 Merge branch 'bug-1802' of https://github.com/marcosgdf/dolibarr into
marcosgdf-bug-1802

Conflicts:
	ChangeLog
2015-01-18 12:37:16 +01:00
Marcos García de La Fuente
17b14eed88 Updated bug title 2015-01-18 02:55:59 +01:00
Marcos García de La Fuente
78905c6af1 Fix: [ bug #1784 ] « Message page de connexion » n'apparaît pas 2015-01-17 20:29:51 +01:00
Marcos García de La Fuente
003aa5ee44 Fix: [ bug #1717 ] Sorting unpaid invoices by amount received brings due amount 2015-01-17 19:41:31 +01:00
Marcos García de La Fuente
dacec491ff Fix: [ bug #1783 ] SQL error when enabling 3rd party module with PostgreSQL and MySQL strict mode ON 2015-01-17 19:37:49 +01:00
Marcos García de La Fuente
7f59cf9194 Fix: [ bug #1787 ] Incorrect behaviour of doActions hook 2015-01-17 19:28:27 +01:00
Marcos García de La Fuente
cc9197e4c8 Fixed problem with Fichinter::getNextNumRef 2015-01-17 19:13:38 +01:00
Marcos García de La Fuente
103a433bdf Fix: [ bug #1796 ] Unable to use numeration modules from an external module 2015-01-17 19:00:44 +01:00
Marcos García de La Fuente
41e01a22a3 Fixed loading of external numeration modules in Contrat, Commande, Facture, Contrat, Expedition, Fichinter, CommandeFournisseur and uniformized code 2015-01-17 18:58:05 +01:00
Marcos García de La Fuente
ed839114ab Fixed loading of external numeration modules in FactureFournisseur and Propal 2015-01-17 18:42:19 +01:00
Marcos García de La Fuente
068045f6a0 Fix: [ bug #1803 ] AJAX company contact input is not aligned 2015-01-17 18:23:20 +01:00
Marcos García de La Fuente
a64084308d Fix: [ bug #1804 ] SQL error when sending email without addresee 2015-01-17 18:12:43 +01:00
Juanjo Menent
fe5533d1c3 Fix: PostgreSQL compatibilty 2015-01-16 17:41:56 +01:00
Laurent Destailleur
d1a0187f82 Merge pull request #2236 from marcosgdf/translations
Corrected translation typos
2015-01-16 12:10:32 +01:00
Laurent Destailleur
767afd3c9f Merge pull request #2231 from KreizIT/fix_cron
Fix cron
2015-01-16 12:08:30 +01:00
Laurent Destailleur
5087ac8153 Merge pull request #2237 from marcosgdf/bug-1797
Fix:  [ bug #1797 ] Tulip Supplier invoice module takes creation date instead of invoice date
2015-01-16 12:08:09 +01:00
Laurent Destailleur
6f00cecd81 Merge pull request #2244 from KreizIT/fix_default_empty
FIX : Creating default object from empty when validating supplier order
2015-01-16 12:03:23 +01:00
Laurent Destailleur
4c8de74140 Merge pull request #2242 from marcosgdf/3.6
Fix: [ bug #1801 ] FAC_FORCE_DATE_VALIDATION constant alters supplier invoice date given to numeration modules
2015-01-16 12:02:24 +01:00
Cedric
999a6052ff FIX : Creating default object from empty when validating supplier order 2015-01-15 16:23:10 +01:00
Marcos García de La Fuente
61809ef6b5 - Fix: [ bug #1802 ] SQL error when updating a task with PostgreSQL database 2015-01-15 13:22:58 +01:00
Marcos García de La Fuente
88c3509dd0 Merge remote-tracking branch 'upstream/3.6' into 3.6
Conflicts:
	ChangeLog
2015-01-15 13:09:23 +01:00
Marcos García de La Fuente
71b609fab0 Fix: [ bug #1801 ] FAC_FORCE_DATE_VALIDATION constant alters supplier invoice date given to numeration modules 2015-01-15 13:08:33 +01:00
Juanjo Menent
d40eab2494 Fix: withdrawal create error if in the same month are deleted previus
withdrawals.
2015-01-15 09:57:20 +01:00
Marcos García de La Fuente
4da52cf733 Fix: [ bug #1797 ] Tulip Supplier invoice module takes creation date instead of invoice date 2015-01-13 11:11:37 +01:00
Marcos García de La Fuente
7b4cf976df Corrected translation typos 2015-01-13 09:42:46 +01:00
Marcos García de La Fuente
85b1188593 Fix: [ bug #1788 ] Duplicated doActions hook in product/fournisseurs.php 2015-01-13 09:22:12 +01:00
Marcos García de La Fuente
6c4702f282 Fix: [ bug #1785 ] Start date is lost in Project > Linked objects 2015-01-13 09:11:04 +01:00
Marcos García de La Fuente
7e16d0c1d3 Fix: [ bug #1792 ] Users are not allowed to see margins module index page when no product view permission is enabled 2015-01-13 01:48:58 +01:00
Cedric
d2cd841573 Fix divide by zero error 2015-01-12 13:23:18 +01:00
Cedric
26cad2400e Fix missing lang key 2015-01-12 13:18:50 +01:00
Laurent Destailleur
c441aa89db Fixed: Avoid warning 2015-01-10 18:19:44 +01:00
Laurent Destailleur
90add2fa96 Fix: amarok is a bugged theme making dolidroid failed. We swith to
eldy automatically with dolidroid.
2015-01-10 17:23:52 +01:00
Laurent Destailleur
32edb33411 Start 3.6.3 2015-01-09 22:32:25 +01:00
Laurent Destailleur
068ae7f0d4 - Fix: ref_ext was not saved when recording a customer order from web
service
2015-01-09 22:32:00 +01:00
Laurent Destailleur
4ce7a27dca Merge branch '3.6' of git@github.com:Dolibarr/dolibarr.git into 3.6 2015-01-06 00:28:07 +01:00
Laurent Destailleur
a668d163fd Repair corrupted data 2015-01-06 00:27:35 +01:00
Laurent Destailleur
e5f81b1fec Merge pull request #2202 from defrance69/patch-38
Update facture.php
2015-01-06 00:13:55 +01:00
Laurent Destailleur
337d055872 Merge pull request #2199 from altatof/3.6
FIX: dont remove price ht if it is forced (ie: calculated by margin rate and cost price, or by external module)
2015-01-06 00:10:08 +01:00
BENKE Charles
191d4467e3 Update facture.php
$soc already filled upper when $socid send
2014-12-28 12:31:27 +01:00
Christophe Battarel
1ab6955494 FIX: dont remove price ht if it is forced (ie: calculated by margin rate
and cost price, or by external module)
2014-12-27 11:27:41 +01:00
jean
619bcb44df object must be reloaded before creating pdf on confirmation and ordering 2014-10-21 19:02:48 +02:00
107 changed files with 6957 additions and 6578 deletions

View File

@@ -52,6 +52,9 @@ http://www.fsf.org/licensing/licenses/index_html
Copyright
---------
Copyright (C) 2015
- Marcos García <marcosgdf@gmail.com>
Copyright (C) 2014
- Laurent Destailleur <eldy@users.sourceforge.net>
- Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>

View File

@@ -2,14 +2,50 @@
English Dolibarr ChangeLog
--------------------------------------------------------------
***** ChangeLog for 3.6.3 compared to 3.6.2 *****
- Fix: ref_ext was not saved when recording a customer order from web service
- Fix: amarok is a bugged theme making dolidroid failed. We switch to eldy automatically with dolidroid.
- Fix: [ bug #1788 ] Duplicated doActions hook in product/fournisseurs.php
- Fix: withdrawal create error if in the same month are deleted previous withdrawals.
- Fix: [ bug #1801 ] FAC_FORCE_DATE_VALIDATION constant alters supplier invoice date given to numeration modules
- Fix: [ bug #1802 ] SQL error when updating a task with PostgreSQL database
- Fix: [ bug #1785 ] Start date is lost in Project > Linked objects
- Fix: [ bug #1804 ] SQL error when sending email without address
- Fix: [ bug #1803 ] AJAX company contact input is not aligned
- Fix: [ bug #1787 ] Incorrect behaviour of doActions hook
- Fix: [ bug #1796 ] Unable to use numeration modules from an external module
- Fix: [ bug #1783 ] SQL error when enabling 3rd party module with PostgreSQL and MySQL strict mode ON
- Fix: [ bug #1717 ] Sorting unpaid invoices by amount received brings due amount
- Fix: [ bug #1784 ] MOTD doesn't show up in Amarok theme
- Fix: Tracking number not visible on shipment pdf
- Fix: [ bug #1812 ] SQL Error message while sending emailing with PostgreSQL database
- Fix: [ bug #1819 ] SQL error when searching for an invoice payment
- Fix: [ bug #1827 ] Tax reports gives incorrect amounts when using external modules that create lines with special codes
- Fix: [ bug #1822 ] SQL error in clientfourn.php report with PostgreSQL
- Fix: [ bug #1832 ] SQL error when adding a product with no price defined to an object
- Fix: [ bug #1833 ] user permissions in contact/note.php not working
- Fix: [ bug #1826 ] Supplier payment types are not translated into fourn/facture/paiement.php
- Fix: [ bug #1830 ] Salaries payment only allows checking accounts
- Fix: [ bug #1825 ] External agenda: hide/show checkbox doesn't work
- Fix: [ bug #1790 ] Email form behaves in an unexpected way when pressing Enter key
- Fix: Bad SEPA xml file creation
- Fix: [ bug #1892 ] PHP Fatal error when using USER_UPDATE_SESSION trigger and adding a supplier invoice payment
- Fix: Showing system error if not enough stock of product into orders creation with lines
- Fix: [ bug #2543 ] Untranslated "Contract" origin string when creating an invoice from a contract
- Fix: [ bug #2534 ] SQL error when editing a supplier invoice line
- Fix: [ bug #2535 ] Untranslated string in "Linked objects" page of a project
- Fix: [ bug #2545 ] Missing object_margin.png in Amarok theme
- Fix: [ bug #2542 ] Contracts store localtax preferences
- Fix: Bad permission assignments for stock movements actions
***** ChangeLog for 3.6.2 compared to 3.6.1 *****
- Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice.
- Fix: bug 1588 : relative discount.
- Fix: label of input method not tranlated.
- Fix: box of customer and propsects were not correctly disabled.
- Fix: label of input method not translated.
- Fix: box of customer and prospects were not correctly disabled.
- Fix: [ bug #1618 ] PHP Error thrown when saving a barcode
- Fix: Civility & birthdate wasn't save into adherent module.
- Fix: webservice Thirdparty parameter lastname for invidual creation is now lastname and not ref
- Fix: webservice Thirdparty parameter lastname for individual creation is now lastname and not ref
- Fix: Chars - is no more allowed into value for code for extra fields.
- Fix: [ bug #1622 ] Requesting holiday than spans across two years cause high CPU usage by Apache
- Fix: [ bug #1595 ] Selected boolean extrafield in intervention creation page, does not save state
@@ -36,14 +72,14 @@ For users:
- Fix: Iban was used instead of Bic into SEPA file.
- Fix: Must unaccent strings into SEPA file.
- Fix: Extrafield feature select from table should try to translate multiple column when not needed
- Fix: cents for indian ruppes are calle paisa and paise.
- Fix: cents for indian ruppes are called paisa and paise.
- Fix: Invoices payments may be older than invoices.
- Fix: Withdrawal total amount is double
- Fix: [ bug #1593 ] Spanish Localtax IRPF not being calculated since 3.6.0 in supplier invoices when adding a line
- Fix: Web service categorie WDSL declaration is correct
- Fix: ErrorBadValueForParamNotAString was displayed in virtual product if no base price defined
- Fix: Category creation failed and no message output
- Fix: Lanf for Payment Type
- Fix: Lang for Payment Type
- Fix: PHPCheckstyle 1.5.5
***** ChangeLog for 3.6 compared to 3.5.* *****
@@ -65,12 +101,12 @@ For users:
- New: Improved Opensurvey module:
Added options to disable comments and disable public votes.
Limit dates use calendar popup.
Description of survey use wysiwig editor.
Description of survey use wysiwyg editor.
More information shown on result tab.
Renamed "survey" into "poll" (better translation).
- New: Add filter on text and status into survey list. Can also sort on id, text and date end.
- New: The box "balance of bank accounts" show all opened accounts.
- New: Add option MAIN_ADD_SALE_REP_SIGNATURE_IN_NOTE to add sale represnative into public
- New: Add option MAIN_ADD_SALE_REP_SIGNATURE_IN_NOTE to add sale representative into public
note of generated documents.
- New: Add warning if supplier payment is higher that due amount.
- New: Increase length of url into bookmark module.
@@ -83,7 +119,7 @@ For users:
- New: Add barcode fields into user database.
- New: Add manager name (ceo, director, president...) into main company information page.
- New: Add field url as product properties.
- New: More options to create a credit note (can be filled autatically according to remain to pay).
- New: More options to create a credit note (can be filled automatically according to remain to pay).
- New: Can define custom fields for categories.
- New: Prepare generation of SEPA files into module withdrawal.
- New: [ task #1164 ] Add "Ref. supplier" search box in supplier orders
@@ -100,7 +136,7 @@ For users:
- New: [ task #926 ] Add extrafield feature on order lines.
- New: [ task #927 ] Add extrafield feature on Proposal lines.
- New: [ task #928 ] Add extrafield feature on invoice lines.
- New: Paypal/paybox email sent after backcall of a payment is now a formated and translated
- New: Paypal/paybox email sent after backcall of a payment is now a formatted and translated
HTML content. For member subscription renewal, there is also a link to member.
- New: When a subscription is recorded with invoice and payment:
- the document (PDF) of invoice is also generated.
@@ -151,14 +187,24 @@ removed. You must now use the 6 parameters way. See file modMyModule.class.php f
So check that return value is 0 to keep default standard behaviour after hook or 1 to disable
default standard behaviour.
- Properties "civilite_id" were renamed into "civility_id".
- Remove add_photo_web() that is ot used anymore by core code.
- Remove add_photo_web() that is not used anymore by core code.
***** ChangeLog for 3.5.7 compared to 3.5.6 *****
Fix: Paypal link were broken dur to SSL v3 closed.
Fix: Paypal link were broken due to SSL v3 closed.
Fix: [ bug #1769 ] Error when installing to a PostgreSQL DB that contains numbers
Fix: [ bug #1752 ] Date filter of margins module, filters since 12H instead of 00H
Fix: [ bug #1757 ] Sorting breaks product/service statistics
Fix: [ bug #1797 ] Tulip supplier invoice module takes creation date instead of invoice date
Fix: [ bug #1792 ] Users are not allowed to see margins module index page when no product view permission is enabled
Fix: [ bug #1846 ] Browser IE11 not detected
Fix: [ bug #1906 ] Deplacement does not allow translated decimal format
Fix: [ bug #1905 ] Custom deplacement types do not get translated in deplacement card
Fix: [ bug #2583 ] Unable to create a bank transfer with localized numbers
Fix: [ bug #2577 ] Incorrect invoice status in "Linked objects" page of a project
Fix: [ bug #2576 ] Unable to edit a dictionary entry that has # in its ref
Fix: [ bug #2758 ] Product::update sets product note to "null" when $prod->note is null
Fix: [ bug #2757 ] Deleting product category photo gives "Forbidden access" error
***** ChangeLog for 3.5.6 compared to 3.5.5 *****
Fix: Avoid missing class error for fetch_thirdparty method #1973
@@ -172,7 +218,7 @@ Fix: Bad days and month reported by function.
Fix: Bad margin calculation.
***** ChangeLog for 3.5.5 compared to 3.5.4 *****
Fix: Holiday module was broken. Initializaion of amount of holidays failed.
Fix: Holiday module was broken. Initialization of amount of holidays failed.
Fix: [ bug #1523 ] suite bug #1334 : filtre et ordre de tri conjoints ne s'appliquent pas.
Fix: Fusion PDF button on unpaid invoice is no more displayed.
Fix: Unpaid invoice launch fusion PDF action even if it is only search (with enter keyboard input instead of lens click).
@@ -207,7 +253,7 @@ Fix: When using option MAIN_MAIL_ALLOW_SENDMAIL_F, a mail was sent to sender.
Fix: Question about warehouse must not be done when module stock is disabled.
Fix: Option STOCK_SUPPORTS_SERVICES was not correctly implemented
(missing test at some places).
Fix: Renaming a project with uplaoded files failed.
Fix: Renaming a project with uploaded files failed.
Fix: [ bug #1476 ] Invoice creation form loses invoice date when there is a validation error.
Fix: [ bug #1431 ] Reception and Send supplier order box has a weird top margin.
Fix: [ bug #1428 ] "Nothing" is shown in the middle of the screen in a supplier order.
@@ -228,7 +274,7 @@ Fix: [ bug #1449 ] Trigger ORDER_CREATE, LINEORDER_DELETE, LINEORDER_UPDATE and
Fix: [ bug #1450 ] Several Customer order's triggers do not report the error from the trigger handler.
Fix: [ bug #1451 ] Interrupted order clone through trigger, loads nonexistent order.
Fix: [ bug #1454 ] Mention de bas de page erroné
Fix: Do not display dictionnay for non activated module
Fix: Do not display dictionary for non activated module
Fix: Link element from element project pages
Fix: [ bug #1509 ] Expedition admin free text & watermark submit error
Fix: [ bug #1349 ] AJAX contact selector does not work fine in Project card

View File

@@ -1,20 +1,6 @@
dolibarr (3.6.2-3) unstable; urgency=low
dolibarr (3.6.4-3) UNRELEASED; urgency=low
[ Laurent Destailleur (eldy) ]
* New upstream release.
-- Laurent Destailleur (eldy) <eldy@users.sourceforge.net> Sat, 27 dec 2014 12:00:00 +0100
dolibarr (3.6.1-3) unstable; urgency=low
[ Laurent Destailleur (eldy) ]
* New upstream release.
-- Laurent Destailleur (eldy) <eldy@users.sourceforge.net> Tue, 23 Sep 2014 12:00:00 +0100
dolibarr (3.6.0-3) unstable; urgency=low
[ Laurent Destailleur (eldy) ]
* New upstream release.
-- Laurent Destailleur (eldy) <eldy@users.sourceforge.net> Tue, 15 July 2014 12:00:00 +0100
-- Laurent Destailleur (eldy) <eldy@users.sourceforge.net> Tue, 12 May 2015 12:00:00 +0100

View File

@@ -32,7 +32,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-2014 Laurent Destailleur, NLTechno
AppCopyright=Copyright (C) 2008-2015 Laurent Destailleur, NLTechno
DefaultDirName=c:\dolibarr
DefaultGroupName=Dolibarr
;LicenseFile=COPYING
@@ -108,7 +108,7 @@ Source: "C:\Program Files\Wamp\bin\mysql\mysql5.0.45\*.*"; DestDir: "{app}\bin\m
; Mysql data files (does not overwrite if exists)
Source: "build\exe\doliwamp\mysql\*.*"; DestDir: "{app}\bin\mysql\data\mysql"; Flags: onlyifdoesntexist ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db"
; Dolibarr
Source: "htdocs\*.*"; DestDir: "{app}\www\dolibarr\htdocs"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,custom\*,custom2\*,documents\*,nltechno*\*,includes\ckeditor\_source\*,includes\savant\*,includes\phpmailer\*,jquery\plugins\template\*,PHPExcel\Shared\PDF\*,PHPExcel\Shared\PCLZip\*,tcpdf\fonts\dejavu-fonts-ttf-2.33\*,tcpdf\fonts\freefont-20100919\*,tcpdf\fonts\utils\*,*\conf.php,*\conf.php.mysql,*\conf.php.old,*\conf.php.postgres,*\conf.php.sav,*\install.forced.php"
Source: "htdocs\*.*"; DestDir: "{app}\www\dolibarr\htdocs"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,custom\*,custom2\*,documents\*,includes\ckeditor\_source\*,includes\savant\*,includes\phpmailer\*,jquery\plugins\template\*,nltechno*\*,PHPExcel\Shared\PDF\*,PHPExcel\Shared\PCLZip\*,tcpdf\fonts\dejavu-fonts-ttf-2.33\*,tcpdf\fonts\freefont-20100919\*,tcpdf\fonts\utils\*,*\conf.php,*\conf.php.mysql,*\conf.php.old,*\conf.php.postgres,*\conf.php.sav,*\install.forced.php"
Source: "dev\*.*"; DestDir: "{app}\www\dolibarr\dev"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,dbmodel\*,fpdf\*,initdata\*,iso-normes\*,licence\*,phpcheckstyle\*,phpunit\*,samples\*,test\*,uml\*,vagrant\*,xdebug\*"
Source: "doc\*.*"; DestDir: "{app}\www\dolibarr\doc"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,wiki\*,plaquette\*,dev\*,images\dolibarr_screenshot2.png,images\dolibarr_screenshot3.png,images\dolibarr_screenshot4.png,images\dolibarr_screenshot5.png,images\dolibarr_screenshot6.png,images\dolibarr_screenshot7.png,images\dolibarr_screenshot8.png,images\dolibarr_screenshot9.png,images\dolibarr_screenshot10.png,images\dolibarr_screenshot11.png,images\dolibarr_screenshot12.png"
Source: "scripts\*.*"; DestDir: "{app}\www\dolibarr\scripts"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,product\materiel.net.php,product\import-product.php"

File diff suppressed because it is too large Load Diff

View File

@@ -12,7 +12,6 @@ beta version of Dolibarr, step by step.
- Update version number with x.y.z-w in htdocs/filefunc.inc.php
- Update version number with x.y.z-w in build/debian/changelog
- Update version number with x.y.z-w in build/exe/doliwamp/doliwamp.iss
- Update version number with x.y.z-w in build/rpm/*.spec
- Commit all changes.
- Add a Tag (x.y.betaz_YYYYMMDD) and push it: git push --tags
- Create a branch (x.y).
@@ -34,7 +33,6 @@ complete release of Dolibarr, step by step.
- Update version number with x.y.z in htdocs/filefunc.inc.php
- Update version number with x.y.z in build/debian/changelog
- Update version number with x.y.z in build/exe/doliwamp/doliwamp.iss
- Update version number with x.y.z in build/rpm/*.spec
- Commit all changes.
- Build Dolibarr and DoliWamp packages with makepack-dolibarr.pl

View File

@@ -333,11 +333,4 @@ fi
# version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release
%changelog
* Sat Dec 27 2014 Laurent Destailleur 3.6.2-0.3
- Upstream release
* Wed Sep 24 2014 Laurent Destailleur 3.6.1-0.3
- Upstream release
* Wed Jul 15 2014 Laurent Destailleur 3.6.0-0.3
- Upstream release
__CHANGELOGSTRING__

View File

@@ -569,12 +569,4 @@ fi
# version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release
%changelog
* Sat Dec 27 2014 Laurent Destailleur 3.6.2-0.3
- Upstream release
* Wed Sep 24 2014 Laurent Destailleur 3.6.1-0.3
- Upstream release
* Wed Jul 15 2014 Laurent Destailleur 3.6.0-0.3
- Upstream release
__CHANGELOGSTRING__

View File

@@ -338,12 +338,4 @@ fi
# version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release
%changelog
* Sat Dec 27 2014 Laurent Destailleur 3.6.2-0.3
- Upstream release
* Wed Sep 24 2014 Laurent Destailleur 3.6.1-0.3
- Upstream release
* Wed Jul 15 2014 Laurent Destailleur 3.6.0-0.3
- Upstream release
__CHANGELOGSTRING__

View File

@@ -349,12 +349,4 @@ fi
# version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release
%changelog
* Sat Dec 27 2014 Laurent Destailleur 3.6.2-0.3
- Upstream release
* Wed Sep 24 2014 Laurent Destailleur 3.6.1-0.3
- Upstream release
* Wed Jul 15 2014 Laurent Destailleur 3.6.0-0.3
- Upstream release
__CHANGELOGSTRING__

View File

@@ -213,6 +213,7 @@
<rule ref="PEAR.Commenting.FunctionComment.Missing">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.Missing@authorTag">
<severity>0</severity>
</rule>
@@ -228,6 +229,23 @@
<rule ref="PEAR.Commenting.ClassComment.Missing@packageTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.MissingAuthorTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.MissingCategoryTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.MissingLicenseTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.MissingLinkTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.MissingPackageTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamType">
<severity>0</severity>
</rule>

File diff suppressed because it is too large Load Diff

View File

@@ -6,7 +6,7 @@
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2011 Remy Younes <ryounes@gmail.com>
* Copyright (C) 2012-2013 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2012-2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@ltairis.fr>
* Copyright (C) 2011-2012 Alexandre Spangaro <alexandre.spangaro@gmail.com>
*
@@ -1116,7 +1116,7 @@ if ($id)
if (isset($obj->type) && in_array($obj->type, array('system', 'systemauto'))) $iserasable=0;
$url = $_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(! empty($obj->rowid)?$obj->rowid:(! empty($obj->code)?$obj->code:'')).'&amp;code='.(! empty($obj->code)?$obj->code:'').'&amp;id='.$id.'&amp;';
$url = $_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(! empty($obj->rowid)?$obj->rowid:(! empty($obj->code)?$obj->code:'')).'&amp;code='.(! empty($obj->code)?urlencode($obj->code):'').'&amp;id='.$id.'&amp;';
// Active
print '<td align="center" class="nowrap">';

View File

@@ -100,6 +100,7 @@ print '<br>';
print '<br>';
// Add hook to add information
$parameters=array();
$reshook=$hookmanager->executeHooks('addHomeSetup',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
print $hookmanager->resPrint;
if (empty($reshook))

View File

@@ -1060,6 +1060,7 @@ class ActionComm extends CommonObject
$this->datef=$now;
$this->author=$user;
$this->usermod=$user;
$this->usertodo=$user;
$this->fulldayevent=0;
$this->punctual=0;
$this->percentage=0;

View File

@@ -1038,7 +1038,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
$numicals[dol_string_nospecial($event->icalname)]++;
}
$color=$event->icalcolor;
$cssclass=(! empty($event->icalname)?'family_'.dol_string_nospecial($event->icalname):'family_other');
$cssclass=(! empty($event->icalname)?'family_ext'.md5($event->icalname):'family_other');
}
else if ($event->type_code == 'BIRTHDAY') { $numbirthday++; $colorindex=2; $cssclass='family_birthday'; }
else { $numother++; $cssclass='family_other'; }

View File

@@ -79,76 +79,78 @@ $object = new Societe($db);
$parameters = array('socid' => $id);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some
//Some actions show a "cancel" input submit button with name="cancel"
$cancelbutton = GETPOST('cancel');
if (empty($reshook)) {
//Some actions show a "cancel" input submit button with name="cancel"
$cancelbutton = GETPOST('cancel');
if ($action == 'setcustomeraccountancycode')
{
if (!$cancelbutton) {
$result=$object->fetch($id);
$object->code_compta=$_POST["customeraccountancycode"];
$result=$object->update($object->id,$user,1,1,0);
if ($result < 0)
{
$mesgs[]=join(',',$object->errors);
if ($action == 'setcustomeraccountancycode')
{
if (!$cancelbutton) {
$result=$object->fetch($id);
$object->code_compta=$_POST["customeraccountancycode"];
$result=$object->update($object->id,$user,1,1,0);
if ($result < 0)
{
$mesgs[]=join(',',$object->errors);
}
$action="";
}
$action="";
}
}
// conditions de reglement
if ($action == 'setconditions' && $user->rights->societe->creer)
{
$object->fetch($id);
$result=$object->setPaymentTerms(GETPOST('cond_reglement_id','int'));
if ($result < 0) dol_print_error($db,$object->error);
}
// mode de reglement
if ($action == 'setmode' && $user->rights->societe->creer)
{
$object->fetch($id);
$result=$object->setPaymentMethods(GETPOST('mode_reglement_id','int'));
if ($result < 0) dol_print_error($db,$object->error);
}
// assujetissement a la TVA
if ($action == 'setassujtva' && $user->rights->societe->creer)
{
$object->fetch($id);
$object->tva_assuj=$_POST['assujtva_value'];
// TODO move to DAO class
$sql = "UPDATE ".MAIN_DB_PREFIX."societe SET tva_assuj='".$_POST['assujtva_value']."' WHERE rowid='".$id."'";
$result = $db->query($sql);
if (! $result) dol_print_error($result);
}
// set prospect level
if ($action == 'setprospectlevel' && $user->rights->societe->creer)
{
$object->fetch($id);
$object->fk_prospectlevel=GETPOST('prospect_level_id','alpha');
$result=$object->set_prospect_level($user);
if ($result < 0) setEventMessage($object->error,'errors');
}
// Update communication level
if ($action == 'cstc')
{
$object->fetch($id);
$object->stcomm_id=GETPOST('stcomm','int');
$result=$object->set_commnucation_level($user);
if ($result < 0) setEventMessage($object->error,'errors');
}
// Update communication level
if ($action == 'setOutstandingBill')
{
if (!$cancelbutton) {
// conditions de reglement
if ($action == 'setconditions' && $user->rights->societe->creer)
{
$object->fetch($id);
$object->outstanding_limit = GETPOST('OutstandingBill');
$result = $object->set_OutstandingBill($user);
if ($result < 0) {
setEventMessage($object->error, 'errors');
$result=$object->setPaymentTerms(GETPOST('cond_reglement_id','int'));
if ($result < 0) dol_print_error($db,$object->error);
}
// mode de reglement
if ($action == 'setmode' && $user->rights->societe->creer)
{
$object->fetch($id);
$result=$object->setPaymentMethods(GETPOST('mode_reglement_id','int'));
if ($result < 0) dol_print_error($db,$object->error);
}
// assujetissement a la TVA
if ($action == 'setassujtva' && $user->rights->societe->creer)
{
$object->fetch($id);
$object->tva_assuj=$_POST['assujtva_value'];
// TODO move to DAO class
$sql = "UPDATE ".MAIN_DB_PREFIX."societe SET tva_assuj='".$_POST['assujtva_value']."' WHERE rowid='".$id."'";
$result = $db->query($sql);
if (! $result) dol_print_error($result);
}
// set prospect level
if ($action == 'setprospectlevel' && $user->rights->societe->creer)
{
$object->fetch($id);
$object->fk_prospectlevel=GETPOST('prospect_level_id','alpha');
$result=$object->set_prospect_level($user);
if ($result < 0) setEventMessage($object->error,'errors');
}
// Update communication level
if ($action == 'cstc')
{
$object->fetch($id);
$object->stcomm_id=GETPOST('stcomm','int');
$result=$object->set_commnucation_level($user);
if ($result < 0) setEventMessage($object->error,'errors');
}
// Update communication level
if ($action == 'setOutstandingBill')
{
if (!$cancelbutton) {
$object->fetch($id);
$object->outstanding_limit = GETPOST('OutstandingBill');
$result = $object->set_OutstandingBill($user);
if ($result < 0) {
setEventMessage($object->error, 'errors');
}
}
}
}

View File

@@ -102,446 +102,390 @@ $object->substitutionarrayfortest=array(
$parameters=array();
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
// Action clone object
if ($action == 'confirm_clone' && $confirm == 'yes')
{
if (empty($_REQUEST["clone_content"]) && empty($_REQUEST["clone_receivers"]))
if (empty($reshook)) {
// Action clone object
if ($action == 'confirm_clone' && $confirm == 'yes')
{
$mesg='<div class="error">'.$langs->trans("NoCloneOptionsSpecified").'</div>';
}
else
{
$result=$object->createFromClone($object->id,$_REQUEST["clone_content"],$_REQUEST["clone_receivers"]);
if ($result > 0)
if (empty($_REQUEST["clone_content"]) && empty($_REQUEST["clone_receivers"]))
{
header("Location: ".$_SERVER['PHP_SELF'].'?id='.$result);
exit;
$mesg='<div class="error">'.$langs->trans("NoCloneOptionsSpecified").'</div>';
}
else
{
$mesg=$object->error;
}
}
$action='';
}
// Action send emailing for everybody
if ($action == 'sendallconfirmed' && $confirm == 'yes')
{
if (empty($conf->global->MAILING_LIMIT_SENDBYWEB))
{
// Pour des raisons de securite, on ne permet pas cette fonction via l'IHM,
// on affiche donc juste un message
$mesg='<div class="warning">'.$langs->trans("MailingNeedCommand").'</div>';
$mesg.='<br><textarea cols="70" rows="'.ROWS_2.'" wrap="soft">php ./scripts/emailings/mailing-send.php '.$object->id.'</textarea>';
$mesg.='<br><br><div class="warning">'.$langs->trans("MailingNeedCommand2").'</div>';
$action='';
}
else if ($conf->global->MAILING_LIMIT_SENDBYWEB < 0)
{
$mesg='<div class="warning">'.$langs->trans("NotEnoughPermissions").'</div>';
$action='';
}
else
{
$upload_dir = $conf->mailing->dir_output . "/" . get_exdir($object->id,2,0,1);
if ($object->statut == 0)
{
dol_print_error('','ErrorMailIsNotValidated');
exit;
}
$id = $object->id;
$subject = $object->sujet;
$message = $object->body;
$from = $object->email_from;
$replyto = $object->email_replyto;
$errorsto = $object->email_errorsto;
// Le message est-il en html
$msgishtml=-1; // Unknown by default
if (preg_match('/[\s\t]*<html>/i',$message)) $msgishtml=1;
// Warning, we must not use begin-commit transaction here
// because we want to save update for each mail sent.
$nbok=0; $nbko=0;
// On choisit les mails non deja envoyes pour ce mailing (statut=0)
// ou envoyes en erreur (statut=-1)
$sql = "SELECT mc.rowid, mc.lastname, mc.firstname, mc.email, mc.other, mc.source_url, mc.source_id, mc.source_type, mc.tag";
$sql .= " FROM ".MAIN_DB_PREFIX."mailing_cibles as mc";
$sql .= " WHERE mc.statut < 1 AND mc.fk_mailing = ".$object->id;
dol_syslog("fiche.php: select targets sql=".$sql, LOG_DEBUG);
$resql=$db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql); // nb of possible recipients
if ($num)
$result=$object->createFromClone($object->id,$_REQUEST["clone_content"],$_REQUEST["clone_receivers"]);
if ($result > 0)
{
dol_syslog("comm/mailing/fiche.php: nb of targets = ".$num, LOG_DEBUG);
header("Location: ".$_SERVER['PHP_SELF'].'?id='.$result);
exit;
}
else
{
$mesg=$object->error;
}
}
$action='';
}
$now=dol_now();
// Action send emailing for everybody
if ($action == 'sendallconfirmed' && $confirm == 'yes')
{
if (empty($conf->global->MAILING_LIMIT_SENDBYWEB))
{
// Pour des raisons de securite, on ne permet pas cette fonction via l'IHM,
// on affiche donc juste un message
$mesg='<div class="warning">'.$langs->trans("MailingNeedCommand").'</div>';
$mesg.='<br><textarea cols="70" rows="'.ROWS_2.'" wrap="soft">php ./scripts/emailings/mailing-send.php '.$object->id.'</textarea>';
$mesg.='<br><br><div class="warning">'.$langs->trans("MailingNeedCommand2").'</div>';
$action='';
}
else if ($conf->global->MAILING_LIMIT_SENDBYWEB < 0)
{
$mesg='<div class="warning">'.$langs->trans("NotEnoughPermissions").'</div>';
$action='';
}
else
{
$upload_dir = $conf->mailing->dir_output . "/" . get_exdir($object->id,2,0,1);
// Positionne date debut envoi
$sql="UPDATE ".MAIN_DB_PREFIX."mailing SET date_envoi=".$db->idate($now)." WHERE rowid=".$object->id;
if ($object->statut == 0)
{
dol_print_error('','ErrorMailIsNotValidated');
exit;
}
$id = $object->id;
$subject = $object->sujet;
$message = $object->body;
$from = $object->email_from;
$replyto = $object->email_replyto;
$errorsto = $object->email_errorsto;
// Le message est-il en html
$msgishtml=-1; // Unknown by default
if (preg_match('/[\s\t]*<html>/i',$message)) $msgishtml=1;
// Warning, we must not use begin-commit transaction here
// because we want to save update for each mail sent.
$nbok=0; $nbko=0;
// On choisit les mails non deja envoyes pour ce mailing (statut=0)
// ou envoyes en erreur (statut=-1)
$sql = "SELECT mc.rowid, mc.lastname, mc.firstname, mc.email, mc.other, mc.source_url, mc.source_id, mc.source_type, mc.tag";
$sql .= " FROM ".MAIN_DB_PREFIX."mailing_cibles as mc";
$sql .= " WHERE mc.statut < 1 AND mc.fk_mailing = ".$object->id;
dol_syslog("fiche.php: select targets sql=".$sql, LOG_DEBUG);
$resql=$db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql); // nb of possible recipients
if ($num)
{
dol_syslog("comm/mailing/fiche.php: nb of targets = ".$num, LOG_DEBUG);
$now=dol_now();
// Positionne date debut envoi
$sql="UPDATE ".MAIN_DB_PREFIX."mailing SET date_envoi='".$db->idate($now)."' WHERE rowid=".$object->id;
$resql2=$db->query($sql);
if (! $resql2)
{
dol_print_error($db);
}
// Loop on each email and send it
$i = 0;
while ($i < $num && $i < $conf->global->MAILING_LIMIT_SENDBYWEB)
{
$res=1;
$obj = $db->fetch_object($resql);
// sendto en RFC2822
$sendto = str_replace(',',' ',dolGetFirstLastname($obj->firstname, $obj->lastname))." <".$obj->email.">";
// Make substitutions on topic and body. From (AA=YY;BB=CC;...) we keep YY, CC, ...
$other=explode(';',$obj->other);
$tmpfield=explode('=',$other[0],2); $other1=(isset($tmpfield[1])?$tmpfield[1]:$tmpfield[0]);
$tmpfield=explode('=',$other[1],2); $other2=(isset($tmpfield[1])?$tmpfield[1]:$tmpfield[0]);
$tmpfield=explode('=',$other[2],2); $other3=(isset($tmpfield[1])?$tmpfield[1]:$tmpfield[0]);
$tmpfield=explode('=',$other[3],2); $other4=(isset($tmpfield[1])?$tmpfield[1]:$tmpfield[0]);
$tmpfield=explode('=',$other[4],2); $other5=(isset($tmpfield[1])?$tmpfield[1]:$tmpfield[0]);
// Array of possible substitutions (See also fie mailing-send.php that should manage same substitutions)
$substitutionarray=array(
'__ID__' => $obj->source_id,
'__EMAIL__' => $obj->email,
'__LASTNAME__' => $obj->lastname,
'__FIRSTNAME__' => $obj->firstname,
'__MAILTOEMAIL__' => '<a href="mailto:'.$obj->email.'">'.$obj->email.'</a>',
'__OTHER1__' => $other1,
'__OTHER2__' => $other2,
'__OTHER3__' => $other3,
'__OTHER4__' => $other4,
'__OTHER5__' => $other5,
'__CHECK_READ__' => '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$obj->tag.'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>',
'__UNSUBSCRIBE__' => '<a href="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-unsubscribe.php?tag='.$obj->tag.'&unsuscrib=1&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" target="_blank">'.$langs->trans("MailUnsubcribe").'</a>'
);
if (! empty($conf->paypal->enabled) && ! empty($conf->global->PAYPAL_SECURITY_TOKEN))
{
$substitutionarray['__SECUREKEYPAYPAL__']=dol_hash($conf->global->PAYPAL_SECURITY_TOKEN, 2);
if (empty($conf->global->PAYPAL_SECURITY_TOKEN_UNIQUE)) $substitutionarray['__SECUREKEYPAYPAL_MEMBER__']=dol_hash($conf->global->PAYPAL_SECURITY_TOKEN, 2);
else $substitutionarray['__SECUREKEYPAYPAL_MEMBER__']=dol_hash($conf->global->PAYPAL_SECURITY_TOKEN . 'membersubscription' . $obj->source_id, 2);
}
$substitutionisok=true;
complete_substitutions_array($substitutionarray, $langs);
$newsubject=make_substitutions($subject,$substitutionarray);
$newmessage=make_substitutions($message,$substitutionarray);
$arr_file = array();
$arr_mime = array();
$arr_name = array();
$arr_css = array();
$listofpaths=dol_dir_list($upload_dir,'all',0,'','','name',SORT_ASC,0);
if (count($listofpaths))
{
foreach($listofpaths as $key => $val)
{
$arr_file[]=$listofpaths[$key]['fullname'];
$arr_mime[]=dol_mimetype($listofpaths[$key]['name']);
$arr_name[]=$listofpaths[$key]['name'];
}
}
// Fabrication du mail
$mail = new CMailFile($newsubject, $sendto, $from, $newmessage, $arr_file, $arr_mime, $arr_name, '', '', 0, $msgishtml, $errorsto, $arr_css);
if ($mail->error)
{
$res=0;
}
if (! $substitutionisok)
{
$mail->error='Some substitution failed';
$res=0;
}
// Send mail
if ($res)
{
$res=$mail->sendfile();
}
if ($res)
{
// Mail successful
$nbok++;
dol_syslog("comm/mailing/fiche.php: ok for #".$i.($mail->error?' - '.$mail->error:''), LOG_DEBUG);
$sql="UPDATE ".MAIN_DB_PREFIX."mailing_cibles";
$sql.=" SET statut=1, date_envoi='".$db->idate($now)."' WHERE rowid=".$obj->rowid;
$resql2=$db->query($sql);
if (! $resql2)
{
dol_print_error($db);
}
else
{
//if cheack read is use then update prospect contact status
if (strpos($message, '__CHECK_READ__') !== false)
{
//Update status communication of thirdparty prospect
$sql = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_stcomm=2 WHERE rowid IN (SELECT source_id FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE rowid=".$obj->rowid.")";
dol_syslog("fiche.php: set prospect thirdparty status sql=".$sql, LOG_DEBUG);
$resql2=$db->query($sql);
if (! $resql2)
{
dol_print_error($db);
}
//Update status communication of contact prospect
$sql = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_stcomm=2 WHERE rowid IN (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."socpeople AS sc INNER JOIN ".MAIN_DB_PREFIX."mailing_cibles AS mc ON mc.rowid=".$obj->rowid." AND mc.source_type = 'contact' AND mc.source_id = sc.rowid)";
dol_syslog("fiche.php: set prospect contact status sql=".$sql, LOG_DEBUG);
$resql2=$db->query($sql);
if (! $resql2)
{
dol_print_error($db);
}
}
}
//test if CHECK READ change statut prospect contact
}
else
{
// Mail failed
$nbko++;
dol_syslog("comm/mailing/fiche.php: error for #".$i.($mail->error?' - '.$mail->error:''), LOG_WARNING);
$sql="UPDATE ".MAIN_DB_PREFIX."mailing_cibles";
$sql.=" SET statut=-1, date_envoi=".$db->idate($now)." WHERE rowid=".$obj->rowid;
$resql2=$db->query($sql);
if (! $resql2)
{
dol_print_error($db);
}
}
$i++;
}
}
else
{
setEventMessage($langs->transnoentitiesnoconv("NoMoreRecipientToSendTo"));
}
// Loop finished, set global statut of mail
if ($nbko > 0)
{
$statut=2; // Status 'sent partially' (because at least one error)
if ($nbok > 0) setEventMessage($langs->transnoentitiesnoconv("EMailSentToNRecipients",$nbok));
else setEventMessage($langs->transnoentitiesnoconv("EMailSentToNRecipients",$nbok));
}
else
{
if ($nbok >= $num)
{
$statut=3; // Send to everybody
setEventMessage($langs->transnoentitiesnoconv("EMailSentToNRecipients",$nbok));
}
else
{
$statut=2; // Status 'sent partially' (because not send to everybody)
setEventMessage($langs->transnoentitiesnoconv("EMailSentToNRecipients",$nbok));
}
}
$sql="UPDATE ".MAIN_DB_PREFIX."mailing SET statut=".$statut." WHERE rowid=".$object->id;
dol_syslog("comm/mailing/fiche.php: update global status sql=".$sql, LOG_DEBUG);
$resql2=$db->query($sql);
if (! $resql2)
{
dol_print_error($db);
}
// Loop on each email and send it
$i = 0;
while ($i < $num && $i < $conf->global->MAILING_LIMIT_SENDBYWEB)
{
$res=1;
$obj = $db->fetch_object($resql);
// sendto en RFC2822
$sendto = str_replace(',',' ',dolGetFirstLastname($obj->firstname, $obj->lastname))." <".$obj->email.">";
// Make substitutions on topic and body. From (AA=YY;BB=CC;...) we keep YY, CC, ...
$other=explode(';',$obj->other);
$tmpfield=explode('=',$other[0],2); $other1=(isset($tmpfield[1])?$tmpfield[1]:$tmpfield[0]);
$tmpfield=explode('=',$other[1],2); $other2=(isset($tmpfield[1])?$tmpfield[1]:$tmpfield[0]);
$tmpfield=explode('=',$other[2],2); $other3=(isset($tmpfield[1])?$tmpfield[1]:$tmpfield[0]);
$tmpfield=explode('=',$other[3],2); $other4=(isset($tmpfield[1])?$tmpfield[1]:$tmpfield[0]);
$tmpfield=explode('=',$other[4],2); $other5=(isset($tmpfield[1])?$tmpfield[1]:$tmpfield[0]);
// Array of possible substitutions (See also fie mailing-send.php that should manage same substitutions)
$substitutionarray=array(
'__ID__' => $obj->source_id,
'__EMAIL__' => $obj->email,
'__LASTNAME__' => $obj->lastname,
'__FIRSTNAME__' => $obj->firstname,
'__MAILTOEMAIL__' => '<a href="mailto:'.$obj->email.'">'.$obj->email.'</a>',
'__OTHER1__' => $other1,
'__OTHER2__' => $other2,
'__OTHER3__' => $other3,
'__OTHER4__' => $other4,
'__OTHER5__' => $other5,
'__CHECK_READ__' => '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$obj->tag.'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>',
'__UNSUBSCRIBE__' => '<a href="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-unsubscribe.php?tag='.$obj->tag.'&unsuscrib=1&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" target="_blank">'.$langs->trans("MailUnsubcribe").'</a>'
);
if (! empty($conf->paypal->enabled) && ! empty($conf->global->PAYPAL_SECURITY_TOKEN))
{
$substitutionarray['__SECUREKEYPAYPAL__']=dol_hash($conf->global->PAYPAL_SECURITY_TOKEN, 2);
if (empty($conf->global->PAYPAL_SECURITY_TOKEN_UNIQUE)) $substitutionarray['__SECUREKEYPAYPAL_MEMBER__']=dol_hash($conf->global->PAYPAL_SECURITY_TOKEN, 2);
else $substitutionarray['__SECUREKEYPAYPAL_MEMBER__']=dol_hash($conf->global->PAYPAL_SECURITY_TOKEN . 'membersubscription' . $obj->source_id, 2);
}
$substitutionisok=true;
complete_substitutions_array($substitutionarray, $langs);
$newsubject=make_substitutions($subject,$substitutionarray);
$newmessage=make_substitutions($message,$substitutionarray);
$arr_file = array();
$arr_mime = array();
$arr_name = array();
$arr_css = array();
$listofpaths=dol_dir_list($upload_dir,'all',0,'','','name',SORT_ASC,0);
if (count($listofpaths))
{
foreach($listofpaths as $key => $val)
{
$arr_file[]=$listofpaths[$key]['fullname'];
$arr_mime[]=dol_mimetype($listofpaths[$key]['name']);
$arr_name[]=$listofpaths[$key]['name'];
}
}
// Fabrication du mail
$mail = new CMailFile($newsubject, $sendto, $from, $newmessage, $arr_file, $arr_mime, $arr_name, '', '', 0, $msgishtml, $errorsto, $arr_css);
if ($mail->error)
{
$res=0;
}
if (! $substitutionisok)
{
$mail->error='Some substitution failed';
$res=0;
}
// Send mail
if ($res)
{
$res=$mail->sendfile();
}
if ($res)
{
// Mail successful
$nbok++;
dol_syslog("comm/mailing/fiche.php: ok for #".$i.($mail->error?' - '.$mail->error:''), LOG_DEBUG);
$sql="UPDATE ".MAIN_DB_PREFIX."mailing_cibles";
$sql.=" SET statut=1, date_envoi=".$db->idate($now)." WHERE rowid=".$obj->rowid;
$resql2=$db->query($sql);
if (! $resql2)
{
dol_print_error($db);
}
else
{
//if cheack read is use then update prospect contact status
if (strpos($message, '__CHECK_READ__') !== false)
{
//Update status communication of thirdparty prospect
$sql = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_stcomm=2 WHERE rowid IN (SELECT source_id FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE rowid=".$obj->rowid.")";
dol_syslog("fiche.php: set prospect thirdparty status sql=".$sql, LOG_DEBUG);
$resql2=$db->query($sql);
if (! $resql2)
{
dol_print_error($db);
}
//Update status communication of contact prospect
$sql = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_stcomm=2 WHERE rowid IN (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."socpeople AS sc INNER JOIN ".MAIN_DB_PREFIX."mailing_cibles AS mc ON mc.rowid=".$obj->rowid." AND mc.source_type = 'contact' AND mc.source_id = sc.rowid)";
dol_syslog("fiche.php: set prospect contact status sql=".$sql, LOG_DEBUG);
$resql2=$db->query($sql);
if (! $resql2)
{
dol_print_error($db);
}
}
}
//test if CHECK READ change statut prospect contact
}
else
{
// Mail failed
$nbko++;
dol_syslog("comm/mailing/fiche.php: error for #".$i.($mail->error?' - '.$mail->error:''), LOG_WARNING);
$sql="UPDATE ".MAIN_DB_PREFIX."mailing_cibles";
$sql.=" SET statut=-1, date_envoi=".$db->idate($now)." WHERE rowid=".$obj->rowid;
$resql2=$db->query($sql);
if (! $resql2)
{
dol_print_error($db);
}
}
$i++;
}
}
else
{
setEventMessage($langs->transnoentitiesnoconv("NoMoreRecipientToSendTo"));
}
// Loop finished, set global statut of mail
if ($nbko > 0)
{
$statut=2; // Status 'sent partially' (because at least one error)
if ($nbok > 0) setEventMessage($langs->transnoentitiesnoconv("EMailSentToNRecipients",$nbok));
else setEventMessage($langs->transnoentitiesnoconv("EMailSentToNRecipients",$nbok));
}
else
{
if ($nbok >= $num)
{
$statut=3; // Send to everybody
setEventMessage($langs->transnoentitiesnoconv("EMailSentToNRecipients",$nbok));
}
else
{
$statut=2; // Status 'sent partially' (because not send to everybody)
setEventMessage($langs->transnoentitiesnoconv("EMailSentToNRecipients",$nbok));
}
}
$sql="UPDATE ".MAIN_DB_PREFIX."mailing SET statut=".$statut." WHERE rowid=".$object->id;
dol_syslog("comm/mailing/fiche.php: update global status sql=".$sql, LOG_DEBUG);
$resql2=$db->query($sql);
if (! $resql2)
{
dol_syslog($db->error());
dol_print_error($db);
}
$action = '';
}
else
{
dol_syslog($db->error());
dol_print_error($db);
}
$action = '';
}
}
// Action send test emailing
if ($action == 'send' && empty($_POST["cancel"]))
{
$error=0;
$upload_dir = $conf->mailing->dir_output . "/" . get_exdir($object->id,2,0,1);
$object->sendto = $_POST["sendto"];
if (! $object->sendto)
{
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->trans("MailTo")).'</div>';
$error++;
}
if (! $error)
// Action send test emailing
if ($action == 'send' && empty($_POST["cancel"]))
{
// Le message est-il en html
$msgishtml=-1; // Inconnu par defaut
if (preg_match('/[\s\t]*<html>/i',$object->body)) $msgishtml=1;
$error=0;
// Pratique les substitutions sur le sujet et message
$tmpsujet=make_substitutions($object->sujet,$object->substitutionarrayfortest);
$tmpbody=make_substitutions($object->body,$object->substitutionarrayfortest);
$upload_dir = $conf->mailing->dir_output . "/" . get_exdir($object->id,2,0,1);
$arr_file = array();
$arr_mime = array();
$arr_name = array();
$arr_css = array();
// Ajout CSS
if (!empty($object->bgcolor)) $arr_css['bgcolor'] = (preg_match('/^#/',$object->bgcolor)?'':'#').$object->bgcolor;
if (!empty($object->bgimage)) $arr_css['bgimage'] = $object->bgimage;
// Attached files
$listofpaths=dol_dir_list($upload_dir,'all',0,'','','name',SORT_ASC,0);
if (count($listofpaths))
$object->sendto = $_POST["sendto"];
if (! $object->sendto)
{
foreach($listofpaths as $key => $val)
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->trans("MailTo")).'</div>';
$error++;
}
if (! $error)
{
// Le message est-il en html
$msgishtml=-1; // Inconnu par defaut
if (preg_match('/[\s\t]*<html>/i',$object->body)) $msgishtml=1;
// Pratique les substitutions sur le sujet et message
$tmpsujet=make_substitutions($object->sujet,$object->substitutionarrayfortest);
$tmpbody=make_substitutions($object->body,$object->substitutionarrayfortest);
$arr_file = array();
$arr_mime = array();
$arr_name = array();
$arr_css = array();
// Ajout CSS
if (!empty($object->bgcolor)) $arr_css['bgcolor'] = (preg_match('/^#/',$object->bgcolor)?'':'#').$object->bgcolor;
if (!empty($object->bgimage)) $arr_css['bgimage'] = $object->bgimage;
// Attached files
$listofpaths=dol_dir_list($upload_dir,'all',0,'','','name',SORT_ASC,0);
if (count($listofpaths))
{
$arr_file[]=$listofpaths[$key]['fullname'];
$arr_mime[]=dol_mimetype($listofpaths[$key]['name']);
$arr_name[]=$listofpaths[$key]['name'];
foreach($listofpaths as $key => $val)
{
$arr_file[]=$listofpaths[$key]['fullname'];
$arr_mime[]=dol_mimetype($listofpaths[$key]['name']);
$arr_name[]=$listofpaths[$key]['name'];
}
}
$mailfile = new CMailFile($tmpsujet,$object->sendto,$object->email_from,$tmpbody, $arr_file,$arr_mime,$arr_name,'', '', 0, $msgishtml,$object->email_errorsto,$arr_css);
$result=$mailfile->sendfile();
if ($result)
{
$mesg='<div class="ok">'.$langs->trans("MailSuccessfulySent",$mailfile->getValidAddress($object->email_from,2),$mailfile->getValidAddress($object->sendto,2)).'</div>';
}
else
{
$mesg='<div class="error">'.$langs->trans("ResultKo").'<br>'.$mailfile->error.' '.$result.'</div>';
}
$action='';
}
$mailfile = new CMailFile($tmpsujet,$object->sendto,$object->email_from,$tmpbody, $arr_file,$arr_mime,$arr_name,'', '', 0, $msgishtml,$object->email_errorsto,$arr_css);
$result=$mailfile->sendfile();
if ($result)
{
$mesg='<div class="ok">'.$langs->trans("MailSuccessfulySent",$mailfile->getValidAddress($object->email_from,2),$mailfile->getValidAddress($object->sendto,2)).'</div>';
}
else
{
$mesg='<div class="error">'.$langs->trans("ResultKo").'<br>'.$mailfile->error.' '.$result.'</div>';
}
$action='';
}
}
// Action add emailing
if ($action == 'add')
{
$object->email_from = trim($_POST["from"]);
$object->email_replyto = trim($_POST["replyto"]);
$object->email_errorsto = trim($_POST["errorsto"]);
$object->titre = trim($_POST["titre"]);
$object->sujet = trim($_POST["sujet"]);
$object->body = trim($_POST["body"]);
$object->bgcolor = trim($_POST["bgcolor"]);
$object->bgimage = trim($_POST["bgimage"]);
if (! $object->titre) $mesg.=($mesg?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->transnoentities("MailTitle"));
if (! $object->sujet) $mesg.=($mesg?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->transnoentities("MailTopic"));
if (! $object->body) $mesg.=($mesg?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->transnoentities("MailMessage"));
if (! $mesg)
{
if ($object->create($user) >= 0)
{
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
$mesg=$object->error;
}
$mesg='<div class="error">'.$mesg.'</div>';
$action="create";
}
// Action update description of emailing
if ($action == 'settitre' || $action == 'setemail_from' || $actino == 'setreplyto' || $action == 'setemail_errorsto')
{
$upload_dir = $conf->mailing->dir_output . "/" . get_exdir($object->id,2,0,1);
if ($action == 'settitre') $object->titre = trim(GETPOST('titre','alpha'));
else if ($action == 'setemail_from') $object->email_from = trim(GETPOST('email_from','alpha'));
else if ($action == 'setemail_replyto') $object->email_replyto = trim(GETPOST('email_replyto','alpha'));
else if ($action == 'setemail_errorsto') $object->email_errorsto = trim(GETPOST('email_errorsto','alpha'));
else if ($action == 'settitre' && empty($object->titre)) $mesg.=($mesg?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->transnoentities("MailTitle"));
else if ($action == 'setfrom' && empty($object->email_from)) $mesg.=($mesg?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->transnoentities("MailFrom"));
if (! $mesg)
{
if ($object->update($user) >= 0)
{
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
$mesg=$object->error;
}
$mesg='<div class="error">'.$mesg.'</div>';
$action="";
}
/*
* Add file in email form
*/
if (! empty($_POST['addfile']))
{
$upload_dir = $conf->mailing->dir_output . "/" . get_exdir($object->id,2,0,1);
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
// Set tmp user directory
dol_add_file_process($upload_dir,0,0);
$action="edit";
}
// Action remove file
if (! empty($_POST["removedfile"]))
{
$upload_dir = $conf->mailing->dir_output . "/" . get_exdir($object->id,2,0,1);
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
dol_remove_file_process($_POST['removedfile'],0);
$action="edit";
}
// Action update emailing
if ($action == 'update' && empty($_POST["removedfile"]) && empty($_POST["cancel"]))
{
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$isupload=0;
if (! $isupload)
// Action add emailing
if ($action == 'add')
{
$object->email_from = trim($_POST["from"]);
$object->email_replyto = trim($_POST["replyto"]);
$object->email_errorsto = trim($_POST["errorsto"]);
$object->titre = trim($_POST["titre"]);
$object->sujet = trim($_POST["sujet"]);
$object->body = trim($_POST["body"]);
$object->bgcolor = trim($_POST["bgcolor"]);
$object->bgimage = trim($_POST["bgimage"]);
if (! $object->titre) $mesg.=($mesg?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->transnoentities("MailTitle"));
if (! $object->sujet) $mesg.=($mesg?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->transnoentities("MailTopic"));
if (! $object->body) $mesg.=($mesg?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->transnoentities("MailMessage"));
if (! $mesg)
{
if ($object->create($user) >= 0)
{
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
$mesg=$object->error;
}
$mesg='<div class="error">'.$mesg.'</div>';
$action="create";
}
// Action update description of emailing
if ($action == 'settitre' || $action == 'setemail_from' || $actino == 'setreplyto' || $action == 'setemail_errorsto')
{
$upload_dir = $conf->mailing->dir_output . "/" . get_exdir($object->id,2,0,1);
if ($action == 'settitre') $object->titre = trim(GETPOST('titre','alpha'));
else if ($action == 'setemail_from') $object->email_from = trim(GETPOST('email_from','alpha'));
else if ($action == 'setemail_replyto') $object->email_replyto = trim(GETPOST('email_replyto','alpha'));
else if ($action == 'setemail_errorsto') $object->email_errorsto = trim(GETPOST('email_errorsto','alpha'));
else if ($action == 'settitre' && empty($object->titre)) $mesg.=($mesg?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->transnoentities("MailTitle"));
else if ($action == 'setfrom' && empty($object->email_from)) $mesg.=($mesg?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->transnoentities("MailFrom"));
if (! $mesg)
{
if ($object->update($user) >= 0)
@@ -553,78 +497,136 @@ if ($action == 'update' && empty($_POST["removedfile"]) && empty($_POST["cancel"
}
$mesg='<div class="error">'.$mesg.'</div>';
$action="";
}
/*
* Add file in email form
*/
if (! empty($_POST['addfile']))
{
$upload_dir = $conf->mailing->dir_output . "/" . get_exdir($object->id,2,0,1);
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
// Set tmp user directory
dol_add_file_process($upload_dir,0,0);
$action="edit";
}
else
// Action remove file
if (! empty($_POST["removedfile"]))
{
$upload_dir = $conf->mailing->dir_output . "/" . get_exdir($object->id,2,0,1);
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
dol_remove_file_process($_POST['removedfile'],0);
$action="edit";
}
}
// Action confirmation validation
if ($action == 'confirm_valid' && $confirm == 'yes')
{
if ($object->id > 0)
// Action update emailing
if ($action == 'update' && empty($_POST["removedfile"]) && empty($_POST["cancel"]))
{
$object->valid($user);
setEventMessage($langs->trans("MailingSuccessfullyValidated"));
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
else
{
dol_print_error($db);
}
}
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
// Resend
if ($action == 'confirm_reset' && $confirm == 'yes')
{
if ($object->id > 0)
{
$db->begin();
$isupload=0;
$result=$object->valid($user);
if ($result > 0)
if (! $isupload)
{
$result=$object->reset_targets_status($user);
$object->sujet = trim($_POST["sujet"]);
$object->body = trim($_POST["body"]);
$object->bgcolor = trim($_POST["bgcolor"]);
$object->bgimage = trim($_POST["bgimage"]);
if (! $object->sujet) $mesg.=($mesg?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->transnoentities("MailTopic"));
if (! $object->body) $mesg.=($mesg?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->transnoentities("MailMessage"));
if (! $mesg)
{
if ($object->update($user) >= 0)
{
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
$mesg=$object->error;
}
$mesg='<div class="error">'.$mesg.'</div>';
$action="edit";
}
if ($result > 0)
else
{
$db->commit();
$action="edit";
}
}
// Action confirmation validation
if ($action == 'confirm_valid' && $confirm == 'yes')
{
if ($object->id > 0)
{
$object->valid($user);
setEventMessage($langs->trans("MailingSuccessfullyValidated"));
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
else
{
$mesg=$object->error;
$db->rollback();
dol_print_error($db);
}
}
else
// Resend
if ($action == 'confirm_reset' && $confirm == 'yes')
{
dol_print_error($db);
if ($object->id > 0)
{
$db->begin();
$result=$object->valid($user);
if ($result > 0)
{
$result=$object->reset_targets_status($user);
}
if ($result > 0)
{
$db->commit();
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
else
{
$mesg=$object->error;
$db->rollback();
}
}
else
{
dol_print_error($db);
}
}
// Action confirmation suppression
if ($action == 'confirm_delete' && $confirm == 'yes')
{
if ($object->delete($object->id))
{
$url= (! empty($urlfrom) ? $urlfrom : 'liste.php');
header("Location: ".$url);
exit;
}
}
if (! empty($_POST["cancel"]))
{
$action = '';
}
}
// Action confirmation suppression
if ($action == 'confirm_delete' && $confirm == 'yes')
{
if ($object->delete($object->id))
{
$url= (! empty($urlfrom) ? $urlfrom : 'liste.php');
header("Location: ".$url);
exit;
}
}
if (! empty($_POST["cancel"]))
{
$action = '';
}
/*
* View

File diff suppressed because it is too large Load Diff

View File

@@ -2564,11 +2564,14 @@ class Propal extends CommonObject
$classname = $conf->global->PROPALE_ADDON;
// Include file with class
foreach ($conf->file->dol_document_root as $dirroot)
{
$dir = $dirroot."/core/modules/propale/";
// Load file with numbering class (if found)
$mybool|=@include_once $dir.$file;
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
foreach ($dirmodels as $reldir) {
$dir = dol_buildpath($reldir."core/modules/propale/");
// Load file with numbering class (if found)
$mybool|=@include_once $dir.$file;
}
if (! $mybool)

View File

@@ -141,7 +141,9 @@ if (! $sortorder) $sortorder='DESC';
$limit = $conf->liste_limit;
$sql = 'SELECT s.rowid, s.nom, s.town, s.client, s.code_client,';
if (! $sall) $sql = 'SELECT';
else $sql = 'SELECT DISTINCT';
$sql.= ' s.rowid, s.nom, s.town, s.client, s.code_client,';
$sql.= ' p.rowid as propalid, p.note_private, p.total_ht, p.ref, p.ref_client, p.fk_statut, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,';
if (! $user->rights->societe->client->voir && ! $socid) $sql .= " sc.fk_soc, sc.fk_user,";
$sql.= ' u.login';
@@ -388,7 +390,7 @@ if ($result)
// Date proposal
print '<td align="center">';
print dol_print_date($db->jdate($obj->dp), 'day');
print dol_print_date($db->jdate($objp->dp), 'day');
print "</td>\n";
// Date end validity

View File

@@ -162,11 +162,13 @@ $hookmanager->initHooks(array('prospectlist'));
$parameters=array();
$reshook=$hookmanager->executeHooks('doActions',$parameters); // Note that $action and $object may have been modified by some hooks
if ($action == 'cstc')
{
$sql = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_stcomm = ".$_GET["pstcomm"];
$sql .= " WHERE rowid = ".$_GET["socid"];
$result=$db->query($sql);
if (empty($reshook)) {
if ($action == 'cstc')
{
$sql = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_stcomm = ".$_GET["pstcomm"];
$sql .= " WHERE rowid = ".$_GET["socid"];
$result=$db->query($sql);
}
}

View File

@@ -3,7 +3,7 @@
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2015 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011 Jean Heimburger <jean@tiaris.info>
* Copyright (C) 2012-2014 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
@@ -100,6 +100,11 @@ class Commande extends CommonOrder
// Pour board
var $nbtodo;
var $nbtodolate;
/**
* ERR Not engouch stock
*/
const STOCK_NOT_ENOUGH_FOR_ORDER = -3;
/**
@@ -137,17 +142,20 @@ class Commande extends CommonOrder
$classname = $conf->global->COMMANDE_ADDON;
// Include file with class
foreach ($conf->file->dol_document_root as $dirroot)
{
$dir = $dirroot."/core/modules/commande/";
// Load file with numbering class (if found)
$mybool|=@include_once $dir.$file;
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
foreach ($dirmodels as $reldir) {
$dir = dol_buildpath($reldir."core/modules/commande/");
// Load file with numbering class (if found)
$mybool|=@include_once $dir.$file;
}
if (! $mybool)
{
dol_print_error('',"Failed to include file ".$file);
return '';
dol_print_error('',"Failed to include file ".$file);
return '';
}
$obj = new $classname();
@@ -658,18 +666,19 @@ class Commande extends CommonOrder
$this->db->begin();
$sql = "INSERT INTO ".MAIN_DB_PREFIX."commande (";
$sql.= " ref, fk_soc, date_creation, fk_user_author, fk_projet, date_commande, source, note_private, note_public, ref_client, ref_int";
$sql.= " ref, fk_soc, date_creation, fk_user_author, fk_projet, date_commande, source, note_private, note_public, ref_ext, ref_client, ref_int";
$sql.= ", model_pdf, fk_cond_reglement, fk_mode_reglement, fk_availability, fk_input_reason, date_livraison, fk_delivery_address";
$sql.= ", remise_absolue, remise_percent";
$sql.= ", entity";
$sql.= ")";
$sql.= " VALUES ('(PROV)',".$this->socid.", '".$this->db->idate($now)."', ".$user->id;
$sql.= ", ".($this->fk_project?$this->fk_project:"null");
$sql.= ", ".($this->fk_project>0?$this->fk_project:"null");
$sql.= ", '".$this->db->idate($date)."'";
$sql.= ", ".($this->source>=0 && $this->source != '' ?$this->source:'null');
$sql.= ", '".$this->db->escape($this->note_private)."'";
$sql.= ", '".$this->db->escape($this->note_public)."'";
$sql.= ", '".$this->db->escape($this->ref_client)."'";
$sql.= ", ".($this->ref_ext?"'".$this->db->escape($this->ref_ext)."'":"null");
$sql.= ", ".($this->ref_client?"'".$this->db->escape($this->ref_client)."'":"null");
$sql.= ", ".($this->ref_int?"'".$this->db->escape($this->ref_int)."'":"null");
$sql.= ", '".$this->modelpdf."'";
$sql.= ", ".($this->cond_reglement_id>0?"'".$this->cond_reglement_id."'":"null");
@@ -730,8 +739,11 @@ class Commande extends CommonOrder
);
if ($result < 0)
{
$this->error=$this->db->lasterror();
dol_print_error($this->db);
if ($result != self::STOCK_NOT_ENOUGH_FOR_ORDER)
{
$this->error=$this->db->lasterror();
dol_print_error($this->db);
}
$this->db->rollback();
return -1;
}
@@ -904,7 +916,7 @@ class Commande extends CommonOrder
$modCommande = new $obj;
$this->ref = $modCommande->getNextValue($objsoc,$this);
// Create clone
$result=$this->create($user);
if ($result < 0) $error++;
@@ -1165,10 +1177,12 @@ class Commande extends CommonOrder
$result=$product->fetch($fk_product);
$product_type=$product->type;
if($conf->global->STOCK_MUST_BE_ENOUGH_FOR_ORDER && $product_type == 0 && $product->stock_reel < $qty) {
if($conf->global->STOCK_MUST_BE_ENOUGH_FOR_ORDER && $product_type == 0 && $product->stock_reel < $qty)
{
$this->error=$langs->trans('ErrorStockIsNotEnough');
dol_syslog(get_class($this)."::addline error=Product ".$product->ref.": ".$this->error, LOG_ERR);
$this->db->rollback();
return -3;
return self::STOCK_NOT_ENOUGH_FOR_ORDER;
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -6,6 +6,7 @@
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -112,7 +113,7 @@ $help_url="EN:Module_Customers_Orders|FR:Module_Commandes_Clients|ES:Módulo_Ped
llxHeader('',$langs->trans("Orders"),$help_url);
$sql = 'SELECT s.nom, s.rowid as socid, s.client, c.rowid, c.ref, c.total_ht, c.ref_client,';
$sql.= ' c.date_valid, c.date_commande, c.note_private, c.date_livraison, c.fk_statut, c.facture as facturee';
$sql.= ' c.date_valid, c.date_commande, c.note_private, c.date_livraison as date_delivery, c.fk_statut, c.facture as facturee';
$sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s';
$sql.= ', '.MAIN_DB_PREFIX.'commande as c';
// We'll need this table joined to the select in order to filter by sale
@@ -306,11 +307,11 @@ if ($resql)
print '<td class="liste_titre" align="left">';
print '<input class="flat" type="text" name="snom" value="'.$snom.'">';
print '</td>';
print '<td class="liste_titre">';
print '<td class="liste_titre" align="right">';
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="orderday" value="'.$orderday.'">';
print '<input class="flat" type="text" size="1" maxlength="2" name="ordermonth" value="'.$ordermonth.'">';
$formother->select_year($orderyear?$orderyear:-1,'orderyear',1, 20, 5);
print '</td><td class="liste_titre">';
print '</td><td class="liste_titre" align="right">';
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="deliveryday" value="'.$deliveryday.'">';
print '<input class="flat" type="text" size="1" maxlength="2" name="deliverymonth" value="'.$deliverymonth.'">';
$formother->select_year($deliveryyear?$deliveryyear:-1,'deliveryyear',1, 20, 5);
@@ -340,7 +341,7 @@ if ($resql)
print '</td>';
print '<td style="min-width: 20px" class="nobordernopadding nowrap">';
if (($objp->fk_statut > 0) && ($objp->fk_statut < 3) && max($db->jdate($objp->date_commande),$db->jdate($objp->date_livraison)) < ($now - $conf->commande->client->warning_delay))
if (($objp->fk_statut > 0) && ($objp->fk_statut < 3) && max($db->jdate($objp->date_commande),$db->jdate($objp->date_delivery)) < ($now - $conf->commande->client->warning_delay))
print img_picto($langs->trans("Late"),"warning");
if(!empty($objp->note_private))
{

View File

@@ -130,7 +130,7 @@ if (! $found) print '<tr '.$bc[$var].'><td colspan="6">'.$langs->trans("None").'
// Total
foreach ($total as $key=>$solde)
{
print '<tr class="liste_total"><td colspan="5" class="liste_total">'.$langs->trans("Total ").$key.'</td><td align="right" class="liste_total">'.price($solde, 0, $langs, 0, 0, -1, $key).'</td></tr>';
print '<tr class="liste_total"><td colspan="5" class="liste_total">'.$langs->trans("Total").' '.$key.'</td><td align="right" class="liste_total">'.price($solde, 0, $langs, 0, 0, -1, $key).'</td></tr>';
}
print '</table>';
@@ -179,7 +179,7 @@ if (! $found) print '<tr '.$bc[$var].'><td colspan="6">'.$langs->trans("None").'
// Total
foreach ($total as $key=>$solde)
{
print '<tr class="liste_total"><td colspan="5" class="liste_total">'.$langs->trans("Total ").$key.'</td><td align="right" class="liste_total">'.price($solde, 0, $langs, 0, 0, -1, $key).'</td></tr>';
print '<tr class="liste_total"><td colspan="5" class="liste_total">'.$langs->trans("Total").' '.$key.'</td><td align="right" class="liste_total">'.price($solde, 0, $langs, 0, 0, -1, $key).'</td></tr>';
}
print '</table>';
@@ -238,7 +238,7 @@ if (! $found) print '<tr '.$bc[$var].'><td colspan="6">'.$langs->trans("None").'
// Total
foreach ($total as $key=>$solde)
{
print '<tr class="liste_total"><td colspan="5" class="liste_total">'.$langs->trans("Total ").$key.'</td><td align="right" class="liste_total">'.price($solde, 0, $langs, 0, 0, -1, $key).'</td></tr>';
print '<tr class="liste_total"><td colspan="5" class="liste_total">'.$langs->trans("Total").' '.$key.'</td><td align="right" class="liste_total">'.price($solde, 0, $langs, 0, 0, -1, $key).'</td></tr>';
}
print "</table>";

View File

@@ -360,7 +360,7 @@ if ($result)
print '</a>';
}
else if ($links[$key]['type']=='user') {
print '<a href="'.DOL_URL_ROOT.'/user/fiche?id='.$links[$key]['url_id'].'">';
print '<a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$links[$key]['url_id'].'">';
print img_object($langs->trans('ShowUser'),'user').' ';
print $langs->trans("User");
print '</a>';

View File

@@ -3,6 +3,7 @@
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copytight (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copytight (C) 2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -48,7 +49,7 @@ if ($action == 'add')
$mesg='';
$dateo = dol_mktime(12,0,0,GETPOST('remonth','int'),GETPOST('reday','int'),GETPOST('reyear','int'));
$label = GETPOST('label','alpha');
$amount= GETPOST('amount','int');
$amount= GETPOST('amount');
if (! $label)
{

View File

@@ -4,6 +4,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -98,8 +99,14 @@ else if ($action == 'add' && $user->rights->deplacement->creer)
{
$error=0;
$km = GETPOST('km');
if ($km) {
$km = price2num($km);
}
$object->date = dol_mktime(12, 0, 0, GETPOST('remonth','int'), GETPOST('reday','int'), GETPOST('reyear','int'));
$object->km = GETPOST('km','int');
$object->km = $km;
$object->type = GETPOST('type','alpha');
$object->socid = GETPOST('socid','int');
$object->fk_user = GETPOST('fk_user','int');
@@ -157,8 +164,14 @@ else if ($action == 'update' && $user->rights->deplacement->creer)
{
$result = $object->fetch($id);
$km = GETPOST('km');
if ($km) {
$km = price2num($km);
}
$object->date = dol_mktime(12, 0, 0, GETPOST('remonth','int'), GETPOST('reday','int'), GETPOST('reyear','int'));
$object->km = GETPOST('km','int');
$object->km = $km;
$object->type = GETPOST('type','alpha');
$object->socid = GETPOST('socid','int');
$object->fk_user = GETPOST('fk_user','int');
@@ -200,12 +213,6 @@ else if ($action == 'setdated' && $user->rights->deplacement->creer)
$result=$object->setValueFrom('dated',$dated,'','','date');
if ($result < 0) dol_print_error($db, $object->error);
}
else if ($action == 'setkm' && $user->rights->deplacement->creer)
{
$object->fetch($id);
$result=$object->setValueFrom('km',GETPOST('km','int'));
if ($result < 0) dol_print_error($db, $object->error);
}
/*
@@ -348,7 +355,7 @@ else if ($id)
// Km
print '<tr><td class="fieldrequired">'.$langs->trans("FeesKilometersOrAmout").'</td><td>';
print '<input name="km" class="flat" size="10" value="'.$object->km.'">';
print '<input name="km" class="flat" size="10" value="'.price($object->km).'">';
print '</td></tr>';
// Where
@@ -416,10 +423,12 @@ else if ($id)
print '</td></tr>';
// Type
$form->load_cache_types_fees();
print '<tr><td>';
print $form->editfieldkey("Type",'type',$langs->trans($object->type),$object,$conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer,'select:types_fees');
print '</td><td>';
print $form->editfieldval("Type",'type',$langs->trans($object->type),$object,$conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer,'select:types_fees');
print $form->editfieldval("Type",'type', $form->cache_types_fees[$object->type],$object,$conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer,'select:types_fees');
print '</td></tr>';
// Who
@@ -440,7 +449,7 @@ else if ($id)
print '<tr><td valign="top">';
print $form->editfieldkey("FeesKilometersOrAmout",'km',$object->km,$object,$conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer,'numeric:6');
print '</td><td>';
print $form->editfieldval("FeesKilometersOrAmout",'km',$object->km,$object,$conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer,'numeric:6');
print $form->editfieldval("FeesKilometersOrAmout",'km',price($object->km),$object,$conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer,'numeric:6');
print "</td></tr>";
// Where

File diff suppressed because it is too large Load Diff

View File

@@ -2504,52 +2504,64 @@ class Facture extends CommonInvoice
else if ($conf->global->FACTURE_ADDON=='terre') $conf->global->FACTURE_ADDON='mod_facture_terre';
else if ($conf->global->FACTURE_ADDON=='mercure') $conf->global->FACTURE_ADDON='mod_facture_mercure';
$mybool=false;
$file = $conf->global->FACTURE_ADDON.".php";
$classname = $conf->global->FACTURE_ADDON;
// Include file with class
foreach ($conf->file->dol_document_root as $dirroot)
if (! empty($conf->global->FACTURE_ADDON))
{
$dir = $dirroot."/core/modules/facture/";
// Load file with numbering class (if found)
$mybool|=@include_once $dir.$file;
}
$mybool=false;
$file = $conf->global->FACTURE_ADDON.".php";
$classname = $conf->global->FACTURE_ADDON;
// For compatibility
if (! $mybool)
{
$file = $conf->global->FACTURE_ADDON."/".$conf->global->FACTURE_ADDON.".modules.php";
$classname = "mod_facture_".$conf->global->FACTURE_ADDON;
$classname = preg_replace('/\-.*$/','',$classname);
// Include file with class
foreach ($conf->file->dol_document_root as $dirroot)
{
$dir = $dirroot."/core/modules/facture/";
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
foreach ($dirmodels as $reldir) {
$dir = dol_buildpath($reldir."core/modules/facture/");
// Load file with numbering class (if found)
$mybool|=@include_once $dir.$file;
}
}
//print "xx".$mybool.$dir.$file."-".$classname;
if (! $mybool)
{
dol_print_error('',"Failed to include file ".$file);
return '';
}
// For compatibility
if (! $mybool)
{
$file = $conf->global->FACTURE_ADDON."/".$conf->global->FACTURE_ADDON.".modules.php";
$classname = "mod_facture_".$conf->global->FACTURE_ADDON;
$classname = preg_replace('/\-.*$/','',$classname);
// Include file with class
foreach ($conf->file->dol_document_root as $dirroot)
{
$dir = $dirroot."/core/modules/facture/";
// Load file with numbering class (if found)
$mybool|=@include_once $dir.$file;
}
}
$obj = new $classname();
$numref = "";
$numref = $obj->getNumRef($soc,$this,$mode);
if (! $mybool)
{
dol_print_error('',"Failed to include file ".$file);
return '';
}
if ($numref != "")
{
return $numref;
$obj = new $classname();
$numref = "";
$numref = $obj->getNextValue($soc,$this,$mode);
if ($numref != "")
{
return $numref;
}
else
{
dol_print_error($db,"Facture::getNextNumRef ".$obj->error);
return "";
}
}
else
{
//dol_print_error($db,get_class($this)."::getNextNumRef ".$obj->error);
return false;
$langs->load("errors");
print $langs->trans("Error")." ".$langs->trans("ErrorModuleSetupNotComplete");
return "";
}
}

View File

@@ -535,7 +535,7 @@ if ($resql)
print_liste_field_titre($langs->trans("Taxes"),$_SERVER["PHP_SELF"],"f.tva","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("AmountTTC"),$_SERVER["PHP_SELF"],"f.total_ttc","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Received"),$_SERVER["PHP_SELF"],"am","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Rest"),$_SERVER["PHP_SELF"],"am","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Rest"),$_SERVER["PHP_SELF"],"","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"fk_statut,paye,am","",$param,'align="right"',$sortfield,$sortorder);
if (empty($mode))
{
@@ -649,13 +649,12 @@ if ($resql)
print '<td align="right">'.price($objp->total_ttc).'</td>';
print '<td align="right">';
$cn=$facturestatic->getSumCreditNotesUsed();
if (! empty($objp->am)) print price($objp->am);
if (! empty($objp->am) && ! empty($cn)) print '+';
if (! empty($cn)) print price($cn);
$dep=$facturestatic->getSumDepositsUsed();
print price($objp->am + $cn + $dep);
print '</td>';
// Remain to receive
print '<td align="right">'.((! empty($objp->am) || ! empty($cn))?price($objp->total_ttc-$objp->am-$cn):'&nbsp;').'</td>';
print '<td align="right">'.price($objp->total_ttc-$objp->am-$cn-$dep).'</td>';
// Status of invoice
print '<td align="right" class="nowrap">';
@@ -685,7 +684,7 @@ if ($resql)
$total_ht+=$objp->total_ht;
$total_tva+=($objp->total_tva + $tx1 + $tx2 + $revenuestamp);
$total_ttc+=$objp->total_ttc;
$total_paid+=$objp->am + $cn;
$total_paid+=$objp->am + $cn + $dep;
$i++;
}

View File

@@ -71,182 +71,184 @@ $hookmanager->initHooks(array('paiementcard'));
$parameters=array('socid'=>$socid);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
/*
* Actions
*/
if ($action == 'add_paiement' || ($action == 'confirm_paiement' && $confirm=='yes'))
{
$error = 0;
if (empty($reshook)) {
$datepaye = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
$paiement_id = 0;
$totalpayment = 0;
$atleastonepaymentnotnull = 0;
// Generate payment array and check if there is payment higher than invoice and payment date before invoice date
$tmpinvoice=new Facture($db);
foreach ($_POST as $key => $value)
/*
* Actions
*/
if ($action == 'add_paiement' || ($action == 'confirm_paiement' && $confirm=='yes'))
{
if (substr($key,0,7) == 'amount_')
$error = 0;
$datepaye = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
$paiement_id = 0;
$totalpayment = 0;
$atleastonepaymentnotnull = 0;
// Generate payment array and check if there is payment higher than invoice and payment date before invoice date
$tmpinvoice=new Facture($db);
foreach ($_POST as $key => $value)
{
$cursorfacid = substr($key,7);
$amounts[$cursorfacid] = price2num(trim(GETPOST($key)));
$totalpayment = $totalpayment + $amounts[$cursorfacid];
if (! empty($amounts[$cursorfacid])) $atleastonepaymentnotnull++;
$result=$tmpinvoice->fetch($cursorfacid);
if ($result <= 0) dol_print_error($db);
$amountsresttopay[$cursorfacid]=price2num($tmpinvoice->total_ttc - $tmpinvoice->getSommePaiement());
if ($amounts[$cursorfacid])
if (substr($key,0,7) == 'amount_')
{
// Check amount
if ($amounts[$cursorfacid] && (abs($amounts[$cursorfacid]) > abs($amountsresttopay[$cursorfacid])))
{
$addwarning=1;
$formquestion['text'] = img_warning($langs->trans("PaymentHigherThanReminderToPay")).' '.$langs->trans("HelpPaymentHigherThanReminderToPay");
}
// Check date
if ($datepaye && ($datepaye < $tmpinvoice->date))
{
$langs->load("errors");
//$error++;
setEventMessage($langs->transnoentities("WarningPaymentDateLowerThanInvoiceDate", dol_print_date($datepaye,'day'), dol_print_date($tmpinvoice->date, 'day'), $tmpinvoice->ref), 'warnings');
}
}
$cursorfacid = substr($key,7);
$amounts[$cursorfacid] = price2num(trim(GETPOST($key)));
$totalpayment = $totalpayment + $amounts[$cursorfacid];
if (! empty($amounts[$cursorfacid])) $atleastonepaymentnotnull++;
$result=$tmpinvoice->fetch($cursorfacid);
if ($result <= 0) dol_print_error($db);
$amountsresttopay[$cursorfacid]=price2num($tmpinvoice->total_ttc - $tmpinvoice->getSommePaiement());
if ($amounts[$cursorfacid])
{
// Check amount
if ($amounts[$cursorfacid] && (abs($amounts[$cursorfacid]) > abs($amountsresttopay[$cursorfacid])))
{
$addwarning=1;
$formquestion['text'] = img_warning($langs->trans("PaymentHigherThanReminderToPay")).' '.$langs->trans("HelpPaymentHigherThanReminderToPay");
}
// Check date
if ($datepaye && ($datepaye < $tmpinvoice->date))
{
$langs->load("errors");
//$error++;
setEventMessage($langs->transnoentities("WarningPaymentDateLowerThanInvoiceDate", dol_print_date($datepaye,'day'), dol_print_date($tmpinvoice->date, 'day'), $tmpinvoice->ref), 'warnings');
}
}
$formquestion[$i++]=array('type' => 'hidden','name' => $key, 'value' => $_POST[$key]);
}
}
// Check parameters
if (! GETPOST('paiementcode'))
{
setEventMessage($langs->transnoentities('ErrorFieldRequired',$langs->transnoentities('PaymentMode')), 'errors');
$error++;
}
if (! empty($conf->banque->enabled))
{
// If bank module is on, account is required to enter a payment
if (GETPOST('accountid') <= 0)
{
setEventMessage($langs->transnoentities('ErrorFieldRequired',$langs->transnoentities('AccountToCredit')), 'errors');
$error++;
}
}
if (empty($totalpayment) && empty($atleastonepaymentnotnull))
{
setEventMessage($langs->transnoentities('ErrorFieldRequired',$langs->trans('PaymentAmount')), 'errors');
$error++;
}
if (empty($datepaye))
{
setEventMessage($langs->transnoentities('ErrorFieldRequired',$langs->transnoentities('Date')), 'errors');
$error++;
}
}
/*
* Action add_paiement
*/
if ($action == 'add_paiement')
{
if ($error)
{
$action = 'create';
}
// Le reste propre a cette action s'affiche en bas de page.
}
/*
* Action confirm_paiement
*/
if ($action == 'confirm_paiement' && $confirm == 'yes')
{
$error=0;
$datepaye = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
$db->begin();
// Clean parameters amount if payment is for a credit note
if (GETPOST('type') == 2)
{
foreach ($amounts as $key => $value) // How payment is dispatch
{
$newvalue = price2num($value,'MT');
$amounts[$key] = -$newvalue;
}
}
if (! empty($conf->banque->enabled))
{
// Si module bank actif, un compte est obligatoire lors de la saisie d'un paiement
if (GETPOST('accountid') <= 0)
{
setEventMessage($langs->trans('ErrorFieldRequired',$langs->transnoentities('AccountToCredit')), 'errors');
$error++;
}
}
// Creation of payment line
$paiement = new Paiement($db);
$paiement->datepaye = $datepaye;
$paiement->amounts = $amounts; // Array with all payments dispatching
$paiement->paiementid = dol_getIdFromCode($db,$_POST['paiementcode'],'c_paiement');
$paiement->num_paiement = $_POST['num_paiement'];
$paiement->note = $_POST['comment'];
if (! $error)
{
$paiement_id = $paiement->create($user, (GETPOST('closepaidinvoices')=='on'?1:0));
if ($paiement_id < 0)
{
setEventMessage($paiement->error, 'errors');
$error++;
}
}
if (! $error)
{
$label='(CustomerInvoicePayment)';
if (GETPOST('type') == 2) $label='(CustomerInvoicePaymentBack)';
$result=$paiement->addPaymentToBank($user,'payment',$label,GETPOST('accountid'),GETPOST('chqemetteur'),GETPOST('chqbank'));
if ($result < 0)
{
setEventMessage($paiement->error, 'errors');
$error++;
}
}
if (! $error)
{
$db->commit();
// If payment dispatching on more than one invoice, we keep on summary page, otherwise go on invoice card
$invoiceid=0;
foreach ($paiement->amounts as $key => $amount)
{
$facid = $key;
if (is_numeric($amount) && $amount <> 0)
{
if ($invoiceid != 0) $invoiceid=-1; // There is more than one invoice payed by this payment
else $invoiceid=$facid;
$formquestion[$i++]=array('type' => 'hidden','name' => $key, 'value' => $_POST[$key]);
}
}
if ($invoiceid > 0) $loc = DOL_URL_ROOT.'/compta/facture.php?facid='.$invoiceid;
else $loc = DOL_URL_ROOT.'/compta/paiement/fiche.php?id='.$paiement_id;
header('Location: '.$loc);
exit;
// Check parameters
if (! GETPOST('paiementcode'))
{
setEventMessage($langs->transnoentities('ErrorFieldRequired',$langs->transnoentities('PaymentMode')), 'errors');
$error++;
}
if (! empty($conf->banque->enabled))
{
// If bank module is on, account is required to enter a payment
if (GETPOST('accountid') <= 0)
{
setEventMessage($langs->transnoentities('ErrorFieldRequired',$langs->transnoentities('AccountToCredit')), 'errors');
$error++;
}
}
if (empty($totalpayment) && empty($atleastonepaymentnotnull))
{
setEventMessage($langs->transnoentities('ErrorFieldRequired',$langs->trans('PaymentAmount')), 'errors');
$error++;
}
if (empty($datepaye))
{
setEventMessage($langs->transnoentities('ErrorFieldRequired',$langs->transnoentities('Date')), 'errors');
$error++;
}
}
else
/*
* Action add_paiement
*/
if ($action == 'add_paiement')
{
$db->rollback();
if ($error)
{
$action = 'create';
}
// Le reste propre a cette action s'affiche en bas de page.
}
/*
* Action confirm_paiement
*/
if ($action == 'confirm_paiement' && $confirm == 'yes')
{
$error=0;
$datepaye = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
$db->begin();
// Clean parameters amount if payment is for a credit note
if (GETPOST('type') == 2)
{
foreach ($amounts as $key => $value) // How payment is dispatch
{
$newvalue = price2num($value,'MT');
$amounts[$key] = -$newvalue;
}
}
if (! empty($conf->banque->enabled))
{
// Si module bank actif, un compte est obligatoire lors de la saisie d'un paiement
if (GETPOST('accountid') <= 0)
{
setEventMessage($langs->trans('ErrorFieldRequired',$langs->transnoentities('AccountToCredit')), 'errors');
$error++;
}
}
// Creation of payment line
$paiement = new Paiement($db);
$paiement->datepaye = $datepaye;
$paiement->amounts = $amounts; // Array with all payments dispatching
$paiement->paiementid = dol_getIdFromCode($db,$_POST['paiementcode'],'c_paiement');
$paiement->num_paiement = $_POST['num_paiement'];
$paiement->note = $_POST['comment'];
if (! $error)
{
$paiement_id = $paiement->create($user, (GETPOST('closepaidinvoices')=='on'?1:0));
if ($paiement_id < 0)
{
setEventMessage($paiement->error, 'errors');
$error++;
}
}
if (! $error)
{
$label='(CustomerInvoicePayment)';
if (GETPOST('type') == 2) $label='(CustomerInvoicePaymentBack)';
$result=$paiement->addPaymentToBank($user,'payment',$label,GETPOST('accountid'),GETPOST('chqemetteur'),GETPOST('chqbank'));
if ($result < 0)
{
setEventMessage($paiement->error, 'errors');
$error++;
}
}
if (! $error)
{
$db->commit();
// If payment dispatching on more than one invoice, we keep on summary page, otherwise go on invoice card
$invoiceid=0;
foreach ($paiement->amounts as $key => $amount)
{
$facid = $key;
if (is_numeric($amount) && $amount <> 0)
{
if ($invoiceid != 0) $invoiceid=-1; // There is more than one invoice payed by this payment
else $invoiceid=$facid;
}
}
if ($invoiceid > 0) $loc = DOL_URL_ROOT.'/compta/facture.php?facid='.$invoiceid;
else $loc = DOL_URL_ROOT.'/compta/paiement/fiche.php?id='.$paiement_id;
header('Location: '.$loc);
exit;
}
else
{
$db->rollback();
}
}
}
/*
* View
*/

View File

@@ -3,6 +3,7 @@
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -53,6 +54,8 @@ $limit = $conf->liste_limit;
if (! $sortorder) $sortorder="DESC";
if (! $sortfield) $sortfield="p.rowid";
$search_ref = GETPOST("search_ref",'int');
$search_account = GETPOST("search_account",'int');
@@ -109,11 +112,13 @@ else
if ($userid == -1) $sql.= " AND f.fk_user_author IS NULL";
else $sql.= " AND f.fk_user_author = ".$userid;
}
// Search criteria
if (GETPOST("search_ref")) $sql .=" AND p.rowid=".GETPOST("search_ref",'int');
if (GETPOST("search_account") > 0) $sql .=" AND b.fk_account=".GETPOST("search_account",'int');
if (GETPOST("search_paymenttype") != "") $sql .=" AND c.code='".GETPOST("search_paymenttype")."'";
if (GETPOST("search_amount")) $sql .=" AND p.amount=".price2num(GETPOST("search_amount"));
if ($search_ref) $sql .=" AND p.rowid=".$search_ref;
if ($search_account > 0) $sql .=" AND b.fk_account=".$search_account;
if (GETPOST("search_paymenttype") != "") $sql .=" AND c.code='".$db->escape(GETPOST("search_paymenttype"))."'";
if (GETPOST("search_amount")) $sql .=" AND p.amount='".$db->escape(price2num(GETPOST("search_amount")))."'";
if (GETPOST("search_company")) $sql .= natural_search('s.nom', GETPOST('search_company'));
}
$sql.= $db->order($sortfield,$sortorder);
@@ -129,7 +134,7 @@ if ($resql)
$paramlist='';
$paramlist.=(GETPOST("orphelins")?"&orphelins=1":"");
$paramlist.=($_REQUEST["search_ref"]?"&search_ref=".$_REQUEST["search_ref"]:"");
$paramlist.=($search_ref?"&search_ref=".$search_ref:"");
$paramlist.=($_REQUEST["search_company"]?"&search_company=".$_REQUEST["search_company"]:"");
$paramlist.=($_REQUEST["search_amount"]?"&search_amount=".$_REQUEST["search_amount"]:"");
@@ -154,7 +159,7 @@ if ($resql)
// Lines for filters fields
print '<tr class="liste_titre">';
print '<td align="left">';
print '<input class="fat" type="text" size="4" name="search_ref" value="'.$_REQUEST["search_ref"].'">';
print '<input class="fat" type="text" size="4" name="search_ref" value="'.$search_ref.'">';
print '</td>';
print '<td>&nbsp;</td>';
print '<td align="left">';

View File

@@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2015 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
*
@@ -890,29 +890,30 @@ class BonPrelevement extends CommonObject
*/
if (!$error)
{
$ref = "T".substr($year,-2).$month;
$ref = substr($year,-2).$month;
$sql = "SELECT count(*)";
$sql.= " FROM ".MAIN_DB_PREFIX."prelevement_bons";
$sql.= " WHERE ref LIKE '".$ref."%'";
$sql.= " AND entity = ".$conf->entity;
$sql = "SELECT substring(ref from char_length(ref) - 1)";
$sql.= " FROM ".MAIN_DB_PREFIX."prelevement_bons";
$sql.= " WHERE ref LIKE '%".$ref."%'";
$sql.= " AND entity = ".$conf->entity;
$sql.= " ORDER BY ref DESC LIMIT 1";
dol_syslog(get_class($this)."::Create sql=".$sql, LOG_DEBUG);
$resql = $this->db->query($sql);
dol_syslog(get_class($this)."::Create sql=".$sql, LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
$row = $this->db->fetch_row($resql);
}
else
{
$error++;
dol_syslog("Erreur recherche reference");
}
if ($resql)
{
$row = $this->db->fetch_row($resql);
}
else
{
$error++;
dol_syslog("Erreur recherche reference");
}
$ref = $ref . substr("00".($row[0]+1), -2);
$ref = "T".$ref.str_pad(dol_substr("00".intval($row[0])+1),2,"0",STR_PAD_LEFT);
$filebonprev = $ref;
$filebonprev = $ref;
// Create withdraw receipt in database
$sql = "INSERT INTO ".MAIN_DB_PREFIX."prelevement_bons (";
@@ -1326,11 +1327,26 @@ class BonPrelevement extends CommonObject
$fileDebiteurSection = '';
$fileEmetteurSection = '';
$i = 0;
$j = 0;
$this->total = 0;
/*
* section Debiteur (sepa Debiteurs bloc lines)
*/
$sql = "SELECT f.facnumber as fac FROM ".MAIN_DB_PREFIX."prelevement_lignes as pl, ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."prelevement_facture as pf, ".MAIN_DB_PREFIX."societe as soc, ".MAIN_DB_PREFIX."c_pays as p, ".MAIN_DB_PREFIX."societe_rib as rib WHERE pl.fk_prelevement_bons = ".$this->id." AND pl.rowid = pf.fk_prelevement_lignes AND pf.fk_facture = f.rowid AND soc.fk_pays = p.rowid AND soc.rowid = f.fk_soc AND rib.fk_soc = f.fk_soc AND rib.default_rib = 1";
$resql=$this->db->query($sql);
if ($resql)
{
$num = $this->db->num_rows($resql);
while ($j < $num)
{
$objfac = $this->db->fetch_object($resql);
$ListOfFactures = $ListOfFactures . $objfac->fac . ",";
$j++;
}
}
$sql = "SELECT soc.code_client as code, soc.address, soc.zip, soc.town, soc.datec, p.code as country_code,";
$sql.= " pl.client_nom as nom, pl.code_banque as cb, pl.code_guichet as cg, pl.number as cc, pl.amount as somme,";
$sql.= " f.facnumber as fac, pf.fk_facture as idfac, rib.iban_prefix as iban, rib.bic as bic, rib.rowid as drum";
@@ -1356,7 +1372,7 @@ class BonPrelevement extends CommonObject
while ($i < $num)
{
$obj = $this->db->fetch_object($resql);
$fileDebiteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $obj->facnumber, $obj->idfac, $obj->iban, $obj->bic, $obj->datec, $obj->drum);
$fileDebiteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $ListOfFactures, $obj->idfac, $obj->iban, $obj->bic, $obj->datec, $obj->drum);
$this->total = $this->total + $obj->somme;
$i++;
}
@@ -1393,13 +1409,14 @@ class BonPrelevement extends CommonObject
fputs($this->file, ' <CtrlSum>'.$this->total.'</CtrlSum>'.$CrLf);
fputs($this->file, ' <InitgPty>'.$CrLf);
fputs($this->file, ' <Nm>'.$this->raison_sociale.'</Nm>'.$CrLf);
/* fputs($this->file, ' <Id>'.$CrLf);
fputs($this->file, ' <Othr>'.$CrLf);
fputs($this->file, ' <Id>0533883248</Id>'.$CrLf);
fputs($this->file, ' <Issr>KBO-BCE</Issr>'.$CrLf);
fputs($this->file, ' <Id>'.$CrLf);
fputs($this->file, ' <PrvtId>'.$CrLf);
fputs($this->file, ' <Othr>'.$CrLf);
fputs($this->file, ' <Id>'.$conf->global->PRELEVEMENT_ICS.'</Id>'.$CrLf);
fputs($this->file, ' </Othr>'.$CrLf);
fputs($this->file, ' </PrvtId>'.$CrLf);
fputs($this->file, ' </Id>'.$CrLf);
*/ fputs($this->file, ' </InitgPty>'.$CrLf);
fputs($this->file, ' </InitgPty>'.$CrLf);
fputs($this->file, ' </GrpHdr>'.$CrLf);
// SEPA File Emetteur
if ($result != -2)
@@ -1582,6 +1599,7 @@ class BonPrelevement extends CommonObject
$CrLf = "\n";
$Rowing = sprintf("%06d", $row_idfac);
$Date_Rum = strtotime($row_datec);
$DtOfSgntr = dol_print_date($row_datec, '%Y-%m-%d');
$pre = ($date_Rum > 1359673200) ? 'Rum' : '++R';
$Rum = $pre.$row_code_client.$row_drum.'-0'.date('U', $Date_Rum);
$XML_DEBITOR ='';
@@ -1589,11 +1607,11 @@ class BonPrelevement extends CommonObject
$XML_DEBITOR .=' <PmtId>'.$CrLf;
$XML_DEBITOR .=' <EndToEndId>'.('AS-'.$row_facnumber.'-'.$Rowing).'</EndToEndId>'.$CrLf;
$XML_DEBITOR .=' </PmtId>'.$CrLf;
$XML_DEBITOR .=' <InstdAmt Ccy.="EUR">'.round($row_somme, 2).'</InstdAmt>'.$CrLf;
$XML_DEBITOR .=' <InstdAmt Ccy="EUR">'.round($row_somme, 2).'</InstdAmt>'.$CrLf;
$XML_DEBITOR .=' <DrctDbtTx>'.$CrLf;
$XML_DEBITOR .=' <MndtRltdInf>'.$CrLf;
$XML_DEBITOR .=' <MndtId>'.$Rum.'</MndtId>'.$CrLf;
$XML_DEBITOR .=' <DtOfSgntr>'.$row_datec.'</DtOfSgntr>'.$CrLf;
$XML_DEBITOR .=' <DtOfSgntr>'.$DtOfSgntr.'</DtOfSgntr>'.$CrLf;
$XML_DEBITOR .=' <AmdmntInd>false</AmdmntInd>'.$CrLf;
$XML_DEBITOR .=' </MndtRltdInf>'.$CrLf;
$XML_DEBITOR .=' </DrctDbtTx>'.$CrLf;
@@ -1606,17 +1624,18 @@ class BonPrelevement extends CommonObject
$XML_DEBITOR .=' <Nm>'.strtoupper(dol_string_unaccent($row_nom)).'</Nm>'.$CrLf;
$XML_DEBITOR .=' <PstlAdr>'.$CrLf;
$XML_DEBITOR .=' <Ctry>'.$row_country_code.'</Ctry>'.$CrLf;
$XML_DEBITOR .=' <AdrLine>'.strtr($row_adr, array(CHR(13) => ", ", CHR(10) => "")).'</AdrLine>'.$CrLf;
$XML_DEBITOR .=' <AdrLine>'.strtr($row_address, array(CHR(13) => ", ", CHR(10) => "")).'</AdrLine>'.$CrLf;
$XML_DEBITOR .=' <AdrLine>'.dol_string_unaccent($row_zip.' '.$row_town).'</AdrLine>'.$CrLf;
$XML_DEBITOR .=' </PstlAdr>'.$CrLf;
$XML_DEBITOR .=' </Dbtr>'.$CrLf;
$XML_DEBITOR .=' <DbtrAcct>'.$CrLf;
$XML_DEBITOR .=' <Id>'.$CrLf;
$XML_DEBITOR .=' <IBAN>'.$row_iban.'</IBAN>'.$CrLf;
$XML_DEBITOR .=' <IBAN>'.preg_replace('/\s/', '', $row_iban).'</IBAN>'.$CrLf;
$XML_DEBITOR .=' </Id>'.$CrLf;
$XML_DEBITOR .=' </DbtrAcct>'.$CrLf;
$XML_DEBITOR .=' <RmtInf>'.$CrLf;
$XML_DEBITOR .=' <Ustrd>'.($row_facnumber.'/'.$Rowing.'/'.$Rum).'</Ustrd>'.$CrLf;
// $XML_DEBITOR .=' <Ustrd>'.($row_facnumber.'/'.$Rowing.'/'.$Rum).'</Ustrd>'.$CrLf;
$XML_DEBITOR .=' <Ustrd>'.$row_facnumber.'</Ustrd>'.$CrLf;
$XML_DEBITOR .=' </RmtInf>'.$CrLf;
$XML_DEBITOR .=' </DrctDbtTxInf>'.$CrLf;
return $XML_DEBITOR;

View File

@@ -551,7 +551,7 @@ $sql.= " WHERE p.entity = ".$conf->entity;
if (! empty($date_start) && ! empty($date_end))
$sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'";
$sql.= " GROUP BY u.rowid";
$sql.= " GROUP BY u.rowid, p.label, p.datep, p.fk_user";
$sql.= " ORDER BY u.firstname";
dol_syslog("get payment salaries sql=".$sql);

View File

@@ -248,7 +248,7 @@ if ($action == 'create')
if (! empty($conf->banque->enabled))
{
print '<tr><td class="fieldrequired">'.$langs->trans("Account").'</td><td>';
$form->select_comptes($_POST["accountid"],"accountid",0,"courant=1",1); // Affiche liste des comptes courant
$form->select_comptes($_POST["accountid"],"accountid",0,'',1);
print '</td></tr>';
}
@@ -365,7 +365,7 @@ if ($id)
print "<div class=\"tabsAction\">\n";
if ($salpayment->rappro == 0)
{
if (! empty($user->rights->tax->charges->supprimer))
if (! empty($user->rights->salaries->delete))
{
print '<a class="butActionDelete" href="fiche.php?id='.$salpayment->id.'&action=delete">'.$langs->trans("Delete").'</a>';
}

View File

@@ -140,6 +140,7 @@ class Contact extends CommonObject
$sql.= ", statut";
$sql.= ", canvas";
$sql.= ", entity";
$sql.= ",ref_ext";
$sql.= ", import_key";
$sql.= ") VALUES (";
$sql.= "'".$this->db->idate($now)."',";
@@ -152,6 +153,7 @@ class Contact extends CommonObject
$sql.= " ".$this->statut.",";
$sql.= " ".(! empty($this->canvas)?"'".$this->canvas."'":"null").",";
$sql.= " ".$conf->entity.",";
$sql.= "'".$this->db->escape($this->ref_ext)."',";
$sql.= " ".(! empty($this->import_key)?"'".$this->import_key."'":"null");
$sql.= ")";
@@ -496,10 +498,12 @@ class Contact extends CommonObject
*
* @param int $id id du contact
* @param User $user Utilisateur (abonnes aux alertes) qui veut les alertes de ce contact
* @param string $ref_ext External reference, not given by Dolibarr
* @return int -1 if KO, 0 if OK but not found, 1 if OK
*/
function fetch($id, $user=0)
function fetch($id, $user=0, $ref_ext='')
{
dol_syslog(get_class($this)."::fetch ".$this->error, LOG_ERR);
global $langs;
$langs->load("companies");
@@ -521,7 +525,8 @@ class Contact extends CommonObject
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as d ON c.fk_departement = d.rowid";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON c.rowid = u.fk_socpeople";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON c.fk_soc = s.rowid";
$sql.= " WHERE c.rowid = ". $id;
if ($id) $sql.= " WHERE c.rowid = ". $id;
elseif ($ref_ext) $sql .= " WHERE c.ref_ext = '".$this->db->escape($ref_ext)."'";
dol_syslog(get_class($this)."::fetch sql=".$sql);
$resql=$this->db->query($sql);

View File

@@ -36,7 +36,7 @@ $langs->load("companies");
// Security check
$id = GETPOST('id','int');
if ($user->societe_id) $id=$user->societe_id;
$result = restrictedArea($user, 'societe', $id, '&societe');
$result = restrictedArea($user, 'contact', $id, 'socpeople&societe');
$object = new Contact($db);
if ($id > 0) $object->fetch($id);

View File

@@ -92,23 +92,31 @@ class Contrat extends CommonObject
global $db, $langs, $conf;
$langs->load("contracts");
$dir = DOL_DOCUMENT_ROOT . "/core/modules/contract";
if (empty($conf->global->CONTRACT_ADDON))
if (!empty($conf->global->CONTRACT_ADDON))
{
$conf->global->CONTRACT_ADDON='mod_contract_serpis';
}
$mybool = false;
$file = $conf->global->CONTRACT_ADDON.".php";
$file = $conf->global->CONTRACT_ADDON.".php";
$classname = $conf->global->CONTRACT_ADDON;
// Chargement de la classe de numerotation
$classname = $conf->global->CONTRACT_ADDON;
// Include file with class
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
foreach ($dirmodels as $reldir) {
$dir = dol_buildpath($reldir."core/modules/contract/");
// Load file with numbering class (if found)
$mybool|=@include_once $dir.$file;
}
if (! $mybool)
{
dol_print_error('',"Failed to include file ".$file);
return '';
}
$result=include_once $dir.'/'.$file;
if ($result)
{
$obj = new $classname();
$numref = "";
$numref = $obj->getNextValue($soc,$this);
@@ -118,15 +126,17 @@ class Contrat extends CommonObject
}
else
{
$this->error = $obj->error;
dol_print_error($db,get_class($this)."::getNextValue ".$obj->error);
return "";
}
}
else
{
print $langs->trans("Error")." ".$langs->trans("Error_CONTRACT_ADDON_NotDefined");
$langs->load("errors");
print $langs->trans("Error")." ".$langs->trans("ErrorModuleSetupNotComplete");
return "";
}
}
}
/**

View File

@@ -1137,7 +1137,7 @@ else
$value = isset($_POST ["options_" . $key]) ? dol_mktime($_POST ["options_" . $key . "hour"], $_POST ["options_" . $key . "min"], 0, $_POST ["options_" . $key . "month"], $_POST ["options_" . $key . "day"], $_POST ["options_" . $key . "year"]) : $db->jdate($object->array_options ['options_' . $key]);
}
if ($action == 'edit_extras' && $user->rights->commande->creer && GETPOST('attribute') == $key) {
if ($action == 'edit_extras' && $user->rights->contrat->creer && GETPOST('attribute') == $key) {
print '<form enctype="multipart/form-data" action="' . $_SERVER["PHP_SELF"] . '" method="post" name="formcontract">';
print '<input type="hidden" name="action" value="update_extras">';
print '<input type="hidden" name="attribute" value="' . $key . '">';
@@ -1150,7 +1150,7 @@ else
print '</form>';
} else {
print $extrafields->showOutputField($key, $value);
if ($object->statut == 0 && $user->rights->commande->creer)
if ($object->statut == 0 && $user->rights->contrat->creer)
print '<a href="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=edit_extras&attribute=' . $key . '">' . img_picto('', 'edit') . ' ' . $langs->trans('Modify') . '</a>';
}
print '</td></tr>' . "\n";

View File

@@ -184,7 +184,7 @@ class HookManager
}*/
}
if (is_array($actionclassinstance->results)) $this->resArray =array_merge($this->resArray, $actionclassinstance->results);
if (isset($actionclassinstance->results) && is_array($actionclassinstance->results)) $this->resArray =array_merge($this->resArray, $actionclassinstance->results);
if (! empty($actionclassinstance->resprints)) $this->resPrint.=$actionclassinstance->resprints;
}
// Generic hooks that return a string or array (printSearchForm, printLeftBlock, formAddObjectLine, formBuilddocOptions, ...)

View File

@@ -203,7 +203,7 @@ class Form
else
{
if ($typeofdata == 'email') $ret.=dol_print_email($value,0,0,0,0,1);
elseif ($typeofdata == 'amount') $ret.=($value != '' ? price($value,'',$langs,0,0,-1,$conf->currency) : '');
elseif ($typeofdata == 'amount') $ret.=($value != '' ? price($value,'',$langs,0,-1,-1,$conf->currency) : '');
elseif (preg_match('/^text/',$typeofdata) || preg_match('/^note/',$typeofdata)) $ret.=dol_htmlentitiesbr($value);
elseif ($typeofdata == 'day' || $typeofdata == 'datepicker') $ret.=dol_print_date($value,'day');
elseif ($typeofdata == 'datehourpicker') $ret.=dol_print_date($value,'dayhour');

View File

@@ -610,8 +610,6 @@ class FormCompany
}
print "\n".'<!-- Input text for third party with Ajax.Autocompleter (selectCompaniesForNewContact) -->'."\n";
print '<table class="nobordernopadding"><tr class="nobordernopadding">';
print '<td class="nobordernopadding">';
if ($obj->rowid == 0)
{
print '<input type="text" size="30" id="search_'.$htmlname.'" name="search_'.$htmlname.'" value="" '.$htmloption.' />';
@@ -621,9 +619,6 @@ class FormCompany
print '<input type="text" size="30" id="search_'.$htmlname.'" name="search_'.$htmlname.'" value="'.$obj->nom.'" '.$htmloption.' />';
}
print ajax_autocompleter(($socid?$socid:-1),$htmlname,DOL_URL_ROOT.'/societe/ajaxcompanies.php','',$minLength);
print '</td>';
print '</tr>';
print '</table>';
print "\n";
return $socid;
}

View File

@@ -2,6 +2,7 @@
/* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -254,6 +255,7 @@ class FormMail
if ($this->withform == 1)
{
$out.= '<form method="POST" name="mailform" enctype="multipart/form-data" action="'.$this->param["returnurl"].'">'."\n";
$out.= '<input style="display:none" type="submit" id="sendmail" name="sendmail">';
$out.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'" />';
}
foreach ($this->param as $key=>$value)

View File

@@ -152,7 +152,7 @@ class Menubase
$sql.= " '".$this->fk_menu."',";
$sql.= " ".($this->fk_mainmenu?"'".$this->fk_mainmenu."'":"null").",";
$sql.= " ".($this->fk_leftmenu?"'".$this->fk_leftmenu."'":"null").",";
$sql.= " '".$this->position."',";
$sql.= " '".(int) $this->position."',";
$sql.= " '".$this->db->escape($this->url)."',";
$sql.= " '".$this->db->escape($this->target)."',";
$sql.= " '".$this->db->escape($this->titre)."',";

View File

@@ -130,7 +130,6 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
print '<td align="center" valign="middle" class="nowrap">';
print '<script type="text/javascript">' . "\n";
print 'jQuery(document).ready(function () {' . "\n";
print 'jQuery("#check_mytasks").click(function() { jQuery(".family_mytasks").toggle(); jQuery(".family_other").toggle(); });' . "\n";
print 'jQuery("#check_birthday").click(function() { jQuery(".family_birthday").toggle(); });' . "\n";
print 'jQuery(".family_birthday").toggle();' . "\n";
print '});' . "\n";
@@ -140,20 +139,24 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
{
if (count($showextcals) > 0)
{
print '<tr><td><input type="checkbox" id="check_mytasks" name="check_mytasks" checked="true" disabled="disabled"> ' . $langs->trans("LocalAgenda") . '</td></tr>';
print '<tr><td>';
print '<script type="text/javascript">
jQuery(document).ready(function () {
jQuery("form.listactionsfilter input[name^=\"check_\"]").click(function() {
var name = $(this).attr("name");
jQuery(".family_" + name.replace("check_", "")).toggle();
});
});
</script>';
print '<input type="checkbox" id="check_mytasks" name="check_mytasks" checked="true" disabled="disabled"> ' . $langs->trans("LocalAgenda") . '</td></tr>';
foreach ($showextcals as $val)
{
$htmlname = dol_string_nospecial($val['name']);
$htmlname = md5($val['name']);
print '<tr><td>';
print '<script type="text/javascript">' . "\n";
print 'jQuery(document).ready(function () {' . "\n";
print ' jQuery("#check_' . $htmlname . '").click(function() {';
print ' /* alert("'.$htmlname.'"); */';
print ' jQuery(".family_' . $htmlname . '").toggle();';
print ' });' . "\n";
print '});' . "\n";
print '</script>' . "\n";
print '<input type="checkbox" id="check_' . $htmlname . '" name="check_' . $htmlname . '" checked="true"> ' . $val ['name'];
print '<input type="checkbox" id="check_' . $htmlname . '" name="check_ext' . $htmlname . '" checked="true"> ' . $val ['name'];
print '</td></tr>';
}
}

View File

@@ -937,9 +937,10 @@ function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0)
$sql.= " u.login, u.rowid";
if (get_class($object) == 'Adherent') $sql.= ", m.lastname, m.firstname";
if (get_class($object) == 'Societe') $sql.= ", sp.lastname, sp.firstname";
$sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u, ".MAIN_DB_PREFIX."actioncomm as a";
$sql.= " FROM ".MAIN_DB_PREFIX."user as u, ".MAIN_DB_PREFIX."actioncomm as a";
if (get_class($object) == 'Adherent') $sql.= ", ".MAIN_DB_PREFIX."adherent as m";
if (get_class($object) == 'Societe') $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_actioncomm as c ON a.fk_action = c.id ";
$sql.= " WHERE u.rowid = a.fk_user_author";
$sql.= " AND a.entity IN (".getEntity('agenda', 1).")";
if (get_class($object) == 'Adherent') {
@@ -949,7 +950,7 @@ function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0)
}
if (get_class($object) == 'Societe' && $object->id) $sql.= " AND a.fk_soc = ".$object->id;
if (! empty($objcon->id)) $sql.= " AND a.fk_contact = ".$objcon->id;
$sql.= " AND c.id=a.fk_action";
// $sql.= " AND c.id=a.fk_action";
$sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep > '".$db->idate($now)."'))";
$sql.= " ORDER BY a.datep DESC, a.id DESC";
@@ -1076,16 +1077,17 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0)
$sql.= " u.login, u.rowid as user_id";
if (get_class($object) == 'Adherent') $sql.= ", m.lastname, m.firstname";
if (get_class($object) == 'Societe') $sql.= ", sp.lastname, sp.firstname";
$sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u, ".MAIN_DB_PREFIX."actioncomm as a";
$sql.= " FROM ".MAIN_DB_PREFIX."user as u, ".MAIN_DB_PREFIX."actioncomm as a";
if (get_class($object) == 'Adherent') $sql.= ", ".MAIN_DB_PREFIX."adherent as m";
if (get_class($object) == 'Societe') $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_actioncomm as c ON a.fk_action = c.id ";
$sql.= " WHERE u.rowid = a.fk_user_author";
$sql.= " AND a.entity IN (".getEntity('agenda', 1).")";
if (get_class($object) == 'Adherent') $sql.= " AND a.fk_element = m.rowid AND a.elementtype = 'member'";
if (get_class($object) == 'Adherent' && $object->id) $sql.= " AND a.fk_element = ".$object->id;
if (get_class($object) == 'Societe' && $object->id) $sql.= " AND a.fk_soc = ".$object->id;
if (is_object($objcon) && $objcon->id) $sql.= " AND a.fk_contact = ".$objcon->id;
$sql.= " AND c.id=a.fk_action";
// $sql.= " AND c.id=a.fk_action";
$sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep <= '".$db->idate($now)."'))";
$sql.= " ORDER BY a.datep DESC, a.id DESC";

View File

@@ -10,6 +10,7 @@
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2013 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -146,7 +147,7 @@ function getBrowserInfo()
elseif (preg_match('/epiphany/i',$_SERVER["HTTP_USER_AGENT"])) { $name='epiphany'; $version=$reg[2]; }
elseif ((empty($phone) || preg_match('/iphone/i',$_SERVER["HTTP_USER_AGENT"])) && preg_match('/safari(\/|\s)([\d\.]*)/i',$_SERVER["HTTP_USER_AGENT"], $reg)) { $name='safari'; $version=$reg[2]; } // Safari is often present in string for mobile but its not.
elseif (preg_match('/opera(\/|\s)([\d\.]*)/i', $_SERVER["HTTP_USER_AGENT"], $reg)) { $name='opera'; $version=$reg[2]; }
elseif (preg_match('/msie(\/|\s)([\d\.]*)/i', $_SERVER["HTTP_USER_AGENT"], $reg)) { $name='ie'; $version=$reg[2]; } // MS products at end
elseif (preg_match('/(MSIE\s([0-9]+\.[0-9]))|.*(Trident\/[0-9]+.[0-9];\srv:([0-9]+\.[0-9]+))/i', $_SERVER["HTTP_USER_AGENT"], $reg)) { $name='ie'; $version= end($reg); } // MS products at end
// Other
$firefox=0;
if (in_array($name,array('firefox','iceweasel'))) $firefox=1;
@@ -1054,11 +1055,11 @@ function dol_mktime($hour,$minute,$second,$month,$day,$year,$gm=false,$check=1)
$default_timezone=@date_default_timezone_get();
}
}
if (empty($localtz)) {
$localtz = new DateTimeZone('UTC');
}
$dt = new DateTime(null,$localtz);
$dt->setDate($year,$month,$day);
$dt->setTime((int) $hour, (int) $minute, (int) $second);
@@ -2540,7 +2541,7 @@ function load_fiche_titre($titre, $mesg='', $picto='title.png', $pictoisfullpath
$return='';
if ($picto == 'setup') $picto='title.png';
if (!empty($conf->browser->ie) && $picto=='title.png') $picto='title.gif';
if (($conf->browser->name == 'ie') && $picto=='title.png') $picto='title.gif';
$return.= "\n";
$return.= '<table '.($id?'id="'.$id.'" ':'').'summary="" width="100%" border="0" class="notopnoleftnoright" style="margin-bottom: 2px;"><tr>';
@@ -2578,7 +2579,7 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so
global $conf,$langs;
if ($picto == 'setup') $picto='title.png';
if (!empty($conf->browser->ie) && $picto=='title.png') $picto='title.gif';
if (($conf->browser->name == 'ie') && $picto=='title.png') $picto='title.gif';
if (($num > $conf->liste_limit) || ($num == -1))
{
@@ -2952,7 +2953,7 @@ function get_localtax($tva, $local, $thirdparty_buyer="", $thirdparty_seller="")
$sql = "SELECT t.localtax1, t.localtax2, t.localtax1_type, t.localtax2_type";
$sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p";
$sql .= " WHERE t.fk_pays = p.rowid AND p.code = '".$thirdparty_seller->country_code."'";
$sql .= " AND t.taux = ".$tva." AND t.active = 1";
$sql .= " AND t.taux = ".((float) $tva)." AND t.active = 1";
dol_syslog("get_localtax sql=".$sql);
$resql=$db->query($sql);
@@ -2988,7 +2989,7 @@ function getLocalTaxesFromRate($vatrate, $local, $thirdparty)
$sql = "SELECT t.localtax1, t.localtax1_type, t.localtax2, t.localtax2_type, t.accountancy_code_sell, t.accountancy_code_buy";
$sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p";
$sql .= " WHERE t.fk_pays = p.rowid AND p.code = '".$thirdparty->country_code."'";
$sql .= " AND t.taux = ".$vatrate." AND t.active = 1";
$sql .= " AND t.taux = ".((float) $vatrate)." AND t.active = 1";
$resql=$db->query($sql);
if ($resql)
@@ -4305,6 +4306,8 @@ function picto_from_langcode($codelang)
{
global $langs;
if (empty($codelang)) return '';
if ($codelang == 'auto')
{
return img_picto_common($langs->trans('AutoDetectLang'), 'flags/int.png');

View File

@@ -52,7 +52,6 @@ function getURLContent($url,$postorget='GET',$param='',$followlocation=1,$addhea
exit;*/
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_SSLVERSION, 3); // Force SSLv3
curl_setopt($ch, CURLOPT_USERAGENT, 'Dolibarr geturl function');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, ($followlocation?true:false));

View File

@@ -416,7 +416,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
if (($total_projectlinesa_planned > 0 || $total_projectlinesa_spent > 0) && $level==0)
{
print '<tr class="liste_total">';
print '<tr class="liste_total nodrag nodrop">';
print '<td class="liste_total">'.$langs->trans("Total").'</td>';
if ($showproject) print '<td></td><td></td>';
print '<td></td>';

View File

@@ -3,6 +3,7 @@
* Copyright (C) 2006-2007 Yannick Warnier <ywarnier@beeznest.org>
* Copyright (C) 2011 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -86,26 +87,18 @@ function vat_by_thirdparty($db, $y, $date_start, $date_end, $modetax, $direction
global $conf;
$list=array();
//print "xx".$conf->global->MAIN_MODULE_ACCOUNTING;
//print "xx".$conf->global->MAIN_MODULE_COMPTABILITE;
if ($direction == 'sell')
{
$invoicetable='facture';
$invoicedettable='facturedet';
$fk_facture='fk_facture';
$total_tva='total_tva';
$total_localtax1='total_localtax1';
$total_localtax2='total_localtax2';
$total_ht='total';
$total_tva='tva';
}
if ($direction == 'buy')
{
$invoicetable='facture_fourn';
$invoicedettable='facture_fourn_det';
$fk_facture='fk_facture_fourn';
$total_tva='tva';
$total_localtax1='total_localtax1';
$total_localtax2='total_localtax2';
$total_ht='total_ht';
$total_tva='total_tva';
}
// Define sql request
@@ -125,11 +118,10 @@ function vat_by_thirdparty($db, $y, $date_start, $date_end, $modetax, $direction
if (! empty($conf->global->MAIN_MODULE_COMPTABILITE))
{
$sql = "SELECT s.rowid as socid, s.nom as nom, s.siren as tva_intra, s.tva_assuj as assuj,";
$sql.= " sum(fd.total_ht) as amount, sum(fd.".$total_tva.") as tva,";
$sql.= " sum(fd.".$total_localtax1.") as localtax1,";
$sql.= " sum(fd.".$total_localtax2.") as localtax2";
$sql.= " sum(f.$total_ht) as amount, sum(f.".$total_tva.") as tva,";
$sql.= " sum(f.localtax1) as localtax1,";
$sql.= " sum(f.localtax2) as localtax2";
$sql.= " FROM ".MAIN_DB_PREFIX.$invoicetable." as f,";
$sql.= " ".MAIN_DB_PREFIX.$invoicedettable." as fd,";
$sql.= " ".MAIN_DB_PREFIX."societe as s";
$sql.= " WHERE f.entity = " . $conf->entity;
$sql.= " AND f.fk_statut in (1,2)"; // Validated or paid (partially or completely)
@@ -146,7 +138,7 @@ function vat_by_thirdparty($db, $y, $date_start, $date_end, $modetax, $direction
$sql.= " AND f.datef <= '".$db->idate(dol_get_last_day($y,12,false))."'";
}
if ($date_start && $date_end) $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'";
$sql.= " AND s.rowid = f.fk_soc AND f.rowid = fd.".$fk_facture;
$sql.= " AND s.rowid = f.fk_soc";
$sql.= " GROUP BY s.rowid, s.nom, s.tva_intra, s.tva_assuj";
}
}

View File

@@ -102,8 +102,8 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->stock->enabled', __HANDLER__, 'left', 3102__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/liste.php', 'List', 1, 'stocks', '$user->rights->stock->lire', '', 2, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->stock->enabled', __HANDLER__, 'left', 3103__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/valo.php', 'EnhancedValue', 1, 'stocks', '$user->rights->stock->lire', '', 2, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->stock->enabled', __HANDLER__, 'left', 3104__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/mouvement.php', 'Movements', 1, 'stocks', '$user->rights->stock->mouvement->lire', '', 2, 3, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->stock->enabled && $conf->fournisseur->enabled', __HANDLER__, 'left', 3105__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/replenish.php', 'Replenishments', 1, 'stocks', '$user->rights->stock->mouvement->lire && $user->rights->fournisseur->lire', '', 2, 4, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->stock->enabled && $conf->fournisseur->enabled', __HANDLER__, 'left', 3106__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/massstockmove.php', 'StockTransfer', 1, 'stocks', '$user->rights->stock->mouvement->lire && $user->rights->fournisseur->lire', '', 2, 5, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->stock->enabled && $conf->fournisseur->enabled', __HANDLER__, 'left', 3105__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/replenish.php', 'Replenishments', 1, 'stocks', '$user->rights->stock->mouvement->creer && $user->rights->fournisseur->lire', '', 2, 4, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->stock->enabled', __HANDLER__, 'left', 3106__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/massstockmove.php', 'StockTransfer', 1, 'stocks', '$user->rights->stock->mouvement->creer', '', 2, 5, __ENTITY__);
-- Product - Categories
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 3200__+MAX_llx_menu__, 'products', 'cat', 3__+MAX_llx_menu__, '/categories/index.php?leftmenu=cat&amp;type=0', 'Categories', 0, 'categories', '$user->rights->categorie->lire', '', 2, 4, __ENTITY__);

View File

@@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2010-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2010 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012-2015 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
*
* This program is free software; you can redistribute it and/or modify
@@ -134,8 +134,8 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0)
}
// Financial
$tmpentry=array('enabled'=>(! empty($conf->comptabilite->enabled) || ! empty($conf->accounting->enabled) || ! empty($conf->facture->enabled) || ! empty($conf->don->enabled) || ! empty($conf->tax->enabled) || ! empty($conf->salaries->enabled)),
'perms'=>(! empty($user->rights->compta->resultat->lire) || ! empty($user->rights->accounting->plancompte->lire) || ! empty($user->rights->facture->lire) || ! empty($user->rights->don->lire) || ! empty($user->rights->tax->charges->lire) || ! empty($user->rights->salaries->read)),
$tmpentry=array('enabled'=>(! empty($conf->comptabilite->enabled) || ! empty($conf->accounting->enabled) || ! empty($conf->facture->enabled) || ! empty($conf->don->enabled) || ! empty($conf->tax->enabled) || ! empty($conf->salaries->enabled) || ! empty($conf->fournisseur->enabled)),
'perms'=>(! empty($user->rights->compta->resultat->lire) || ! empty($user->rights->accounting->plancompte->lire) || ! empty($user->rights->facture->lire) || ! empty($user->rights->don->lire) || ! empty($user->rights->tax->charges->lire) || ! empty($user->rights->salaries->read) || ! empty($user->rights->fournisseur->facture->lire)),
'module'=>'comptabilite|accounting|facture|don|tax|salaries');
$showmode=dol_eldy_showmenu($type_user, $tmpentry, $listofmodulesforexternal);
if ($showmode)
@@ -1000,8 +1000,8 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
if (empty($leftmenu) || $leftmenu=="stock") $newmenu->add("/product/stock/liste.php", $langs->trans("List"), 1, $user->rights->stock->lire);
if (empty($leftmenu) || $leftmenu=="stock") $newmenu->add("/product/stock/valo.php", $langs->trans("EnhancedValue"), 1, $user->rights->stock->lire);
if (empty($leftmenu) || $leftmenu=="stock") $newmenu->add("/product/stock/mouvement.php", $langs->trans("Movements"), 1, $user->rights->stock->mouvement->lire);
if ($conf->fournisseur->enabled) if (empty($leftmenu) || $leftmenu=="stock") $newmenu->add("/product/stock/replenish.php", $langs->trans("Replenishment"), 1, $user->rights->stock->mouvement->lire && $user->rights->fournisseur->lire);
if ($conf->fournisseur->enabled) if (empty($leftmenu) || $leftmenu=="stock") $newmenu->add("/product/stock/massstockmove.php", $langs->trans("StockTransfer"), 1, $user->rights->stock->mouvement->lire && $user->rights->fournisseur->lire);
if ($conf->fournisseur->enabled) if (empty($leftmenu) || $leftmenu=="stock") $newmenu->add("/product/stock/replenish.php", $langs->trans("Replenishment"), 1, $user->rights->stock->mouvement->creer && $user->rights->fournisseur->lire);
if (empty($leftmenu) || $leftmenu=="stock") $newmenu->add("/product/stock/massstockmove.php", $langs->trans("StockTransfer"), 1, $user->rights->stock->mouvement->creer);
}
// Expeditions

View File

@@ -748,6 +748,8 @@ abstract class DolibarrModules
$err=0;
if (empty($this->const)) return 0;
foreach ($this->const as $key => $value)
{
$name = $this->const[$key][0];
@@ -816,6 +818,8 @@ abstract class DolibarrModules
$err=0;
if (empty($this->const)) return 0;
foreach ($this->const as $key => $value)
{
$name = $this->const[$key][0];

View File

@@ -534,13 +534,18 @@ class pdf_merou extends ModelePdfExpedition
// Date Expedition
$Yoff = $Yoff+7;
$pdf->SetXY($blSocX-80,$blSocY+20);
$pdf->SetXY($blSocX-80,$blSocY+17);
$pdf->SetFont('','B', $default_font_size - 2);
$pdf->SetTextColor(0,0,0);
$pdf->MultiCell(50, 8, $outputlangs->transnoentities("Date")." : " . dol_print_date($object->date_delivery,'day',false,$outputlangs,true), '', 'L');
$pdf->SetXY($blSocX-80,$blSocY+20);
$pdf->SetFont('','B', $default_font_size - 2);
$pdf->SetTextColor(0,0,0);
$pdf->MultiCell(50, 8, $outputlangs->transnoentities("TrackingNumber")." : " . $object->tracking_number, '', 'L');
// Deliverer
$pdf->SetXY($blSocX-80,$blSocY+23);
$pdf->SetXY($blSocX-80,$blSocY+24);
$pdf->SetFont('','', $default_font_size - 2);
$pdf->SetTextColor(0,0,0);
@@ -554,13 +559,8 @@ class pdf_merou extends ModelePdfExpedition
// Get code using getLabelFromKey
$code=$outputlangs->getLabelFromKey($this->db,$object->shipping_method_id,'c_shipment_mode','rowid','code');
$label=$outputlangs->trans("SendingMethod".strtoupper($code))." :";
$pdf->writeHTMLCell(50, 8, '', '', $label." ".$object->tracking_url, '', 'L');
}
else
{
$label=$outputlangs->transnoentities("Deliverer");
}
$pdf->writeHTMLCell(50, 8, '', '', $label." ".$object->tracking_url, '', 'L');
}
}
else

View File

@@ -180,11 +180,17 @@ class pdf_rouget extends ModelePdfExpedition
$tab_height = 130;
$tab_height_newpage = 150;
if (! empty($object->note_public) || (! empty($object->tracking_number) && ! empty($object->shipping_method_id)))
if (! empty($object->note_public) || ! empty($object->tracking_number))
{
$tab_top = 88;
$tab_top_alt = $tab_top;
$pdf->SetFont('','B', $default_font_size - 2);
$pdf->writeHTMLCell(60, 4, $this->posxdesc-1, $tab_top-1, $outputlangs->transnoentities("TrackingNumber")." : " . $object->tracking_number, 0, 1, false, true, 'L');
$tab_top_alt = $pdf->GetY();
//$tab_top_alt += 1;
// Tracking number
if (! empty($object->tracking_number))
{
@@ -198,14 +204,14 @@ class pdf_rouget extends ModelePdfExpedition
$label=$outputlangs->trans("LinkToTrackYourPackage")."<br>";
$label.=$outputlangs->trans("SendingMethod".strtoupper($code))." :";
$pdf->SetFont('','B', $default_font_size - 2);
$pdf->writeHTMLCell(60, 7, $this->posxdesc-1, $tab_top-1, $label." ".$object->tracking_url, 0, 1, false, true, 'L');
$pdf->writeHTMLCell(60, 4, $this->posxdesc-1, $tab_top+6, $label." ".$object->tracking_url, 0, 1, false, true, 'L');
$tab_top_alt += 7;
$tab_top_alt = $pdf->GetY();
}
}
}
// Affiche notes
// Notes
if (! empty($object->note_public))
{
$pdf->SetFont('','', $default_font_size - 1); // Dans boucle pour gerer multi-page

View File

@@ -141,15 +141,18 @@ abstract class ModelNumRefExpedition
}
/**
* Cree un bon d'expedition sur disque
* Cree un bon d'expedition sur disque
*
* @param DoliDB $db Objet base de donnee
* @param Object $object Object expedition
* @param string $modele Force le modele a utiliser ('' to not force)
* @param Translate $outputlangs Objet lang a utiliser pour traduction
* @return int <=0 if KO, >0 if OK
* @param DoliDB $db Objet base de donnee
* @param Object $object Object expedition
* @param string $modele Force le modele a utiliser ('' to not force)
* @param Translate $outputlangs Objet lang a utiliser pour traduction
* @param int $hidedetails Hide details of lines
* @param int $hidedesc Hide description
* @param int $hideref Hide ref
* @return int <=0 if KO, >0 if OK
*/
function expedition_pdf_create($db, $object, $modele, $outputlangs)
function expedition_pdf_create($db, $object, $modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
{
global $conf,$user,$langs;
@@ -214,7 +217,7 @@ function expedition_pdf_create($db, $object, $modele, $outputlangs)
// We save charset_output to restore it because write_file can change it if needed for
// output format that does not support UTF8.
$sav_charset_output=$outputlangs->charset_output;
if ($obj->write_file($object, $outputlangs, $srctemplatepath) > 0)
if ($obj->write_file($object, $outputlangs, $srctemplatepath, $hidedetails, $hidedesc, $hideref) > 0)
{
$outputlangs->charset_output=$sav_charset_output;

View File

@@ -607,7 +607,7 @@ class ImportCsv extends ModeleImports
//var_dump($objimport->array_import_convertvalue); exit;
// Build SQL request
if (empty($tablewithentity[$tablename]))
if (empty($tablewithentity_cache[$tablename]))
{
$sql ='INSERT INTO '.$tablename.'('.$listfields.', import_key';
if (! empty($objimport->array_import_tables_creator[0][$alias])) $sql.=', '.$objimport->array_import_tables_creator[0][$alias];

View File

@@ -182,7 +182,7 @@ class modProjet extends DolibarrModules
$this->export_code[$r]=$this->rights_class.'_'.$r;
$this->export_label[$r]='ProjectsAndTasksLines'; // Translation key (used only if key ExportDataset_xxx_z not found)
$this->export_permission[$r]=array(array("projet","export"));
$this->export_dependencies_array[$r]=array('task_time'=>'ppt.rowid');
$this->export_dependencies_array[$r]=array('task_time'=>'pt.rowid');
$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.fk_pays'=>'List:c_pays:libelle',
's.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text',
@@ -280,11 +280,9 @@ class modProjet extends DolibarrModules
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'projet_extrafields as extra ON p.rowid = extra.fk_object';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX."projet_task as pt ON p.rowid = pt.fk_projet";
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'projet_task_extrafields as extra2 ON pt.rowid = extra2.fk_object';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX."projet_task_time as ptt ON pt.rowid = ptt.fk_task,";
$this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'societe as s';
$this->export_sql_end[$r] .=' WHERE p.fk_soc = s.rowid';
$this->export_sql_end[$r] .=' AND p.entity = '.$conf->entity;
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX."projet_task_time as ptt ON pt.rowid = ptt.fk_task";
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON p.fk_soc = s.rowid';
$this->export_sql_end[$r] .=' WHERE p.entity = '.$conf->entity;
}

View File

@@ -44,8 +44,8 @@ class mod_codecompta_aquarium extends ModeleAccountancyCode
function __construct()
{
global $conf;
if (empty($conf->global->COMPANY_AQUARIUM_MASK_CUSTOMER)) $conf->global->COMPANY_AQUARIUM_MASK_CUSTOMER='411';
if (empty($conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER)) $conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER='401';
if (! isset($conf->global->COMPANY_AQUARIUM_MASK_CUSTOMER) || trim($conf->global->COMPANY_AQUARIUM_MASK_CUSTOMER) == '') $conf->global->COMPANY_AQUARIUM_MASK_CUSTOMER='411';
if (! isset($conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER) || trim($conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER) == '') $conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER='401';
$this->prefixcustomeraccountancycode=$conf->global->COMPANY_AQUARIUM_MASK_CUSTOMER;
$this->prefixsupplieraccountancycode=$conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER;
}

View File

@@ -125,7 +125,8 @@ class mod_facture_fournisseur_tulip extends ModeleNumRefSuppliersInvoices
return 0;
}
$numFinal=get_next_value($db,$mask,'facture_fourn','ref','',$objsoc->code_fournisseur,$object->datef);
//Supplier invoices take invoice date instead of creation date for the mask
$numFinal=get_next_value($db,$mask,'facture_fourn','ref','',$objsoc->code_fournisseur,$object->date);
return $numFinal;
}

View File

@@ -203,7 +203,7 @@ if (isset($conf->file->main_authentication) && preg_match('/openid/',$conf->file
<?php if ($main_home)
{
?>
<div class="center" class="login_main_home" style="max-width: 80%">
<div class="login_main_home" style="max-width: 80%">
<?php echo $main_home; ?>
</div><br>
<?php

View File

@@ -201,9 +201,9 @@ else {
<?php } ?>
</td>
<?php } ?>
<td align="right"><input type="text" size="2" name="qty" class="flat" value="<?php echo (isset($_POST["qty"])?$_POST["qty"]:1); ?>">
<td align="right"><input type="text" size="2" id="qty" name="qty" class="flat" value="<?php echo (isset($_POST["qty"])?$_POST["qty"]:1); ?>">
</td>
<td align="right" class="nowrap"><input type="text" size="1" class="flat" value="<?php echo (isset($_POST["remise_percent"])?$_POST["remise_percent"]:$buyer->remise_percent); ?>" name="remise_percent"><span class="hideonsmartphone">%</span></td>
<td align="right" class="nowrap"><input type="text" size="1" id="remise_percent" name="remise_percent" class="flat" value="<?php echo (isset($_POST["remise_percent"])?$_POST["remise_percent"]:$buyer->remise_percent); ?>"><span class="hideonsmartphone">%</span></td>
<?php
if (! empty($usemargins))

View File

@@ -333,7 +333,7 @@ if (! empty($conf->margin->enabled))
var rounding = main_rounding_unit;
var pos = amount.indexOf(dec);
var decpart = '';
if (pos >= 0) decpart = amount.substr(pos+1).replace('/0+$/i',''); // Supprime les 0 de fin de partie decimale
if (pos >= 0) decpart = amount.substr(pos+1).replace('/0+$/i',''); // Remove 0 for decimal part
var nbdec = decpart.length;
if (nbdec > rounding) rounding = nbdec;
// If rounding higher than max shown

View File

@@ -27,7 +27,7 @@
<?php if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { ?>
<td align="center"><?php $coldisplay++; ?><?php echo ($i+1); ?></td>
<?php } ?>
<td><?php $coldisplay++; ?><div id="<?php echo $line->rowid; ?>"></div>
<td><?php $coldisplay++; ?><div id="line_<?php echo $line->rowid; ?>"></div>
<?php if (($line->info_bits & 2) == 2) { ?>
<a href="<?php echo DOL_URL_ROOT.'/comm/remx.php?id='.$this->socid; ?>">
<?php
@@ -142,7 +142,7 @@
<td align="center"><?php $coldisplay++; ?>
<?php if (($line->info_bits & 2) == 2) { ?>
<?php } else { ?>
<a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=editline&amp;lineid='.$line->id.'#'.$line->id; ?>">
<a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=editline&amp;lineid='.$line->id.'#line_'.$line->id; ?>">
<?php echo img_edit(); ?>
</a>
<?php } ?>

View File

@@ -354,7 +354,7 @@ if (($action=="create") || ($action=="edit"))
print $langs->trans('CronEvery')."</td>";
print "<td><select name=\"nbfrequency\">";
for($i=1; $i<=60; $i++){
if(($object->frequency/$object->unitfrequency) == $i){
if(!is_null($object->unitfrequency) && ($object->frequency/$object->unitfrequency) == $i){
print "<option value='".$i."' selected='selected'>".$i."</option>";
}
else{

View File

@@ -119,21 +119,30 @@ class Expedition extends CommonObject
global $db, $langs, $conf;
$langs->load("sendings");
$dir = DOL_DOCUMENT_ROOT . "/core/modules/expedition";
if (empty($conf->global->EXPEDITION_ADDON_NUMBER))
if (!empty($conf->global->EXPEDITION_ADDON_NUMBER))
{
$conf->global->EXPEDITION_ADDON_NUMBER='mod_expedition_safor';
}
$mybool = false;
$file = $conf->global->EXPEDITION_ADDON_NUMBER.".php";
$file = $conf->global->EXPEDITION_ADDON_NUMBER.".php";
$classname = $conf->global->EXPEDITION_ADDON_NUMBER;
// Chargement de la classe de numerotation
$classname = $conf->global->EXPEDITION_ADDON_NUMBER;
// Include file with class
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
foreach ($dirmodels as $reldir) {
$dir = dol_buildpath($reldir."core/modules/expedition/");
// Load file with numbering class (if found)
$mybool|=@include_once $dir.$file;
}
if (! $mybool)
{
dol_print_error('',"Failed to include file ".$file);
return '';
}
$result=include_once $dir.'/'.$file;
if ($result)
{
$obj = new $classname();
$numref = "";
$numref = $obj->getNextValue($soc,$this);
@@ -147,12 +156,12 @@ class Expedition extends CommonObject
dol_print_error($db,get_class($this)."::getNextNumRef ".$obj->error);
return "";
}
}
else
{
print $langs->trans("Error")." ".$langs->trans("Error_EXPEDITION_ADDON_NUMBER_NotDefined");
return "";
}
}
else
{
print $langs->trans("Error")." ".$langs->trans("Error_EXPEDITION_ADDON_NUMBER_NotDefined");
return "";
}
}
/**
@@ -167,8 +176,6 @@ class Expedition extends CommonObject
$now=dol_now();
if (empty($this->model_pdf)) $this->model_pdf=$conf->global->EXPEDITION_ADDON_PDF;
require_once DOL_DOCUMENT_ROOT .'/product/stock/class/mouvementstock.class.php';
$error = 0;
@@ -1485,7 +1492,7 @@ class Expedition extends CommonObject
}
/**
* Get tracking url status
* Forge an set tracking url
*
* @param string $value Value
* @return void
@@ -1533,6 +1540,8 @@ class Expedition extends CommonObject
if ($this->db->query($sql) )
{
//TODO: Option to set order billed if 100% of order is shipped
$this->billed=1;
$this->db->commit();
return 1;
}
else

View File

@@ -89,473 +89,474 @@ $hookmanager->initHooks(array('expeditioncard'));
$parameters=array();
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if ($action == 'add')
{
$error=0;
if (empty($reshook)) {
$db->begin();
$object->note = GETPOST('note','alpha');
$object->origin = $origin;
$object->origin_id = $origin_id;
$object->weight = GETPOST('weight','int')==''?"NULL":GETPOST('weight','int');
$object->sizeH = GETPOST('sizeH','int')==''?"NULL":GETPOST('sizeH','int');
$object->sizeW = GETPOST('sizeW','int')==''?"NULL":GETPOST('sizeW','int');
$object->sizeS = GETPOST('sizeS','int')==''?"NULL":GETPOST('sizeS','int');
$object->size_units = GETPOST('size_units','int');
$object->weight_units = GETPOST('weight_units','int');
$date_delivery = dol_mktime(GETPOST('date_deliveryhour','int'), GETPOST('date_deliverymin','int'), 0, GETPOST('date_deliverymonth','int'), GETPOST('date_deliveryday','int'), GETPOST('date_deliveryyear','int'));
// On va boucler sur chaque ligne du document d'origine pour completer objet expedition
// avec info diverses + qte a livrer
$classname = ucfirst($object->origin);
$objectsrc = new $classname($db);
$objectsrc->fetch($object->origin_id);
$object->socid = $objectsrc->socid;
$object->ref_customer = $objectsrc->ref_client;
$object->date_delivery = $date_delivery; // Date delivery planed
$object->fk_delivery_address = $objectsrc->fk_delivery_address;
$object->shipping_method_id = GETPOST('shipping_method_id','int');
$object->tracking_number = GETPOST('tracking_number','alpha');
$object->ref_int = GETPOST('ref_int','alpha');
$object->note_private = GETPOST('note_private');
$object->note_public = GETPOST('note_public');
$num=count($objectsrc->lines);
$totalqty=0;
for ($i = 0; $i < $num; $i++)
if ($action == 'add')
{
$qty = "qtyl".$i;
$j=0;
$sub_qty=array();
$subtotalqty=0;
$idl="idl".$i;
$batch="batchl".$i."_0";
if (isset($_POST[$batch])) {
//shipment line with batch-enable product
$qty .= '_'.$j;
while (isset($_POST[$batch])) {
$sub_qty[$j]['q']=GETPOST($qty,'int');
$sub_qty[$j]['id_batch']=GETPOST($batch,'int');
$subtotalqty+=$sub_qty[$j]['q'];
$j++;
$batch="batchl".$i."_".$j;
$qty = "qtyl".$i.'_'.$j;
$error=0;
}
$batch_line[$i]['detail']=$sub_qty;
$batch_line[$i]['qty']=$subtotalqty;
$batch_line[$i]['ix_l']=GETPOST($idl,'int');
$totalqty+=$subtotalqty;
} else {
//Standard product
if (GETPOST($qty,'int') > 0) $totalqty+=GETPOST($qty,'int');
}
}
$db->begin();
if ($totalqty > 0)
{
//var_dump($_POST);exit;
$object->note = GETPOST('note','alpha');
$object->origin = $origin;
$object->origin_id = $origin_id;
$object->weight = GETPOST('weight','int')==''?"NULL":GETPOST('weight','int');
$object->sizeH = GETPOST('sizeH','int')==''?"NULL":GETPOST('sizeH','int');
$object->sizeW = GETPOST('sizeW','int')==''?"NULL":GETPOST('sizeW','int');
$object->sizeS = GETPOST('sizeS','int')==''?"NULL":GETPOST('sizeS','int');
$object->size_units = GETPOST('size_units','int');
$object->weight_units = GETPOST('weight_units','int');
$date_delivery = dol_mktime(GETPOST('date_deliveryhour','int'), GETPOST('date_deliverymin','int'), 0, GETPOST('date_deliverymonth','int'), GETPOST('date_deliveryday','int'), GETPOST('date_deliveryyear','int'));
// On va boucler sur chaque ligne du document d'origine pour completer objet expedition
// avec info diverses + qte a livrer
$classname = ucfirst($object->origin);
$objectsrc = new $classname($db);
$objectsrc->fetch($object->origin_id);
$object->socid = $objectsrc->socid;
$object->ref_customer = $objectsrc->ref_client;
$object->date_delivery = $date_delivery; // Date delivery planed
$object->fk_delivery_address = $objectsrc->fk_delivery_address;
$object->shipping_method_id = GETPOST('shipping_method_id','int');
$object->tracking_number = GETPOST('tracking_number','alpha');
$object->ref_int = GETPOST('ref_int','alpha');
$object->note_private = GETPOST('note_private');
$object->note_public = GETPOST('note_public');
$num=count($objectsrc->lines);
$totalqty=0;
for ($i = 0; $i < $num; $i++)
{
$qty = "qtyl".$i;
if (! isset($batch_line[$i])) {
if (GETPOST($qty,'int') > 0)
{
$ent = "entl".$i;
$idl = "idl".$i;
$entrepot_id = is_numeric(GETPOST($ent,'int'))?GETPOST($ent,'int'):GETPOST('entrepot_id','int');
if ($entrepot_id < 0) $entrepot_id='';
$j=0;
$sub_qty=array();
$subtotalqty=0;
$idl="idl".$i;
$batch="batchl".$i."_0";
if (isset($_POST[$batch])) {
//shipment line with batch-enable product
$qty .= '_'.$j;
while (isset($_POST[$batch])) {
$sub_qty[$j]['q']=GETPOST($qty,'int');
$sub_qty[$j]['id_batch']=GETPOST($batch,'int');
$subtotalqty+=$sub_qty[$j]['q'];
$j++;
$batch="batchl".$i."_".$j;
$qty = "qtyl".$i.'_'.$j;
$ret=$object->addline($entrepot_id,GETPOST($idl,'int'),GETPOST($qty,'int'));
if ($ret < 0)
{
$mesg='<div class="error">'.$object->error.'</div>';
$error++;
}
}
} else {
if ($batch_line[$i]['qty']>0) {
$ret=$object->addline_batch($batch_line[$i]);
if ($ret < 0)
{
$mesg='<div class="error">'.$object->error.'</div>';
$error++;
}
}
}
}
$batch_line[$i]['detail']=$sub_qty;
$batch_line[$i]['qty']=$subtotalqty;
$batch_line[$i]['ix_l']=GETPOST($idl,'int');
$totalqty+=$subtotalqty;
} else {
//Standard product
if (GETPOST($qty,'int') > 0) $totalqty+=GETPOST($qty,'int');
}
}
if ($totalqty > 0)
{
//var_dump($_POST);exit;
for ($i = 0; $i < $num; $i++)
{
$qty = "qtyl".$i;
if (! isset($batch_line[$i])) {
if (GETPOST($qty,'int') > 0)
{
$ent = "entl".$i;
$idl = "idl".$i;
$entrepot_id = is_numeric(GETPOST($ent,'int'))?GETPOST($ent,'int'):GETPOST('entrepot_id','int');
if ($entrepot_id < 0) $entrepot_id='';
$ret=$object->addline($entrepot_id,GETPOST($idl,'int'),GETPOST($qty,'int'));
if ($ret < 0)
{
$mesg='<div class="error">'.$object->error.'</div>';
$error++;
}
}
} else {
if ($batch_line[$i]['qty']>0) {
$ret=$object->addline_batch($batch_line[$i]);
if ($ret < 0)
{
$mesg='<div class="error">'.$object->error.'</div>';
$error++;
}
}
}
}
if (! $error)
{
$ret=$object->create($user);
if ($ret <= 0)
{
$mesg='<div class="error">'.$object->error.'</div>';
$error++;
}
}
}
else
{
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Qty")).'</div>';
$error++;
}
if (! $error)
{
$ret=$object->create($user);
if ($ret <= 0)
{
$mesg='<div class="error">'.$object->error.'</div>';
$error++;
}
}
}
else
{
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Qty")).'</div>';
$error++;
}
if (! $error)
{
$db->commit();
header("Location: fiche.php?id=".$object->id);
exit;
}
else
{
$db->rollback();
$_GET["commande_id"]=GETPOST('commande_id','int');
$action='create';
}
}
/*
* Build a receiving receipt
*/
else if ($action == 'create_delivery' && $conf->livraison_bon->enabled && $user->rights->expedition->livraison->creer)
{
$result = $object->create_delivery($user);
if ($result > 0)
{
header("Location: ".DOL_URL_ROOT.'/livraison/fiche.php?id='.$result);
exit;
}
else
{
$mesg=$object->error;
}
}
else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->expedition->valider)
{
$object->fetch_thirdparty();
$result = $object->valid($user);
// Define output language
$outputlangs = $langs;
$newlang='';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id','alpha');
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
if (! empty($newlang))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang);
}
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
{
$ret=$object->fetch($id); // Reload to get new records
$result=expedition_pdf_create($db,$object,$object->modelpdf,$outputlangs);
}
if ($result < 0)
{
dol_print_error($db,$result);
exit;
}
}
else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->expedition->supprimer)
{
$result = $object->delete();
if ($result > 0)
{
header("Location: ".DOL_URL_ROOT.'/expedition/index.php');
exit;
}
else
{
$langs->load("errors");
setEventMessage($langs->trans($object->error),'errors');
}
}
else if ($action == 'reopen' && $user->rights->expedition->valider)
{
$result = $object->setStatut(0);
if ($result < 0)
{
$mesg = $object->error;
}
}
else if ($action == 'setdate_livraison' && $user->rights->expedition->creer)
{
//print "x ".$_POST['liv_month'].", ".$_POST['liv_day'].", ".$_POST['liv_year'];
$datedelivery=dol_mktime(GETPOST('liv_hour','int'), GETPOST('liv_min','int'), 0, GETPOST('liv_month','int'), GETPOST('liv_day','int'), GETPOST('liv_year','int'));
$object->fetch($id);
$result=$object->set_date_livraison($user,$datedelivery);
if ($result < 0)
{
$mesg='<div class="error">'.$object->error.'</div>';
}
}
// Action update description of emailing
else if ($action == 'settrackingnumber' || $action == 'settrackingurl'
|| $action == 'settrueWeight'
|| $action == 'settrueWidth'
|| $action == 'settrueHeight'
|| $action == 'settrueDepth'
|| $action == 'setshipping_method_id')
{
$error=0;
if ($action == 'settrackingnumber') $object->tracking_number = trim(GETPOST('trackingnumber','alpha'));
if ($action == 'settrackingurl') $object->tracking_url = trim(GETPOST('trackingurl','int'));
if ($action == 'settrueWeight') {
$object->trueWeight = trim(GETPOST('trueWeight','int'));
$object->weight_units = GETPOST('weight_units','int');
}
if ($action == 'settrueWidth') $object->trueWidth = trim(GETPOST('trueWidth','int'));
if ($action == 'settrueHeight'){
$object->trueHeight = trim(GETPOST('trueHeight','int'));
$object->size_units = GETPOST('size_units','int');
}
if ($action == 'settrueDepth') $object->trueDepth = trim(GETPOST('trueDepth','int'));
if ($action == 'setshipping_method_id') $object->shipping_method_id = trim(GETPOST('shipping_method_id','int'));
if (! $error)
{
if ($object->update($user) >= 0)
{
$db->commit();
header("Location: fiche.php?id=".$object->id);
exit;
}
setEventMessage($object->error,'errors');
else
{
$db->rollback();
$_GET["commande_id"]=GETPOST('commande_id','int');
$action='create';
}
}
$action="";
}
// Build document
else if ($action == 'builddoc') // En get ou en post
{
// Save last template used to generate document
if (GETPOST('model')) $object->setDocModel($user, GETPOST('model','alpha'));
// Define output language
$outputlangs = $langs;
$newlang='';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id','alpha');
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$shipment->client->default_lang;
if (! empty($newlang))
/*
* Build a receiving receipt
*/
else if ($action == 'create_delivery' && $conf->livraison_bon->enabled && $user->rights->expedition->livraison->creer)
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang);
$result = $object->create_delivery($user);
if ($result > 0)
{
header("Location: ".DOL_URL_ROOT.'/livraison/fiche.php?id='.$result);
exit;
}
else
{
$mesg=$object->error;
}
}
$result=expedition_pdf_create($db,$object,$object->modelpdf,$outputlangs);
if ($result <= 0)
else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->expedition->valider)
{
dol_print_error($db,$result);
exit;
$object->fetch_thirdparty();
$result = $object->valid($user);
// Define output language
$outputlangs = $langs;
$newlang='';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id','alpha');
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
if (! empty($newlang))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang);
}
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
{
$ret=$object->fetch($id); // Reload to get new records
$result=expedition_pdf_create($db,$object,$object->modelpdf,$outputlangs, $hidedetails, $hidedesc, $hideref);
}
if ($result < 0)
{
dol_print_error($db,$result);
exit;
}
}
}
// Delete file in doc form
elseif ($action == 'remove_file')
{
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$upload_dir = $conf->expedition->dir_output . "/sending";
$file = $upload_dir . '/' . GETPOST('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');
}
/*
* Add file in email form
*/
if (GETPOST('addfile','alpha'))
{
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
// Set tmp user directory TODO Use a dedicated directory for temp mails files
$vardir=$conf->user->dir_output."/".$user->id;
$upload_dir_tmp = $vardir.'/temp';
dol_add_file_process($upload_dir_tmp,0,0);
$action ='presend';
}
/*
* Remove file in email form
*/
if (GETPOST('removedfile','alpha'))
{
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
// Set tmp user directory
$vardir=$conf->user->dir_output."/".$user->id;
$upload_dir_tmp = $vardir.'/temp';
// TODO Delete only files that was uploaded from email form
dol_remove_file_process(GETPOST('removedfile','int'),0);
$action ='presend';
}
/*
* Send mail
*/
if ($action == 'send' && ! GETPOST('addfile','alpha') && ! GETPOST('removedfile','alpha') && ! GETPOST('cancel','alpha'))
{
$langs->load('mails');
// $ref = dol_sanitizeFileName($object->ref);
// $file = $conf->expedition->dir_output . '/sending/' . $ref . '/' . $ref . '.pdf';
// if (is_readable($file))
// {
if (GETPOST('sendto','alpha'))
{
// Le destinataire a ete fourni via le champ libre
$sendto = GETPOST('sendto','alpha');
$sendtoid = 0;
}
elseif (GETPOST('receiver','alpha') != '-1')
{
// Recipient was provided from combo list
if (GETPOST('receiver','alpha') == 'thirdparty') // Id of third party
{
$sendto = $object->client->email;
$sendtoid = 0;
}
else // Id du contact
{
$sendto = $object->client->contact_get_property(GETPOST('receiver','alpha'),'email');
$sendtoid = GETPOST('receiver','alpha');
}
}
if (dol_strlen($sendto))
{
$langs->load("commercial");
$from = GETPOST('fromname','alpha') . ' <' . GETPOST('frommail','alpha') .'>';
$replyto = GETPOST('replytoname','alpha'). ' <' . GETPOST('replytomail','alpha').'>';
$message = GETPOST('message');
$sendtocc = GETPOST('sendtocc','alpha');
$deliveryreceipt = GETPOST('deliveryreceipt','alpha');
if ($action == 'send')
{
if (dol_strlen(GETPOST('subject','alpha'))) $subject=GETPOST('subject','alpha');
else $subject = $langs->transnoentities('Shipping').' '.$object->ref;
$actiontypecode='AC_SHIP';
$actionmsg = $langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto.".\n";
if ($message)
{
$actionmsg.=$langs->transnoentities('MailTopic').": ".$subject."\n";
$actionmsg.=$langs->transnoentities('TextUsedInTheMessageBody').":\n";
$actionmsg.=$message;
}
$actionmsg2=$langs->transnoentities('Action'.$actiontypecode);
}
// Create form object
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$formmail = new FormMail($db);
$attachedfiles=$formmail->get_attached_files();
$filepath = $attachedfiles['paths'];
$filename = $attachedfiles['names'];
$mimetype = $attachedfiles['mimes'];
// Send mail
require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
$mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,'',$deliveryreceipt,-1);
if ($mailfile->error)
{
$mesg='<div class="error">'.$mailfile->error.'</div>';
}
else
{
$result=$mailfile->sendfile();
if ($result)
{
$error=0;
// Initialisation donnees
$object->sendtoid = $sendtoid;
$object->actiontypecode = $actiontypecode;
$object->actionmsg = $actionmsg;
$object->actionmsg2 = $actionmsg2;
$object->fk_element = $object->id;
$object->elementtype = $object->element;
// Appel des triggers
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
$interface=new Interfaces($db);
$result=$interface->run_triggers('SHIPPING_SENTBYMAIL',$object,$user,$langs,$conf);
if ($result < 0) {
$error++; $object->errors=$interface->errors;
}
// Fin appel triggers
if ($error)
{
dol_print_error($db);
}
else
{
// Redirect here
// This avoid sending mail twice if going out and then back to page
$mesg=$langs->trans('MailSuccessfulySent',$mailfile->getValidAddress($from,2),$mailfile->getValidAddress($sendto,2));
setEventMessage($mesg);
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
exit;
}
}
else
{
$langs->load("other");
$mesg='<div class="error">';
if ($mailfile->error)
{
$mesg.=$langs->trans('ErrorFailedToSendMail',$from,$sendto);
$mesg.='<br>'.$mailfile->error;
}
else
{
$mesg.='No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS';
}
$mesg.='</div>';
}
}
}
else
{
$langs->load("other");
$mesg='<div class="error">'.$langs->trans('ErrorMailRecipientIsEmpty').' !</div>';
$action='presend';
dol_syslog('Recipient email is empty');
}
/* }
else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->expedition->supprimer)
{
$result = $object->delete();
if ($result > 0)
{
header("Location: ".DOL_URL_ROOT.'/expedition/index.php');
exit;
}
else
{
$langs->load("errors");
$mesg='<div class="error">'.$langs->trans('ErrorCantReadFile',$file).'</div>';
dol_syslog('Failed to read file: '.$file);
}*/
}
setEventMessage($langs->trans($object->error),'errors');
}
}
else if ($action == 'classifybilled')
{
$object->fetch($id);
$object->set_billed();
}
else if ($action == 'reopen' && $user->rights->expedition->valider)
{
$result = $object->setStatut(0);
if ($result < 0)
{
$mesg = $object->error;
}
}
else if ($action == 'setdate_livraison' && $user->rights->expedition->creer)
{
//print "x ".$_POST['liv_month'].", ".$_POST['liv_day'].", ".$_POST['liv_year'];
$datedelivery=dol_mktime(GETPOST('liv_hour','int'), GETPOST('liv_min','int'), 0, GETPOST('liv_month','int'), GETPOST('liv_day','int'), GETPOST('liv_year','int'));
$object->fetch($id);
$result=$object->set_date_livraison($user,$datedelivery);
if ($result < 0)
{
$mesg='<div class="error">'.$object->error.'</div>';
}
}
// Action update description of emailing
else if ($action == 'settrackingnumber' || $action == 'settrackingurl'
|| $action == 'settrueWeight'
|| $action == 'settrueWidth'
|| $action == 'settrueHeight'
|| $action == 'settrueDepth'
|| $action == 'setshipping_method_id')
{
$error=0;
if ($action == 'settrackingnumber') $object->tracking_number = trim(GETPOST('trackingnumber','alpha'));
if ($action == 'settrackingurl') $object->tracking_url = trim(GETPOST('trackingurl','int'));
if ($action == 'settrueWeight') {
$object->trueWeight = trim(GETPOST('trueWeight','int'));
$object->weight_units = GETPOST('weight_units','int');
}
if ($action == 'settrueWidth') $object->trueWidth = trim(GETPOST('trueWidth','int'));
if ($action == 'settrueHeight'){
$object->trueHeight = trim(GETPOST('trueHeight','int'));
$object->size_units = GETPOST('size_units','int');
}
if ($action == 'settrueDepth') $object->trueDepth = trim(GETPOST('trueDepth','int'));
if ($action == 'setshipping_method_id') $object->shipping_method_id = trim(GETPOST('shipping_method_id','int'));
if (! $error)
{
if ($object->update($user) >= 0)
{
header("Location: fiche.php?id=".$object->id);
exit;
}
setEventMessage($object->error,'errors');
}
$action="";
}
// Build document
else if ($action == 'builddoc') // En get ou en post
{
// Save last template used to generate document
if (GETPOST('model')) $object->setDocModel($user, GETPOST('model','alpha'));
// Define output language
$outputlangs = $langs;
$newlang='';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id','alpha');
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$shipment->client->default_lang;
if (! empty($newlang))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang);
}
$result=expedition_pdf_create($db,$object,$object->modelpdf,$outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result <= 0)
{
dol_print_error($db,$result);
exit;
}
}
// Delete file in doc form
elseif ($action == 'remove_file')
{
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$upload_dir = $conf->expedition->dir_output . "/sending";
$file = $upload_dir . '/' . GETPOST('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');
}
/*
* Add file in email form
*/
if (GETPOST('addfile','alpha'))
{
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
// Set tmp user directory TODO Use a dedicated directory for temp mails files
$vardir=$conf->user->dir_output."/".$user->id;
$upload_dir_tmp = $vardir.'/temp';
dol_add_file_process($upload_dir_tmp,0,0);
$action ='presend';
}
/*
* Remove file in email form
*/
if (GETPOST('removedfile','alpha'))
{
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
// Set tmp user directory
$vardir=$conf->user->dir_output."/".$user->id;
$upload_dir_tmp = $vardir.'/temp';
// TODO Delete only files that was uploaded from email form
dol_remove_file_process(GETPOST('removedfile','int'),0);
$action ='presend';
}
/*
* Send mail
*/
if ($action == 'send' && ! GETPOST('addfile','alpha') && ! GETPOST('removedfile','alpha') && ! GETPOST('cancel','alpha'))
{
$langs->load('mails');
// $ref = dol_sanitizeFileName($object->ref);
// $file = $conf->expedition->dir_output . '/sending/' . $ref . '/' . $ref . '.pdf';
// if (is_readable($file))
// {
if (GETPOST('sendto','alpha'))
{
// Le destinataire a ete fourni via le champ libre
$sendto = GETPOST('sendto','alpha');
$sendtoid = 0;
}
elseif (GETPOST('receiver','alpha') != '-1')
{
// Recipient was provided from combo list
if (GETPOST('receiver','alpha') == 'thirdparty') // Id of third party
{
$sendto = $object->client->email;
$sendtoid = 0;
}
else // Id du contact
{
$sendto = $object->client->contact_get_property(GETPOST('receiver','alpha'),'email');
$sendtoid = GETPOST('receiver','alpha');
}
}
if (dol_strlen($sendto))
{
$langs->load("commercial");
$from = GETPOST('fromname','alpha') . ' <' . GETPOST('frommail','alpha') .'>';
$replyto = GETPOST('replytoname','alpha'). ' <' . GETPOST('replytomail','alpha').'>';
$message = GETPOST('message');
$sendtocc = GETPOST('sendtocc','alpha');
$deliveryreceipt = GETPOST('deliveryreceipt','alpha');
if ($action == 'send')
{
if (dol_strlen(GETPOST('subject','alpha'))) $subject=GETPOST('subject','alpha');
else $subject = $langs->transnoentities('Shipping').' '.$object->ref;
$actiontypecode='AC_SHIP';
$actionmsg = $langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto.".\n";
if ($message)
{
$actionmsg.=$langs->transnoentities('MailTopic').": ".$subject."\n";
$actionmsg.=$langs->transnoentities('TextUsedInTheMessageBody').":\n";
$actionmsg.=$message;
}
$actionmsg2=$langs->transnoentities('Action'.$actiontypecode);
}
// Create form object
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$formmail = new FormMail($db);
$attachedfiles=$formmail->get_attached_files();
$filepath = $attachedfiles['paths'];
$filename = $attachedfiles['names'];
$mimetype = $attachedfiles['mimes'];
// Send mail
require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
$mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,'',$deliveryreceipt,-1);
if ($mailfile->error)
{
$mesg='<div class="error">'.$mailfile->error.'</div>';
}
else
{
$result=$mailfile->sendfile();
if ($result)
{
$error=0;
// Initialisation donnees
$object->sendtoid = $sendtoid;
$object->actiontypecode = $actiontypecode;
$object->actionmsg = $actionmsg;
$object->actionmsg2 = $actionmsg2;
$object->fk_element = $object->id;
$object->elementtype = $object->element;
// Appel des triggers
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
$interface=new Interfaces($db);
$result=$interface->run_triggers('SHIPPING_SENTBYMAIL',$object,$user,$langs,$conf);
if ($result < 0) {
$error++; $object->errors=$interface->errors;
}
// Fin appel triggers
if ($error)
{
dol_print_error($db);
}
else
{
// Redirect here
// This avoid sending mail twice if going out and then back to page
$mesg=$langs->trans('MailSuccessfulySent',$mailfile->getValidAddress($from,2),$mailfile->getValidAddress($sendto,2));
setEventMessage($mesg);
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
exit;
}
}
else
{
$langs->load("other");
$mesg='<div class="error">';
if ($mailfile->error)
{
$mesg.=$langs->trans('ErrorFailedToSendMail',$from,$sendto);
$mesg.='<br>'.$mailfile->error;
}
else
{
$mesg.='No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS';
}
$mesg.='</div>';
}
}
}
else
{
$langs->load("other");
$mesg='<div class="error">'.$langs->trans('ErrorMailRecipientIsEmpty').' !</div>';
$action='presend';
dol_syslog('Recipient email is empty');
}
/* }
else
{
$langs->load("errors");
$mesg='<div class="error">'.$langs->trans('ErrorCantReadFile',$file).'</div>';
dol_syslog('Failed to read file: '.$file);
}*/
}
else if ($action == 'classifybilled')
{
$object->fetch($id);
$object->set_billed();
}
}
/*
* View
@@ -705,6 +706,14 @@ if ($action == 'create')
print '<td colspan="3">';
print '<input name="tracking_number" size="20" value="'.GETPOST('tracking_number','alpha').'">';
print "</td></tr>\n";
// Document model
print "<tr><td>".$langs->trans("Model")."</td>";
print '<td colspan="3">';
include_once DOL_DOCUMENT_ROOT . '/core/modules/expedition/modules_expedition.php';
$liste = ModelePdfExpedition::liste_modeles($db);
print $form->selectarray('model', $liste, $conf->global->EXPEDITION_ADDON_PDF);
print "</td></tr>\n";
// Other attributes
$parameters=array('colspan' => ' colspan="3"');

View File

@@ -328,7 +328,7 @@ class Export
function conditionDate($Field, $Value, $Sens)
{
// TODO date_format is forbidden, not performant and not portable. Use instead BETWEEN
if (strlen($Value)==4) $Condition=" date_format(".$Field.",'%Y') ".$Sens." ".$Value;
if (strlen($Value)==4) $Condition=" date_format(".$Field.",'%Y') ".$Sens." '".$Value."'";
elseif (strlen($Value)==6) $Condition=" date_format(".$Field.",'%Y%m') ".$Sens." '".$Value."'";
else $Condition=" date_format(".$Field.",'%Y%m%d') ".$Sens." ".$Value;
return $Condition;

View File

@@ -599,25 +599,33 @@ class Fichinter extends CommonObject
global $conf, $db, $langs;
$langs->load("interventions");
$dir = DOL_DOCUMENT_ROOT . "/core/modules/fichinter/";
if (! empty($conf->global->FICHEINTER_ADDON))
{
$file = $conf->global->FICHEINTER_ADDON.".php";
$classname = $conf->global->FICHEINTER_ADDON;
if (! file_exists($dir.$file))
{
$file='mod_'.$file;
$classname='mod_'.$classname;
$mybool = false;
$file = "mod_".$conf->global->FICHEINTER_ADDON.".php";
$classname = "mod_".$conf->global->FICHEINTER_ADDON;
// Include file with class
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
foreach ($dirmodels as $reldir) {
$dir = dol_buildpath($reldir."core/modules/fichinter/");
// Load file with numbering class (if found)
$mybool|=@include_once $dir.$file;
}
// Chargement de la classe de numerotation
require_once $dir.$file;
if (! $mybool)
{
dol_print_error('',"Failed to include file ".$file);
return '';
}
$obj = new $classname();
$numref = "";
$numref = $obj->getNumRef($soc,$this);
$numref = $obj->getNextValue($soc,$this);
if ( $numref != "")
{
@@ -631,6 +639,7 @@ class Fichinter extends CommonObject
}
else
{
$langs->load("errors");
print $langs->trans("Error")." ".$langs->trans("Error_FICHEINTER_ADDON_NotDefined");
return "";
}

View File

@@ -29,7 +29,7 @@
* \brief File that include conf.php file and commons lib like functions.lib.php
*/
if (! defined('DOL_VERSION')) define('DOL_VERSION','3.6.2');
if (! defined('DOL_VERSION')) define('DOL_VERSION','3.6.4');
if (! defined('EURO')) define('EURO',chr(128));
// Define syslog constants

View File

@@ -551,44 +551,50 @@ class CommandeFournisseur extends CommonOrder
global $db, $langs, $conf;
$langs->load("orders");
$dir = DOL_DOCUMENT_ROOT .'/core/modules/supplier_order/';
if (! empty($conf->global->COMMANDE_SUPPLIER_ADDON_NUMBER))
{
$mybool = false;
$file = $conf->global->COMMANDE_SUPPLIER_ADDON_NUMBER.'.php';
$classname=$conf->global->COMMANDE_SUPPLIER_ADDON_NUMBER;
if (is_readable($dir.'/'.$file))
// Include file with class
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
foreach ($dirmodels as $reldir) {
$dir = dol_buildpath($reldir."core/modules/supplier_order/");
// Load file with numbering class (if found)
$mybool|=@include_once $dir.$file;
}
if (! $mybool)
{
// Definition du nom de modele de numerotation de commande fournisseur
$modName=$conf->global->COMMANDE_SUPPLIER_ADDON_NUMBER;
require_once $dir.'/'.$file;
dol_print_error('',"Failed to include file ".$file);
return '';
}
// Recuperation de la nouvelle reference
$objMod = new $modName($this->db);
$obj = new $classname();
$numref = "";
$numref = $obj->getNextValue($soc,$this);
$numref = "";
$numref = $objMod->commande_get_num($soc,$this);
if ( $numref != "")
{
return $numref;
}
else
{
dol_print_error($db, get_class($this)."::getNextNumRef ".$obj->error);
return -1;
}
if ( $numref != "")
{
return $numref;
}
else
{
print $langs->trans("Error")." ".$langs->trans("Error_FailedToLoad_COMMANDE_SUPPLIER_ADDON_File",$conf->global->COMMANDE_SUPPLIER_ADDON_NUMBER);
return -2;
$this->error = $obj->error;
dol_print_error($db, get_class($this)."::getNextNumRef ".$obj->error);
return "";
}
}
else
{
print $langs->trans("Error")." ".$langs->trans("Error_COMMANDE_SUPPLIER_ADDON_NotDefined");
return -3;
$langs->load("errors");
print $langs->trans("Error")." ".$langs->trans("ErrorModuleSetupNotComplete");
return "";
}
}

View File

@@ -1497,10 +1497,14 @@ class FactureFournisseur extends CommonInvoice
$file = $conf->global->INVOICE_SUPPLIER_ADDON_NUMBER.".php";
$classname = $conf->global->INVOICE_SUPPLIER_ADDON_NUMBER;
// Include file with class
foreach ($conf->file->dol_document_root as $dirroot)
{
$dir = $dirroot."/core/modules/supplier_invoice/";
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
foreach ($dirmodels as $reldir) {
$dir = dol_buildpath($reldir."core/modules/supplier_invoice/");
// Load file with numbering class (if found)
$mybool|=@include_once $dir.$file;
}

View File

@@ -522,8 +522,16 @@ else if ($action == 'confirm_approve' && $confirm == 'yes' && $user->rights->fou
$result = $object->approve($user, $idwarehouse);
if ($result > 0)
{
$outputlangs = $langs;
if (GETPOST('lang_id'))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang(GETPOST('lang_id'));
}
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
supplier_order_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
$ret=$object->fetch($object->id); // Reload to get new records
supplier_order_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id);
exit;
@@ -554,8 +562,16 @@ else if ($action == 'confirm_commande' && $confirm == 'yes' && $user->rights->fo
$result = $object->commande($user, $_REQUEST["datecommande"], $_REQUEST["methode"], $_REQUEST['comment']);
if ($result > 0)
{
$outputlangs = $langs;
if (GETPOST('lang_id'))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang(GETPOST('lang_id'));
}
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
supplier_order_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
$ret=$object->fetch($object->id); // Reload to get new records
supplier_order_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id);
exit;

View File

@@ -7,6 +7,7 @@
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -521,6 +522,10 @@ elseif ($action == 'update_line' && $user->rights->fournisseur->facture->creer)
$localtax2_tx= get_localtax($_POST['tauxtva'], 2, $mysoc,$object->thirdparty);
$remise_percent=GETPOST('remise_percent');
if (empty($remise_percent)) {
$remise_percent = 0;
}
$result=$object->updateline(GETPOST('lineid'), $label, $pu, GETPOST('tauxtva'), $localtax1_tx, $localtax2_tx, GETPOST('qty'), GETPOST('idprod'), $price_base_type, 0, $type, $remise_percent);
if ($result >= 0)
{
@@ -1500,12 +1505,7 @@ else
if ($objectref == 'PROV')
{
$savdate=$object->date;
if (! empty($conf->global->FAC_FORCE_DATE_VALIDATION))
{
$object->date=dol_now();
//TODO: Possibly will have to control payment information into suppliers
//$object->date_lim_reglement=$object->calculate_date_lim_reglement();
}
$numref = $object->getNextNumRef($societe);
}
else

View File

@@ -5,6 +5,7 @@
* Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -27,9 +28,9 @@
*/
require '../../main.inc.php';
require DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
require DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
require DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php';
$langs->load('companies');
$langs->load('bills');
@@ -68,164 +69,166 @@ $hookmanager->initHooks(array('paymentsupplier'));
$parameters=array('socid'=>$socid);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
/*
* Actions
*/
if ($action == 'add_paiement' || ($action == 'confirm_paiement' && $confirm=='yes'))
{
$error = 0;
if (empty($reshook)) {
$datepaye = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
$paiement_id = 0;
$totalpayment = 0;
$atleastonepaymentnotnull = 0;
// Generate payment array and check if there is payment higher than invoice and payment date before invoice date
$tmpinvoice=new FactureFournisseur($db);
foreach ($_POST as $key => $value)
/*
* Actions
*/
if ($action == 'add_paiement' || ($action == 'confirm_paiement' && $confirm=='yes'))
{
if (substr($key,0,7) == 'amount_')
$error = 0;
$datepaye = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
$paiement_id = 0;
$totalpayment = 0;
$atleastonepaymentnotnull = 0;
// Generate payment array and check if there is payment higher than invoice and payment date before invoice date
$tmpinvoice=new FactureFournisseur($db);
foreach ($_POST as $key => $value)
{
$cursorfacid = substr($key,7);
$amounts[$cursorfacid] = price2num(trim(GETPOST($key)));
$totalpayment = $totalpayment + $amounts[$cursorfacid];
if (! empty($amounts[$cursorfacid])) $atleastonepaymentnotnull++;
$result=$tmpinvoice->fetch($cursorfacid);
if ($result <= 0) dol_print_error($db);
$amountsresttopay[$cursorfacid]=price2num($tmpinvoice->total_ttc - $tmpinvoice->getSommePaiement());
if ($amounts[$cursorfacid])
if (substr($key,0,7) == 'amount_')
{
// Check amount
if ($amounts[$cursorfacid] && (abs($amounts[$cursorfacid]) > abs($amountsresttopay[$cursorfacid])))
{
$addwarning=1;
$formquestion['text'] = img_warning($langs->trans("PaymentHigherThanReminderToPaySupplier")).' '.$langs->trans("HelpPaymentHigherThanReminderToPaySupplier");
}
// Check date
if ($datepaye && ($datepaye < $tmpinvoice->date))
{
$langs->load("errors");
//$error++;
setEventMessage($langs->transnoentities("WarningPaymentDateLowerThanInvoiceDate", dol_print_date($datepaye,'day'), dol_print_date($tmpinvoice->date, 'day'), $tmpinvoice->ref), 'warnings');
}
$cursorfacid = substr($key,7);
$amounts[$cursorfacid] = price2num(trim(GETPOST($key)));
$totalpayment = $totalpayment + $amounts[$cursorfacid];
if (! empty($amounts[$cursorfacid])) $atleastonepaymentnotnull++;
$result=$tmpinvoice->fetch($cursorfacid);
if ($result <= 0) dol_print_error($db);
$amountsresttopay[$cursorfacid]=price2num($tmpinvoice->total_ttc - $tmpinvoice->getSommePaiement());
if ($amounts[$cursorfacid])
{
// Check amount
if ($amounts[$cursorfacid] && (abs($amounts[$cursorfacid]) > abs($amountsresttopay[$cursorfacid])))
{
$addwarning=1;
$formquestion['text'] = img_warning($langs->trans("PaymentHigherThanReminderToPaySupplier")).' '.$langs->trans("HelpPaymentHigherThanReminderToPaySupplier");
}
// Check date
if ($datepaye && ($datepaye < $tmpinvoice->date))
{
$langs->load("errors");
//$error++;
setEventMessage($langs->transnoentities("WarningPaymentDateLowerThanInvoiceDate", dol_print_date($datepaye,'day'), dol_print_date($tmpinvoice->date, 'day'), $tmpinvoice->ref), 'warnings');
}
}
$formquestion[$i++]=array('type' => 'hidden','name' => $key, 'value' => $_POST[$key]);
}
$formquestion[$i++]=array('type' => 'hidden','name' => $key, 'value' => $_POST[$key]);
}
}
// Check parameters
if ($_POST['paiementid'] <= 0)
{
setEventMessage($langs->transnoentities('ErrorFieldRequired',$langs->transnoentities('PaymentMode')), 'errors');
$error++;
}
if (! empty($conf->banque->enabled))
{
// If bank module is on, account is required to enter a payment
if (GETPOST('accountid') <= 0)
// Check parameters
if ($_POST['paiementid'] <= 0)
{
setEventMessage($langs->transnoentities('ErrorFieldRequired',$langs->transnoentities('AccountToCredit')), 'errors');
setEventMessage($langs->transnoentities('ErrorFieldRequired',$langs->transnoentities('PaymentMode')), 'errors');
$error++;
}
if (! empty($conf->banque->enabled))
{
// If bank module is on, account is required to enter a payment
if (GETPOST('accountid') <= 0)
{
setEventMessage($langs->transnoentities('ErrorFieldRequired',$langs->transnoentities('AccountToCredit')), 'errors');
$error++;
}
}
if (empty($totalpayment) && empty($atleastonepaymentnotnull))
{
setEventMessage($langs->transnoentities('ErrorFieldRequired',$langs->trans('PaymentAmount')), 'errors');
$error++;
}
if (empty($datepaye))
{
setEventMessage($langs->transnoentities('ErrorFieldRequired',$langs->transnoentities('Date')), 'errors');
$error++;
}
}
if (empty($totalpayment) && empty($atleastonepaymentnotnull))
/*
* Action add_paiement
*/
if ($action == 'add_paiement')
{
setEventMessage($langs->transnoentities('ErrorFieldRequired',$langs->trans('PaymentAmount')), 'errors');
$error++;
}
if (empty($datepaye))
{
setEventMessage($langs->transnoentities('ErrorFieldRequired',$langs->transnoentities('Date')), 'errors');
$error++;
}
}
/*
* Action add_paiement
*/
if ($action == 'add_paiement')
{
if ($error)
{
$action = 'create';
}
// Le reste propre a cette action s'affiche en bas de page.
}
/*
* Action confirm_paiement
*/
if ($action == 'confirm_paiement' && $confirm == 'yes')
{
$error=0;
$datepaye = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
if (! $error)
{
$db->begin();
// Creation de la ligne paiement
$paiement = new PaiementFourn($db);
$paiement->datepaye = $datepaye;
$paiement->amounts = $amounts; // Array of amounts
$paiement->paiementid = $_POST['paiementid'];
$paiement->num_paiement = $_POST['num_paiement'];
$paiement->note = $_POST['comment'];
if (! $error)
if ($error)
{
$paiement_id = $paiement->create($user,(GETPOST('closepaidinvoices')=='on'?1:0));
if ($paiement_id < 0)
{
setEventMessage($paiement->error, 'errors');
$error++;
}
$action = 'create';
}
// Le reste propre a cette action s'affiche en bas de page.
}
/*
* Action confirm_paiement
*/
if ($action == 'confirm_paiement' && $confirm == 'yes')
{
$error=0;
$datepaye = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
if (! $error)
{
$result=$paiement->addPaymentToBank($user,'payment_supplier','(SupplierInvoicePayment)',$_POST['accountid'],'','');
if ($result < 0)
{
setEventMessage($paiement->error, 'errors');
$error++;
}
}
$db->begin();
if (! $error)
{
$db->commit();
// If payment dispatching on more than one invoice, we keep on summary page, otherwise go on invoice card
$invoiceid=0;
foreach ($paiement->amounts as $key => $amount)
// Creation de la ligne paiement
$paiement = new PaiementFourn($db);
$paiement->datepaye = $datepaye;
$paiement->amounts = $amounts; // Array of amounts
$paiement->paiementid = $_POST['paiementid'];
$paiement->num_paiement = $_POST['num_paiement'];
$paiement->note = $_POST['comment'];
if (! $error)
{
$facid = $key;
if (is_numeric($amount) && $amount <> 0)
$paiement_id = $paiement->create($user,(GETPOST('closepaidinvoices')=='on'?1:0));
if ($paiement_id < 0)
{
if ($invoiceid != 0) $invoiceid=-1; // There is more than one invoice payed by this payment
else $invoiceid=$facid;
setEventMessage($paiement->error, 'errors');
$error++;
}
}
if ($invoiceid > 0) $loc = DOL_URL_ROOT.'/fourn/facture/fiche.php?facid='.$invoiceid;
else $loc = DOL_URL_ROOT.'/fourn/paiement/fiche.php?id='.$paiement_id;
header('Location: '.$loc);
exit;
}
else
{
$db->rollback();
if (! $error)
{
$result=$paiement->addPaymentToBank($user,'payment_supplier','(SupplierInvoicePayment)',$_POST['accountid'],'','');
if ($result < 0)
{
setEventMessage($paiement->error, 'errors');
$error++;
}
}
if (! $error)
{
$db->commit();
// If payment dispatching on more than one invoice, we keep on summary page, otherwise go on invoice card
$invoiceid=0;
foreach ($paiement->amounts as $key => $amount)
{
$facid = $key;
if (is_numeric($amount) && $amount <> 0)
{
if ($invoiceid != 0) $invoiceid=-1; // There is more than one invoice payed by this payment
else $invoiceid=$facid;
}
}
if ($invoiceid > 0) $loc = DOL_URL_ROOT.'/fourn/facture/fiche.php?facid='.$invoiceid;
else $loc = DOL_URL_ROOT.'/fourn/paiement/fiche.php?id='.$paiement_id;
header('Location: '.$loc);
exit;
}
else
{
$db->rollback();
}
}
}
}
/*
* View
*/
@@ -445,7 +448,7 @@ if (empty($action))
$sql = 'SELECT p.rowid as pid, p.datep as dp, p.amount as pamount, p.num_paiement,';
$sql.= ' s.rowid as socid, s.nom,';
$sql.= ' c.libelle as paiement_type,';
$sql.= ' c.code as paiement_type, c.libelle as paiement_libelle,';
$sql.= ' ba.rowid as bid, ba.label,';
if (!$user->rights->societe->client->voir) $sql .= ' sc.fk_soc, sc.fk_user,';
$sql.= ' SUM(f.amount)';
@@ -484,7 +487,7 @@ if (empty($action))
{
$sql .= " AND s.nom LIKE '%".$db->escape($search_company)."%'";
}
$sql.= " GROUP BY p.rowid, p.datep, p.amount, p.num_paiement, s.rowid, s.nom, c.libelle, ba.rowid, ba.label";
$sql.= " GROUP BY p.rowid, p.datep, p.amount, p.num_paiement, s.rowid, s.nom, c.code, c.libelle, ba.rowid, ba.label";
if (!$user->rights->societe->client->voir) $sql .= ", sc.fk_soc, sc.fk_user";
$sql.= $db->order($sortfield,$sortorder);
$sql.= $db->plimit($limit+1, $offset);
@@ -556,7 +559,9 @@ if (empty($action))
else print '&nbsp;';
print '</td>';
print '<td>'.dol_trunc($objp->paiement_type.' '.$objp->num_paiement,32)."</td>\n";
$payment_type = $langs->trans("PaymentType".$objp->paiement_type)!=("PaymentType".$objp->paiement_type)?$langs->trans("PaymentType".$objp->paiement_type):$objp->paiement_libelle;
print '<td>'.$payment_type.' '.dol_trunc($objp->num_paiement,32)."</td>\n";
print '<td>';
if ($objp->bid) print '<a href="'.DOL_URL_ROOT.'/compta/bank/account.php?account='.$objp->bid.'">'.img_object($langs->trans("ShowAccount"),'account').' '.dol_trunc($objp->label,24).'</a>';

View File

@@ -54,40 +54,41 @@ $hookmanager->initHooks(array('suppliercard'));
$parameters = array('id' => $id);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
/*
* Action
*/
if (empty($reshook)) {
/*
* Action
*/
if ($action == 'setsupplieraccountancycode')
{
$cancelbutton = GETPOST('cancel');
if ($action == 'setsupplieraccountancycode')
{
$cancelbutton = GETPOST('cancel');
if (!$cancelbutton) {
if (!$cancelbutton) {
$result = $object->fetch($id);
$object->code_compta_fournisseur = $_POST["supplieraccountancycode"];
$result = $object->update($object->id, $user, 1, 0, 1);
if ($result < 0) {
$mesg = join(',', $object->errors);
$result = $object->fetch($id);
$object->code_compta_fournisseur = $_POST["supplieraccountancycode"];
$result = $object->update($object->id, $user, 1, 0, 1);
if ($result < 0) {
$mesg = join(',', $object->errors);
}
$action = "";
}
$action = "";
}
// conditions de reglement
if ($action == 'setconditions' && $user->rights->societe->creer)
{
$object->fetch($id);
$result=$object->setPaymentTerms(GETPOST('cond_reglement_supplier_id','int'));
if ($result < 0) dol_print_error($db,$object->error);
}
// mode de reglement
if ($action == 'setmode' && $user->rights->societe->creer)
{
$object->fetch($id);
$result=$object->setPaymentMethods(GETPOST('mode_reglement_supplier_id','int'));
if ($result < 0) dol_print_error($db,$object->error);
}
}
// conditions de reglement
if ($action == 'setconditions' && $user->rights->societe->creer)
{
$object->fetch($id);
$result=$object->setPaymentTerms(GETPOST('cond_reglement_supplier_id','int'));
if ($result < 0) dol_print_error($db,$object->error);
}
// mode de reglement
if ($action == 'setmode' && $user->rights->societe->creer)
{
$object->fetch($id);
$result=$object->setPaymentMethods(GETPOST('mode_reglement_supplier_id','int'));
if ($result < 0) dol_print_error($db,$object->error);
}
/*
* View

View File

@@ -26,10 +26,10 @@
*/
require '../../main.inc.php';
require DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php';
require DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
require DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
require DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
$langs->load('bills');
$langs->load('banks');

View File

@@ -115,7 +115,7 @@ ALTER TABLE llx_product_fournisseur_price DROP FOREIGN KEY fk_product_fournisseu
-- Fix: deprecated tag to new one
update llx_opensurvey_sondage set format = 'D' where format = 'D+';
update llx_opensurvey_sondage set format = 'A' where format = 'A+';
update llx_opensurvey_sondage set tms = now();
-- ALTER TABLE llx_facture_fourn ALTER COLUMN fk_cond_reglement DROP NOT NULL;

View File

@@ -1014,7 +1014,7 @@ SendingMailSetup=Setup of sendings by email
SendmailOptionNotComplete=Warning, on some Linux systems, to send email from your email, sendmail execution setup must contains option -ba (parameter mail.force_extra_parameters into your php.ini file). If some recipients never receive emails, try to edit this PHP parameter with mail.force_extra_parameters = -ba).
PathToDocuments=Path to documents
PathDirectory=Directory
SendmailOptionMayHurtBuggedMTA=Feature to send mails using method "PHP mail direct" will generate a mail message that might be not correctly parsed by some receiving mail servers. Result is that some mails can't be read by people hosted by thoose bugged platforms. It's case for some Internet providers (Ex: Orange in France). This is not a problem into Dolibarr nor into PHP but onto receiving mail server. You can however add option MAIN_FIX_FOR_BUGGED_MTA to 1 into setup - other to modify Dolibarr to avoid this. However, you may experience problem with other servers that respect strictly the SMTP standard. The other solution (recommanded) is to use the method "SMTP socket library" that has no disadvantages.
SendmailOptionMayHurtBuggedMTA=Feature to send mails using method "PHP mail direct" will generate a mail message that might be not correctly parsed by some receiving mail servers. Result is that some mails can't be read by people hosted by those bugged platforms. It's case for some Internet providers (Ex: Orange in France). This is not a problem into Dolibarr nor into PHP but onto receiving mail server. You can however add option MAIN_FIX_FOR_BUGGED_MTA to 1 into setup - other to modify Dolibarr to avoid this. However, you may experience problem with other servers that respect strictly the SMTP standard. The other solution (recommended) is to use the method "SMTP socket library" that has no disadvantages.
TranslationSetup=Configuration de la traduction
TranslationDesc=Choice of language visible on screen can be modified:<br>* Globally from menu <strong>Home - Setup - Display</strong><br>* For user only from tab <strong>User display</strong> of user card (click on login on top of screen).
TotalNumberOfActivatedModules=Total number of activated feature modules: <b>%s</b>
@@ -1374,9 +1374,9 @@ ListOfAvailableNotifications=List of available notifications (This list depends
SendingsSetup=Sending module setup
SendingsReceiptModel=Sending receipt model
SendingsNumberingModules=Sendings numbering modules
SendingsAbility=Support sendings sheets for customer deliveries
SendingsAbility=Support shipment sheets for customer deliveries
NoNeedForDeliveryReceipts=In most cases, sendings receipts are used both as sheets for customer deliveries (list of products to send) and sheets that is recevied and signed by customer. So product deliveries receipts is a duplicated feature and is rarely activated.
FreeLegalTextOnShippings=Free text on shippings
FreeLegalTextOnShippings=Free text on shipments
##### Deliveries #####
DeliveryOrderNumberingModules=Products deliveries receipt numbering module
DeliveryOrderModel=Products deliveries receipt model
@@ -1387,7 +1387,7 @@ AdvancedEditor=Advanced editor
ActivateFCKeditor=Activate advanced editor for:
FCKeditorForCompany=WYSIWIG creation/edition of elements description and note (except products/services)
FCKeditorForProduct=WYSIWIG creation/edition of products/services description and note
FCKeditorForProductDetails=WYSIWIG creation/edition of products details lines for all entities (proposals, orders, invoices, etc...). <font class="warning">Warning: Using this option for this case is seriously not recommanded as it can create problems with special characters and page formating when building PDF files.</font>
FCKeditorForProductDetails=WYSIWIG creation/edition of products details lines for all entities (proposals, orders, invoices, etc...). <font class="warning">Warning: Using this option for this case is seriously not recommended as it can create problems with special characters and page formating when building PDF files.</font>
FCKeditorForMailing= WYSIWIG creation/edition for mass eMailings (Tools->eMailing)
FCKeditorForUserSignature=WYSIWIG creation/edition of user signature
FCKeditorForMail=WYSIWIG creation/edition for all mail (except Outils->eMailing)

View File

@@ -52,8 +52,8 @@ OrderSentByEMail=Customer order %s sent by EMail
InvoiceSentByEMail=Customer invoice %s sent by EMail
SupplierOrderSentByEMail=Supplier order %s sent by EMail
SupplierInvoiceSentByEMail=Supplier invoice %s sent by EMail
ShippingSentByEMail=Shipping %s sent by EMail
ShippingValidated= Shipping %s validated
ShippingSentByEMail=Shipment %s sent by EMail
ShippingValidated= Shipment %s validated
InterventionSentByEMail=Intervention %s sent by EMail
NewCompanyToDolibarr= Third party created
DateActionPlannedStart= Planned start date

View File

@@ -158,3 +158,5 @@ LabelRIB=BAN Label
NoBANRecord=No BAN record
DeleteARib=Delete BAN record
ConfirmDeleteRib=Are you sure you want to delete this BAN record ?
StartDate=Start date
EndDate=End date

View File

@@ -258,6 +258,7 @@ days=days
Hours=Hours
Minutes=Minutes
Seconds=Seconds
Weeks=Weeks
Today=Today
Yesterday=Yesterday
Tomorrow=Tomorrow

View File

@@ -4,7 +4,7 @@ Sending=Shipment
Sendings=Shipments
Shipment=Shipment
Shipments=Shipments
Receivings=Receivings
Receivings=Receipts
SendingsArea=Shipments area
ListOfSendings=List of shipments
SendingMethod=Shipping method
@@ -14,7 +14,7 @@ SearchASending=Search for shipment
StatisticsOfSendings=Statistics for shipments
NbOfSendings=Number of shipments
NumberOfShipmentsByMonth=Number of shipments by month
SendingCard=Shipping card
SendingCard=Shipment card
NewSending=New shipment
CreateASending=Create a shipment
CreateSending=Create shipment
@@ -37,7 +37,7 @@ StatusSendingCanceledShort=Canceled
StatusSendingDraftShort=Draft
StatusSendingValidatedShort=Validated
StatusSendingProcessedShort=Processed
SendingSheet=Sending sheet
SendingSheet=Shipment sheet
Carriers=Carriers
Carrier=Carrier
CarriersArea=Carriers area
@@ -58,7 +58,7 @@ SendShippingRef=Send shipment %s
ActionsOnShipping=Events on shipment
LinkToTrackYourPackage=Link to track your package
ShipmentCreationIsDoneFromOrder=For the moment, creation of a new shipment is done from the order card.
RelatedShippings=Related shippings
RelatedShippings=Related shipments
ShipmentLine=Shipment line
CarrierList=List of transporters

View File

@@ -116,7 +116,7 @@ MassMovement=Mass movement
MassStockMovement=Mass stock movement
SelectProductInAndOutWareHouse=Select a product, a quantity, a source warehouse and a target warehouse, then click "%s". Once this is done for all required movements, click onto "%s".
RecordMovement=Record transfert
ReceivingForSameOrder=Receivings for this order
ReceivingForSameOrder=Receipts for this order
StockMovementRecorded=Stock movements recorded
RuleForStockAvailability=Rules on stock requirements
StockMustBeEnoughForInvoice=Stock level must be enough to add product/service into invoice

View File

@@ -725,7 +725,7 @@ if (! empty($conf->browser->phone))
// If we force to use jmobile, then we reenable javascript
if (! empty($conf->dol_use_jmobile)) $conf->use_javascript_ajax=1;
// Disabled bugged themes
if (! empty($conf->dol_use_jmobile) && in_array($conf->theme,array('bureau2crea','cameleo')))
if (! empty($conf->dol_use_jmobile) && in_array($conf->theme,array('bureau2crea','cameleo','amarok')))
{
$conf->theme='eldy';
$conf->css = "/theme/".$conf->theme."/style.css.php";
@@ -1682,22 +1682,28 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me
}
}
// Link to bugtrack
if (! empty($conf->global->MAIN_BUGTRACK_ENABLELINK))
{
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
// Link to bugtrack
if (! empty($conf->global->MAIN_BUGTRACK_ENABLELINK))
{
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
$bugbaseurl='https://doliforge.org/tracker/?';
$bugbaseurl.='func=add&group_id=144&atid=246';
$bugbaseurl.="&details=";
$bugbaseurl.=urlencode("\n\n\n\n\n-------------\n");
$bugbaseurl.=urlencode($langs->trans("Version").": ".DOL_VERSION."\n");
$bugbaseurl.=urlencode($langs->trans("Server").": ".$_SERVER["SERVER_SOFTWARE"]."\n");
$bugbaseurl.=urlencode($langs->trans("PHP").": ".version_php()."\n");
$bugbaseurl.=urlencode($langs->trans("Url").": ".$_SERVER["REQUEST_URI"]."\n");
print '<div id="blockvmenubugtracker" class="blockvmenuhelp"><a class="help" target="_blank" href="'.$bugbaseurl.'">'.$langs->trans("FindBug").'</a></div>';
}
print "\n";
$bugbaseurl = 'https://github.com/Dolibarr/dolibarr/issues/new';
$bugbaseurl.= '?title=';
$bugbaseurl.= urlencode("Bug: ");
$bugbaseurl.= '&body=';
$bugbaseurl.= urlencode("# Environment\n");
$bugbaseurl.= urlencode("- **Version**: " . DOL_VERSION . "\n");
$bugbaseurl.= urlencode("- **OS**: " . php_uname('s') . "\n");
$bugbaseurl.= urlencode("- **Web server**: " . $_SERVER["SERVER_SOFTWARE"] . "\n");
$bugbaseurl.= urlencode("- **PHP**: " . php_sapi_name() . ' ' . phpversion() . "\n");
$bugbaseurl.= urlencode("- **Database**: " . $db::LABEL . ' ' . $db->getVersion() . "\n");
$bugbaseurl.= urlencode("- **URL**: " . $_SERVER["REQUEST_URI"] . "\n");
$bugbaseurl.= urlencode("\n");
$bugbaseurl.= urlencode("# Report\n");
print '<p id="blockvmenuhelpbugreport" class="blockvmenuhelp">';
print '<a class="help" target="_blank" href="'.$bugbaseurl.'">'.$langs->trans("FindBug").'</a>';
print '</p>';
}
print "</div>\n";
print "<!-- End left menu -->\n";

View File

@@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2014 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
@@ -21,5 +22,15 @@
* \brief Page d'index du module margin
*/
require 'productMargins.php';
require '../main.inc.php';
if ($user->rights->produit->lire) {
$page = 'productMargins';
} elseif ($user->rights->societe->lire) {
$page = 'customerMargins';
} else {
$page = 'agentMargins';
}
header('Location: '.dol_buildpath('/margin/'.$page.'.php', 1));

View File

@@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2014 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
@@ -56,21 +57,25 @@ function marges_admin_prepare_head()
*/
function marges_prepare_head()
{
global $langs, $conf;
global $langs, $conf, $user;
$langs->load("marges@marges");
$h = 0;
$head = array();
$head[$h][0] = DOL_URL_ROOT."/margin/productMargins.php";
$head[$h][1] = $langs->trans("ProductMargins");
$head[$h][2] = 'productMargins';
$h++;
if ($user->rights->produit->lire) {
$head[$h][0] = DOL_URL_ROOT."/margin/productMargins.php";
$head[$h][1] = $langs->trans("ProductMargins");
$head[$h][2] = 'productMargins';
$h++;
}
$head[$h][0] = DOL_URL_ROOT."/margin/customerMargins.php";
$head[$h][1] = $langs->trans("CustomerMargins");
$head[$h][2] = 'customerMargins';
$h++;
if ($user->rights->societe->lire) {
$head[$h][0] = DOL_URL_ROOT."/margin/customerMargins.php";
$head[$h][1] = $langs->trans("CustomerMargins");
$head[$h][2] = 'customerMargins';
$h++;
}
$head[$h][0] = DOL_URL_ROOT."/margin/agentMargins.php";
$head[$h][1] = $langs->trans("SalesRepresentativeMargins");

View File

@@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2005-2015 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2007-2011 Jean Heimburger <jean@tiaris.info>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
@@ -1482,7 +1482,7 @@ class Product extends CommonObject
$this->date_modification = $obj->tms;
$this->import_key = $obj->import_key;
$this->entity = $obj->entity;
$this->ref_ext = $obj->ref_ext;
$this->db->free($resql);
@@ -3376,7 +3376,7 @@ class Product extends CommonObject
$filename = preg_replace('/'.preg_quote($dir,'/').'/i','',$file); // Nom du fichier
// On efface l'image d'origine
dol_delete_file($file);
dol_delete_file($file, 0, 0, 0, $this); // For triggers
// Si elle existe, on efface la vignette
if (preg_match('/(\.jpg|\.bmp|\.gif|\.png|\.tiff)$/i',$filename,$regs))

View File

@@ -76,13 +76,13 @@ $modulepart='produit';
$parameters=array('id'=>$id);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if (empty($reshook)) {
/*
* Action envoie fichier
*/
/*
* Action envoie fichier
*/
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php';
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_pre_headers.tpl.php';
}
/*
* View

View File

@@ -64,10 +64,6 @@ $hookmanager->initHooks(array('pricesuppliercard'));
$product = new ProductFournisseur($db);
$product->fetch($id,$ref);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$product,$action); // Note that $action and $object may have been modified by some hooks
$error=$hookmanager->error; $errors=$hookmanager->errors;
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
@@ -81,127 +77,130 @@ if (! $sortorder) $sortorder="ASC";
$parameters=array('socid'=>$socid, 'id_prod'=>$id);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
$error=$hookmanager->error; $errors=array_merge($errors, (array) $hookmanager->errors);
if ($action == 'remove_pf')
{
$product = new ProductFournisseur($db);
if ($product->fetch($id) > 0)
{
if ($rowid)
{
$result=$product->remove_product_fournisseur_price($rowid);
$action = '';
$mesg = '<div class="ok">'.$langs->trans("PriceRemoved").'.</div>';
}
}
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
}
if ($action == 'updateprice' && GETPOST('cancel') <> $langs->trans("Cancel"))
{
$id_fourn=GETPOST("id_fourn");
if (empty($id_fourn)) $id_fourn=GETPOST("search_id_fourn");
$ref_fourn=GETPOST("ref_fourn");
if (empty($ref_fourn)) $ref_fourn=GETPOST("search_ref_fourn");
$quantity=GETPOST("qty");
$remise_percent=price2num(GETPOST('remise_percent','alpha'));
$npr = preg_match('/\*/', $_POST['tva_tx']) ? 1 : 0 ;
$tva_tx = str_replace('*','', GETPOST('tva_tx','alpha'));
$tva_tx = price2num($tva_tx);
if ($tva_tx == '')
{
$error++;
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("VATRateForSupplierProduct")).'</div>';
}
if (empty($quantity))
if (empty($reshook)) {
if ($action == 'remove_pf')
{
$error++;
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Qty")).'</div>';
}
if (empty($ref_fourn))
{
$error++;
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("RefSupplier")).'</div>';
}
if ($id_fourn <= 0)
{
$error++;
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Supplier")).'</div>';
}
if ($_POST["price"] < 0 || $_POST["price"] == '')
{
$error++;
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Price")).'</div>';
}
$product = new ProductFournisseur($db);
$result=$product->fetch($id);
if ($result <= 0)
{
$error++;
$mesg=$product->error;
}
if (! $error)
{
$db->begin();
if (! $error)
$product = new ProductFournisseur($db);
if ($product->fetch($id) > 0)
{
$ret=$product->add_fournisseur($user, $id_fourn, $ref_fourn, $quantity); // This insert record with no value for price. Values are update later with update_buyprice
if ($ret == -3)
if ($rowid)
{
$error++;
$product->fetch($product->product_id_already_linked);
$productLink = $product->getNomUrl(1,'supplier');
$mesg='<div class="error">'.$langs->trans("ReferenceSupplierIsAlreadyAssociatedWithAProduct",$productLink).'</div>';
}
else if ($ret < 0)
{
$error++;
$mesg='<div class="error">'.$product->error.'</div>';
$result=$product->remove_product_fournisseur_price($rowid);
$action = '';
$mesg = '<div class="ok">'.$langs->trans("PriceRemoved").'.</div>';
}
}
}
if ($action == 'updateprice' && GETPOST('cancel') <> $langs->trans("Cancel"))
{
$id_fourn=GETPOST("id_fourn");
if (empty($id_fourn)) $id_fourn=GETPOST("search_id_fourn");
$ref_fourn=GETPOST("ref_fourn");
if (empty($ref_fourn)) $ref_fourn=GETPOST("search_ref_fourn");
$quantity=GETPOST("qty");
$remise_percent=price2num(GETPOST('remise_percent','alpha'));
$npr = preg_match('/\*/', $_POST['tva_tx']) ? 1 : 0 ;
$tva_tx = str_replace('*','', GETPOST('tva_tx','alpha'));
$tva_tx = price2num($tva_tx);
if ($tva_tx == '')
{
$error++;
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("VATRateForSupplierProduct")).'</div>';
}
if (empty($quantity))
{
$error++;
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Qty")).'</div>';
}
if (empty($ref_fourn))
{
$error++;
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("RefSupplier")).'</div>';
}
if ($id_fourn <= 0)
{
$error++;
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Supplier")).'</div>';
}
if ($_POST["price"] < 0 || $_POST["price"] == '')
{
$error++;
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Price")).'</div>';
}
$product = new ProductFournisseur($db);
$result=$product->fetch($id);
if ($result <= 0)
{
$error++;
$mesg=$product->error;
}
if (! $error)
{
$supplier=new Fournisseur($db);
$result=$supplier->fetch($id_fourn);
if (isset($_POST['ref_fourn_price_id']))
$product->fetch_product_fournisseur_price($_POST['ref_fourn_price_id']);
{
$db->begin();
$ret=$product->update_buyprice($quantity, $_POST["price"], $user, $_POST["price_base_type"], $supplier, $_POST["oselDispo"], $ref_fourn, $tva_tx, $_POST["charges"], $remise_percent, $npr);
if ($ret < 0)
if (! $error)
{
$error++;
$mesg='<div class="error">'.$product->error.'</div>';
$ret=$product->add_fournisseur($user, $id_fourn, $ref_fourn, $quantity); // This insert record with no value for price. Values are update later with update_buyprice
if ($ret == -3)
{
$error++;
$product->fetch($product->product_id_already_linked);
$productLink = $product->getNomUrl(1,'supplier');
$mesg='<div class="error">'.$langs->trans("ReferenceSupplierIsAlreadyAssociatedWithAProduct",$productLink).'</div>';
}
else if ($ret < 0)
{
$error++;
$mesg='<div class="error">'.$product->error.'</div>';
}
}
}
if (! $error)
{
$db->commit();
$action='';
}
else
{
$db->rollback();
}
}
if (! $error)
{
$supplier=new Fournisseur($db);
$result=$supplier->fetch($id_fourn);
if (isset($_POST['ref_fourn_price_id']))
$product->fetch_product_fournisseur_price($_POST['ref_fourn_price_id']);
$ret=$product->update_buyprice($quantity, $_POST["price"], $user, $_POST["price_base_type"], $supplier, $_POST["oselDispo"], $ref_fourn, $tva_tx, $_POST["charges"], $remise_percent, $npr);
if ($ret < 0)
{
$error++;
$mesg='<div class="error">'.$product->error.'</div>';
}
}
if (! $error)
{
$db->commit();
$action='';
}
else
{
$db->rollback();
}
}
}
if (GETPOST('cancel') == $langs->trans("Cancel"))
{
$action = '';
header("Location: fournisseurs.php?id=".$_GET["id"]);
exit;
}
}
if (GETPOST('cancel') == $langs->trans("Cancel"))
{
$action = '';
header("Location: fournisseurs.php?id=".$_GET["id"]);
exit;
}
/*
* view
*/

View File

@@ -2,6 +2,7 @@
/* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 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
@@ -387,7 +388,7 @@ if ($resql)
{
print "<div class=\"tabsAction\">\n";
if ($user->rights->stock->creer)
if ($user->rights->stock->mouvement->creer)
{
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$id.'&action=correction">'.$langs->trans("StockCorrection").'</a>';
}

View File

@@ -5,7 +5,7 @@
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Cédric Salvador <csalvador.gpcsolutions.fr>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013-2015 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2014 Cédric Gross <c.gross@kreiz-it.fr>
*
* This program is free software; you can redistribute it and/or modify
@@ -343,7 +343,7 @@ if ($id > 0 || $ref)
if (! empty($conf->commande->enabled))
{
if ($found) print '<br>'; else $found=1;
print $langs->trans("CustomersOrdersRunning").': '.($product->stats_commande['qty']-$product->stats_sendings['qty']);
print $langs->trans("CustomersOrdersRunning").': '.($product->stats_commande['qty']-$product->stats_expedition['qty']);
$result=$product->load_stats_commande(0,'0');
if ($result < 0) dol_print_error($db,$product->error);
print ' ('.$langs->trans("Draft").': '.$product->stats_commande['qty'].')';
@@ -543,7 +543,7 @@ if (empty($action) && $product->id)
{
print "<div class=\"tabsAction\">\n";
if ($user->rights->stock->creer)
if ($user->rights->stock->mouvement->creer)
{
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$product->id.'&amp;action=correction">'.$langs->trans("StockCorrection").'</a>';
}

View File

@@ -287,8 +287,8 @@ class Task extends CommonObject
$sql.= " description=".(isset($this->description)?"'".$this->db->escape($this->description)."'":"null").",";
$sql.= " duration_effective=".(isset($this->duration_effective)?$this->duration_effective:"null").",";
$sql.= " planned_workload=".(isset($this->planned_workload)?$this->planned_workload:"0").",";
$sql.= " dateo=".($this->date_start!=''?$this->db->idate($this->date_start):'null').",";
$sql.= " datee=".($this->date_end!=''?$this->db->idate($this->date_end):'null').",";
$sql.= " dateo=".($this->date_start!=''?"'".$this->db->idate($this->date_start)."'":'null').",";
$sql.= " datee=".($this->date_end!=''?"'".$this->db->idate($this->date_end)."'":'null').",";
$sql.= " progress=".$this->progress.",";
$sql.= " rang=".((!empty($this->rang))?$this->rang:"0");
$sql.= " WHERE rowid=".$this->id;

View File

@@ -3,6 +3,7 @@
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -130,12 +131,12 @@ print '<tr><td>'.$langs->trans("Status").'</td><td>'.$project->getLibStatut(4).'
// Date start
print '<tr><td>'.$langs->trans("DateStart").'</td><td>';
print dol_print_date($object->date_start,'day');
print dol_print_date($project->date_start,'day');
print '</td></tr>';
// Date end
print '<tr><td>'.$langs->trans("DateEnd").'</td><td>';
print dol_print_date($object->date_end,'day');
print dol_print_date($project->date_end,'day');
print '</td></tr>';
print '</table>';
@@ -314,7 +315,14 @@ foreach ($listofreferent as $key => $value)
}
// Status
print '<td align="right">'.$element->getLibStatut(5).'</td>';
print '<td align="right">';
if ($element instanceof CommonInvoice) {
//This applies for Facture and FactureFournisseur
print $element->getLibStatut(5, $element->getSommePaiement());
} else {
print $element->getLibStatut(5);
}
print '</td>';
print '</tr>';
@@ -360,11 +368,11 @@ foreach ($listofreferent as $key => $value)
{
if ($key == 'order_supplier' && ! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->commande->creer)
{
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/facture/fiche.php?socid='.$project->societe->id.'&amp;action=create&amp;origin='.$project->element.'&amp;originid='.$project->id.'">'.$langs->trans("AddSupplierInvoice").'</a>';
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/commande/fiche.php?socid='.$project->societe->id.'&amp;action=create&amp;origin='.$project->element.'&amp;originid='.$project->id.'">'.$langs->trans("AddSupplierOrder").'</a>';
}
if ($key == 'invoice_supplier' && ! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->creer)
{
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/commande/fiche.php?socid='.$project->societe->id.'&amp;action=create&amp;origin='.$project->element.'&amp;originid='.$project->id.'">'.$langs->trans("AddSupplierOrder").'</a>';
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/facture/fiche.php?socid='.$project->societe->id.'&amp;action=create&amp;origin='.$project->element.'&amp;originid='.$project->id.'">'.$langs->trans("AddSupplierInvoice").'</a>';
}
}
}
@@ -415,8 +423,31 @@ foreach ($listofreferent as $key => $value)
}
}
switch ($classname) {
case 'FactureFournisseur':
$newclassname = 'SupplierInvoice';
break;
case 'Facture':
$newclassname = 'Bill';
break;
case 'Propal':
$newclassname = 'CommercialProposal';
break;
case 'Commande':
$newclassname = 'Order';
break;
case 'Expedition':
$newclassname = 'Sending';
break;
case 'Contrat':
$newclassname = 'Contract';
break;
default:
$newclassname = $classname;
}
print '<tr >';
print '<td align="left" >'.$classname.'</td>';
print '<td align="left" >'.$langs->trans($newclassname).'</td>';
print '<td align="right">'.$i.'</td>';
print '<td align="right">'.price($total_ht).'</td>';
print '<td align="right">'.price($total_ttc).'</td>';

View File

@@ -61,58 +61,59 @@ $hookmanager->initHooks(array('resource_card'));
$parameters=array('resource_id'=>$id);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if (empty($reshook)) {
/*******************************************************************
* ACTIONS
*
* Put here all code to do according to value of "action" parameter
********************************************************************/
/*******************************************************************
* ACTIONS
*
* Put here all code to do according to value of "action" parameter
********************************************************************/
if ($action == 'update' && ! $_POST["cancel"] && $user->rights->resource->write )
{
$error=0;
if (empty($ref))
if ($action == 'update' && ! $_POST["cancel"] && $user->rights->resource->write )
{
$error++;
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Ref")).'</div>';
}
$error=0;
if (! $error)
{
$res = $object->fetch($id);
if ( $res > 0 )
if (empty($ref))
{
$object->ref = $ref;
$object->description = $description;
$object->fk_code_type_resource = $fk_code_type_resource;
$result=$object->update($user);
if ($result > 0)
$error++;
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Ref")).'</div>';
}
if (! $error)
{
$res = $object->fetch($id);
if ( $res > 0 )
{
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
$object->ref = $ref;
$object->description = $description;
$object->fk_code_type_resource = $fk_code_type_resource;
$result=$object->update($user);
if ($result > 0)
{
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
else
{
setEventMessage('<div class="error">'.$object->error.'</div>');
$action='edit';
}
}
else
{
setEventMessage('<div class="error">'.$object->error.'</div>');
setEventMessage($object->error,'errors');
$action='edit';
}
}
else
else
{
setEventMessage($object->error,'errors');
$action='edit';
}
}
else
{
$action='edit';
}
}
/***************************************************
* VIEW
*

View File

@@ -3091,7 +3091,7 @@ class Societe extends CommonObject
$alreadypayed=price2num($paiement + $creditnotes + $deposits,'MT');
$remaintopay=price2num($invoice->total_ttc - $paiement - $creditnotes - $deposits,'MT');
*/
$sql = "SELECT sum(total) as amount FROM ".MAIN_DB_PREFIX."facture as f";
$sql = "SELECT rowid, total_ttc FROM ".MAIN_DB_PREFIX."facture as f";
$sql .= " WHERE fk_soc = ". $this->id;
$sql .= " AND paye = 0";
$sql .= " AND fk_statut <> 0"; // Not a draft
@@ -3102,8 +3102,18 @@ class Societe extends CommonObject
$resql=$this->db->query($sql);
if ($resql)
{
$obj=$this->db->fetch_object($resql);
return ($obj->amount);
$outstandingBill = 0;
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$facturestatic=new Facture($this->db);
while($obj=$this->db->fetch_object($resql)) {
$facturestatic->id=$obj->rowid;
$paiement = $facturestatic->getSommePaiement();
$creditnotes = $facturestatic->getSumCreditNotesUsed();
$deposits = $facturestatic->getSumDepositsUsed();
$outstandingBill+= $obj->total_ttc - $paiement - $creditnotes - $deposits;
}
return $outstandingBill;
}
else
return 0;

View File

@@ -4,6 +4,7 @@
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Peter Fontaine <contact@peterfontaine.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -382,7 +383,7 @@ if ($socid && $action != 'edit' && $action != "create")
}
if (count($rib_list) == 0) {
print '<tr><td colspan="5" align="center">'.$langs->trans("NoBANRecord").'</td></tr>';
print '<tr><td colspan="7" align="center">'.$langs->trans("NoBANRecord").'</td></tr>';
}
print '</table>';

Binary file not shown.

After

Width:  |  Height:  |  Size: 579 B

Some files were not shown because too many files have changed in this diff Show More