diff --git a/ChangeLog b/ChangeLog index 7d94a664ce680bca46aee8fb0e0c66264bf15fb3..e221e29f09745c05f3f92939f434596215d7eae5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,17 +6,18 @@ English Dolibarr ChangeLog For users: - New: Update ckeditor to version 4. - New: Add form "search customer order" on commercial main page. -- New: Can input barcode during product creation step. -- New: Add autonumbering of barcode value for products. - New: Can create contract from an order. - New: Add list of orders products in tab "consumption" on thirdparties. - New: Add graph stats for suppliers orders in tab "stats" on products. - New: Add option MAIN_HIDE_INACTIVETAB_ON_PRINT to hide inactive tabs when you use the "print" view on screen. -- New: Add a page/tool for mass barcode generation. - New: Add option MAIN_AUTO_TIMESTAMP_IN_PUBLIC_NOTES and MAIN_AUTO_TIMESTAMP_IN_PRIVATE_NOTES to automatically add timestamp and user line into edition field when editing a note. - New: Add button cancel into edition of notes. +- New: Improved Barcode module: + Can input barcode during product creation step. + Add autonumbering of barcode value for products. + Add a page/tool for mass barcode generation. - New: Improved Opensurvey module: Added options to disable comments and disable public votes. Limit dates use calendar popup. @@ -39,9 +40,9 @@ For users: - 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: Can define custom fields for catagories. +- New: Can define custom fields for categories. - Fix: Project Task numbering customs rule works. -- Fix: Add actions events not implemented +- Fix: Add actions events not implemented. TODO - New: Predefined product and free product use same form. @@ -113,6 +114,8 @@ Fix: [ bug #1240 ] traduction. Fix: [ bug #1238 ] When creating accompte with a %, free product are used for calculation. Fix: [ bug #1280 ] service with not end of date was tagged as expired. Fix: [ bug #1295 ] Error when creating an agenda extrafield with a number as reference +Fix: [ bug #1306 ] Fatal error when adding an external calendar +New: Added es_CL language ***** ChangeLog for 3.5 compared to 3.4.* ***** For users: diff --git a/build/debian/README.Debian b/build/debian/README.Debian new file mode 100644 index 0000000000000000000000000000000000000000..e5262b8c61a5f5d78ea0500e6ce35fb4b248ad45 --- /dev/null +++ b/build/debian/README.Debian @@ -0,0 +1,13 @@ +Information about Dolibarr in Debian +------------------------------------ + +The Debian package provides integration with apache2 and lighttpd. +If you have one of those servers installed, then Dolibarr is immediately +accessible at http://localhost/dolibarr/ + +But it won't be usable until you configure it via +http://localhost/dolibarr/install/ + +To complete the setup process you will need the MySQL root credentials +because the Dolibarr installer will create the database and the dedicated user +for you. diff --git a/build/debian/README.source b/build/debian/README.source deleted file mode 100644 index 298db1e85952a6bb23a27b6eb14e981dc05e0ff7..0000000000000000000000000000000000000000 --- a/build/debian/README.source +++ /dev/null @@ -1,12 +0,0 @@ -================================================================== -Dolibarr - Web based software to manage a small company or foundation -================================================================== - - -Note for package maintainers ----------------------------- -This file explains how to modify official sources (from http://www.dolibarr.org) -to have ready to use source files to build a debian package. - -All changes are included into patch file -build/debian/patches diff --git a/build/debian/changelog b/build/debian/changelog index c4e31ec51c8715e37af9e5e5750650fcfe4ba349..eb2100922f4967e6503be3bac5f885e9d3a95572 100644 --- a/build/debian/changelog +++ b/build/debian/changelog @@ -5,6 +5,13 @@ dolibarr (3.6.0-1) unstable; urgency=low -- Laurent Destailleur (eldy) <eldy@users.sourceforge.net> Sat, 8 Feb 2014 12:00:00 +0100 +dolibarr (3.5.2-3) unstable; urgency=low + + [ Laurent Destailleur (eldy) ] + * New upstream release. + + -- Laurent Destailleur (eldy) <eldy@users.sourceforge.net> Fri, 14 March 2014 12:00:00 +0100 + dolibarr (3.5.1-3) unstable; urgency=low [ Laurent Destailleur (eldy) ] diff --git a/build/debian/dolibarr.doc-base b/build/debian/dolibarr.doc-base deleted file mode 100644 index d7d5666d883bf27050ed691e5b4adcce9cd94dc7..0000000000000000000000000000000000000000 --- a/build/debian/dolibarr.doc-base +++ /dev/null @@ -1,10 +0,0 @@ -Document: dolibarr -Title: Dolibarr ERP & CRM documentation -Author: Dolibarr team -Abstract: This documentation covers the install, use and administration of - Dolibarr ERP & CRM software. -Section: Office - -Format: HTML -Index: /usr/share/doc/dolibarr/index.html -Files: /usr/share/doc/dolibarr/*.html \ No newline at end of file diff --git a/build/debian/dolibarr.docs b/build/debian/dolibarr.docs new file mode 100644 index 0000000000000000000000000000000000000000..5d4b554ef74776e3af82ce3feb73bcc614dbf02d --- /dev/null +++ b/build/debian/dolibarr.docs @@ -0,0 +1,2 @@ +README.md +README-FR.md diff --git a/build/debian/dolibarr.install b/build/debian/dolibarr.install index 72dff46ed158fdd7496c091b8f5757b405eb9cde..a49ad442eb52a1051f5d1dd8971d46a85d93a266 100755 --- a/build/debian/dolibarr.install +++ b/build/debian/dolibarr.install @@ -6,8 +6,6 @@ debian/lighttpd/50-dolibarr.conf etc/lighttpd/conf-available/ debian/install.forced.php.install etc/dolibarr/ htdocs usr/share/dolibarr/ scripts usr/share/dolibarr/ -changelog usr/share/doc/dolibarr/ -README usr/share/doc/dolibarr/ doc/install usr/share/doc/dolibarr/ doc/user usr/share/doc/dolibarr/ doc/index.html usr/share/doc/dolibarr/ \ No newline at end of file diff --git a/build/debian/rules b/build/debian/rules index 776dd540eb7cde221166cbacc6aeab6f0ab3410a..bd3a9badb09a0d385fc9e56e34327fd7602f719d 100755 --- a/build/debian/rules +++ b/build/debian/rules @@ -9,6 +9,12 @@ export DH_OPTIONS=-v %: dh $@ + +override_dh_auto_clean: +# Do nothing. Added to disable launchpad to use bugged dh_auto_clean search for ant + +override_dh_auto_build: +# Do nothing. Added to disable launchpad to use bugged dh_auto_build search for ant override_dh_install: dh_install diff --git a/build/launchpad/README b/build/launchpad/README index 0107c7d9537279148fedf7d2c9f4f3dbce0d8e64..973509aa6d1298b1d2eb5bc1783c279fabb7c0f9 100644 --- a/build/launchpad/README +++ b/build/launchpad/README @@ -81,7 +81,7 @@ If you want to build/test package locally: bzr init bzr add bzr commit -m "Init control files" - bzr push lp:~yourlogin/+junk/debian-[dev|beta|stable] (put here any branch name) + bzr push lp:~yourlogin/+junk/debian-[dev|beta|stable] (put here any branch name or just bzr push if into a known branch) - or download it from launchpad bazaar: cd bzr bzr branch lp:~yourlogin/+junk/debian-[dev|beta|stable] diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index b82fdcb05a0ff62ed5449a137df236e924a72769..b7c43443ed852497ecd4887a16427f8065024599 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -365,7 +365,6 @@ if ($nboftargetok) { $ret=`rm -f $BUILDROOT/$PROJECT/build.xml`; $ret=`rm -f $BUILDROOT/$PROJECT/quickbuild.xml`; $ret=`rm -f $BUILDROOT/$PROJECT/pom.xml`; - $ret=`mv $BUILDROOT/$PROJECT/README.md $BUILDROOT/$PROJECT/README`; $ret=`rm -fr $BUILDROOT/$PROJECT/build/html`; $ret=`rm -f $BUILDROOT/$PROJECT/build/Doli*-*`; @@ -708,7 +707,7 @@ if ($nboftargetok) { $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/copyright`; $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/dolibarr.config`; $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/dolibarr.desktop`; - $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/dolibarr.doc-base`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/dolibarr.docs`; $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/dolibarr.install`; $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/dolibarr.lintian-overrides`; $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/dolibarr.postrm`; @@ -716,6 +715,7 @@ if ($nboftargetok) { $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/dolibarr.templates`; $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/dolibarr.templates.futur`; $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/rules`; + $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/README.Debian`; $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/README.howto`; $ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/watch`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/doap`; @@ -744,11 +744,10 @@ if ($nboftargetok) { $ret=`cp -f "$SOURCE/build/debian/control" "$BUILDROOT/$PROJECT.tmp/debian"`; $ret=`cp -f "$SOURCE/build/debian/copyright" "$BUILDROOT/$PROJECT.tmp/debian"`; $ret=`cp -f "$SOURCE/build/debian/dolibarr.desktop" "$BUILDROOT/$PROJECT.tmp/debian"`; - $ret=`cp -f "$SOURCE/build/debian/dolibarr.doc-base" "$BUILDROOT/$PROJECT.tmp/debian"`; + $ret=`cp -f "$SOURCE/build/debian/dolibarr.docs" "$BUILDROOT/$PROJECT.tmp/debian"`; $ret=`cp -f "$SOURCE/build/debian/dolibarr.install" "$BUILDROOT/$PROJECT.tmp/debian"`; $ret=`cp -f "$SOURCE/build/debian/dolibarr.lintian-overrides" "$BUILDROOT/$PROJECT.tmp/debian"`; $ret=`cp -f "$SOURCE/build/debian/dolibarr.xpm" "$BUILDROOT/$PROJECT.tmp/debian"`; - $ret=`cp -f "$SOURCE/build/debian/README.source" "$BUILDROOT/$PROJECT.tmp/debian"`; $ret=`cp -f "$SOURCE/build/debian/rules" "$BUILDROOT/$PROJECT.tmp/debian"`; $ret=`cp -f "$SOURCE/build/debian/watch" "$BUILDROOT/$PROJECT.tmp/debian"`; $ret=`cp -fr "$SOURCE/build/debian/patches" "$BUILDROOT/$PROJECT.tmp/debian"`; diff --git a/build/perl/virtualmin/dolibarr.pl b/build/perl/virtualmin/dolibarr.pl index 31abc0138ee64ffe8cd85a007b21bcdc15f07648..c44481db736f576b46702e954a714be2d0a34334 100644 --- a/build/perl/virtualmin/dolibarr.pl +++ b/build/perl/virtualmin/dolibarr.pl @@ -30,7 +30,7 @@ return "Regis Houssin"; # script_dolibarr_versions() sub script_dolibarr_versions { -return ( "3.6.0", "3.5.1", "3.5.0", "3.4.1", "3.4.0", "3.3.3", "3.3.2", "3.3.1", "3.3.0", "3.2.1", "3.1.1" ); +return ( "3.6.0", "3.5.2", "3.5.1", "3.5.0", "3.4.1", "3.4.0", "3.3.3", "3.3.2", "3.3.1", "3.3.0", "3.2.1", "3.1.1" ); } sub script_dolibarr_category diff --git a/build/rpm/dolibarr_fedora.spec b/build/rpm/dolibarr_fedora.spec index 4cbf9c11171e4013136c5e04a7d13fc75a5ef377..94b2bb2ef7577ba7fe0e6e5ab14c205c0a27e166 100755 --- a/build/rpm/dolibarr_fedora.spec +++ b/build/rpm/dolibarr_fedora.spec @@ -334,5 +334,11 @@ fi * Fri Feb 7 2014 Laurent Destailleur 3.6.0-0.2.b - Upstream release +* Fri Feb 14 2014 Laurent Destailleur 3.5.2-0.3 +- Upstream release + +* Fri Feb 7 2014 Laurent Destailleur 3.5.1-0.3 +- Upstream release + * Mon Dec 30 2013 Laurent Destailleur 3.5.0-0.3 - Initial version (#723326) diff --git a/build/rpm/dolibarr_generic.spec b/build/rpm/dolibarr_generic.spec index d37a41390f07a8d5cf46b05c44e0e18ecaa0ec17..64efb3ffe92cdfaba59a85fdf845f6a547891a64 100755 --- a/build/rpm/dolibarr_generic.spec +++ b/build/rpm/dolibarr_generic.spec @@ -562,5 +562,11 @@ fi * Mon Feb 7 2014 Laurent Destailleur 3.6.0-0.2.b - Upstream release +* Fri Feb 14 2014 Laurent Destailleur 3.5.2-0.3 +- Upstream release + +* Fri Feb 7 2014 Laurent Destailleur 3.5.1-0.3 +- Upstream release + * Mon Dec 30 2013 Laurent Destailleur 3.5.0-0.3 - Initial version (#723326) diff --git a/build/rpm/dolibarr_mandriva.spec b/build/rpm/dolibarr_mandriva.spec index 0645eb55f4edf338116e6c5c75f57a4413e0f4a6..e000403715794b8ceac5a3208494ee47040cc378 100755 --- a/build/rpm/dolibarr_mandriva.spec +++ b/build/rpm/dolibarr_mandriva.spec @@ -339,5 +339,11 @@ fi * Mon Feb 7 2014 Laurent Destailleur 3.6.0-0.2.b - Upstream release +* Fri Feb 14 2014 Laurent Destailleur 3.5.2-0.3 +- Upstream release + +* Fri Feb 7 2014 Laurent Destailleur 3.5.1-0.3 +- Upstream release + * Mon Dec 30 2013 Laurent Destailleur 3.5.0-0.3 - Initial version (#723326) diff --git a/build/rpm/dolibarr_opensuse.spec b/build/rpm/dolibarr_opensuse.spec index 06feacf42c2fae933e09ebc52eb0f19359e9336a..d42c0bf8bc3d2f12c84df7f3edca3572dab6ec33 100755 --- a/build/rpm/dolibarr_opensuse.spec +++ b/build/rpm/dolibarr_opensuse.spec @@ -349,5 +349,11 @@ fi * Mon Feb 7 2014 Laurent Destailleur 3.6.0-0.2.b - Upstream release +* Fri Feb 14 2014 Laurent Destailleur 3.5.2-0.3 +- Upstream release + +* Fri Feb 7 2014 Laurent Destailleur 3.5.1-0.3 +- Upstream release + * Mon Dec 30 2013 Laurent Destailleur 3.5.0-0.3 - Initial version (#723326) diff --git a/dev/initdata/mysqldump_dolibarr_3.4.0.sql b/dev/initdata/mysqldump_dolibarr_3.4.0.sql index 3226d57f460384b4d92474066feb795b3a9cb7d8..51635d4a033e2a859c621ec4e6012bda8a4a1e6c 100644 --- a/dev/initdata/mysqldump_dolibarr_3.4.0.sql +++ b/dev/initdata/mysqldump_dolibarr_3.4.0.sql @@ -1599,7 +1599,7 @@ CREATE TABLE `llx_c_tva` ( LOCK TABLES `llx_c_tva` WRITE; /*!40000 ALTER TABLE `llx_c_tva` DISABLE KEYS */; -INSERT INTO `llx_c_tva` VALUES (11,1,19.6,0,'0',0,'0',0,'VAT standard rate (France hors DOM-TOM)',1,NULL,NULL),(12,1,8.5,0,'0',0,'0',0,'VAT standard rate (DOM sauf Guyane et Saint-Martin)',0,NULL,NULL),(13,1,8.5,0,'0',0,'0',1,'VAT standard rate (DOM sauf Guyane et Saint-Martin), non perçu par le vendeur mais récupérable par acheteur',0,NULL,NULL),(14,1,5.5,0,'0',0,'0',0,'VAT reduced rate (France hors DOM-TOM)',1,NULL,NULL),(15,1,0,0,'0',0,'0',0,'VAT Rate 0 ou non applicable',1,NULL,NULL),(16,1,2.1,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(21,2,21,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(22,2,6,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(23,2,0,0,'0',0,'0',0,'VAT Rate 0 ou non applicable',1,NULL,NULL),(24,2,12,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(31,3,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(32,3,10,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(33,3,4,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(34,3,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(41,4,21,5.2,'3',-21,'1',0,'VAT standard rate',1,NULL,NULL),(42,4,10,1.4,'3',-21,'1',0,'VAT reduced rate',1,NULL,NULL),(43,4,4,0.5,'3',-21,'1',0,'VAT super-reduced rate',1,NULL,NULL),(44,4,0,0,'3',-21,'1',0,'VAT Rate 0',1,NULL,NULL),(51,5,19,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(52,5,7,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(53,5,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(61,6,7.6,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(62,6,3.6,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(63,6,2.4,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(64,6,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(71,7,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(72,7,17.5,0,'0',0,'0',0,'VAT standard rate before 2011',1,NULL,NULL),(73,7,5,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(74,7,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(91,9,17,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(92,9,13,0,'0',0,'0',0,'VAT reduced rate 0',1,NULL,NULL),(93,9,3,0,'0',0,'0',0,'VAT super reduced rate 0',1,NULL,NULL),(94,9,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(101,10,6,0,'0',0,'0',0,'VAT 6%',1,NULL,NULL),(102,10,12,1,'4',0,'0',0,'VAT 12%',1,NULL,NULL),(103,10,18,0,'0',0,'0',0,'VAT 18%',1,NULL,NULL),(104,10,7.5,1,'4',0,'0',0,'VAT 6% Majoré à 25% (7.5%)',1,NULL,NULL),(105,10,15,1,'4',0,'0',0,'VAT 12% Majoré à 25% (15%)',1,NULL,NULL),(106,10,22.5,1,'4',0,'0',0,'VAT 18% Majoré à 25% (22.5%)',1,NULL,NULL),(107,10,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(111,11,0,0,'0',0,'0',0,'No Sales Tax',1,NULL,NULL),(112,11,4,0,'0',0,'0',0,'Sales Tax 4%',1,NULL,NULL),(113,11,6,0,'0',0,'0',0,'Sales Tax 6%',1,NULL,NULL),(121,12,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(122,12,14,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(123,12,10,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(124,12,7,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(125,12,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(141,14,7,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(142,14,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(143,14,5,9.975,'1',0,'0',0,'TPS and TVQ rate',1,NULL,NULL),(171,17,19,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(172,17,6,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(173,17,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(201,20,25,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(202,20,12,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(203,20,6,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(204,20,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(231,23,21,0,'0',0,'0',0,'IVA standard rate',1,NULL,NULL),(232,23,10.5,0,'0',0,'0',0,'IVA reduced rate',1,NULL,NULL),(233,23,0,0,'0',0,'0',0,'IVA Rate 0',1,NULL,NULL),(251,25,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(252,25,12,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(253,25,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(254,25,5,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(271,27,19.6,0,'0',0,'0',0,'VAT standard rate (France hors DOM-TOM)',1,NULL,NULL),(272,27,8.5,0,'0',0,'0',0,'VAT standard rate (DOM sauf Guyane et Saint-Martin)',0,NULL,NULL),(273,27,8.5,0,'0',0,'0',1,'VAT standard rate (DOM sauf Guyane et Saint-Martin), non perçu par le vendeur mais récupérable par acheteur',0,NULL,NULL),(274,27,5.5,0,'0',0,'0',0,'VAT reduced rate (France hors DOM-TOM)',0,NULL,NULL),(275,27,0,0,'0',0,'0',0,'VAT Rate 0 ou non applicable',1,NULL,NULL),(276,27,2.1,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(277,27,7,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(281,28,10,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(282,28,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(411,41,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(412,41,10,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(413,41,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(461,46,0,0,'0',0,'0',0,'No VAT',1,NULL,NULL),(462,46,15,0,'0',0,'0',0,'VAT 15%',1,NULL,NULL),(463,46,7.5,0,'0',0,'0',0,'VAT 7.5%',1,NULL,NULL),(591,59,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(592,59,7,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(593,59,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(671,67,19,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(672,67,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(801,80,25,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(802,80,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(861,86,13,0,'0',0,'0',0,'IVA 13',1,NULL,NULL),(862,86,0,0,'0',0,'0',0,'SIN IVA',1,NULL,NULL),(1141,114,0,0,'0',0,'0',0,'No ISV',1,NULL,NULL),(1142,114,12,0,'0',0,'0',0,'ISV 12%',1,NULL,NULL),(1161,116,25.5,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(1162,116,7,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1163,116,0,0,'0',0,'0',0,'VAT rate 0',1,NULL,NULL),(1171,117,12.5,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(1172,117,4,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1173,117,1,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(1174,117,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1231,123,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1232,123,5,0,'0',0,'0',0,'VAT Rate 5',1,NULL,NULL),(1401,140,15,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(1402,140,12,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1403,140,6,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1404,140,3,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(1405,140,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1521,152,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1522,152,15,0,'0',0,'0',0,'VAT Rate 15',1,NULL,NULL),(1541,154,0,0,'0',0,'0',0,'No VAT',1,NULL,NULL),(1542,154,16,0,'0',0,'0',0,'VAT 16%',1,NULL,NULL),(1543,154,10,0,'0',0,'0',0,'VAT Frontero',1,NULL,NULL),(1662,166,15,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(1663,166,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1731,173,25,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(1732,173,14,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1733,173,8,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1734,173,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1841,184,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(1842,184,7,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1843,184,3,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1844,184,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1881,188,24,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(1882,188,9,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1883,188,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1884,188,5,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1931,193,0,0,'0',0,'0',0,'No VAT in SPM',1,NULL,NULL),(2011,201,19,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(2012,201,10,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(2013,201,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(2021,202,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(2022,202,8.5,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(2023,202,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(2321,232,0,0,'0',0,'0',0,'No VAT',1,NULL,NULL),(2322,232,12,0,'0',0,'0',0,'VAT 12%',1,NULL,NULL),(2323,232,8,0,'0',0,'0',0,'VAT 8%',1,NULL,NULL),(2461,246,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(2462,4,15,0,'0',0,'0',0,'aaaa',1,NULL,NULL); +INSERT INTO `llx_c_tva` VALUES (11,1,20,0,'0',0,'0',0,'VAT standard rate (France hors DOM-TOM)',1,NULL,NULL),(12,1,8.5,0,'0',0,'0',0,'VAT standard rate (DOM sauf Guyane et Saint-Martin)',0,NULL,NULL),(13,1,8.5,0,'0',0,'0',1,'VAT standard rate (DOM sauf Guyane et Saint-Martin), non perçu par le vendeur mais récupérable par acheteur',0,NULL,NULL),(14,1,5.5,0,'0',0,'0',0,'VAT reduced rate (France hors DOM-TOM)',1,NULL,NULL),(15,1,0,0,'0',0,'0',0,'VAT Rate 0 ou non applicable',1,NULL,NULL),(16,1,2.1,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(21,2,21,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(22,2,6,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(23,2,0,0,'0',0,'0',0,'VAT Rate 0 ou non applicable',1,NULL,NULL),(24,2,12,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(31,3,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(32,3,10,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(33,3,4,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(34,3,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(41,4,21,5.2,'3',-21,'1',0,'VAT standard rate',1,NULL,NULL),(42,4,10,1.4,'3',-21,'1',0,'VAT reduced rate',1,NULL,NULL),(43,4,4,0.5,'3',-21,'1',0,'VAT super-reduced rate',1,NULL,NULL),(44,4,0,0,'3',-21,'1',0,'VAT Rate 0',1,NULL,NULL),(51,5,19,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(52,5,7,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(53,5,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(61,6,7.6,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(62,6,3.6,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(63,6,2.4,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(64,6,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(71,7,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(72,7,17.5,0,'0',0,'0',0,'VAT standard rate before 2011',1,NULL,NULL),(73,7,5,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(74,7,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(91,9,17,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(92,9,13,0,'0',0,'0',0,'VAT reduced rate 0',1,NULL,NULL),(93,9,3,0,'0',0,'0',0,'VAT super reduced rate 0',1,NULL,NULL),(94,9,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(101,10,6,0,'0',0,'0',0,'VAT 6%',1,NULL,NULL),(102,10,12,1,'4',0,'0',0,'VAT 12%',1,NULL,NULL),(103,10,18,0,'0',0,'0',0,'VAT 18%',1,NULL,NULL),(104,10,7.5,1,'4',0,'0',0,'VAT 6% Majoré à 25% (7.5%)',1,NULL,NULL),(105,10,15,1,'4',0,'0',0,'VAT 12% Majoré à 25% (15%)',1,NULL,NULL),(106,10,22.5,1,'4',0,'0',0,'VAT 18% Majoré à 25% (22.5%)',1,NULL,NULL),(107,10,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(111,11,0,0,'0',0,'0',0,'No Sales Tax',1,NULL,NULL),(112,11,4,0,'0',0,'0',0,'Sales Tax 4%',1,NULL,NULL),(113,11,6,0,'0',0,'0',0,'Sales Tax 6%',1,NULL,NULL),(121,12,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(122,12,14,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(123,12,10,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(124,12,7,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(125,12,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(141,14,7,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(142,14,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(143,14,5,9.975,'1',0,'0',0,'TPS and TVQ rate',1,NULL,NULL),(171,17,19,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(172,17,6,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(173,17,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(201,20,25,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(202,20,12,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(203,20,6,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(204,20,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(231,23,21,0,'0',0,'0',0,'IVA standard rate',1,NULL,NULL),(232,23,10.5,0,'0',0,'0',0,'IVA reduced rate',1,NULL,NULL),(233,23,0,0,'0',0,'0',0,'IVA Rate 0',1,NULL,NULL),(251,25,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(252,25,12,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(253,25,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(254,25,5,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(271,27,20,0,'0',0,'0',0,'VAT standard rate (France hors DOM-TOM)',1,NULL,NULL),(272,27,8.5,0,'0',0,'0',0,'VAT standard rate (DOM sauf Guyane et Saint-Martin)',0,NULL,NULL),(273,27,8.5,0,'0',0,'0',1,'VAT standard rate (DOM sauf Guyane et Saint-Martin), non perçu par le vendeur mais récupérable par acheteur',0,NULL,NULL),(274,27,5.5,0,'0',0,'0',0,'VAT reduced rate (France hors DOM-TOM)',0,NULL,NULL),(275,27,0,0,'0',0,'0',0,'VAT Rate 0 ou non applicable',1,NULL,NULL),(276,27,2.1,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(277,27,7,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(281,28,10,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(282,28,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(411,41,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(412,41,10,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(413,41,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(461,46,0,0,'0',0,'0',0,'No VAT',1,NULL,NULL),(462,46,15,0,'0',0,'0',0,'VAT 15%',1,NULL,NULL),(463,46,7.5,0,'0',0,'0',0,'VAT 7.5%',1,NULL,NULL),(591,59,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(592,59,7,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(593,59,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(671,67,19,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(672,67,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(801,80,25,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(802,80,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(861,86,13,0,'0',0,'0',0,'IVA 13',1,NULL,NULL),(862,86,0,0,'0',0,'0',0,'SIN IVA',1,NULL,NULL),(1141,114,0,0,'0',0,'0',0,'No ISV',1,NULL,NULL),(1142,114,12,0,'0',0,'0',0,'ISV 12%',1,NULL,NULL),(1161,116,25.5,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(1162,116,7,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1163,116,0,0,'0',0,'0',0,'VAT rate 0',1,NULL,NULL),(1171,117,12.5,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(1172,117,4,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1173,117,1,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(1174,117,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1231,123,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1232,123,5,0,'0',0,'0',0,'VAT Rate 5',1,NULL,NULL),(1401,140,15,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(1402,140,12,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1403,140,6,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1404,140,3,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(1405,140,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1521,152,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1522,152,15,0,'0',0,'0',0,'VAT Rate 15',1,NULL,NULL),(1541,154,0,0,'0',0,'0',0,'No VAT',1,NULL,NULL),(1542,154,16,0,'0',0,'0',0,'VAT 16%',1,NULL,NULL),(1543,154,10,0,'0',0,'0',0,'VAT Frontero',1,NULL,NULL),(1662,166,15,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(1663,166,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1731,173,25,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(1732,173,14,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1733,173,8,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1734,173,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1841,184,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(1842,184,7,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1843,184,3,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1844,184,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1881,188,24,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(1882,188,9,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1883,188,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1884,188,5,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1931,193,0,0,'0',0,'0',0,'No VAT in SPM',1,NULL,NULL),(2011,201,19,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(2012,201,10,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(2013,201,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(2021,202,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(2022,202,8.5,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(2023,202,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(2321,232,0,0,'0',0,'0',0,'No VAT',1,NULL,NULL),(2322,232,12,0,'0',0,'0',0,'VAT 12%',1,NULL,NULL),(2323,232,8,0,'0',0,'0',0,'VAT 8%',1,NULL,NULL),(2461,246,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(2462,4,15,0,'0',0,'0',0,'aaaa',1,NULL,NULL); /*!40000 ALTER TABLE `llx_c_tva` ENABLE KEYS */; UNLOCK TABLES; diff --git a/dev/initdata/mysqldump_dolibarr_3.5.0.sql b/dev/initdata/mysqldump_dolibarr_3.5.0.sql index eb7c6b7c17518e994e4560fc08a18f674f50bf1b..69ab3b8ec2c05408ef37245d172d4355185d9172 100644 --- a/dev/initdata/mysqldump_dolibarr_3.5.0.sql +++ b/dev/initdata/mysqldump_dolibarr_3.5.0.sql @@ -1616,7 +1616,7 @@ CREATE TABLE `llx_c_tva` ( LOCK TABLES `llx_c_tva` WRITE; /*!40000 ALTER TABLE `llx_c_tva` DISABLE KEYS */; -INSERT INTO `llx_c_tva` VALUES (11,1,19.6,0,'0',0,'0',0,'VAT standard rate (France hors DOM-TOM)',1,NULL,NULL),(12,1,8.5,0,'0',0,'0',0,'VAT standard rate (DOM sauf Guyane et Saint-Martin)',0,NULL,NULL),(13,1,8.5,0,'0',0,'0',1,'VAT standard rate (DOM sauf Guyane et Saint-Martin), non perçu par le vendeur mais récupérable par acheteur',0,NULL,NULL),(14,1,5.5,0,'0',0,'0',0,'VAT reduced rate (France hors DOM-TOM)',1,NULL,NULL),(15,1,0,0,'0',0,'0',0,'VAT Rate 0 ou non applicable',1,NULL,NULL),(16,1,2.1,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(21,2,21,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(22,2,6,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(23,2,0,0,'0',0,'0',0,'VAT Rate 0 ou non applicable',1,NULL,NULL),(24,2,12,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(31,3,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(32,3,10,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(33,3,4,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(34,3,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(41,4,21,5.2,'3',-21,'1',0,'VAT standard rate',1,NULL,NULL),(42,4,10,1.4,'3',-21,'1',0,'VAT reduced rate',1,NULL,NULL),(43,4,4,0.5,'3',-21,'1',0,'VAT super-reduced rate',1,NULL,NULL),(44,4,0,0,'3',-21,'1',0,'VAT Rate 0',1,NULL,NULL),(51,5,19,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(52,5,7,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(53,5,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(61,6,7.6,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(62,6,3.6,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(63,6,2.4,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(64,6,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(71,7,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(72,7,17.5,0,'0',0,'0',0,'VAT standard rate before 2011',1,NULL,NULL),(73,7,5,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(74,7,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(91,9,17,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(92,9,13,0,'0',0,'0',0,'VAT reduced rate 0',1,NULL,NULL),(93,9,3,0,'0',0,'0',0,'VAT super reduced rate 0',1,NULL,NULL),(94,9,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(101,10,6,0,'0',0,'0',0,'VAT 6%',1,NULL,NULL),(102,10,12,1,'4',0,'0',0,'VAT 12%',1,NULL,NULL),(103,10,18,0,'0',0,'0',0,'VAT 18%',1,NULL,NULL),(104,10,7.5,1,'4',0,'0',0,'VAT 6% Majoré à 25% (7.5%)',1,NULL,NULL),(105,10,15,1,'4',0,'0',0,'VAT 12% Majoré à 25% (15%)',1,NULL,NULL),(106,10,22.5,1,'4',0,'0',0,'VAT 18% Majoré à 25% (22.5%)',1,NULL,NULL),(107,10,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(111,11,0,0,'0',0,'0',0,'No Sales Tax',1,NULL,NULL),(112,11,4,0,'0',0,'0',0,'Sales Tax 4%',1,NULL,NULL),(113,11,6,0,'0',0,'0',0,'Sales Tax 6%',1,NULL,NULL),(121,12,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(122,12,14,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(123,12,10,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(124,12,7,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(125,12,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(141,14,7,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(142,14,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(143,14,5,9.975,'1',0,'0',0,'TPS and TVQ rate',1,NULL,NULL),(171,17,19,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(172,17,6,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(173,17,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(201,20,25,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(202,20,12,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(203,20,6,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(204,20,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(231,23,21,0,'0',0,'0',0,'IVA standard rate',1,NULL,NULL),(232,23,10.5,0,'0',0,'0',0,'IVA reduced rate',1,NULL,NULL),(233,23,0,0,'0',0,'0',0,'IVA Rate 0',1,NULL,NULL),(251,25,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(252,25,12,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(253,25,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(254,25,5,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(271,27,19.6,0,'0',0,'0',0,'VAT standard rate (France hors DOM-TOM)',1,NULL,NULL),(272,27,8.5,0,'0',0,'0',0,'VAT standard rate (DOM sauf Guyane et Saint-Martin)',0,NULL,NULL),(273,27,8.5,0,'0',0,'0',1,'VAT standard rate (DOM sauf Guyane et Saint-Martin), non perçu par le vendeur mais récupérable par acheteur',0,NULL,NULL),(274,27,5.5,0,'0',0,'0',0,'VAT reduced rate (France hors DOM-TOM)',0,NULL,NULL),(275,27,0,0,'0',0,'0',0,'VAT Rate 0 ou non applicable',1,NULL,NULL),(276,27,2.1,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(277,27,7,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(281,28,10,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(282,28,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(411,41,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(412,41,10,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(413,41,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(461,46,0,0,'0',0,'0',0,'No VAT',1,NULL,NULL),(462,46,15,0,'0',0,'0',0,'VAT 15%',1,NULL,NULL),(463,46,7.5,0,'0',0,'0',0,'VAT 7.5%',1,NULL,NULL),(591,59,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(592,59,7,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(593,59,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(671,67,19,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(672,67,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(801,80,25,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(802,80,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(861,86,13,0,'0',0,'0',0,'IVA 13',1,NULL,NULL),(862,86,0,0,'0',0,'0',0,'SIN IVA',1,NULL,NULL),(1141,114,0,0,'0',0,'0',0,'No ISV',1,NULL,NULL),(1142,114,12,0,'0',0,'0',0,'ISV 12%',1,NULL,NULL),(1161,116,25.5,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(1162,116,7,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1163,116,0,0,'0',0,'0',0,'VAT rate 0',1,NULL,NULL),(1171,117,12.5,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(1172,117,4,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1173,117,1,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(1174,117,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1231,123,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1232,123,5,0,'0',0,'0',0,'VAT Rate 5',1,NULL,NULL),(1401,140,15,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(1402,140,12,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1403,140,6,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1404,140,3,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(1405,140,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1521,152,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1522,152,15,0,'0',0,'0',0,'VAT Rate 15',1,NULL,NULL),(1541,154,0,0,'0',0,'0',0,'No VAT',1,NULL,NULL),(1542,154,16,0,'0',0,'0',0,'VAT 16%',1,NULL,NULL),(1543,154,10,0,'0',0,'0',0,'VAT Frontero',1,NULL,NULL),(1662,166,15,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(1663,166,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1731,173,25,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(1732,173,14,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1733,173,8,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1734,173,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1841,184,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(1842,184,7,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1843,184,3,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1844,184,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1881,188,24,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(1882,188,9,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1883,188,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1884,188,5,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1931,193,0,0,'0',0,'0',0,'No VAT in SPM',1,NULL,NULL),(2011,201,19,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(2012,201,10,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(2013,201,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(2021,202,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(2022,202,8.5,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(2023,202,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(2321,232,0,0,'0',0,'0',0,'No VAT',1,NULL,NULL),(2322,232,12,0,'0',0,'0',0,'VAT 12%',1,NULL,NULL),(2323,232,8,0,'0',0,'0',0,'VAT 8%',1,NULL,NULL),(2461,246,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(2462,4,15,0,'0',0,'0',0,'aaaa',1,NULL,NULL); +INSERT INTO `llx_c_tva` VALUES (11,1,20,0,'0',0,'0',0,'VAT standard rate (France hors DOM-TOM)',1,NULL,NULL),(12,1,8.5,0,'0',0,'0',0,'VAT standard rate (DOM sauf Guyane et Saint-Martin)',0,NULL,NULL),(13,1,8.5,0,'0',0,'0',1,'VAT standard rate (DOM sauf Guyane et Saint-Martin), non perçu par le vendeur mais récupérable par acheteur',0,NULL,NULL),(14,1,5.5,0,'0',0,'0',0,'VAT reduced rate (France hors DOM-TOM)',1,NULL,NULL),(15,1,0,0,'0',0,'0',0,'VAT Rate 0 ou non applicable',1,NULL,NULL),(16,1,2.1,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(21,2,21,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(22,2,6,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(23,2,0,0,'0',0,'0',0,'VAT Rate 0 ou non applicable',1,NULL,NULL),(24,2,12,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(31,3,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(32,3,10,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(33,3,4,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(34,3,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(41,4,21,5.2,'3',-21,'1',0,'VAT standard rate',1,NULL,NULL),(42,4,10,1.4,'3',-21,'1',0,'VAT reduced rate',1,NULL,NULL),(43,4,4,0.5,'3',-21,'1',0,'VAT super-reduced rate',1,NULL,NULL),(44,4,0,0,'3',-21,'1',0,'VAT Rate 0',1,NULL,NULL),(51,5,19,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(52,5,7,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(53,5,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(61,6,7.6,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(62,6,3.6,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(63,6,2.4,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(64,6,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(71,7,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(72,7,17.5,0,'0',0,'0',0,'VAT standard rate before 2011',1,NULL,NULL),(73,7,5,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(74,7,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(91,9,17,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(92,9,13,0,'0',0,'0',0,'VAT reduced rate 0',1,NULL,NULL),(93,9,3,0,'0',0,'0',0,'VAT super reduced rate 0',1,NULL,NULL),(94,9,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(101,10,6,0,'0',0,'0',0,'VAT 6%',1,NULL,NULL),(102,10,12,1,'4',0,'0',0,'VAT 12%',1,NULL,NULL),(103,10,18,0,'0',0,'0',0,'VAT 18%',1,NULL,NULL),(104,10,7.5,1,'4',0,'0',0,'VAT 6% Majoré à 25% (7.5%)',1,NULL,NULL),(105,10,15,1,'4',0,'0',0,'VAT 12% Majoré à 25% (15%)',1,NULL,NULL),(106,10,22.5,1,'4',0,'0',0,'VAT 18% Majoré à 25% (22.5%)',1,NULL,NULL),(107,10,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(111,11,0,0,'0',0,'0',0,'No Sales Tax',1,NULL,NULL),(112,11,4,0,'0',0,'0',0,'Sales Tax 4%',1,NULL,NULL),(113,11,6,0,'0',0,'0',0,'Sales Tax 6%',1,NULL,NULL),(121,12,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(122,12,14,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(123,12,10,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(124,12,7,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(125,12,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(141,14,7,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(142,14,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(143,14,5,9.975,'1',0,'0',0,'TPS and TVQ rate',1,NULL,NULL),(171,17,19,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(172,17,6,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(173,17,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(201,20,25,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(202,20,12,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(203,20,6,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(204,20,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(231,23,21,0,'0',0,'0',0,'IVA standard rate',1,NULL,NULL),(232,23,10.5,0,'0',0,'0',0,'IVA reduced rate',1,NULL,NULL),(233,23,0,0,'0',0,'0',0,'IVA Rate 0',1,NULL,NULL),(251,25,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(252,25,12,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(253,25,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(254,25,5,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(271,27,20,0,'0',0,'0',0,'VAT standard rate (France hors DOM-TOM)',1,NULL,NULL),(272,27,8.5,0,'0',0,'0',0,'VAT standard rate (DOM sauf Guyane et Saint-Martin)',0,NULL,NULL),(273,27,8.5,0,'0',0,'0',1,'VAT standard rate (DOM sauf Guyane et Saint-Martin), non perçu par le vendeur mais récupérable par acheteur',0,NULL,NULL),(274,27,5.5,0,'0',0,'0',0,'VAT reduced rate (France hors DOM-TOM)',0,NULL,NULL),(275,27,0,0,'0',0,'0',0,'VAT Rate 0 ou non applicable',1,NULL,NULL),(276,27,2.1,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(277,27,7,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(281,28,10,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(282,28,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(411,41,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(412,41,10,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(413,41,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(461,46,0,0,'0',0,'0',0,'No VAT',1,NULL,NULL),(462,46,15,0,'0',0,'0',0,'VAT 15%',1,NULL,NULL),(463,46,7.5,0,'0',0,'0',0,'VAT 7.5%',1,NULL,NULL),(591,59,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(592,59,7,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(593,59,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(671,67,19,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(672,67,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(801,80,25,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(802,80,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(861,86,13,0,'0',0,'0',0,'IVA 13',1,NULL,NULL),(862,86,0,0,'0',0,'0',0,'SIN IVA',1,NULL,NULL),(1141,114,0,0,'0',0,'0',0,'No ISV',1,NULL,NULL),(1142,114,12,0,'0',0,'0',0,'ISV 12%',1,NULL,NULL),(1161,116,25.5,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(1162,116,7,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1163,116,0,0,'0',0,'0',0,'VAT rate 0',1,NULL,NULL),(1171,117,12.5,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(1172,117,4,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1173,117,1,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(1174,117,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1231,123,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1232,123,5,0,'0',0,'0',0,'VAT Rate 5',1,NULL,NULL),(1401,140,15,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(1402,140,12,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1403,140,6,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1404,140,3,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(1405,140,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1521,152,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1522,152,15,0,'0',0,'0',0,'VAT Rate 15',1,NULL,NULL),(1541,154,0,0,'0',0,'0',0,'No VAT',1,NULL,NULL),(1542,154,16,0,'0',0,'0',0,'VAT 16%',1,NULL,NULL),(1543,154,10,0,'0',0,'0',0,'VAT Frontero',1,NULL,NULL),(1662,166,15,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(1663,166,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1731,173,25,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(1732,173,14,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1733,173,8,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1734,173,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1841,184,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(1842,184,7,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1843,184,3,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1844,184,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1881,188,24,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(1882,188,9,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1883,188,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1884,188,5,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1931,193,0,0,'0',0,'0',0,'No VAT in SPM',1,NULL,NULL),(2011,201,19,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(2012,201,10,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(2013,201,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(2021,202,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(2022,202,8.5,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(2023,202,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(2321,232,0,0,'0',0,'0',0,'No VAT',1,NULL,NULL),(2322,232,12,0,'0',0,'0',0,'VAT 12%',1,NULL,NULL),(2323,232,8,0,'0',0,'0',0,'VAT 8%',1,NULL,NULL),(2461,246,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(2462,4,15,0,'0',0,'0',0,'aaaa',1,NULL,NULL); /*!40000 ALTER TABLE `llx_c_tva` ENABLE KEYS */; UNLOCK TABLES; diff --git a/dev/initdata/mysqldump_dolibarr_3.6.0.sql b/dev/initdata/mysqldump_dolibarr_3.6.0.sql index 3d012f7225af4d8fa8f60ed353aa39348db62ad2..905d21795340258eff909dcb286f735ad129d991 100644 --- a/dev/initdata/mysqldump_dolibarr_3.6.0.sql +++ b/dev/initdata/mysqldump_dolibarr_3.6.0.sql @@ -1652,7 +1652,7 @@ CREATE TABLE `llx_c_tva` ( LOCK TABLES `llx_c_tva` WRITE; /*!40000 ALTER TABLE `llx_c_tva` DISABLE KEYS */; -INSERT INTO `llx_c_tva` VALUES (11,1,19.6,0,'0',0,'0',0,'VAT standard rate (France hors DOM-TOM)',1,NULL,NULL),(12,1,8.5,0,'0',0,'0',0,'VAT standard rate (DOM sauf Guyane et Saint-Martin)',0,NULL,NULL),(13,1,8.5,0,'0',0,'0',1,'VAT standard rate (DOM sauf Guyane et Saint-Martin), non perçu par le vendeur mais récupérable par acheteur',0,NULL,NULL),(14,1,5.5,0,'0',0,'0',0,'VAT reduced rate (France hors DOM-TOM)',1,NULL,NULL),(15,1,0,0,'0',0,'0',0,'VAT Rate 0 ou non applicable',1,NULL,NULL),(16,1,2.1,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(21,2,21,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(22,2,6,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(23,2,0,0,'0',0,'0',0,'VAT Rate 0 ou non applicable',1,NULL,NULL),(24,2,12,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(31,3,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(32,3,10,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(33,3,4,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(34,3,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(41,4,21,5.2,'3',-21,'1',0,'VAT standard rate',1,NULL,NULL),(42,4,10,1.4,'3',-21,'1',0,'VAT reduced rate',1,NULL,NULL),(43,4,4,0.5,'3',-21,'1',0,'VAT super-reduced rate',1,NULL,NULL),(44,4,0,0,'3',-21,'1',0,'VAT Rate 0',1,NULL,NULL),(51,5,19,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(52,5,7,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(53,5,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(61,6,7.6,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(62,6,3.6,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(63,6,2.4,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(64,6,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(71,7,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(72,7,17.5,0,'0',0,'0',0,'VAT standard rate before 2011',1,NULL,NULL),(73,7,5,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(74,7,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(91,9,17,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(92,9,13,0,'0',0,'0',0,'VAT reduced rate 0',1,NULL,NULL),(93,9,3,0,'0',0,'0',0,'VAT super reduced rate 0',1,NULL,NULL),(94,9,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(101,10,6,0,'0',0,'0',0,'VAT 6%',1,NULL,NULL),(102,10,12,1,'4',0,'0',0,'VAT 12%',1,NULL,NULL),(103,10,18,0,'0',0,'0',0,'VAT 18%',1,NULL,NULL),(104,10,7.5,1,'4',0,'0',0,'VAT 6% Majoré à 25% (7.5%)',1,NULL,NULL),(105,10,15,1,'4',0,'0',0,'VAT 12% Majoré à 25% (15%)',1,NULL,NULL),(106,10,22.5,1,'4',0,'0',0,'VAT 18% Majoré à 25% (22.5%)',1,NULL,NULL),(107,10,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(111,11,0,0,'0',0,'0',0,'No Sales Tax',1,NULL,NULL),(112,11,4,0,'0',0,'0',0,'Sales Tax 4%',1,NULL,NULL),(113,11,6,0,'0',0,'0',0,'Sales Tax 6%',1,NULL,NULL),(121,12,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(122,12,14,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(123,12,10,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(124,12,7,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(125,12,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(141,14,7,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(142,14,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(143,14,5,9.975,'1',0,'0',0,'TPS and TVQ rate',1,NULL,NULL),(171,17,19,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(172,17,6,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(173,17,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(201,20,25,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(202,20,12,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(203,20,6,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(204,20,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(231,23,21,0,'0',0,'0',0,'IVA standard rate',1,NULL,NULL),(232,23,10.5,0,'0',0,'0',0,'IVA reduced rate',1,NULL,NULL),(233,23,0,0,'0',0,'0',0,'IVA Rate 0',1,NULL,NULL),(251,25,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(252,25,12,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(253,25,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(254,25,5,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(271,27,19.6,0,'0',0,'0',0,'VAT standard rate (France hors DOM-TOM)',1,NULL,NULL),(272,27,8.5,0,'0',0,'0',0,'VAT standard rate (DOM sauf Guyane et Saint-Martin)',0,NULL,NULL),(273,27,8.5,0,'0',0,'0',1,'VAT standard rate (DOM sauf Guyane et Saint-Martin), non perçu par le vendeur mais récupérable par acheteur',0,NULL,NULL),(274,27,5.5,0,'0',0,'0',0,'VAT reduced rate (France hors DOM-TOM)',0,NULL,NULL),(275,27,0,0,'0',0,'0',0,'VAT Rate 0 ou non applicable',1,NULL,NULL),(276,27,2.1,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(277,27,7,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(281,28,10,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(282,28,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(411,41,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(412,41,10,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(413,41,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(461,46,0,0,'0',0,'0',0,'No VAT',1,NULL,NULL),(462,46,15,0,'0',0,'0',0,'VAT 15%',1,NULL,NULL),(463,46,7.5,0,'0',0,'0',0,'VAT 7.5%',1,NULL,NULL),(591,59,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(592,59,7,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(593,59,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(671,67,19,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(672,67,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(801,80,25,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(802,80,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(861,86,13,0,'0',0,'0',0,'IVA 13',1,NULL,NULL),(862,86,0,0,'0',0,'0',0,'SIN IVA',1,NULL,NULL),(1141,114,0,0,'0',0,'0',0,'No ISV',1,NULL,NULL),(1142,114,12,0,'0',0,'0',0,'ISV 12%',1,NULL,NULL),(1161,116,25.5,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(1162,116,7,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1163,116,0,0,'0',0,'0',0,'VAT rate 0',1,NULL,NULL),(1171,117,12.5,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(1172,117,4,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1173,117,1,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(1174,117,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1231,123,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1232,123,5,0,'0',0,'0',0,'VAT Rate 5',1,NULL,NULL),(1401,140,15,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(1402,140,12,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1403,140,6,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1404,140,3,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(1405,140,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1521,152,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1522,152,15,0,'0',0,'0',0,'VAT Rate 15',1,NULL,NULL),(1541,154,0,0,'0',0,'0',0,'No VAT',1,NULL,NULL),(1542,154,16,0,'0',0,'0',0,'VAT 16%',1,NULL,NULL),(1543,154,10,0,'0',0,'0',0,'VAT Frontero',1,NULL,NULL),(1662,166,15,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(1663,166,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1731,173,25,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(1732,173,14,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1733,173,8,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1734,173,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1841,184,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(1842,184,7,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1843,184,3,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1844,184,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1881,188,24,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(1882,188,9,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1883,188,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1884,188,5,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1931,193,0,0,'0',0,'0',0,'No VAT in SPM',1,NULL,NULL),(2011,201,19,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(2012,201,10,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(2013,201,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(2021,202,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(2022,202,8.5,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(2023,202,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(2321,232,0,0,'0',0,'0',0,'No VAT',1,NULL,NULL),(2322,232,12,0,'0',0,'0',0,'VAT 12%',1,NULL,NULL),(2323,232,8,0,'0',0,'0',0,'VAT 8%',1,NULL,NULL),(2461,246,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(2462,4,15,0,'0',0,'0',0,'aaaa',1,NULL,NULL); +INSERT INTO `llx_c_tva` VALUES (11,1,20,0,'0',0,'0',0,'VAT standard rate (France hors DOM-TOM)',1,NULL,NULL),(12,1,8.5,0,'0',0,'0',0,'VAT standard rate (DOM sauf Guyane et Saint-Martin)',0,NULL,NULL),(13,1,8.5,0,'0',0,'0',1,'VAT standard rate (DOM sauf Guyane et Saint-Martin), non perçu par le vendeur mais récupérable par acheteur',0,NULL,NULL),(14,1,5.5,0,'0',0,'0',0,'VAT reduced rate (France hors DOM-TOM)',1,NULL,NULL),(15,1,0,0,'0',0,'0',0,'VAT Rate 0 ou non applicable',1,NULL,NULL),(16,1,2.1,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(21,2,21,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(22,2,6,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(23,2,0,0,'0',0,'0',0,'VAT Rate 0 ou non applicable',1,NULL,NULL),(24,2,12,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(31,3,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(32,3,10,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(33,3,4,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(34,3,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(41,4,21,5.2,'3',-21,'1',0,'VAT standard rate',1,NULL,NULL),(42,4,10,1.4,'3',-21,'1',0,'VAT reduced rate',1,NULL,NULL),(43,4,4,0.5,'3',-21,'1',0,'VAT super-reduced rate',1,NULL,NULL),(44,4,0,0,'3',-21,'1',0,'VAT Rate 0',1,NULL,NULL),(51,5,19,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(52,5,7,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(53,5,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(61,6,7.6,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(62,6,3.6,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(63,6,2.4,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(64,6,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(71,7,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(72,7,17.5,0,'0',0,'0',0,'VAT standard rate before 2011',1,NULL,NULL),(73,7,5,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(74,7,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(91,9,17,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(92,9,13,0,'0',0,'0',0,'VAT reduced rate 0',1,NULL,NULL),(93,9,3,0,'0',0,'0',0,'VAT super reduced rate 0',1,NULL,NULL),(94,9,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(101,10,6,0,'0',0,'0',0,'VAT 6%',1,NULL,NULL),(102,10,12,1,'4',0,'0',0,'VAT 12%',1,NULL,NULL),(103,10,18,0,'0',0,'0',0,'VAT 18%',1,NULL,NULL),(104,10,7.5,1,'4',0,'0',0,'VAT 6% Majoré à 25% (7.5%)',1,NULL,NULL),(105,10,15,1,'4',0,'0',0,'VAT 12% Majoré à 25% (15%)',1,NULL,NULL),(106,10,22.5,1,'4',0,'0',0,'VAT 18% Majoré à 25% (22.5%)',1,NULL,NULL),(107,10,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(111,11,0,0,'0',0,'0',0,'No Sales Tax',1,NULL,NULL),(112,11,4,0,'0',0,'0',0,'Sales Tax 4%',1,NULL,NULL),(113,11,6,0,'0',0,'0',0,'Sales Tax 6%',1,NULL,NULL),(121,12,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(122,12,14,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(123,12,10,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(124,12,7,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(125,12,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(141,14,7,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(142,14,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(143,14,5,9.975,'1',0,'0',0,'TPS and TVQ rate',1,NULL,NULL),(171,17,19,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(172,17,6,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(173,17,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(201,20,25,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(202,20,12,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(203,20,6,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(204,20,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(231,23,21,0,'0',0,'0',0,'IVA standard rate',1,NULL,NULL),(232,23,10.5,0,'0',0,'0',0,'IVA reduced rate',1,NULL,NULL),(233,23,0,0,'0',0,'0',0,'IVA Rate 0',1,NULL,NULL),(251,25,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(252,25,12,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(253,25,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(254,25,5,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(271,27,20,0,'0',0,'0',0,'VAT standard rate (France hors DOM-TOM)',1,NULL,NULL),(272,27,8.5,0,'0',0,'0',0,'VAT standard rate (DOM sauf Guyane et Saint-Martin)',0,NULL,NULL),(273,27,8.5,0,'0',0,'0',1,'VAT standard rate (DOM sauf Guyane et Saint-Martin), non perçu par le vendeur mais récupérable par acheteur',0,NULL,NULL),(274,27,5.5,0,'0',0,'0',0,'VAT reduced rate (France hors DOM-TOM)',0,NULL,NULL),(275,27,0,0,'0',0,'0',0,'VAT Rate 0 ou non applicable',1,NULL,NULL),(276,27,2.1,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(277,27,7,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(281,28,10,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(282,28,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(411,41,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(412,41,10,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(413,41,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(461,46,0,0,'0',0,'0',0,'No VAT',1,NULL,NULL),(462,46,15,0,'0',0,'0',0,'VAT 15%',1,NULL,NULL),(463,46,7.5,0,'0',0,'0',0,'VAT 7.5%',1,NULL,NULL),(591,59,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(592,59,7,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(593,59,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(671,67,19,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(672,67,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(801,80,25,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(802,80,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(861,86,13,0,'0',0,'0',0,'IVA 13',1,NULL,NULL),(862,86,0,0,'0',0,'0',0,'SIN IVA',1,NULL,NULL),(1141,114,0,0,'0',0,'0',0,'No ISV',1,NULL,NULL),(1142,114,12,0,'0',0,'0',0,'ISV 12%',1,NULL,NULL),(1161,116,25.5,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(1162,116,7,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1163,116,0,0,'0',0,'0',0,'VAT rate 0',1,NULL,NULL),(1171,117,12.5,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(1172,117,4,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1173,117,1,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(1174,117,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1231,123,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1232,123,5,0,'0',0,'0',0,'VAT Rate 5',1,NULL,NULL),(1401,140,15,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(1402,140,12,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1403,140,6,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1404,140,3,0,'0',0,'0',0,'VAT super-reduced rate',1,NULL,NULL),(1405,140,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1521,152,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1522,152,15,0,'0',0,'0',0,'VAT Rate 15',1,NULL,NULL),(1541,154,0,0,'0',0,'0',0,'No VAT',1,NULL,NULL),(1542,154,16,0,'0',0,'0',0,'VAT 16%',1,NULL,NULL),(1543,154,10,0,'0',0,'0',0,'VAT Frontero',1,NULL,NULL),(1662,166,15,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(1663,166,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1731,173,25,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(1732,173,14,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1733,173,8,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1734,173,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1841,184,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(1842,184,7,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1843,184,3,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1844,184,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1881,188,24,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(1882,188,9,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1883,188,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(1884,188,5,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(1931,193,0,0,'0',0,'0',0,'No VAT in SPM',1,NULL,NULL),(2011,201,19,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(2012,201,10,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(2013,201,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(2021,202,20,0,'0',0,'0',0,'VAT standard rate',1,NULL,NULL),(2022,202,8.5,0,'0',0,'0',0,'VAT reduced rate',1,NULL,NULL),(2023,202,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(2321,232,0,0,'0',0,'0',0,'No VAT',1,NULL,NULL),(2322,232,12,0,'0',0,'0',0,'VAT 12%',1,NULL,NULL),(2323,232,8,0,'0',0,'0',0,'VAT 8%',1,NULL,NULL),(2461,246,0,0,'0',0,'0',0,'VAT Rate 0',1,NULL,NULL),(2462,4,15,0,'0',0,'0',0,'aaaa',1,NULL,NULL); /*!40000 ALTER TABLE `llx_c_tva` ENABLE KEYS */; UNLOCK TABLES; diff --git a/htdocs/admin/agenda_extsites.php b/htdocs/admin/agenda_extsites.php index 9a3a95f924c1cc1cfe453c53758cd329937f970a..6976fef48827bb7b7188437e816b41c9a0d407a2 100644 --- a/htdocs/admin/agenda_extsites.php +++ b/htdocs/admin/agenda_extsites.php @@ -1,6 +1,6 @@ <?php /* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net> - * Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es> + * Copyright (C) 2011-2014 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 @@ -28,6 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; if (!$user->admin) accessforbidden(); @@ -228,4 +229,4 @@ dol_fiche_end(); llxFooter(); $db->close(); -?> \ No newline at end of file +?> diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php index 59f3b3f3856a4dad2c4c28f56cddb94860335c5e..9b5d411b136e61a9c98fd9b75f2542ae96afa207 100644 --- a/htdocs/admin/system/dolibarr.php +++ b/htdocs/admin/system/dolibarr.php @@ -155,7 +155,8 @@ print '<tr '.$bc[$var].'><td width="300"> => price(1234.56)</td><td>'.pric // Timezone $txt =$langs->trans("OSTZ").' (variable system TZ): '.(! empty($_ENV["TZ"])?$_ENV["TZ"]:$langs->trans("NotDefined")).'<br>'."\n"; $txt.=$langs->trans("PHPTZ").' (php.ini date.timezone): '.(ini_get("date.timezone")?ini_get("date.timezone"):$langs->trans("NotDefined")).''."<br>\n"; // date.timezone must be in valued defined in http://fr3.php.net/manual/en/timezones.europe.php -$txt.=$langs->trans("YouCanEditPHPTZ"); +$txt.=$langs->trans("Dolibarr constant MAIN_SERVER_TZ").': '.(empty($conf->global->MAIN_SERVER_TZ)?$langs->trans("NotDefined"):$conf->global->MAIN_SERVER_TZ); +//$txt.=$langs->trans("YouCanEditPHPTZ"); // deprecated $var=!$var; print '<tr '.$bc[$var].'><td width="300">'.$langs->trans("CurrentTimeZone").'</td><td>'; // Timezone server PHP $a=getServerTimeZoneInt('now'); diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index a2be9d478f2dd6fc83d904cfbb0e5bf23934d530..831eb3f52ad748e5856938b73b37e28a6607a1c9 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1,7 +1,7 @@ <?php /* Copyright (C) 2002-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org> * Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com> - * Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net> + * Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> @@ -26,10 +26,11 @@ */ /** - * \file htdocs/compta/facture.php + * \file htdocs/compta/facture.php * \ingroup facture - * \brief Page to create/see an invoice + * \brief Page to create/see an invoice */ + require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT . '/compta/paiement/class/paiement.class.php'; @@ -81,8 +82,7 @@ $hideref = (GETPOST('hideref', 'int') ? GETPOST('hideref', 'int') : (! empty($co // Security check $fieldid = (! empty($ref) ? 'facnumber' : 'rowid'); -if ($user->societe_id) - $socid = $user->societe_id; +if ($user->societe_id) $socid = $user->societe_id; $result = restrictedArea($user, 'facture', $id, '', '', 'fk_soc', $fieldid); // Nombre de ligne pour choix de produit/service predefinis @@ -236,7 +236,7 @@ else if ($action == 'set_thirdparty' && $user->rights->facture->creer) { else if ($action == 'classin' && $user->rights->facture->creer) { $object->fetch($id); - $object->setProject($_POST ['projectid']); + $object->setProject($_POST['projectid']); } else if ($action == 'setmode' && $user->rights->facture->creer) { @@ -244,10 +244,12 @@ else if ($action == 'setmode' && $user->rights->facture->creer) { $result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int')); if ($result < 0) dol_print_error($db, $object->error); -} else if ($action == 'setinvoicedate' && $user->rights->facture->creer) { +} + +else if ($action == 'setinvoicedate' && $user->rights->facture->creer) { $object->fetch($id); $old_date_lim_reglement = $object->date_lim_reglement; - $object->date = dol_mktime(12, 0, 0, $_POST ['invoicedatemonth'], $_POST ['invoicedateday'], $_POST ['invoicedateyear']); + $object->date = dol_mktime(12, 0, 0, $_POST['invoicedatemonth'], $_POST['invoicedateday'], $_POST['invoicedateyear']); $new_date_lim_reglement = $object->calculate_date_lim_reglement(); if ($new_date_lim_reglement > $old_date_lim_reglement) $object->date_lim_reglement = $new_date_lim_reglement; @@ -256,7 +258,9 @@ else if ($action == 'setmode' && $user->rights->facture->creer) { $result = $object->update($user); if ($result < 0) dol_print_error($db, $object->error); -} else if ($action == 'setconditions' && $user->rights->facture->creer) { +} + +else if ($action == 'setconditions' && $user->rights->facture->creer) { $object->fetch($id); $object->cond_reglement_code = 0; // To clean property $object->cond_reglement_id = 0; // To clean property @@ -273,9 +277,11 @@ else if ($action == 'setmode' && $user->rights->facture->creer) { $result = $object->update($user); if ($result < 0) dol_print_error($db, $object->error); -} else if ($action == 'setpaymentterm' && $user->rights->facture->creer) { +} + +else if ($action == 'setpaymentterm' && $user->rights->facture->creer) { $object->fetch($id); - $object->date_lim_reglement = dol_mktime(12, 0, 0, $_POST ['paymenttermmonth'], $_POST ['paymenttermday'], $_POST ['paymenttermyear']); + $object->date_lim_reglement = dol_mktime(12, 0, 0, $_POST['paymenttermmonth'], $_POST['paymenttermday'], $_POST['paymenttermyear']); if ($object->date_lim_reglement < $object->date) { $object->date_lim_reglement = $object->calculate_date_lim_reglement(); setEventMessage($langs->trans("DatePaymentTermCantBeLowerThanObjectDate"), 'warnings'); @@ -283,22 +289,28 @@ else if ($action == 'setmode' && $user->rights->facture->creer) { $result = $object->update($user); if ($result < 0) dol_print_error($db, $object->error); -} else if ($action == 'setrevenuestamp' && $user->rights->facture->creer) { +} + +else if ($action == 'setrevenuestamp' && $user->rights->facture->creer) { $object->fetch($id); $object->revenuestamp = GETPOST('revenuestamp'); $result = $object->update($user); $object->update_price(1); if ($result < 0) dol_print_error($db, $object->error); -} else if ($action == 'setremisepercent' && $user->rights->facture->creer) { +} + +else if ($action == 'setremisepercent' && $user->rights->facture->creer) { $object->fetch($id); - $result = $object->set_remise($user, $_POST ['remise_percent']); -} else if ($action == "setabsolutediscount" && $user->rights->facture->creer) { + $result = $object->set_remise($user, $_POST['remise_percent']); +} + +else if ($action == "setabsolutediscount" && $user->rights->facture->creer) { // POST[remise_id] ou POST[remise_id_for_payment] - if (! empty($_POST ["remise_id"])) { + if (! empty($_POST["remise_id"])) { $ret = $object->fetch($id); if ($ret > 0) { - $result = $object->insert_discount($_POST ["remise_id"]); + $result = $object->insert_discount($_POST["remise_id"]); if ($result < 0) { $mesgs [] = '<div class="error">' . $object->error . '</div>'; } @@ -306,10 +318,10 @@ else if ($action == 'setmode' && $user->rights->facture->creer) { dol_print_error($db, $object->error); } } - if (! empty($_POST ["remise_id_for_payment"])) { + if (! empty($_POST["remise_id_for_payment"])) { require_once DOL_DOCUMENT_ROOT . '/core/class/discount.class.php'; $discount = new DiscountAbsolute($db); - $discount->fetch($_POST ["remise_id_for_payment"]); + $discount->fetch($_POST["remise_id_for_payment"]); $result = $discount->link_to_invoice(0, $id); if ($result < 0) { @@ -320,7 +332,7 @@ else if ($action == 'setmode' && $user->rights->facture->creer) { else if ($action == 'set_ref_client' && $user->rights->facture->creer) { $object->fetch($id); - $object->set_ref_client($_POST ['ref_client']); + $object->set_ref_client($_POST['ref_client']); } // Classify to validated @@ -468,8 +480,8 @@ else if ($action == 'confirm_paid' && $confirm == 'yes' && $user->rights->factur } // Classif "paid partialy" else if ($action == 'confirm_paid_partially' && $confirm == 'yes' && $user->rights->facture->paiement) { $object->fetch($id); - $close_code = $_POST ["close_code"]; - $close_note = $_POST ["close_note"]; + $close_code = $_POST["close_code"]; + $close_note = $_POST["close_note"]; if ($close_code) { $result = $object->set_paid($user, $close_code, $close_note); } else { @@ -478,8 +490,8 @@ else if ($action == 'confirm_paid_partially' && $confirm == 'yes' && $user->righ } // Classify "abandoned" else if ($action == 'confirm_canceled' && $confirm == 'yes') { $object->fetch($id); - $close_code = $_POST ["close_code"]; - $close_note = $_POST ["close_note"]; + $close_code = $_POST["close_code"]; + $close_note = $_POST["close_note"]; if ($close_code) { $result = $object->set_canceled($user, $close_code, $close_note); } else { @@ -488,15 +500,23 @@ else if ($action == 'confirm_canceled' && $confirm == 'yes') { } // Convertir en reduc -else if ($action == 'confirm_converttoreduc' && $confirm == 'yes' && $user->rights->facture->creer) { - $db->begin(); - +else if ($action == 'confirm_converttoreduc' && $confirm == 'yes' && $user->rights->facture->creer) +{ $object->fetch($id); $object->fetch_thirdparty(); $object->fetch_lines(); - if (! $object->paye) // protection against multiple submit + // Check if there is already a discount (protection to avoid duplicate creation when resubmit post) + $discountcheck=new DiscountAbsolute($db); + $result=$discountcheck->fetch(0,$object->id); + + $canconvert=0; + if ($object->type == Facture::TYPE_DEPOSIT && $object->paye == 1 && empty($discountcheck->id)) $canconvert=1; // we can convert deposit into discount if deposit is payed completely and not already converted (see real condition into condition used to show button converttoreduc) + if ($object->type == Facture::TYPE_CREDIT_NOTE && $object->paye == 0 && empty($discountcheck->id)) $canconvert=1; // we can convert credit note into discount if credit note is not payed back and not already converted and amount of payment is 0 (see real condition into condition used to show button converttoreduc) + if ($canconvert) { + $db->begin(); + // Boucle sur chaque taux de tva $i = 0; foreach ($object->lines as $line) { @@ -513,8 +533,7 @@ else if ($action == 'confirm_converttoreduc' && $confirm == 'yes' && $user->righ elseif ($object->type == Facture::TYPE_DEPOSIT) $discount->description = '(DEPOSIT)'; else { - $this->error = "CantConvertToReducAnInvoiceOfThisType"; - return - 1; + setEventMessage($langs->trans('CantConvertToReducAnInvoiceOfThisType'),'errors'); } $discount->tva_tx = abs($object->total_ttc); $discount->fk_soc = $object->socid; @@ -528,24 +547,31 @@ else if ($action == 'confirm_converttoreduc' && $confirm == 'yes' && $user->righ $discount->tva_tx = abs($tva_tx); $result = $discount->create($user); - if ($result < 0) { - $error ++; + if ($result < 0) + { + $error++; break; } } - if (! $error) { + if (empty($error)) + { // Classe facture $result = $object->set_paid($user); - if ($result > 0) { - // $mesgs[]='OK'.$discount->id; + if ($result >= 0) + { + //$mesgs[]='OK'.$discount->id; $db->commit(); - } else { - $mesgs [] = '<div class="error">' . $object->error . '</div>'; + } + else + { + setEventMessage($object->error,'errors'); $db->rollback(); } - } else { - $mesgs [] = '<div class="error">' . $discount->error . '</div>'; + } + else + { + setEventMessage($discount->error,'errors'); $db->rollback(); } } @@ -554,9 +580,9 @@ else if ($action == 'confirm_converttoreduc' && $confirm == 'yes' && $user->righ /* * Insert new invoice in database */ -else if ($action == 'add' && $user->rights->facture->creer) { - if ($socid > 0) - $object->socid = GETPOST('socid', 'int'); +else if ($action == 'add' && $user->rights->facture->creer) +{ + if ($socid > 0) $object->socid = GETPOST('socid', 'int'); $db->begin(); @@ -565,41 +591,41 @@ else if ($action == 'add' && $user->rights->facture->creer) { // Fill array 'array_options' with data from add form $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); $ret = $extrafields->setOptionalsFromPost($extralabels, $object); - if ($ret < 0) - $error ++; + if ($ret < 0) $error ++; // Replacement invoice - if ($_POST ['type'] == 1) { - $datefacture = dol_mktime(12, 0, 0, $_POST ['remonth'], $_POST ['reday'], $_POST ['reyear']); + if ($_POST['type'] == Facture::TYPE_REPLACEMENT) + { + $datefacture = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); if (empty($datefacture)) { $error ++; setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), 'errors'); } - if (! ($_POST ['fac_replacement'] > 0)) { + if (! ($_POST['fac_replacement'] > 0)) { $error ++; setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ReplaceInvoice")), 'errors'); } if (! $error) { // This is a replacement invoice - $result = $object->fetch($_POST ['fac_replacement']); + $result = $object->fetch($_POST['fac_replacement']); $object->fetch_thirdparty(); $object->date = $datefacture; - $object->note_public = trim($_POST ['note_public']); - $object->note = trim($_POST ['note']); - $object->ref_client = $_POST ['ref_client']; - $object->ref_int = $_POST ['ref_int']; - $object->modelpdf = $_POST ['model']; - $object->fk_project = $_POST ['projectid']; - $object->cond_reglement_id = $_POST ['cond_reglement_id']; - $object->mode_reglement_id = $_POST ['mode_reglement_id']; - $object->remise_absolue = $_POST ['remise_absolue']; - $object->remise_percent = $_POST ['remise_percent']; + $object->note_public = trim($_POST['note_public']); + $object->note = trim($_POST['note']); + $object->ref_client = $_POST['ref_client']; + $object->ref_int = $_POST['ref_int']; + $object->modelpdf = $_POST['model']; + $object->fk_project = $_POST['projectid']; + $object->cond_reglement_id = $_POST['cond_reglement_id']; + $object->mode_reglement_id = $_POST['mode_reglement_id']; + $object->remise_absolue = $_POST['remise_absolue']; + $object->remise_percent = $_POST['remise_percent']; // Proprietes particulieres a facture de remplacement - $object->fk_facture_source = $_POST ['fac_replacement']; + $object->fk_facture_source = $_POST['fac_replacement']; $object->type = Facture::TYPE_REPLACEMENT; $id = $object->createFromCurrent($user); @@ -609,53 +635,57 @@ else if ($action == 'add' && $user->rights->facture->creer) { } // Credit note invoice - if ($_POST ['type'] == 2) { - if (! $_POST ['fac_avoir'] > 0) { + if ($_POST['type'] == Facture::TYPE_CREDIT_NOTE) + { + if (! ($_POST['fac_avoir'] > 0)) + { $error ++; setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CorrectInvoice")), 'errors'); } - $datefacture = dol_mktime(12, 0, 0, $_POST ['remonth'], $_POST ['reday'], $_POST ['reyear']); - if (empty($datefacture)) { + $datefacture = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); + if (empty($datefacture)) + { $error ++; setEventMessage($langs->trans("ErrorFieldRequired", $langs->trans("Date")), 'errors'); } - if (! $error) { + if (! $error) + { // Si facture avoir - $datefacture = dol_mktime(12, 0, 0, $_POST ['remonth'], $_POST ['reday'], $_POST ['reyear']); + $datefacture = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); // $result=$object->fetch($_POST['fac_avoir']); $object->socid = GETPOST('socid', 'int'); - $object->number = $_POST ['facnumber']; + $object->number = $_POST['facnumber']; $object->date = $datefacture; - $object->note_public = trim($_POST ['note_public']); - $object->note = trim($_POST ['note']); - $object->ref_client = $_POST ['ref_client']; - $object->ref_int = $_POST ['ref_int']; - $object->modelpdf = $_POST ['model']; - $object->fk_project = $_POST ['projectid']; + $object->note_public = trim($_POST['note_public']); + $object->note = trim($_POST['note']); + $object->ref_client = $_POST['ref_client']; + $object->ref_int = $_POST['ref_int']; + $object->modelpdf = $_POST['model']; + $object->fk_project = $_POST['projectid']; $object->cond_reglement_id = 0; - $object->mode_reglement_id = $_POST ['mode_reglement_id']; - $object->remise_absolue = $_POST ['remise_absolue']; - $object->remise_percent = $_POST ['remise_percent']; + $object->mode_reglement_id = $_POST['mode_reglement_id']; + $object->remise_absolue = $_POST['remise_absolue']; + $object->remise_percent = $_POST['remise_percent']; // Proprietes particulieres a facture avoir - $object->fk_facture_source = $_POST ['fac_avoir']; + $object->fk_facture_source = $_POST['fac_avoir']; $object->type = Facture::TYPE_CREDIT_NOTE; $id = $object->create($user); if(GETPOST('invoiceAvoirWithLines', 'int')==1 && $id>0) { - + $facture_source = new Facture($db); // fetch origin object if($facture_source->fetch($object->fk_facture_source)>0) { - + foreach($facture_source->lines as $line) { - - $line->fk_facture = $object->id; - + + $line->fk_facture = $object->id; + $line->subprice =-$line->subprice; // invert price for object $line->pa_ht = -$line->pa_ht; $line->total_ht=-$line->total_ht; @@ -663,48 +693,48 @@ else if ($action == 'add' && $user->rights->facture->creer) { $line->total_ttc=-$line->total_ttc; $line->total_localtax1=-$line->total_localtax1; $line->total_localtax2=-$line->total_localtax2; - + $line->insert(); - + $object->lines[] = $line; // insert new line in current object } - - $object->update_price(1); + + $object->update_price(1); } - + } - + if(GETPOST('invoiceAvoirWithPaymentRestAmount', 'int')==1 && $id>0) { - + $facture_source = new Facture($db); // fetch origin object if not previously defined if($facture_source->fetch($object->fk_facture_source)>0) { $totalpaye = $facture_source->getSommePaiement(); $totalcreditnotes = $facture_source->getSumCreditNotesUsed(); $totaldeposits = $facture_source->getSumDepositsUsed(); $remain_to_pay = abs($facture_source->total_ttc - $totalpaye - $totalcreditnotes - $totaldeposits); - - $object->addline($langs->trans('invoiceAvoirLineWithPaymentRestAmount'),$remain_to_pay,1,0,0,0,0,0,'','','TTC'); + + $object->addline($langs->trans('invoiceAvoirLineWithPaymentRestAmount'),$remain_to_pay,1,0,0,0,0,0,'','','TTC'); } } - + // Add predefined lines /* - TODO delete + TODO delete for($i = 1; $i <= $NBLINES; $i ++) { - if ($_POST ['idprod' . $i]) { + if ($_POST['idprod' . $i]) { $product = new Product($db); - $product->fetch($_POST ['idprod' . $i]); - $startday = dol_mktime(12, 0, 0, $_POST ['date_start' . $i . 'month'], $_POST ['date_start' . $i . 'day'], $_POST ['date_start' . $i . 'year']); - $endday = dol_mktime(12, 0, 0, $_POST ['date_end' . $i . 'month'], $_POST ['date_end' . $i . 'day'], $_POST ['date_end' . $i . 'year']); - $result = $object->addline($product->description, $product->price, $_POST ['qty' . $i], $product->tva_tx, $product->localtax1_tx, $product->localtax2_tx, $_POST ['idprod' . $i], $_POST ['remise_percent' . $i], $startday, $endday, 0, 0, '', $product->price_base_type, $product->price_ttc, $product->type); + $product->fetch($_POST['idprod' . $i]); + $startday = dol_mktime(12, 0, 0, $_POST['date_start' . $i . 'month'], $_POST['date_start' . $i . 'day'], $_POST['date_start' . $i . 'year']); + $endday = dol_mktime(12, 0, 0, $_POST['date_end' . $i . 'month'], $_POST['date_end' . $i . 'day'], $_POST['date_end' . $i . 'year']); + $result = $object->addline($product->description, $product->price, $_POST['qty' . $i], $product->tva_tx, $product->localtax1_tx, $product->localtax2_tx, $_POST['idprod' . $i], $_POST['remise_percent' . $i], $startday, $endday, 0, 0, '', $product->price_base_type, $product->price_ttc, $product->type); } }*/ } } // Standard invoice or Deposit invoice created from a Predefined invoice - if (($_POST ['type'] == 0 || $_POST ['type'] == 3) && $_POST ['fac_rec'] > 0) { - $datefacture = dol_mktime(12, 0, 0, $_POST ['remonth'], $_POST ['reday'], $_POST ['reyear']); + if (($_POST['type'] == 0 || $_POST['type'] == 3) && $_POST['fac_rec'] > 0) { + $datefacture = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); if (empty($datefacture)) { $error ++; setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), 'errors'); @@ -712,30 +742,30 @@ else if ($action == 'add' && $user->rights->facture->creer) { if (! $error) { $object->socid = GETPOST('socid', 'int'); - $object->type = $_POST ['type']; - $object->number = $_POST ['facnumber']; + $object->type = $_POST['type']; + $object->number = $_POST['facnumber']; $object->date = $datefacture; - $object->note_public = trim($_POST ['note_public']); - $object->note_private = trim($_POST ['note_private']); - $object->ref_client = $_POST ['ref_client']; - $object->ref_int = $_POST ['ref_int']; - $object->modelpdf = $_POST ['model']; + $object->note_public = trim($_POST['note_public']); + $object->note_private = trim($_POST['note_private']); + $object->ref_client = $_POST['ref_client']; + $object->ref_int = $_POST['ref_int']; + $object->modelpdf = $_POST['model']; // Source facture - $object->fac_rec = $_POST ['fac_rec']; + $object->fac_rec = $_POST['fac_rec']; $id = $object->create($user); } } // Standard or deposit or proforma invoice - if (($_POST ['type'] == 0 || $_POST ['type'] == 3 || $_POST ['type'] == 4) && $_POST ['fac_rec'] <= 0) { + if (($_POST['type'] == 0 || $_POST['type'] == 3 || $_POST['type'] == 4) && $_POST['fac_rec'] <= 0) { if (GETPOST('socid', 'int') < 1) { $error ++; setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Customer")), 'errors'); } - $datefacture = dol_mktime(12, 0, 0, $_POST ['remonth'], $_POST ['reday'], $_POST ['reyear']); + $datefacture = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); if (empty($datefacture)) { $error ++; setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), 'errors'); @@ -745,26 +775,26 @@ else if ($action == 'add' && $user->rights->facture->creer) { // Si facture standard $object->socid = GETPOST('socid', 'int'); $object->type = GETPOST('type'); - $object->number = $_POST ['facnumber']; + $object->number = $_POST['facnumber']; $object->date = $datefacture; - $object->note_public = trim($_POST ['note_public']); - $object->note_private = trim($_POST ['note_private']); - $object->ref_client = $_POST ['ref_client']; - $object->ref_int = $_POST ['ref_int']; - $object->modelpdf = $_POST ['model']; - $object->fk_project = $_POST ['projectid']; - $object->cond_reglement_id = ($_POST ['type'] == 3 ? 1 : $_POST ['cond_reglement_id']); - $object->mode_reglement_id = $_POST ['mode_reglement_id']; - $object->amount = $_POST ['amount']; - $object->remise_absolue = $_POST ['remise_absolue']; - $object->remise_percent = $_POST ['remise_percent']; + $object->note_public = trim($_POST['note_public']); + $object->note_private = trim($_POST['note_private']); + $object->ref_client = $_POST['ref_client']; + $object->ref_int = $_POST['ref_int']; + $object->modelpdf = $_POST['model']; + $object->fk_project = $_POST['projectid']; + $object->cond_reglement_id = ($_POST['type'] == 3 ? 1 : $_POST['cond_reglement_id']); + $object->mode_reglement_id = $_POST['mode_reglement_id']; + $object->amount = $_POST['amount']; + $object->remise_absolue = $_POST['remise_absolue']; + $object->remise_percent = $_POST['remise_percent']; $object->fetch_thirdparty(); // If creation from another object of another module (Example: origin=propal, originid=1) - if ($_POST ['origin'] && $_POST ['originid']) { + if ($_POST['origin'] && $_POST['originid']) { // Parse element/subelement (ex: project_task) - $element = $subelement = $_POST ['origin']; - if (preg_match('/^([^_]+)_([^_]+)/i', $_POST ['origin'], $regs)) { + $element = $subelement = $_POST['origin']; + if (preg_match('/^([^_]+)_([^_]+)/i', $_POST['origin'], $regs)) { $element = $regs [1]; $subelement = $regs [2]; } @@ -787,20 +817,20 @@ else if ($action == 'add' && $user->rights->facture->creer) { $element = $subelement = 'expedition'; } - $object->origin = $_POST ['origin']; - $object->origin_id = $_POST ['originid']; + $object->origin = $_POST['origin']; + $object->origin_id = $_POST['originid']; // Possibility to add external linked objects with hooks $object->linked_objects [$object->origin] = $object->origin_id; - if (is_array($_POST ['other_linked_objects']) && ! empty($_POST ['other_linked_objects'])) { - $object->linked_objects = array_merge($object->linked_objects, $_POST ['other_linked_objects']); + if (is_array($_POST['other_linked_objects']) && ! empty($_POST['other_linked_objects'])) { + $object->linked_objects = array_merge($object->linked_objects, $_POST['other_linked_objects']); } $id = $object->create($user); if ($id > 0) { // If deposit invoice - if ($_POST ['type'] == 3) { + if ($_POST['type'] == 3) { $typeamount = GETPOST('typedeposit', 'alpha'); $valuedeposit = GETPOST('valuedeposit', 'int'); @@ -970,12 +1000,12 @@ else if ($action == 'add' && $user->rights->facture->creer) { $id = $object->create($user); for($i = 1; $i <= $NBLINES; $i ++) { - if ($_POST ['idprod' . $i]) { + if ($_POST['idprod' . $i]) { $product = new Product($db); - $product->fetch($_POST ['idprod' . $i]); - $startday = dol_mktime(12, 0, 0, $_POST ['date_start' . $i . 'month'], $_POST ['date_start' . $i . 'day'], $_POST ['date_start' . $i . 'year']); - $endday = dol_mktime(12, 0, 0, $_POST ['date_end' . $i . 'month'], $_POST ['date_end' . $i . 'day'], $_POST ['date_end' . $i . 'year']); - $result = $object->addline($product->description, $product->price, $_POST ['qty' . $i], $product->tva_tx, $product->localtax1_tx, $product->localtax2_tx, $_POST ['idprod' . $i], $_POST ['remise_percent' . $i], $startday, $endday, 0, 0, '', $product->price_base_type, $product->price_ttc, $product->type); + $product->fetch($_POST['idprod' . $i]); + $startday = dol_mktime(12, 0, 0, $_POST['date_start' . $i . 'month'], $_POST['date_start' . $i . 'day'], $_POST['date_start' . $i . 'year']); + $endday = dol_mktime(12, 0, 0, $_POST['date_end' . $i . 'month'], $_POST['date_end' . $i . 'day'], $_POST['date_end' . $i . 'year']); + $result = $object->addline($product->description, $product->price, $_POST['qty' . $i], $product->tva_tx, $product->localtax1_tx, $product->localtax2_tx, $_POST['idprod' . $i], $_POST['remise_percent' . $i], $startday, $endday, 0, 0, '', $product->price_base_type, $product->price_ttc, $product->type); } } } @@ -983,40 +1013,47 @@ else if ($action == 'add' && $user->rights->facture->creer) { } // End of object creation, we show it - if ($id > 0 && ! $error) { + if ($id > 0 && ! $error) + { $db->commit(); header('Location: ' . $_SERVER ["PHP_SELF"] . '?facid=' . $id); exit(); - } else { + } + else + { $db->rollback(); $action = 'create'; - $_GET ["origin"] = $_POST ["origin"]; - $_GET ["originid"] = $_POST ["originid"]; + $_GET ["origin"] = $_POST["origin"]; + $_GET ["originid"] = $_POST["originid"]; $mesgs [] = '<div class="error">' . $object->error . '</div>'; } } // Add a new line -else if (($action == 'addline' || $action == 'addline_predef') && $user->rights->facture->creer) { +else if (($action == 'addline' || $action == 'addline_predef') && $user->rights->facture->creer) +{ $langs->load('errors'); $error = 0; // Set if we used free entry or predefined product - if (GETPOST('addline_libre')) { + if (GETPOST('addline_libre')) + { $predef = ''; $idprod = 0; $product_desc = (GETPOST('dp_desc') ? GETPOST('dp_desc') : ''); $price_ht = GETPOST('price_ht'); $tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); } - if (GETPOST('addline_predefined')) { + if (GETPOST('addline_predefined')) + { $predef = (($conf->global->MAIN_FEATURES_LEVEL < 2) ? '_predef' : ''); $idprod = GETPOST('idprod', 'int'); $product_desc = (GETPOST('product_desc') ? GETPOST('product_desc') : (GETPOST('np_desc') ? GETPOST('np_desc') : '')); $price_ht = ''; $tva_tx = ''; } - if (GETPOST('usenewaddlineform')) { // TODO Remove this + if (GETPOST('usenewaddlineform')) // TODO Remove this + { $idprod = GETPOST('idprod', 'int'); $product_desc = (GETPOST('product_desc') ? GETPOST('product_desc') : (GETPOST('np_desc') ? GETPOST('np_desc') : (GETPOST('dp_desc') ? GETPOST('dp_desc') : ''))); $price_ht = GETPOST('price_ht'); @@ -1033,7 +1070,7 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights- if (is_array($extralabelsline)) { // Get extra fields foreach ($extralabelsline as $key => $value) { - unset($_POST ["options_" . $key . $predef]); + unset($_POST["options_" . $key . $predef]); } } @@ -1225,29 +1262,29 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights- facture_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); } - unset($_POST ['qty']); - unset($_POST ['type']); - unset($_POST ['remise_percent']); - unset($_POST ['price_ht']); - unset($_POST ['price_ttc']); - unset($_POST ['tva_tx']); - unset($_POST ['product_ref']); - unset($_POST ['product_label']); - unset($_POST ['product_desc']); - unset($_POST ['fournprice']); - unset($_POST ['buying_price']); - unset($_POST ['np_marginRate']); - unset($_POST ['np_markRate']); - unset($_POST ['dp_desc']); - - unset($_POST ['idprod']); - unset($_POST ['qty_predef']); - unset($_POST ['remise_percent_predef']); - unset($_POST ['fournprice_predef']); - unset($_POST ['buying_price_predef']); - unset($_POST ['np_marginRate_predef']); - unset($_POST ['np_markRate_predef']); - unset($_POST ['np_desc']); + unset($_POST['qty']); + unset($_POST['type']); + unset($_POST['remise_percent']); + unset($_POST['price_ht']); + unset($_POST['price_ttc']); + unset($_POST['tva_tx']); + unset($_POST['product_ref']); + unset($_POST['product_label']); + unset($_POST['product_desc']); + unset($_POST['fournprice']); + unset($_POST['buying_price']); + unset($_POST['np_marginRate']); + unset($_POST['np_markRate']); + unset($_POST['dp_desc']); + + unset($_POST['idprod']); + unset($_POST['qty_predef']); + unset($_POST['remise_percent_predef']); + unset($_POST['fournprice_predef']); + unset($_POST['buying_price_predef']); + unset($_POST['np_marginRate_predef']); + unset($_POST['np_markRate_predef']); + unset($_POST['np_desc']); } else { setEventMessage($object->error, 'errors'); } @@ -1293,7 +1330,7 @@ elseif ($action == 'updateligne' && $user->rights->facture->creer && ! GETPOST(' if (is_array($extralabelsline)) { // Get extra fields foreach ($extralabelsline as $key => $value) { - unset($_POST ["options_" . $key]); + unset($_POST["options_" . $key]); } } @@ -1349,25 +1386,25 @@ elseif ($action == 'updateligne' && $user->rights->facture->creer && ! GETPOST(' facture_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); } - unset($_POST ['qty']); - unset($_POST ['type']); - unset($_POST ['productid']); - unset($_POST ['remise_percent']); - unset($_POST ['price_ht']); - unset($_POST ['price_ttc']); - unset($_POST ['tva_tx']); - unset($_POST ['product_ref']); - unset($_POST ['product_label']); - unset($_POST ['product_desc']); - unset($_POST ['fournprice']); - unset($_POST ['buying_price']); + unset($_POST['qty']); + unset($_POST['type']); + unset($_POST['productid']); + unset($_POST['remise_percent']); + unset($_POST['price_ht']); + unset($_POST['price_ttc']); + unset($_POST['tva_tx']); + unset($_POST['product_ref']); + unset($_POST['product_label']); + unset($_POST['product_desc']); + unset($_POST['fournprice']); + unset($_POST['buying_price']); } else { setEventMessage($object->error, 'errors'); } } } -else if ($action == 'updateligne' && $user->rights->facture->creer && $_POST ['cancel'] == $langs->trans('Cancel')) { +else if ($action == 'updateligne' && $user->rights->facture->creer && $_POST['cancel'] == $langs->trans('Cancel')) { header('Location: ' . $_SERVER ["PHP_SELF"] . '?facid=' . $id); // Pour reaffichage de la fiche en cours d'edition exit(); } @@ -1442,7 +1479,7 @@ if (GETPOST('addfile')) { /* * Remove file in email form */ -if (! empty($_POST ['removedfile'])) { +if (! empty($_POST['removedfile'])) { require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; // Set tmp user directory @@ -1450,14 +1487,14 @@ if (! empty($_POST ['removedfile'])) { $upload_dir_tmp = $vardir . '/temp'; // TODO Delete only files that was uploaded from email form - dol_remove_file_process($_POST ['removedfile'], 0); + dol_remove_file_process($_POST['removedfile'], 0); $action = 'presend'; } /* * Send mail */ -if (($action == 'send' || $action == 'relance') && ! $_POST ['addfile'] && ! $_POST ['removedfile'] && ! $_POST ['cancel']) { +if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_POST['removedfile'] && ! $_POST['cancel']) { $langs->load('mails'); $actiontypecode = ''; @@ -1474,35 +1511,35 @@ if (($action == 'send' || $action == 'relance') && ! $_POST ['addfile'] && ! $_P // if (is_readable($file)) // { - if ($_POST ['sendto']) { + if ($_POST['sendto']) { // Le destinataire a ete fourni via le champ libre - $sendto = $_POST ['sendto']; + $sendto = $_POST['sendto']; $sendtoid = 0; - } elseif ($_POST ['receiver'] != '-1') { + } elseif ($_POST['receiver'] != '-1') { // Recipient was provided from combo list - if ($_POST ['receiver'] == 'thirdparty') // Id of third party + if ($_POST['receiver'] == 'thirdparty') // Id of third party { $sendto = $object->client->email; $sendtoid = 0; } else // Id du contact { - $sendto = $object->client->contact_get_property($_POST ['receiver'], 'email'); - $sendtoid = $_POST ['receiver']; + $sendto = $object->client->contact_get_property($_POST['receiver'], 'email'); + $sendtoid = $_POST['receiver']; } } if (dol_strlen($sendto)) { $langs->load("commercial"); - $from = $_POST ['fromname'] . ' <' . $_POST ['frommail'] . '>'; - $replyto = $_POST ['replytoname'] . ' <' . $_POST ['replytomail'] . '>'; - $message = $_POST ['message']; - $sendtocc = $_POST ['sendtocc']; - $deliveryreceipt = $_POST ['deliveryreceipt']; + $from = $_POST['fromname'] . ' <' . $_POST['frommail'] . '>'; + $replyto = $_POST['replytoname'] . ' <' . $_POST['replytomail'] . '>'; + $message = $_POST['message']; + $sendtocc = $_POST['sendtocc']; + $deliveryreceipt = $_POST['deliveryreceipt']; if ($action == 'send') { - if (dol_strlen($_POST ['subject'])) - $subject = $_POST ['subject']; + if (dol_strlen($_POST['subject'])) + $subject = $_POST['subject']; else $subject = $langs->transnoentities('Bill') . ' ' . $object->ref; $actiontypecode = 'AC_FAC'; @@ -1515,8 +1552,8 @@ if (($action == 'send' || $action == 'relance') && ! $_POST ['addfile'] && ! $_P // $actionmsg2=$langs->transnoentities('Action'.$actiontypecode); } if ($action == 'relance') { - if (dol_strlen($_POST ['subject'])) - $subject = $_POST ['subject']; + if (dol_strlen($_POST['subject'])) + $subject = $_POST['subject']; else $subject = $langs->transnoentities('Relance facture ' . $object->ref); $actiontypecode = 'AC_FAC'; @@ -1676,7 +1713,7 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->facture- if ($result > 0 && $id > 0) { $contactid = (GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid')); - $result = $object->add_contact($contactid, $_POST ["type"], $_POST ["source"]); + $result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]); } if ($result >= 0) { @@ -1742,9 +1779,11 @@ if ($action == 'update_extras') { $action = 'edit_extras'; } + + /* * View -*/ + */ $form = new Form($db); $formother = new FormOther($db); @@ -1771,6 +1810,7 @@ jQuery(document).ready(function() { * * ******************************************************************** */ + if ($action == 'create') { $facturestatic = new Facture($db); @@ -1782,7 +1822,8 @@ if ($action == 'create') if ($socid > 0) $res = $soc->fetch($socid); - if (! empty($origin) && ! empty($originid)) { + if (! empty($origin) && ! empty($originid)) + { // Parse element/subelement (ex: project_task) $element = $subelement = $origin; if (preg_match('/^([^_]+)_([^_]+)/i', $origin, $regs)) { @@ -1865,7 +1906,8 @@ if ($action == 'create') // Thirdparty print '<td class="fieldrequired">' . $langs->trans('Customer') . '</td>'; - if ($soc->id > 0) { + if ($soc->id > 0) + { print '<td colspan="2">'; print $soc->getNomUrl(1); print '<input type="hidden" name="socid" value="' . $soc->id . '">'; @@ -1873,14 +1915,16 @@ if ($action == 'create') $outstandigBills = $soc->get_OutstandingBill(); print ' (' . $langs->trans('CurrentOutstandingBill') . ': '; print price($outstandigBills, '', $langs, 0, 0, - 1, $conf->currency); - if ($soc->outstanding_limit != '') { - if ($outstandigBills > $soc->outstanding_limit) - print img_warning($langs->trans("OutstandingBillReached")); + if ($soc->outstanding_limit != '') + { + if ($outstandigBills > $soc->outstanding_limit) print img_warning($langs->trans("OutstandingBillReached")); print ' / ' . price($soc->outstanding_limit); } print ')'; print '</td>'; - } else { + } + else + { print '<td colspan="2">'; print $form->select_company('', 'socid', 's.client = 1 OR s.client = 3', 1); print '</td>'; @@ -1932,17 +1976,19 @@ if ($action == 'create') foreach ($facids as $facparam) { $options .= '<option value="' . $facparam ['id'] . '"'; - if ($facparam ['id'] == $_POST ['fac_replacement']) + if ($facparam ['id'] == $_POST['fac_replacement']) $options .= ' selected="selected"'; $options .= '>' . $facparam ['ref']; $options .= ' (' . $facturestatic->LibStatut(0, $facparam ['status']) . ')'; $options .= '</option>'; } - $facids = $facturestatic->list_qualified_avoir_invoices($soc->id); - if ($facids < 0) { - dol_print_error($db, $facturestatic); - exit(); + // Show link for credit note + $facids=$facturestatic->list_qualified_avoir_invoices($soc->id); + if ($facids < 0) + { + dol_print_error($db,$facturestatic); + exit; } $optionsav = ""; $newinvoice_static = new Facture($db); @@ -1955,7 +2001,7 @@ if ($action == 'create') $newinvoice_static->paye = $valarray ['paye']; $optionsav .= '<option value="' . $key . '"'; - if ($key == $_POST ['fac_avoir']) + if ($key == $_POST['fac_avoir']) $optionsav .= ' selected="selected"'; $optionsav .= '>'; $optionsav .= $newinvoice_static->ref; @@ -1974,17 +2020,6 @@ if ($action == 'create') print $desc; print '</td></tr>' . "\n"; - // Proforma - if (! empty($conf->global->FACTURE_USE_PROFORMAT)) - { - print '<tr height="18"><td width="16px" valign="middle">'; - print '<input type="radio" name="type" value="4"' . (GETPOST('type') == 4 ? ' checked="checked"' : '') . '>'; - print '</td><td valign="middle">'; - $desc = $form->textwithpicto($langs->trans("InvoiceProForma"), $langs->transnoentities("InvoiceProFormaDesc"), 1); - print $desc; - print '</td></tr>' . "\n"; - } - if ((empty($origin)) || ((($origin == 'propal') || ($origin == 'commande')) && (! empty($originid)))) { // Deposit @@ -2043,49 +2078,75 @@ if ($action == 'create') print $desc; print '</td></tr>' . "\n"; } + else + { + print '<tr height="18"><td valign="middle">'; + print '<input type="radio" name="type" id="radio_replacement" value="0" disabled="disabled">'; + print '</td><td valign="middle">'; + $text = $langs->trans("InvoiceReplacement") . ' '; + $text.= '('.$langs->trans("YouMustCreateInvoiceFromThird").') '; + $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceReplacementDesc"), 1); + print $desc; + print '</td></tr>' . "\n"; + } - if (empty($origin) && $socid > 0) + if (empty($origin)) { - // Credit note - print '<tr height="18"><td valign="top">'; - print '<input type="radio" id="radio_creditnote" name="type" value="2"' . (GETPOST('type') == 2 ? ' checked=true' : ''); - if (! $optionsav) - print ' disabled="disabled"'; - print '>'; - print '</td><td valign="top">'; - print '<script type="text/javascript" language="javascript"> - jQuery(document).ready(function() { - jQuery("#fac_avoir").click(function() { - jQuery("#radio_creditnote").attr(\'checked\',\'checked\'); + if ($socid > 0) + { + // Credit note + print '<tr height="18"><td valign="top">'; + print '<input type="radio" id="radio_creditnote" name="type" value="2"' . (GETPOST('type') == 2 ? ' checked=true' : ''); + if (! $optionsav) + print ' disabled="disabled"'; + print '>'; + print '</td><td valign="top">'; + print '<script type="text/javascript" language="javascript"> + jQuery(document).ready(function() { + jQuery("#fac_avoir").click(function() { + jQuery("#radio_creditnote").attr(\'checked\',\'checked\'); + }); }); - }); - </script>'; - $text = $langs->transnoentities("InvoiceAvoirAsk") . ' '; - // $text.='<input type="text" value="">'; - $text .= '<select class="flat" name="fac_avoir" id="fac_avoir"'; - if (! $optionsav) - $text .= ' disabled="disabled"'; - $text .= '>'; - if ($optionsav) { - $text .= '<option value="-1"></option>'; - $text .= $optionsav; - } else { - $text .= '<option value="-1">' . $langs->trans("NoInvoiceToCorrect") . '</option>'; + </script>'; + $text = $langs->transnoentities("InvoiceAvoirAsk") . ' '; + // $text.='<input type="text" value="">'; + $text .= '<select class="flat" name="fac_avoir" id="fac_avoir"'; + if (! $optionsav) + $text .= ' disabled="disabled"'; + $text .= '>'; + if ($optionsav) { + $text .= '<option value="-1"></option>'; + $text .= $optionsav; + } else { + $text .= '<option value="-1">' . $langs->trans("NoInvoiceToCorrect") . '</option>'; + } + $text .= '</select>'; + $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceAvoirDesc"), 1); + print $desc; + + print ' <input type="checkbox" name="invoiceAvoirWithLines" id="invoiceAvoirWithLines" value="1" onclick="if($(this).is(\':checked\') ) { $(\'#radio_creditnote\').attr(\'checked\',\'checked\'); $(\'#invoiceAvoirWithPaymentRestAmount\').removeAttr(\'checked\'); }" '.(GETPOST('invoiceAvoirWithLines','int')>0 ? 'checked="checked"':'').' /> <label for="invoiceAvoirWithLines">'.$langs->trans('invoiceAvoirWithLines')."</label>"; + print '<br /> <input type="checkbox" name="invoiceAvoirWithPaymentRestAmount" id="invoiceAvoirWithPaymentRestAmount" value="1" onclick="if($(this).is(\':checked\') ) { $(\'#radio_creditnote\').attr(\'checked\',\'checked\'); $(\'#invoiceAvoirWithLines\').removeAttr(\'checked\'); }" '.(GETPOST('invoiceAvoirWithPaymentRestAmount','int')>0 ? 'checked="checked"':'').' /> <label for="invoiceAvoirWithPaymentRestAmount">'.$langs->trans('invoiceAvoirWithPaymentRestAmount')."</label>"; + + print '</td></tr>' . "\n"; + } + else + { + print '<tr height="18"><td valign="middle">'; + print '<input type="radio" name="type" id="radio_creditnote" value="0" disabled="disabled">'; + print '</td><td valign="middle">'; + $text = $langs->trans("InvoiceAvoir") . ' '; + $text.= '('.$langs->trans("YouMustCreateInvoiceFromThird").') '; + $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceAvoirDesc"), 1); + print $desc; + print '</td></tr>' . "\n"; } - $text .= '</select>'; - $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceAvoirDesc"), 1); - print $desc; - - print ' <input type="checkbox" name="invoiceAvoirWithLines" id="invoiceAvoirWithLines" value="1" onclick="if($(this).is(\':checked\') ) { $(\'#radio_creditnote\').attr(\'checked\',\'checked\'); $(\'#invoiceAvoirWithPaymentRestAmount\').removeAttr(\'checked\'); }" '.(GETPOST('invoiceAvoirWithLines','int')>0 ? 'checked="checked"':'').' /> <label for="invoiceAvoirWithLines">'.$langs->trans('invoiceAvoirWithLines')."</label>"; - print '<br /> <input type="checkbox" name="invoiceAvoirWithPaymentRestAmount" id="invoiceAvoirWithPaymentRestAmount" value="1" onclick="if($(this).is(\':checked\') ) { $(\'#radio_creditnote\').attr(\'checked\',\'checked\'); $(\'#invoiceAvoirWithLines\').removeAttr(\'checked\'); }" '.(GETPOST('invoiceAvoirWithPaymentRestAmount','int')>0 ? 'checked="checked"':'').' /> <label for="invoiceAvoirWithPaymentRestAmount">'.$langs->trans('invoiceAvoirWithPaymentRestAmount')."</label>"; - - print '</td></tr>' . "\n"; } print '</table>'; print '</td></tr>'; - if ($socid > 0) { + if ($socid > 0) + { // Discounts for third party print '<tr><td>' . $langs->trans('Discounts') . '</td><td colspan="2">'; if ($soc->remise_percent) @@ -2106,17 +2167,18 @@ if ($action == 'create') // Date invoice print '<tr><td class="fieldrequired">' . $langs->trans('Date') . '</td><td colspan="2">'; - $form->select_date($dateinvoice, '', '', '', '', "add", 1, 1); + $datefacture = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); + $form->select_date($datefacture?$datefacture:$dateinvoice, '', '', '', '', "add", 1, 1); print '</td></tr>'; // Payment term print '<tr><td class="nowrap">' . $langs->trans('PaymentConditionsShort') . '</td><td colspan="2">'; - $form->select_conditions_paiements(isset($_POST ['cond_reglement_id']) ? $_POST ['cond_reglement_id'] : $cond_reglement_id, 'cond_reglement_id'); + $form->select_conditions_paiements(isset($_POST['cond_reglement_id']) ? $_POST['cond_reglement_id'] : $cond_reglement_id, 'cond_reglement_id'); print '</td></tr>'; // Payment mode print '<tr><td>' . $langs->trans('PaymentMode') . '</td><td colspan="2">'; - $form->select_types_paiements(isset($_POST ['mode_reglement_id']) ? $_POST ['mode_reglement_id'] : $mode_reglement_id, 'mode_reglement_id'); + $form->select_types_paiements(isset($_POST['mode_reglement_id']) ? $_POST['mode_reglement_id'] : $mode_reglement_id, 'mode_reglement_id'); print '</td></tr>'; // Project @@ -3147,7 +3209,7 @@ if ($action == 'create') foreach ($extrafields->attribute_label as $key => $label) { if ($action == 'edit_extras') { - $value = (isset($_POST ["options_" . $key]) ? $_POST ["options_" . $key] : $object->array_options ["options_" . $key]); + $value = (isset($_POST["options_" . $key]) ? $_POST["options_" . $key] : $object->array_options ["options_" . $key]); } else { $value = $object->array_options ["options_" . $key]; } @@ -3160,7 +3222,7 @@ if ($action == 'create') print '>' . $label . '</td><td colspan="5">'; // Convert date into timestamp format if (in_array($extrafields->attribute_type [$key], array('date','datetime'))) { - $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]); + $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->facture->creer && GETPOST('attribute') == $key) { @@ -3275,10 +3337,11 @@ if ($action == 'create') } // Reopen a standard paid invoice - if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT) && ($object->statut == Facture::TYPE_CREDIT_NOTE || $object->statut == Facture::TYPE_DEPOSIT) && $user->rights->facture->creer) // A paid - // invoice - // (partially or - // completely) + if ((($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT) + || ($object->type == Facture::TYPE_CREDIT_NOTE && empty($discount->id)) + || ($object->type == Facture::TYPE_DEPOSIT && empty($discount->id))) + && ($object->statut == 2 || $object->statut == 3) + && $user->rights->facture->creer) // A paid invoice (partially or completely) { if (! $objectidnext && $object->close_code != 'replaced') // Not replaced by another invoice { @@ -3337,30 +3400,47 @@ if ($action == 'create') // Reverse back money or convert to reduction if ($object->type == Facture::TYPE_CREDIT_NOTE || $object->type == Facture::TYPE_DEPOSIT) { // For credit note only - if ($object->type == Facture::TYPE_CREDIT_NOTE && $object->statut == 1 && $object->paye == 0 && $user->rights->facture->paiement) { - print '<div class="inline-block divButAction"><a class="butAction" href="paiement.php?facid=' . $object->id . '&action=create">' . $langs->trans('DoPaymentBack') . '</a></div>'; + if ($object->type == Facture::TYPE_CREDIT_NOTE && $object->statut == 1 && $object->paye == 0 && $user->rights->facture->paiement) + { + if ($resteapayer == 0) + { + print '<div class="inline-block divButAction"><span class="butActionRefused" title="'.$langs->trans("DisabledBecauseRemainderToPayIsZero").'">'.$langs->trans('DoPaymentBack').'</span></div>'; + } + else + { + print '<div class="inline-block divButAction"><a class="butAction" href="paiement.php?facid='.$object->id.'&action=create">'.$langs->trans('DoPaymentBack').'</a></div>'; + } } + // For credit note if ($object->type == Facture::TYPE_CREDIT_NOTE && $object->statut == 1 && $object->paye == 0 && $user->rights->facture->creer && $object->getSommePaiement() == 0) { print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER ["PHP_SELF"] . '?facid=' . $object->id . '&action=converttoreduc">' . $langs->trans('ConvertToReduc') . '</a></div>'; } // For deposit invoice - if ($object->type == Facture::TYPE_DEPOSIT && $object->statut == 1 && $resteapayer == 0 && $user->rights->facture->creer) { - print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER ["PHP_SELF"] . '?facid=' . $object->id . '&action=converttoreduc">' . $langs->trans('ConvertToReduc') . '</a></div>'; + if ($object->type == Facture::TYPE_DEPOSIT && $object->paye == 1 && $resteapayer == 0 && $user->rights->facture->creer && empty($discount->id)) + { + print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?facid='.$object->id.'&action=converttoreduc">'.$langs->trans('ConvertToReduc').'</a></div>'; } } - // Classify paid (if not deposit and not credit note. Such invoice are "converted") - if ($object->statut == 1 && $object->paye == 0 && $user->rights->facture->paiement && (($object->type != Facture::TYPE_CREDIT_NOTE && $object->type != Facture::TYPE_DEPOSIT && $resteapayer <= 0) || ($object->type == Facture::TYPE_CREDIT_NOTE && $resteapayer >= 0))) { - print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER ['PHP_SELF'] . '?facid=' . $object->id . '&action=paid">' . $langs->trans('ClassifyPaid') . '</a></div>'; + // Classify paid + if ($object->statut == 1 && $object->paye == 0 && $user->rights->facture->paiement && (($object->type != Facture::TYPE_CREDIT_NOTE && $object->type != Facture::TYPE_DEPOSIT && $resteapayer <= 0) || ($object->type == Facture::TYPE_CREDIT_NOTE && $resteapayer >= 0)) + || ($object->type == Facture::TYPE_DEPOSIT && $object->paye == 0 && $resteapayer == 0 && $user->rights->facture->paiement && empty($discount->id)) + ) + { + print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?facid='.$object->id.'&action=paid">'.$langs->trans('ClassifyPaid').'</a></div>'; } // Classify 'closed not completely paid' (possible si validee et pas encore classee payee) - if ($object->statut == 1 && $object->paye == 0 && $resteapayer > 0 && $user->rights->facture->paiement) { - if ($totalpaye > 0 || $totalcreditnotes > 0) { + if ($object->statut == 1 && $object->paye == 0 && $resteapayer > 0 && $user->rights->facture->paiement) + { + if ($totalpaye > 0 || $totalcreditnotes > 0) + { // If one payment or one credit note was linked to this invoice print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER ['PHP_SELF'] . '?facid=' . $object->id . '&action=paid">' . $langs->trans('ClassifyPaidPartially') . '</a></div>'; - } else { + } + else + { if ($objectidnext) { print '<div class="inline-block divButAction"><span class="butActionRefused" title="' . $langs->trans("DisabledBecauseReplacedInvoice") . '">' . $langs->trans('ClassifyCanceled') . '</span></div>'; } else { @@ -3370,19 +3450,23 @@ if ($action == 'create') } // Clone - if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_PROFORMA) && $user->rights->facture->creer) { + if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_PROFORMA) && $user->rights->facture->creer) + { print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER ['PHP_SELF'] . '?facid=' . $object->id . '&action=clone&object=invoice">' . $langs->trans("ToClone") . '</a></div>'; } // Clone as predefined - if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_PROFORMA) && $object->statut == 0 && $user->rights->facture->creer) { - if (! $objectidnext) { + if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_PROFORMA) && $object->statut == 0 && $user->rights->facture->creer) + { + if (! $objectidnext) + { print '<div class="inline-block divButAction"><a class="butAction" href="facture/fiche-rec.php?facid=' . $object->id . '&action=create">' . $langs->trans("ChangeIntoRepeatableInvoice") . '</a></div>'; } } // Delete - if ($user->rights->facture->supprimer) { + if ($user->rights->facture->supprimer) + { if (! $object->is_erasable()) { print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="' . $langs->trans("DisabledBecauseNotErasable") . '">' . $langs->trans('Delete') . '</a></div>'; } else if ($objectidnext) { @@ -3401,7 +3485,8 @@ if ($action == 'create') } print '<br>'; - if ($action != 'prerelance' && $action != 'presend') { + if ($action != 'prerelance' && $action != 'presend') + { print '<div class="fichecenter"><div class="fichehalfleft">'; print '<a name="builddoc"></a>'; // ancre diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 81794f24c552815229d4367c4e7e0f9bcf6e2467..babf0257d7c6db6eb8a654fb48c96e6e28854208 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1472,7 +1472,8 @@ class Facture extends CommonInvoice } /** - * Tag la facture comme paye completement (close_code non renseigne) ou partiellement (close_code renseigne) + appel trigger BILL_PAYED + * Tag la facture comme paye completement (si close_code non renseigne) => this->fk_statut=2, this->paye=1 + * ou partiellement (si close_code renseigne) + appel trigger BILL_PAYED => this->fk_statut=2, this->paye stay 0 * * @param User $user Objet utilisateur qui modifie * @param string $close_code Code renseigne si on classe a payee completement alors que paiement incomplet (cas escompte par exemple) @@ -1496,6 +1497,7 @@ class Facture extends CommonInvoice if ($close_note) $sql.= ", close_note='".$this->db->escape($close_note)."'"; $sql.= ' WHERE rowid = '.$this->id; + dol_syslog(get_class($this)."::set_paid sql=".$sql, LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -1511,8 +1513,7 @@ class Facture extends CommonInvoice else { $error++; - $this->error=$this->db->error(); - dol_print_error($this->db); + $this->error=$this->db->lasterror(); } if (! $error) @@ -2075,7 +2076,7 @@ class Facture extends CommonInvoice $product=new Product($this->db); $result=$product->fetch($fk_product); $product_type=$product->type; - + if($conf->global->STOCK_MUST_BE_ENOUGH_FOR_INVOICE && $product_type == 0 && $product->stock_reel < $qty) { $this->error=$langs->trans('ErrorStockIsNotEnough'); $this->db->rollback(); diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 8629d7c73e379d58553bcb3406081d28b5436321..1d122a6c6f14175ef6d07114eeaaa3396ea07487 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -200,7 +200,12 @@ class Conf } //var_dump($this->modules); //var_dump($this->modules_parts['theme']); - + + // If you can't set timezone of your PHP, set this constant. Better is to set it to UTC. + // In future, this constant will be forced to 'UTC' so PHP server timezone will not have effect anymore. + //$this->global->MAIN_SERVER_TZ='Europe/Paris'; + if (! empty($this->global->MAIN_SERVER_TZ) && $this->global->MAIN_SERVER_TZ != 'auto') date_default_timezone_set($this->global->MAIN_SERVER_TZ); + // Object $mc if (! defined('NOREQUIREMC') && ! empty($this->multicompany->enabled)) { diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 1319ad766d0f67e5b4d726289444629550ad9d3d..5317d49c23cad8c84900a0be4e44b6315fb315e4 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -764,8 +764,9 @@ class FormFile if (empty($relativepath)) { $relativepath=(! empty($object->ref)?dol_sanitizeFileName($object->ref):'').'/'; - if ($object->element == 'invoice_supplier') $relativepath=get_exdir($object->id,2).$relativepath; - if ($object->element == 'member') $relativepath=get_exdir($object->id,2).$relativepath; + if ($object->element == 'invoice_supplier') $relativepath=get_exdir($object->id,2).$relativepath; // TODO Call using a defined value for $relativepath + if ($object->element == 'member') $relativepath=get_exdir($object->id,2).$relativepath; // TODO Call using a defined value for $relativepath + if ($object->element == 'project_task') $relativepath='Call_not_supported_._Call_function_using_a_defined_relative_path_.'; } $var=!$var; @@ -1052,9 +1053,10 @@ class FormFile * @param int $permtodelete Deletion is allowed * @param string $action Action * @param string $selected ??? + * @param string $param More param to add into URL * @return int Number of links */ - public function listOfLinks($object, $permtodelete=1, $action=null, $selected=null) + public function listOfLinks($object, $permtodelete=1, $action=null, $selected=null, $param='') { global $user, $conf, $langs, $user; global $bc; @@ -1071,17 +1073,17 @@ class FormFile $sortfield = null; } $res = $link->fetchAll($links, $object->element, $object->id, $sortfield, $sortorder); - $param = (isset($object->id)?'&id=' . $object->id : ''); + $param .= (isset($object->id)?'&id=' . $object->id : ''); // Show list of associated links print_titre($langs->trans("LinkedFiles")); - print '<form action="' . $_SERVER['PHP_SELF'] . '" method="POST">'; + print '<form action="' . $_SERVER['PHP_SELF'] . ($param?'?'.$param:'') . '" method="POST">'; print '<table width="100%" class="liste">'; print '<tr class="liste_titre">'; print_liste_field_titre( - $langs->trans("Documents2"), + $langs->trans("Links"), $_SERVER['PHP_SELF'], "name", "", @@ -1135,34 +1137,34 @@ class FormFile print '<input type="hidden" name="action" value="confirm_updateline">'; print $langs->trans('Link') . ': <input type="text" name="link" size="50" value="' . $link->url . '">'; print '</td>'; - print '<td align="right">'; + print '<td>'; print $langs->trans('Label') . ': <input type="text" name="label" value="' . $link->label . '">'; print '</td>'; print '<td align="center">' . dol_print_date(dol_now(), "dayhour", "tzuser") . '</td>'; print '<td align="right"></td>'; - print '<td align="right" colspan="2"><input type="submit" name="save" class="button" value="' . $langs->trans('Save') . '">'; - print '<input type="submit" name="cancel" class="button" value="' . $langs->trans('Cancel') . '">'; + print '<td align="right" colspan="2">'; + print '<input type="submit" name="save" class="button" value="' . dol_escape_htmltag($langs->trans('Save')) . '">'; + print '<input type="submit" name="cancel" class="button" value="' . dol_escape_htmltag($langs->trans('Cancel')) . '">'; print '</td>'; } - else { + else + { print '<td>'; - print '<a data-ajax="false" href="'. $link->url . '" target="_blank">'; + print '<a data-ajax="false" href="' . $link->url . '" target="_blank">'; print $link->label; print '</a>'; - print "</td>\n"; + print '</td>'."\n"; print '<td align="right"></td>'; print '<td align="center">' . dol_print_date($link->datea, "dayhour", "tzuser") . '</td>'; print '<td align="center"></td>'; print '<td align="right" colspan="2">'; - print '<a href="' . $_SERVER['PHP_SELF'] . '?action=update&linkid=' . $link->id - . '&id=' . $object->id . '" class="editfilelink" >' . img_edit().'</a>'; + print '<a href="' . $_SERVER['PHP_SELF'] . '?action=update&linkid=' . $link->id . $param . '" class="editfilelink" >' . img_edit() . '</a>'; // id= is included into $param if ($permtodelete) { - print ' <a href="'. $_SERVER['PHP_SELF'] .'?action=delete&linkid=' . $link->id - . '&id=' . $object->id . '" class="deletefilelink" >' . img_delete() . '</a>'; + print ' <a href="'. $_SERVER['PHP_SELF'] .'?action=delete&linkid=' . $link->id . $param . '" class="deletefilelink">' . img_delete() . '</a>'; // id= is included into $param } else { print ' '; } - print "</td>"; + print '</td>'; } print "</tr>\n"; } diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 5d336ccc2c23b78722fc2f8d36bd6a352c0c3a99..8a1c35ace9c57260dde74cacd220c3a39b2bd530 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -69,13 +69,11 @@ function get_tz_array() */ function getServerTimeZoneString() { - if (function_exists('date_default_timezone_get')) return date_default_timezone_get(); - else return ''; + return @date_default_timezone_get(); } /** * Return server timezone int. - * If $conf->global->MAIN_OLD_DATE is set or PHP too old, we use old behaviour: All convertions does not take care of dayling saving time. * * @param string $refgmtdate Reference period for timezone (timezone differs on winter and summer. May be 'now', 'winter' or 'summer') * @return int An offset in hour (+1 for Europe/Paris on winter and +2 for Europe/Paris on summer) @@ -83,7 +81,7 @@ function getServerTimeZoneString() function getServerTimeZoneInt($refgmtdate='now') { global $conf; - if (method_exists('DateTimeZone','getOffset') && empty($conf->global->MAIN_OLD_DATE)) + if (method_exists('DateTimeZone','getOffset')) { // Method 1 (include daylight) $gmtnow=dol_now('gmt'); $yearref=dol_print_date($gmtnow,'%Y'); $monthref=dol_print_date($gmtnow,'%m'); $dayref=dol_print_date($gmtnow,'%d'); @@ -97,11 +95,13 @@ function getServerTimeZoneInt($refgmtdate='now') } else { + dol_print_error('','PHP version must be 5.3+'); + /* // Method 2 (does not include daylight, not supported by adodb) if ($refgmtdate == 'now') { if (ini_get("date.timezone")=='UTC') return 0; - // We don't know server timezone string, so we don't know location, so we can't guess daylight. We assume we use same than client. Fix is to use new PHP with not MAIN_OLD_DATE. + // We don't know server timezone string, so we don't know location, so we can't guess daylight. We assume we use same than client but this may be a bug. $gmtnow=dol_now('gmt'); $yearref=dol_print_date($gmtnow,'%Y'); $monthref=dol_print_date($gmtnow,'%m'); $dayref=dol_print_date($gmtnow,'%d'); if (dol_stringtotime($_SESSION['dol_dst_first']) <= $gmtnow && $gmtnow < dol_stringtotime($_SESSION['dol_dst_second'])) $daylight=1; else $daylight=0; @@ -111,7 +111,7 @@ function getServerTimeZoneInt($refgmtdate='now') elseif ($refgmtdate == 'summer') { if (ini_get("date.timezone")=='UTC') return 0; - // We don't know server timezone string, so we don't know location, so we can't guess daylight. We assume we use same than client. Fix is to use new PHP with not MAIN_OLD_DATE. + // We don't know server timezone string, so we don't know location, so we can't guess daylight. We assume we use same than client but this may be a bug. $gmtnow=dol_now('gmt'); $yearref=dol_print_date($gmtnow,'%Y'); $monthref='08'; $dayref='01'; if (dol_stringtotime($_SESSION['dol_dst_first']) <= dol_stringtotime($yearref.'-'.$monthref.'-'.$dayref) && dol_stringtotime($yearref.'-'.$monthref.'-'.$dayref) < dol_stringtotime($_SESSION['dol_dst_second'])) $daylight=1; else $daylight=0; @@ -119,49 +119,12 @@ function getServerTimeZoneInt($refgmtdate='now') return 'unknown'; // For true result } else $tmp=dol_mktime(0,0,0,1,1,1970); + */ } $tz=round(($tmp<0?1:-1)*abs($tmp/3600)); return $tz; } -/** - * Return server timezone string - * - * @return string Parent company timezone string ('Europe/Paris') - * -function getParentCompanyTimeZoneString() -{ - if (function_exists('date_default_timezone_get')) return date_default_timezone_get(); - else return ''; -} -*/ - -/** - * Return parent company timezone int. - * If $conf->global->MAIN_NEW_DATE is set, we use new behaviour: All convertions take care of dayling saving time. - * - * @param string $refgmtdate Reference date for timezone (timezone differs on winter and summer) - * @return int An offset in hour (+1 for Europe/Paris on winter and +2 for Europe/Paris on summer) - * -function getParentCompanyTimeZoneInt($refgmtdate='now') -{ - global $conf; - if (class_exists('DateTime') && empty($conf->global->MAIN_OLD_DATE)) - { - // Method 1 (include daylight) - $localtz = new DateTimeZone(getParentCompanyTimeZoneString()); - $localdt = new DateTime($refgmtdate, $localtz); - $tmp=-1*$localtz->getOffset($localdt); - } - else - { - // Method 2 (does not include daylight) - $tmp=dol_mktime(0,0,0,1,1,1970); - } - $tz=($tmp<0?1:-1)*abs($tmp/3600); - return $tz; -}*/ - /** * Add a delay to a date @@ -476,7 +439,7 @@ function dol_get_next_week($day, $week, $month, $year) * * @param int $year Year * @param int $month Month - * @param boolean $gm False = Return date to compare with server TZ, True to compare with GM date. + * @param mixed $gm False or 0 or 'server' = Return date to compare with server TZ, True or 1 to compare with GM date. * Exemple: dol_get_first_day(1970,1,false) will return -3600 with TZ+1, after a dol_print_date will return 1970-01-01 00:00:00 * Exemple: dol_get_first_day(1970,1,true) will return 0 whatever is TZ, after a dol_print_date will return 1970-01-01 00:00:00 * @return timestamp Date for first day @@ -491,7 +454,7 @@ function dol_get_first_day($year,$month=1,$gm=false) * * @param int $year Year * @param int $month Month - * @param boolean $gm False = Return date to compare with server TZ, True to compare with GM date. + * @param boolean $gm False or 0 or 'server' = Return date to compare with server TZ, True or 1 to compare with GM date. * @return timestamp Date for first day */ function dol_get_last_day($year,$month=12,$gm=false) @@ -518,7 +481,7 @@ function dol_get_last_day($year,$month=12,$gm=false) * @param int $day Day * @param int $month Month * @param int $year Year - * @param int $gm False = Return date to compare with server TZ, True to compare with GM date. + * @param int $gm False or 0 or 'server' = Return date to compare with server TZ, True or 1 to compare with GM date. * @return array year,month, week,first_day,prev_year,prev_month,prev_day */ function dol_get_first_day_week($day,$month,$year,$gm=false) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 309b7df529c36cdbaa6db74cdf5a7017f034a77c..42c300ab56d3c3f965bc0dd81deda6ef5b84453e 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -997,7 +997,7 @@ function dol_getdate($timestamp,$fast=false) * @param int $month Month (1 to 12) * @param int $day Day (1 to 31) * @param int $year Year - * @param int $gm 1=Input informations are GMT values, otherwise local to server TZ + * @param mixed $gm True or 1 or 'gmt'=Input informations are GMT values, False or 0 or 'server' = local to server TZ, 'user' = local to user TZ * @param int $check 0=No check on parameters (Can use day 32, etc...) * @return int Date as a timestamp, '' if error * @see dol_print_date, dol_stringtotime, dol_getdate @@ -1023,17 +1023,28 @@ function dol_mktime($hour,$minute,$second,$month,$day,$year,$gm=false,$check=1) if ($second< 0 || $second > 60) return ''; } - if (method_exists('DateTime','getTimestamp') && empty($conf->global->MAIN_OLD_DATE)) + if (method_exists('DateTime','getTimestamp')) { - if (empty($gm)) $localtz = new DateTimeZone(date_default_timezone_get()); + if (empty($gm) || $gm === 'server') + { + $default_timezone=@date_default_timezone_get(); + $localtz = new DateTimeZone($default_timezone); + } + else if ($gm === 'user') + { + $default_timezone=(empty($_SESSION["dol_tz_string"])?'UTC':$_SESSION["dol_tz_string"]); + $localtz = new DateTimeZone($default_timezone); + } else $localtz = new DateTimeZone('UTC'); $dt = new DateTime(null,$localtz); $dt->setDate($year,$month,$day); $dt->setTime((int) $hour, (int) $minute, (int) $second); - $date=$dt->getTimestamp(); + $date=$dt->getTimestamp(); // should include daylight saving time } else { + dol_print_error('','PHP version must be 5.3+'); + /* $usealternatemethod=false; if ($year <= 1970) $usealternatemethod=true; // <= 1970 if ($year >= 2038) $usealternatemethod=true; // >= 2038 @@ -1045,7 +1056,7 @@ function dol_mktime($hour,$minute,$second,$month,$day,$year,$gm=false,$check=1) else { $date=mktime($hour,$minute,$second,$month,$day,$year); - } + }*/ } return $date; } @@ -2223,10 +2234,10 @@ function info_admin($text, $infoonimgalt = 0, $nodiv=0) if ($infoonimgalt) { - return img_picto($text, 'star', 'class="hideonsmartphone"'); + return img_picto($text, 'info', 'class="hideonsmartphone"'); } - return ($nodiv?'':'<div class="info hideonsmartphone">').img_picto($langs->trans('InfoAdmin'), 'star', 'class="hideonsmartphone"').' '.$text.($nodiv?'':'</div>'); + return ($nodiv?'':'<div class="info hideonsmartphone">').img_picto($langs->trans('InfoAdmin'), 'info', 'class="hideonsmartphone"').' '.$text.($nodiv?'':'</div>'); } diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index af0cb03b68f069320de6c6befe6a9cf9a7425873..a1b8852860fc31cad5a5692e203f96095b93fb7d 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -1,5 +1,5 @@ <?php -/* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net> +/* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr> * Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es> @@ -109,7 +109,7 @@ class pdf_einstein extends ModelePDFCommandes $this->posxdiscount=162; $this->postotalht=174; if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva=$this->posxup; - $this->posxpicture=$this->posxtva - 16; // width of images + $this->posxpicture=$this->posxtva - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH)?16:$conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images if ($this->page_largeur < 210) // To work with US executive format { $this->posxpicture-=20; @@ -153,7 +153,7 @@ class pdf_einstein extends ModelePDFCommandes $outputlangs->load("products"); $outputlangs->load("orders"); $outputlangs->load("deliveries"); - + if ($conf->commande->dir_output) { $object->fetch_thirdparty(); @@ -228,6 +228,15 @@ class pdf_einstein extends ModelePDFCommandes $this->atleastonediscount++; } } + if (empty($this->atleastonediscount)) + { + $this->posxpicture+=($this->postotalht - $this->posxdiscount); + $this->posxtva+=($this->postotalht - $this->posxdiscount); + $this->posxup+=($this->postotalht - $this->posxdiscount); + $this->posxqty+=($this->postotalht - $this->posxdiscount); + $this->posxdiscount+=($this->postotalht - $this->posxdiscount); + //$this->postotalht; + } // New page $pdf->AddPage(); @@ -316,7 +325,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->AddPage('','',true); if (! empty($tplidx)) $pdf->useTemplate($tplidx); if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); - $pdf->setPage($pagenb+1); + $pdf->setPage($pageposafter+1); } } else @@ -412,6 +421,7 @@ class pdf_einstein extends ModelePDFCommandes // Add line if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1)) { + $pdf->setPage($pageposafter); $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210))); //$pdf->SetDrawColor(190,190,200); $pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1); @@ -601,7 +611,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetFont('','B', $default_font_size - 2); $text=$outputlangs->transnoentities("DeliveryDate").':'; $pdf->MultiCell(80, 3, $text, 0, 'L', 0); - + $pdf->SetFont('','', $default_font_size - 2); $pdf->SetXY($posxval, $posy); $text=dol_print_date($object->date_livraison,'day','',$outputlangs); diff --git a/htdocs/core/modules/commande/doc/pdf_proforma.modules.php b/htdocs/core/modules/commande/doc/pdf_proforma.modules.php index 9733b30ded67d7a6035d41fa5bdca2cdd6cf6767..7ea8ebb2e557b49fd9f2c1a8f512f5abca6e26ce 100644 --- a/htdocs/core/modules/commande/doc/pdf_proforma.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_proforma.modules.php @@ -1,5 +1,5 @@ <?php -/* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net> +/* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr> * Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es> @@ -109,7 +109,7 @@ class pdf_proforma extends ModelePDFCommandes $this->posxdiscount=162; $this->postotalht=174; if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva=$this->posxup; - $this->posxpicture=$this->posxtva - 16; // width of images + $this->posxpicture=$this->posxtva - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH)?16:$conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images if ($this->page_largeur < 210) // To work with US executive format { $this->posxpicture-=20; @@ -227,6 +227,15 @@ class pdf_proforma extends ModelePDFCommandes $this->atleastonediscount++; } } + if (empty($this->atleastonediscount)) + { + $this->posxpicture+=($this->postotalht - $this->posxdiscount); + $this->posxtva+=($this->postotalht - $this->posxdiscount); + $this->posxup+=($this->postotalht - $this->posxdiscount); + $this->posxqty+=($this->postotalht - $this->posxdiscount); + $this->posxdiscount+=($this->postotalht - $this->posxdiscount); + //$this->postotalht; + } // New page $pdf->AddPage(); @@ -315,7 +324,7 @@ class pdf_proforma extends ModelePDFCommandes $pdf->AddPage('','',true); if (! empty($tplidx)) $pdf->useTemplate($tplidx); if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); - $pdf->setPage($pagenb+1); + $pdf->setPage($pageposafter+1); } } else @@ -411,6 +420,7 @@ class pdf_proforma extends ModelePDFCommandes // Add line if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1)) { + $pdf->setPage($pageposafter); $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210))); //$pdf->SetDrawColor(190,190,200); $pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1); diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index 6976754285a10f67f02c406db81b2bc098d9ad09..353b77ffaf791a21263ee3e015709b7e1daf815a 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -116,15 +116,24 @@ class pdf_strato extends ModelePDFContract $outputlangs->load("dict"); $outputlangs->load("companies"); $outputlangs->load("contracts"); + $outputlangs->load("interventions"); if ($conf->contrat->dir_output) { $object->fetch_thirdparty(); - $objectref = dol_sanitizeFileName($object->ref); - $dir = $conf->contrat->dir_output; - if (! preg_match('/specimen/i',$objectref)) $dir.= "/" . $objectref; - $file = $dir . "/" . $objectref . ".pdf"; + // Definition of $dir and $file + if ($object->specimen) + { + $dir = $conf->contrat->dir_output; + $file = $dir . "/SPECIMEN.pdf"; + } + else + { + $objectref = dol_sanitizeFileName($object->ref); + $dir = $conf->contrat->dir_output . "/" . $objectref; + $file = $dir . "/" . $objectref . ".pdf"; + } if (! file_exists($dir)) { diff --git a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php index c5662089e9e2b4c3f5f7625361aba55eecec62e0..dafff8b81ea0bc7f0ff52b465db7d9f08fef528b 100644 --- a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php @@ -267,6 +267,7 @@ class pdf_merou extends ModelePdfExpedition // Add line if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1)) { + $pdf->setPage($pageposafter); $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210))); //$pdf->SetDrawColor(190,190,200); $pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1); @@ -474,7 +475,7 @@ class pdf_merou extends ModelePdfExpedition else { $text=$this->emetteur->name; - $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($text), 0, 'L'); + $pdf->MultiCell(70, 3, $outputlangs->convToOutputCharset($text), 0, 'L'); } //*********************Entete**************************** diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index 4394c3200f5a9e46f80830c3674e9cb97cb042a5..d924da16785b70c523d5bf1cec6fae5ecc8c0e6d 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -240,7 +240,7 @@ class pdf_rouget extends ModelePdfExpedition $pageposbefore=$pdf->getPage(); // Description de la ligne produit - pdf_writelinedesc($pdf,$object,$i,$outputlangs,150,3,$this->posxdesc,$curY,0,1); + pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxqtyordered-10,3,$this->posxdesc,$curY,0,1); $nexY = $pdf->GetY(); $pageposafter=$pdf->getPage(); @@ -264,6 +264,7 @@ class pdf_rouget extends ModelePdfExpedition // Add line if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1)) { + $pdf->setPage($pageposafter); $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210))); //$pdf->SetDrawColor(190,190,200); $pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1); diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index ebbe4727cfeea00dc6100317dd2309ddbc729673..eecf69eed8dc6181f0297d435e57ad35bb99c45d 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1,5 +1,5 @@ <?php -/* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net> +/* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr> * Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es> @@ -109,7 +109,7 @@ class pdf_crabe extends ModelePDFFactures $this->posxdiscount=162; $this->postotalht=174; if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva=$this->posxup; - $this->posxpicture=$this->posxtva - 16; // width of images + $this->posxpicture=$this->posxtva - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH)?16:$conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images if ($this->page_largeur < 210) // To work with US executive format { $this->posxpicture-=20; @@ -228,6 +228,15 @@ class pdf_crabe extends ModelePDFFactures $this->atleastonediscount++; } } + if (empty($this->atleastonediscount)) + { + $this->posxpicture+=($this->postotalht - $this->posxdiscount); + $this->posxtva+=($this->postotalht - $this->posxdiscount); + $this->posxup+=($this->postotalht - $this->posxdiscount); + $this->posxqty+=($this->postotalht - $this->posxdiscount); + $this->posxdiscount+=($this->postotalht - $this->posxdiscount); + //$this->postotalht; + } // New page $pdf->AddPage(); @@ -318,7 +327,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->AddPage('','',true); if (! empty($tplidx)) $pdf->useTemplate($tplidx); if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); - $pdf->setPage($pagenb+1); + $pdf->setPage($pageposafter+1); } } else @@ -413,6 +422,7 @@ class pdf_crabe extends ModelePDFFactures // Add line if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1)) { + $pdf->setPage($pageposafter); $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210))); //$pdf->SetDrawColor(190,190,200); $pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1); diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php index f0766e271e5956a2ad33d3860ba1afade074aea6..0a812096fa49988a054f26e9e3e7641947c1e8fc 100644 --- a/htdocs/core/modules/import/import_csv.modules.php +++ b/htdocs/core/modules/import/import_csv.modules.php @@ -250,7 +250,7 @@ class ImportCsv extends ModeleImports /** * Return array of next record in input file. * - * @return Array Array of field values. Data are UTF8 encoded. [fieldpos] => (['val']=>val, ['type']=>-1=null,0=blank,1=string) + * @return Array Array of field values. Data are UTF8 encoded. [fieldpos] => (['val']=>val, ['type']=>-1=null,0=blank,1=not empty string) */ function import_read_record() { @@ -335,7 +335,8 @@ class ImportCsv extends ModeleImports function import_insert($arrayrecord,$array_match_file_to_database,$objimport,$maxfields,$importid) { global $langs,$conf,$user; - global $thirdparty_static; // Specifi to thirdparty import + global $thirdparty_static; // Specific to thirdparty import + global $tablewithentity_cache; // Cache to avoid to call desc at each rows on tables $error=0; $warning=0; @@ -371,6 +372,25 @@ class ImportCsv extends ModeleImports $i=0; $errorforthistable=0; + // Define $tablewithentity_cache[$tablename] if not already defined + if (! isset($tablewithentity_cache[$tablename])) // keep this test with "isset" + { + dol_syslog("Check if table ".$tablename." has an entity field"); + $resql=$this->db->DDLDescTable($tablename,'entity'); + if ($resql) + { + $obj=$this->db->fetch_object($resql); + if ($obj) $tablewithentity_cache[$tablename]=1; // table contains entity field + else $tablewithentity_cache[$tablename]=0; // table does not contains entity field + } + else dol_print_error($this->db);; + } + else + { + //dol_syslog("Table ".$tablename." check for entity into cache is ".$tablewithentity_cache[$tablename]); + } + + // Loop on each fields in the match array: $key = 1..n, $val=alias of field (s.nom) foreach($sort_array_match_file_to_database as $key => $val) { @@ -383,7 +403,7 @@ class ImportCsv extends ModeleImports { // Set $newval with value to insert and set $listvalues with sql request part for insert $newval=''; - if ($arrayrecord[($key-1)]['type'] > 0) $newval=$arrayrecord[($key-1)]['val']; // If type of field is not null or '' but string + if ($arrayrecord[($key-1)]['type'] > 0) $newval=$arrayrecord[($key-1)]['val']; // If type of field into input file is not empty string (so defined into input file), we get value // Make some tests on $newval @@ -441,41 +461,46 @@ class ImportCsv extends ModeleImports { if (empty($newval)) $newval='0'; } - elseif ($objimport->array_import_convertvalue[0][$val]['rule']=='getcustomercodeifnull') + elseif ($objimport->array_import_convertvalue[0][$val]['rule']=='getcustomercodeifauto') { - if (empty($newval) || $newval=='auto') + if (strtolower($newval) == 'auto') { $this->thirpartyobject->get_codeclient(0,0); $newval=$this->thirpartyobject->code_client; //print 'code_client='.$newval; } + if (empty($newval)) $arrayrecord[($key-1)]['type']=-1; // If we get empty value, we will use "null" } - elseif ($objimport->array_import_convertvalue[0][$val]['rule']=='getsuppliercodeifnull') + elseif ($objimport->array_import_convertvalue[0][$val]['rule']=='getsuppliercodeifauto') { - if (empty($newval) || $newval=='auto') + if (strtolower($newval) == 'auto') { $newval=$this->thirpartyobject->get_codefournisseur(0,1); $newval=$this->thirpartyobject->code_fournisseur; //print 'code_fournisseur='.$newval; } + if (empty($newval)) $arrayrecord[($key-1)]['type']=-1; // If we get empty value, we will use "null" } - elseif ($objimport->array_import_convertvalue[0][$val]['rule']=='getcustomeraccountancycodeifnull') + elseif ($objimport->array_import_convertvalue[0][$val]['rule']=='getcustomeraccountancycodeifauto') { - if (empty($newval) || $newval=='auto') + if (strtolower($newval) == 'auto') { $this->thirpartyobject->get_codecompta('customer'); $newval=$this->thirpartyobject->code_compta; //print 'code_compta='.$newval; } + if (empty($newval)) $arrayrecord[($key-1)]['type']=-1; // If we get empty value, we will use "null" } - elseif ($objimport->array_import_convertvalue[0][$val]['rule']=='getsupplieraccountancycodeifnull') + elseif ($objimport->array_import_convertvalue[0][$val]['rule']=='getsupplieraccountancycodeifauto') { - if (empty($newval) || $newval=='auto') + if (strtolower($newval) == 'auto') { $this->thirpartyobject->get_codecompta('supplier'); $newval=$this->thirpartyobject->code_compta_fournisseur; + if (empty($newval)) $arrayrecord[($key-1)]['type']=-1; // If we get empty value, we will use "null" //print 'code_compta_fournisseur='.$newval; } + if (empty($newval)) $arrayrecord[($key-1)]['type']=-1; // If we get empty value, we will use "null" } //print 'Val to use as insert is '.$newval.'<br>'; @@ -540,6 +565,7 @@ class ImportCsv extends ModeleImports if ($listfields) { $listfields.=', '; $listvalues.=', '; } $listfields.=$fieldname; + // Note: arrayrecord (and 'type') is filled with ->import_read_record called by import.php page before calling import_insert if (empty($newval) && $arrayrecord[($key-1)]['type'] < 0) $listvalues.=($newval=='0'?$newval:"null"); elseif (empty($newval) && $arrayrecord[($key-1)]['type'] == 0) $listvalues.="''"; else $listvalues.="'".$this->db->escape($newval)."'"; @@ -581,7 +607,7 @@ class ImportCsv extends ModeleImports //var_dump($objimport->array_import_convertvalue); exit; // Build SQL request - if (! tablewithentity($tablename)) + if (empty($tablewithentity[$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]; @@ -644,25 +670,5 @@ function cleansep($value) return str_replace(array(',',';'),'/',$value); }; -/** - * Returns if a table contains entity column - * - * @param string $table Table name - * @return int 1 if table contains entity, 0 if not and -1 if error - */ -function tablewithentity($table) -{ - global $db; - - $resql=$db->DDLDescTable($table,'entity'); - if ($resql) - { - $i=0; - $obj=$db->fetch_object($resql); - if ($obj) return 1; - else return 0; - } - else return -1; -} ?> diff --git a/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php b/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php index bdb35d67fbe7649a0d329972db4acad5dcfa1b90..b9d61ec10490a915c5be9414fb3368423a5e040b 100644 --- a/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php +++ b/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php @@ -1,5 +1,5 @@ <?php -/* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net> +/* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be> * Copyright (C) 2008 Chiptronik @@ -223,15 +223,24 @@ class pdf_typhon extends ModelePDFDeliveryOrder $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right /* - // Positionne $this->atleastonediscount si on a au moins une remise - for ($i = 0 ; $i < $nblines ; $i++) - { - if ($object->lines[$i]->remise_percent) - { - $this->atleastonediscount++; - } - } - */ + // Positionne $this->atleastonediscount si on a au moins une remise + for ($i = 0 ; $i < $nblines ; $i++) + { + if ($object->lines[$i]->remise_percent) + { + $this->atleastonediscount++; + } + } + if (empty($this->atleastonediscount)) + { + $this->posxpicture+=($this->postotalht - $this->posxdiscount); + $this->posxtva+=($this->postotalht - $this->posxdiscount); + $this->posxup+=($this->postotalht - $this->posxdiscount); + $this->posxqty+=($this->postotalht - $this->posxdiscount); + $this->posxdiscount+=($this->postotalht - $this->posxdiscount); + //$this->postotalht; + } + */ // New page $pdf->AddPage(); @@ -307,7 +316,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $pdf->AddPage('','',true); if (! empty($tplidx)) $pdf->useTemplate($tplidx); if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); - $pdf->setPage($pagenb+1); + $pdf->setPage($pageposafter+1); } } else @@ -370,6 +379,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder // Add line if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblines - 1)) { + $pdf->setPage($pageposafter); $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210))); //$pdf->SetDrawColor(190,190,200); $pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1); diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index 205791624c1849aeacce3d3599acddcafe980fa8..88fe8d2865cb288364dd5278eda227f6992461f0 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -401,14 +401,14 @@ class modSociete extends DolibarrModules 's.fk_typent'=>array('rule'=>'fetchidfromcodeid','classfile'=>'/core/class/ctypent.class.php','class'=>'Ctypent','method'=>'fetch','dict'=>'DictionaryCompanyType'), 's.fk_pays'=>array('rule'=>'fetchidfromcodeid','classfile'=>'/core/class/cpays.class.php','class'=>'Cpays','method'=>'fetch','dict'=>'DictionaryCountry'), 's.fk_stcomm'=>array('rule'=>'zeroifnull'), - 's.code_client'=>array('rule'=>'getcustomercodeifnull'), - 's.code_fournisseur'=>array('rule'=>'getsuppliercodeifnull'), - 's.code_compta'=>array('rule'=>'getcustomeraccountancycodeifnull'), - 's.code_compta_fournisseur'=>array('rule'=>'getsupplieraccountancycodeifnull') + 's.code_client'=>array('rule'=>'getcustomercodeifauto'), + 's.code_fournisseur'=>array('rule'=>'getsuppliercodeifauto'), + 's.code_compta'=>array('rule'=>'getcustomeraccountancycodeifauto'), + 's.code_compta_fournisseur'=>array('rule'=>'getsupplieraccountancycodeifauto') ); //$this->import_convertvalue_array[$r]=array('s.fk_soc'=>array('rule'=>'lastrowid',table='t'); $this->import_regex_array[$r]=array('s.status'=>'^[0|1]','s.client'=>'^[0|1|2|3]','s.fournisseur'=>'^[0|1]','s.fk_typent'=>'id@'.MAIN_DB_PREFIX.'c_typent','s.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$'); - $this->import_examplevalues_array[$r]=array('s.nom'=>"MyBigCompany",'s.status'=>"0 (closed) or 1 (active)",'s.client'=>'0 (no customer no prospect)/1 (customer)/2 (prospect)/3 (customer and prospect)','s.fournisseur'=>'0 or 1','s.datec'=>dol_print_date(dol_now(),'%Y-%m-%d'),'s.code_client'=>"CU01-0001 or auto",'s.code_fournisseur'=>"SU01-0001 or auto",'s.address'=>"61 jump street",'s.zip'=>"123456",'s.town'=>"Big town",'s.fk_pays'=>'US, FR, DE...','s.phone'=>"0101010101",'s.fax'=>"0101010102",'s.url'=>"http://mycompany.com",'s.email'=>"test@mycompany.com",'s.siret'=>"",'s.siren'=>"",'s.ape'=>"",'s.idprof4'=>"",'s.tva_intra'=>"FR0123456789",'s.capital'=>"10000",'s.note_private'=>"This is an example of private note for record",'s.note_public'=>"This is an example of public note for record",'s.fk_typent'=>"2",'s.fk_effectif'=>"3","s.fk_forme_juridique"=>"1",'s.fk_prospectlevel'=>'PL_MEDIUM','s.fk_stcomm'=>'0','s.default_lang'=>'en_US','s.barcode'=>'123456789'); + $this->import_examplevalues_array[$r]=array('s.nom'=>"MyBigCompany",'s.status'=>"0 (closed) or 1 (active)",'s.client'=>'0 (no customer no prospect)/1 (customer)/2 (prospect)/3 (customer and prospect)','s.fournisseur'=>'0 or 1','s.datec'=>dol_print_date(dol_now(),'%Y-%m-%d'),'s.code_client'=>"CU01-0001 or empty or 'auto'",'s.code_fournisseur'=>"SU01-0001 or empty or 'auto'",'s.address'=>"61 jump street",'s.zip'=>"123456",'s.town'=>"Big town",'s.fk_pays'=>'US, FR, DE...','s.phone'=>"0101010101",'s.fax'=>"0101010102",'s.url'=>"http://mycompany.com",'s.email'=>"test@mycompany.com",'s.siret'=>"",'s.siren'=>"",'s.ape'=>"",'s.idprof4'=>"",'s.tva_intra'=>"FR0123456789",'s.capital'=>"10000",'s.note_private'=>"This is an example of private note for record",'s.note_public'=>"This is an example of public note for record",'s.fk_typent'=>"2",'s.fk_effectif'=>"3","s.fk_forme_juridique"=>"1",'s.fk_prospectlevel'=>'PL_MEDIUM','s.fk_stcomm'=>'0','s.default_lang'=>'en_US','s.barcode'=>'123456789'); // Import list of contact and attributes $r++; diff --git a/htdocs/core/modules/project/pdf/pdf_baleine.modules.php b/htdocs/core/modules/project/pdf/pdf_baleine.modules.php index cca049cba920c0d88e9d6d9f8d2767eb36ec8088..881b112688ecb9e2ab3e403a5d779a6c1f2b2714 100644 --- a/htdocs/core/modules/project/pdf/pdf_baleine.modules.php +++ b/htdocs/core/modules/project/pdf/pdf_baleine.modules.php @@ -222,12 +222,15 @@ class pdf_baleine extends ModelePDFProjects $pdf->MultiCell(20, 3, $dateend, 0, 'L'); + $pageposafter=$pdf->getPage(); + $pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut $nexY = $pdf->GetY(); // Add line if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1)) { + $pdf->setPage($pageposafter); $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210))); //$pdf->SetDrawColor(190,190,200); $pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1); diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 700e558668eccd98af9eb12334dafaf04c34eee7..af073ddc1ca37cc72b4dd82299739ab486364ba0 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -254,6 +254,15 @@ class pdf_azur extends ModelePDFPropales $this->atleastonediscount++; } } + if (empty($this->atleastonediscount)) + { + $this->posxpicture+=($this->postotalht - $this->posxdiscount); + $this->posxtva+=($this->postotalht - $this->posxdiscount); + $this->posxup+=($this->postotalht - $this->posxdiscount); + $this->posxqty+=($this->postotalht - $this->posxdiscount); + $this->posxdiscount+=($this->postotalht - $this->posxdiscount); + //$this->postotalht; + } // New page $pdf->AddPage(); @@ -332,7 +341,7 @@ class pdf_azur extends ModelePDFPropales $pdf->AddPage('','',true); if (! empty($tplidx)) $pdf->useTemplate($tplidx); if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); - $pdf->setPage($pagenb+1); + $pdf->setPage($pageposbefore+1); $curY = $tab_top_newpage; $showpricebeforepagebreak=0; @@ -370,7 +379,7 @@ class pdf_azur extends ModelePDFPropales $pdf->AddPage('','',true); if (! empty($tplidx)) $pdf->useTemplate($tplidx); if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); - $pdf->setPage($pagenb+1); + $pdf->setPage($pageposafter+1); } } else @@ -387,6 +396,7 @@ class pdf_azur extends ModelePDFPropales $nexY = $pdf->GetY(); $pageposafter=$pdf->getPage(); + $pdf->setPage($pageposbefore); $pdf->setTopMargin($this->marge_haute); $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. @@ -468,6 +478,7 @@ class pdf_azur extends ModelePDFPropales // Add line if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1)) { + $pdf->setPage($pageposafter); $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210))); //$pdf->SetDrawColor(190,190,200); $pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1); diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index 34c031734f1a7fc777489a993c38caef61bf166f..b6ed22e3c37c17a419ab3583796630ec8255766d 100644 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -1,6 +1,6 @@ <?php /* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es> - * Copyright (C) 2010-2012 Laurent Destailleur <eldy@users.sourceforge.net> + * Copyright (C) 2010-2014 Laurent Destailleur <eldy@users.sourceforge.net> * * 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 @@ -58,7 +58,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices * Constructor * * @param DoliDB $db Database handler - * @param Societe $object Supplier invoice + * @param Object $object Supplier invoice */ function __construct($db,$object) { @@ -105,7 +105,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $this->posxdiscount=162; $this->postotalht=174; //if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva=$this->posxup; - $this->posxpicture=$this->posxtva - 16; // width of images + $this->posxpicture=$this->posxtva - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH)?16:$conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images if ($this->page_largeur < 210) // To work with US executive format { $this->posxpicture-=20; @@ -227,6 +227,15 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $this->atleastonediscount++; } } + if (empty($this->atleastonediscount)) + { + $this->posxpicture+=($this->postotalht - $this->posxdiscount); + $this->posxtva+=($this->postotalht - $this->posxdiscount); + $this->posxup+=($this->postotalht - $this->posxdiscount); + $this->posxqty+=($this->postotalht - $this->posxdiscount); + $this->posxdiscount+=($this->postotalht - $this->posxdiscount); + //$this->postotalht; + } // New page $pdf->AddPage(); @@ -281,7 +290,39 @@ class pdf_canelle extends ModelePDFSuppliersInvoices // Description of product line $curX = $this->posxdesc-1; - pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,3,$curX,$curY,$hideref,$hidedesc,1); + $showpricebeforepagebreak=1; + + $pdf->startTransaction(); + pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,3,$curX,$curY,$hideref,$hidedesc,1); + $pageposafter=$pdf->getPage(); + if ($pageposafter > $pageposbefore) // There is a pagebreak + { + $pdf->rollbackTransaction(true); + $pageposafter=$pageposbefore; + //print $pageposafter.'-'.$pageposbefore;exit; + $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,4,$curX,$curY,$hideref,$hidedesc); + $posyafter=$pdf->GetY(); + if ($posyafter > ($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))) // There is no space left for total+free text + { + if ($i == ($nblignes-1)) // No more lines, and no space left to show total, so we create a new page + { + $pdf->AddPage('','',true); + if (! empty($tplidx)) $pdf->useTemplate($tplidx); + if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); + $pdf->setPage($pageposafter+1); + } + } + else + { + // We found a page break + $showpricebeforepagebreak=0; + } + } + else // No pagebreak + { + $pdf->commitTransaction(); + } $nexY = $pdf->GetY(); $pageposafter=$pdf->getPage(); @@ -290,7 +331,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. // We suppose that a too long description is moved completely on next page - if ($pageposafter > $pageposbefore) { + if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) { $pdf->setPage($pageposafter); $curY = $tab_top_newpage; } @@ -301,7 +342,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices { $vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails); $pdf->SetXY($this->posxtva, $curY); - $pdf->MultiCell($this->posxup-$this->posxtva-0.8, 3, $vat_rate, 0, 'R'); + $pdf->MultiCell($this->posxup-$this->posxtva-1, 3, $vat_rate, 0, 'R'); } // Unit price before discount @@ -322,7 +363,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices // Total HT line $total_excl_tax = pdf_getlinetotalexcltax($object, $i, $outputlangs); $pdf->SetXY($this->postotalht, $curY); - $pdf->MultiCell(26, 3, $total_excl_tax, 0, 'R', 0); + $pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->postotalht, 3, $total_excl_tax, 0, 'R', 0); // Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva $tvaligne=$object->lines[$i]->total_tva; @@ -344,6 +385,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices // Add line if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1)) { + $pdf->setPage($pageposafter); $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210))); //$pdf->SetDrawColor(190,190,200); $pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1); @@ -368,6 +410,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pagenb++; $pdf->setPage($pagenb); $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); } if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak) { @@ -384,6 +427,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->AddPage(); if (! empty($tplidx)) $pdf->useTemplate($tplidx); $pagenb++; + if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); } } diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index 0b580a41de87d10d7ec453abc36914aec3134dad..3933e21e0e021e344f107757ae62a400749fbf5c 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -1,5 +1,5 @@ <?php -/* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net> +/* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be> * Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es> @@ -110,7 +110,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $this->posxdiscount=162; $this->postotalht=174; //if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva=$this->posxup; - $this->posxpicture=$this->posxtva - 16; // width of images + $this->posxpicture=$this->posxtva - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH)?16:$conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images if ($this->page_largeur < 210) // To work with US executive format { $this->posxpicture-=20; @@ -235,6 +235,15 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $this->atleastonediscount++; } } + if (empty($this->atleastonediscount)) + { + $this->posxpicture+=($this->postotalht - $this->posxdiscount); + $this->posxtva+=($this->postotalht - $this->posxdiscount); + $this->posxup+=($this->postotalht - $this->posxdiscount); + $this->posxqty+=($this->postotalht - $this->posxdiscount); + $this->posxdiscount+=($this->postotalht - $this->posxdiscount); + //$this->postotalht; + } // New page $pdf->AddPage(); @@ -309,7 +318,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->AddPage('','',true); if (! empty($tplidx)) $pdf->useTemplate($tplidx); if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); - $pdf->setPage($pagenb+1); + $pdf->setPage($pageposafter+1); } } else @@ -403,6 +412,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders // Add line if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1)) { + $pdf->setPage($pageposafter); $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210))); //$pdf->SetDrawColor(190,190,200); $pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1); diff --git a/htdocs/core/tpl/document_actions_post_headers.tpl.php b/htdocs/core/tpl/document_actions_post_headers.tpl.php index 2ae7b9ad595cfa0c82bd2eaf150455b618def14f..a662bd5be3defdc607aba6aab6f1b8cfecefca2e 100644 --- a/htdocs/core/tpl/document_actions_post_headers.tpl.php +++ b/htdocs/core/tpl/document_actions_post_headers.tpl.php @@ -1,6 +1,6 @@ <?php -/* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr> - * Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net> +/* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr> + * Copyright (C) 2013-2014 Laurent Destailleur <eldy@users.sourceforge.net> * * 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 @@ -18,16 +18,17 @@ */ $langs->load("link"); +if (empty($relativepathwithnofile)) $relativepathwithnofile=''; /* - * Confirm suppression + * Confirm form to delete */ if ($action == 'delete') { $langs->load("companies"); // Need for string DeleteFile+ConfirmDeleteFiles $ret = $form->form_confirm( - $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&urlfile=' . urlencode(GETPOST("urlfile")) . '&linkid=' . GETPOST('linkid', 'int'), + $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&urlfile=' . urlencode(GETPOST("urlfile")) . '&linkid=' . GETPOST('linkid', 'int') . (empty($param)?'':$param), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', @@ -58,11 +59,11 @@ $formfile->list_of_documents( $modulepart, $param, 0, - '', + $relativepathwithnofile, // relative path with no file. For example "moduledir/0/1" $permission ); print "<br>"; //List of links -$formfile->listOfLinks($object, $permission, $action, GETPOST('linkid', 'int')); +$formfile->listOfLinks($object, $permission, $action, GETPOST('linkid', 'int'), $param); print "<br>"; diff --git a/htdocs/core/tpl/document_actions_pre_headers.tpl.php b/htdocs/core/tpl/document_actions_pre_headers.tpl.php index 989a3bcaf73d689b44e74d3f56a7b14aed06e3a9..ca6929331eccc8898ad35daa0cb019abca7560b2 100644 --- a/htdocs/core/tpl/document_actions_pre_headers.tpl.php +++ b/htdocs/core/tpl/document_actions_pre_headers.tpl.php @@ -74,7 +74,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes') setEventMessage($langs->trans("ErrorFailedToDeleteLink", $link->label), 'errors'); } } - header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id); + header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id.($withproject?'&withproject=1':'')); exit; } } diff --git a/htdocs/expedition/note.php b/htdocs/expedition/note.php index 0ef603a23f92002b16ea2055624cfe85163f031e..ad55c3bbe3e7f98098045ff7d3ba9cd88bede024 100644 --- a/htdocs/expedition/note.php +++ b/htdocs/expedition/note.php @@ -24,10 +24,6 @@ * \brief Note card expedition */ -error_reporting(E_ALL); -ini_set('display_errors', true); -ini_set('html_errors', false); - require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/sendings.lib.php'; diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index 743988b3195cd3bef7aa0f5bad7a7b05caf2a763..4d30aca90fa8bbead281a77956648c8631bbbe1d 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -212,8 +212,9 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer) setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), 'errors'); $error++; } - if (! GETPOST('addline_predefined') && (! GETPOST('pu') || GETPOST('pu')=='')) // Unit price can be 0 but not '' + if (! GETPOST('addline_predefined') && ( GETPOST('pu')==='')) // Unit price can be 0 but not '' { + setEventMessage($langs->trans($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('UnitPrice'))), 'errors'); $error++; } @@ -232,7 +233,7 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer) // Ecrase $pu par celui du produit // Ecrase $desc par celui du produit // Ecrase $txtva par celui du produit - if (GETPOST('addline_predefined') || GETPOST('idprodfournprice')) // With combolist idprodfournprice is > 0 or -1. With autocomplete, idprodfournprice is > 0 or '' + if ((GETPOST('addline_predefined') || GETPOST('idprodfournprice')) && ( GETPOST('pu')!=='')) // With combolist idprodfournprice is > 0 or -1. With autocomplete, idprodfournprice is > 0 or '' { $idprod=0; $productsupplier = new ProductFournisseur($db); @@ -292,7 +293,7 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer) setEventMessage($langs->trans("ErrorQtyTooLowForThisSupplier"), 'errors'); } } - else + else if( GETPOST('pu')!=='' || GETPOST('amountttc')!=='' ) { $type=$_POST["type"]; $desc=$_POST['dp_desc']; @@ -319,7 +320,7 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer) $ttc = price2num($_POST['amountttc']); $ht = $ttc / (1 + ($tauxtva / 100)); $price_base_type = 'HT'; - $result=$object->addline($desc, $ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, 0, 0, '', $remise_percent, $price_base_type, $ttc, $type); + $result=$object->addline($desc, $ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, 0, 0, '', $remise_percent, $price_base_type, $ttc, $type); } } } diff --git a/htdocs/fourn/commande/liste.php b/htdocs/fourn/commande/liste.php index d6c4bb9427dde64fb327ccd47f49aaf46b445e03..9e5cf3dc2d399b683a551d4249ba7688776d6c34 100644 --- a/htdocs/fourn/commande/liste.php +++ b/htdocs/fourn/commande/liste.php @@ -32,11 +32,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; $langs->load("orders"); -$sref=GETPOST('search_ref'); -$snom=GETPOST('search_nom'); -$suser=GETPOST('search_user'); -$sttc=GETPOST('search_ttc'); + $search_ref=GETPOST('search_ref'); +$search_refsupp=GETPOST('search_refsupp'); $search_nom=GETPOST('search_nom'); $search_user=GETPOST('search_user'); $search_ttc=GETPOST('search_ttc'); @@ -81,7 +79,7 @@ $offset = $conf->liste_limit * $page ; */ $sql = "SELECT s.rowid as socid, s.nom, cf.date_commande as dc,"; -$sql.= " cf.rowid,cf.ref, cf.fk_statut, cf.total_ttc, cf.fk_user_author,"; +$sql.= " cf.rowid,cf.ref, cf.ref_supplier, cf.fk_statut, cf.total_ttc, cf.fk_user_author,"; $sql.= " u.login"; $sql.= " FROM (".MAIN_DB_PREFIX."societe as s,"; $sql.= " ".MAIN_DB_PREFIX."commande_fournisseur as cf"; @@ -91,21 +89,21 @@ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON cf.fk_user_author = u.rowid"; $sql.= " WHERE cf.fk_soc = s.rowid "; $sql.= " AND cf.entity = ".$conf->entity; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; -if ($sref) +if ($search_ref) { - $sql .= natural_search('cf.ref', $sref); + $sql .= natural_search('cf.ref', $search_ref); } -if ($snom) +if ($search_nom) { - $sql .= natural_search('s.nom', $snom); + $sql .= natural_search('s.nom', $search_nom); } -if ($suser) +if ($search_user) { - $sql.= " AND u.login LIKE '%".$db->escape($suser)."%'"; + $sql.= " AND u.login LIKE '%".$db->escape($search_user)."%'"; } -if ($sttc) +if ($search_ttc) { - $sql .= " AND total_ttc = ".price2num($sttc); + $sql .= " AND total_ttc = ".price2num($search_ttc); } if ($sall) { @@ -117,6 +115,10 @@ if (GETPOST('statut')) { $sql .= " AND fk_statut =".GETPOST('statut','int'); } +if ($search_refsupp) +{ + $sql.= " AND (cf.ref_supplier LIKE '%".$db->escape($search_refsupp)."%')"; +} $sql.= " ORDER BY $sortfield $sortorder "; $sql.= $db->plimit($conf->liste_limit+1, $offset); @@ -133,11 +135,13 @@ if ($resql) if ($search_nom) $param.="&search_nom=".$search_nom; if ($search_user) $param.="&search_user=".$search_user; if ($search_ttc) $param.="&search_ttc=".$search_ttc; + if ($search_refsupp) $param.="&search_refsupp=".$search_refsupp; print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num); print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">'; print '<table class="noborder" width="100%">'; print '<tr class="liste_titre">'; print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"cf.ref","",$param,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("RefSupplier"),$_SERVER["PHP_SELF"],"cf.ref_supplier","",$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","",$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Author"),$_SERVER["PHP_SELF"],"u.login","",$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("AmountTTC"),$_SERVER["PHP_SELF"],"total_ttc","",$param,$sortfield,$sortorder); @@ -147,10 +151,11 @@ if ($resql) print '<tr class="liste_titre">'; - print '<td class="liste_titre"><input type="text" class="flat" name="search_ref" value="'.$sref.'"></td>'; - print '<td class="liste_titre"><input type="text" class="flat" name="search_nom" value="'.$snom.'"></td>'; - print '<td class="liste_titre"><input type="text" class="flat" name="search_user" value="'.$suser.'"></td>'; - print '<td class="liste_titre"><input type="text" class="flat" name="search_ttc" value="'.$sttc.'"></td>'; + print '<td class="liste_titre"><input type="text" class="flat" name="search_ref" value="'.$search_ref.'"></td>'; + print '<td class="liste_titre"><input type="text" class="flat" name="search_refsupp" value="'.$search_refsupp.'"></td>'; + print '<td class="liste_titre"><input type="text" class="flat" name="search_nom" value="'.$search_nom.'"></td>'; + print '<td class="liste_titre"><input type="text" class="flat" name="search_user" value="'.$search_user.'"></td>'; + print '<td class="liste_titre"><input type="text" class="flat" name="search_ttc" value="'.$search_ttc.'"></td>'; print '<td colspan="2" class="liste_titre" align="right">'; print '<input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">'; print '</td>'; @@ -174,6 +179,10 @@ if ($resql) $filedir=$conf->fournisseur->dir_output.'/commande' . '/' . dol_sanitizeFileName($obj->ref); print $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir); print '</td>'."\n"; + + // Ref Supplier + print '<td>'.$obj->ref_supplier.'</td>'."\n"; + // Company print '<td><a href="'.DOL_URL_ROOT.'/fourn/fiche.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '; diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 0deb13f8c151b808fccce4372d48a9f3723be112..d17ed94ef2a2a7eabd1272ff7a04938c80991538 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -28,10 +28,6 @@ * \brief Page for supplier invoice card (view, edit, validate) */ -error_reporting(E_ALL); -ini_set('display_errors', true); -ini_set('html_errors', false); - require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php'; diff --git a/htdocs/holiday/fiche.php b/htdocs/holiday/fiche.php index e921237583a255934efbea66894c3b1060ca7e3f..b77a93ab6336d9595dc5f62fbf5d01a971e904e4 100644 --- a/htdocs/holiday/fiche.php +++ b/htdocs/holiday/fiche.php @@ -1043,7 +1043,7 @@ else $idGroupValid = $cp->getConfCP('userGroup'); $validator = new UserGroup($db,$idGroupValid); - $valideur = $validator->listUsersForGroup(); + $valideur = $validator->listUsersForGroup('',1); print '<td>'; $form->select_users($cp->fk_validator,"valideur",1,"",0,$valideur,''); diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index 6bb65e258c9cd22141ae60e72bcc240a91255b04..e824c964cb0d7f1de83fab5e3f7ab2591dcabc8b 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -482,7 +482,7 @@ if ($step == 3 && $datatoimport) if ($action == 'delete') { print $form->formconfirm($_SERVER["PHP_SELF"].'?urlfile='.urlencode(GETPOST('urlfile')).'&step=3'.$param, $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1); - + } print '<table width="100%" class="border">'; @@ -1307,7 +1307,10 @@ if ($step == 5 && $datatoimport) $result=$obj->import_open_file($pathfile,$langs); if ($result > 0) { - $sourcelinenb=0; $endoffile=0; + global $tablewithentity_cache; + $tablewithentity_cache=array(); + $sourcelinenb=0; $endoffile=0; + // Loop on each input file record while ($sourcelinenb < $nboflines && ! $endoffile) { @@ -1621,7 +1624,10 @@ if ($step == 6 && $datatoimport) $result=$obj->import_open_file($pathfile,$langs); if ($result > 0) { + global $tablewithentity_cache; + $tablewithentity_cache=array(); $sourcelinenb=0; $endoffile=0; + while ($sourcelinenb < $nboflines && ! $endoffile) { $sourcelinenb++; diff --git a/htdocs/install/check.php b/htdocs/install/check.php index 1217facab5f8bdfd46101dda46aac6ddc68ddd2f..7fd519e56d29051b8084a19b3ebf5f633e82ca2d 100644 --- a/htdocs/install/check.php +++ b/htdocs/install/check.php @@ -73,12 +73,12 @@ if (! empty($useragent)) if (versioncompare(versionphparray(),array(4,3,10)) < 0) // Minimum to use (error if lower) { print '<img src="../theme/eldy/img/error.png" alt="Error"> '.$langs->trans("ErrorPHPVersionTooLow",'4.3.10'); - $checksok=0; + $checksok=0; // 0=error, 1=warning } -else if (versioncompare(versionphparray(),array(5,2,0)) < 0) // Minimum supported (warning if lower) +else if (versioncompare(versionphparray(),array(5,3,0)) < 0) // Minimum supported (error if lower) { - print '<img src="../theme/eldy/img/warning.png" alt="Error"> '.$langs->trans("WarningPHPVersionTooLow",'5.2.0'); - $checksok=1; + print '<img src="../theme/eldy/img/warning.png" alt="Error"> '.$langs->trans("ErrorPHPVersionTooLow",'5.3.0'); + $checksok=0; // 0=error, 1=warning } else { diff --git a/htdocs/install/mysql/migration/3.1.0-3.2.0.sql b/htdocs/install/mysql/migration/3.1.0-3.2.0.sql index a40481155937a5e6e8fa21753bbd16926e2ce5d6..044b1652029fe39be7c3d59f6dd68763f94e6840 100755 --- a/htdocs/install/mysql/migration/3.1.0-3.2.0.sql +++ b/htdocs/install/mysql/migration/3.1.0-3.2.0.sql @@ -428,10 +428,6 @@ INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'XEU' INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'ARP', NULL, 0, 'Pesos argentins'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'MXP', NULL, 0, 'Pesos Mexicans'); -ALTER TABLE llx_propal ADD CONSTRAINT fk_propal_fk_currency FOREIGN KEY (fk_currency) REFERENCES llx_c_currencies (code_iso); -ALTER TABLE llx_commande ADD CONSTRAINT fk_commande_fk_currency FOREIGN KEY (fk_currency) REFERENCES llx_c_currencies (code_iso); -ALTER TABLE llx_facture ADD CONSTRAINT fk_facture_fk_currency FOREIGN KEY (fk_currency) REFERENCES llx_c_currencies (code_iso); - ALTER TABLE llx_expedition DROP COLUMN billed; ALTER TABLE llx_product_fournisseur_price DROP FOREIGN KEY fk_product_fournisseur_price_fk_product_fournisseur; diff --git a/htdocs/install/mysql/migration/3.5.0-3.6.0.sql b/htdocs/install/mysql/migration/3.5.0-3.6.0.sql index 31a3b593fb1e11692ac31c74e7ef5003d41886c2..d6cd4090ddf9f553c5ed0f5f8d41c8a3460518fd 100644 --- a/htdocs/install/mysql/migration/3.5.0-3.6.0.sql +++ b/htdocs/install/mysql/migration/3.5.0-3.6.0.sql @@ -17,6 +17,18 @@ -- -- VPGSQL8.2 DELETE FROM llx_usergroup_user WHERE fk_user NOT IN (SELECT rowid from llx_user); -- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup); + +-- delete foreign key that should never exists +ALTER TABLE llx_propal DROP FOREIGN KEY fk_propal_fk_currency; +ALTER TABLE llx_commande DROP FOREIGN KEY fk_commande_fk_currency; +ALTER TABLE llx_facture DROP FOREIGN KEY fk_facture_fk_currency; +ALTER TABLE llx_facture DROP FOREIGN KEY fk_societe_fk_currency; + +ALTER TABLE llx_propal MODIFY COLUMN fk_currency varchar(3) NULL; +ALTER TABLE llx_commande MODIFY COLUMN fk_currency varchar(3) NULL; +ALTER TABLE llx_facture MODIFY COLUMN fk_currency varchar(3) NULL; +ALTER TABLE llx_societe MODIFY COLUMN fk_currency varchar(3) NULL; + ALTER TABLE llx_bookmark ADD COLUMN entity integer DEFAULT 1 NOT NULL; ALTER TABLE llx_bookmark MODIFY COLUMN url varchar(255) NOT NULL; diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index dec091e6e66c60caf0a3afd2b4ce819e94f70802..b8b0e49fad37a914825d4eb0df7293a3a4dfd633 100644 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -6,6 +6,11 @@ -- Requests to clean corrupted database +-- delete foreign key that should never exists +ALTER TABLE llx_propal DROP FOREIGN KEY fk_propal_fk_currency; +ALTER TABLE llx_commande DROP FOREIGN KEY fk_commande_fk_currency; +ALTER TABLE llx_facture DROP FOREIGN KEY fk_facture_fk_currency; + delete from llx_facturedet where fk_facture in (select rowid from llx_facture where facnumber in ('(PROV)','ErrorBadMask')); delete from llx_facture where facnumber in ('(PROV)','ErrorBadMask'); delete from llx_commandedet where fk_commande in (select rowid from llx_commande where ref in ('(PROV)','ErrorBadMask')); diff --git a/htdocs/install/mysql/tables/llx_commande.sql b/htdocs/install/mysql/tables/llx_commande.sql index 325b1f3fe138ceabdb1084a30280b68b9164b8ad..beda59e79b32f6b8db3049c779afeb037077c2e6 100644 --- a/htdocs/install/mysql/tables/llx_commande.sql +++ b/htdocs/install/mysql/tables/llx_commande.sql @@ -56,7 +56,7 @@ create table llx_commande facture tinyint default 0, fk_account integer, -- bank account - fk_currency varchar(2), -- currency code + fk_currency varchar(3), -- currency code fk_cond_reglement integer, -- condition de reglement fk_mode_reglement integer, -- mode de reglement diff --git a/htdocs/install/mysql/tables/llx_facture.sql b/htdocs/install/mysql/tables/llx_facture.sql index 62ea8936e905a3998d0451749eec7e5a86e6d190..9f55527ff8e5935953675d8c09ba030fd5878b6c 100644 --- a/htdocs/install/mysql/tables/llx_facture.sql +++ b/htdocs/install/mysql/tables/llx_facture.sql @@ -63,7 +63,7 @@ create table llx_facture fk_projet integer DEFAULT NULL, -- projet auquel est associee la facture fk_account integer, -- bank account - fk_currency varchar(2), -- currency code + fk_currency varchar(3), -- currency code fk_cond_reglement integer DEFAULT 1 NOT NULL, -- condition de reglement (30 jours, fin de mois ...) fk_mode_reglement integer, -- mode de reglement (Virement, Prelevement) date_lim_reglement date, -- date limite de reglement diff --git a/htdocs/install/mysql/tables/llx_propal.sql b/htdocs/install/mysql/tables/llx_propal.sql index 3155eed637064589594a6df8b9ccfd379cfba02c..2a97c6c77a3dc2989fee1ca12f5399ee9a4ca575 100644 --- a/htdocs/install/mysql/tables/llx_propal.sql +++ b/htdocs/install/mysql/tables/llx_propal.sql @@ -53,7 +53,7 @@ create table llx_propal total double(24,8) DEFAULT 0, -- montant total ttc apres remise globale fk_account integer, -- bank account - fk_currency varchar(2), -- currency code + fk_currency varchar(3), -- currency code fk_cond_reglement integer, -- condition de reglement (30 jours, fin de mois ...) fk_mode_reglement integer, -- mode de reglement (Virement, Prelevement) diff --git a/htdocs/install/mysql/tables/llx_societe.sql b/htdocs/install/mysql/tables/llx_societe.sql index f4e1614cd7ddbc375b605e96caa856fbfe956c95..57e2f6eb26def31bb3035b9fba9c549e12d6090f 100644 --- a/htdocs/install/mysql/tables/llx_societe.sql +++ b/htdocs/install/mysql/tables/llx_societe.sql @@ -53,7 +53,7 @@ create table llx_societe fk_effectif integer DEFAULT 0, -- fk_typent integer DEFAULT 0, -- fk_forme_juridique integer DEFAULT 0, -- juridical status - fk_currency integer DEFAULT 0, -- currency + fk_currency varchar(3), -- default currency siren varchar(128), -- IDProf1: siren or RCS for france siret varchar(128), -- IDProf2: siret for france ape varchar(128), -- IDProf3: code ape for france diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index b182952940e59d374116e832bebb59e8c71066a7..805a3a6e2ea8667fab25c65fdcac6bceaefa29a7 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -8,7 +8,6 @@ BillsCustomersUnpaid=Unpaid customer's invoices BillsCustomersUnpaidForCompany=Unpaid customer's invoices for %s BillsSuppliersUnpaid=Unpaid supplier's invoices BillsSuppliersUnpaidForCompany=Unpaid supplier's invoices for %s -BillsUnpaid=Unpaid BillsLate=Late payments BillsStatistics=Customer's invoices statistics BillsStatisticsSuppliers=Supplier's invoices statistics @@ -24,7 +23,7 @@ InvoiceProFormaAsk=Proforma invoice InvoiceProFormaDesc=<b>Proforma invoice</b> is an image of a true invoice but has no accountancy value. InvoiceReplacement=Replacement invoice InvoiceReplacementAsk=Replacement invoice for invoice -InvoiceReplacementDesc=<b>Replacement invoice</b> is used to cancel and replace completely an invoice with no payment already received.<br><br>Note: Only invoice with no payment on it can be replaced. If not closed, it will be automatically closed to 'abandoned'. +InvoiceReplacementDesc=<b>Replacement invoice</b> is used to cancel and replace completely an invoice with no payment already received.<br><br>Note: Only invoices with no payment on it can be replaced. If the invoice you replace is not yet closed, it will be automatically closed to 'abandoned'. InvoiceAvoir=Credit note InvoiceAvoirAsk=Credit note to correct invoice InvoiceAvoirDesc=The <b>credit note</b> is a negative invoice used to solve fact that an invoice has an amount that differs than amount really paid (because customer paid too much by error, or will not paid completely since he returned some products for example). @@ -217,7 +216,6 @@ DateEcheance=Due date limit DateInvoice=Invoice date NoInvoice=No invoice ClassifyBill=Classify invoice -NoSupplierBillsUnpaid=No suppliers invoices unpaid SupplierBillsToPay=Suppliers invoices to pay CustomerBillsUnpaid=Unpaid customers invoices DispenseMontantLettres=The bill drafted by mechanographical are exempt from the order in letters @@ -399,6 +397,11 @@ ToMakePaymentBack=Pay back ListOfYourUnpaidInvoices=List of unpaid invoices NoteListOfYourUnpaidInvoices=Note: This list contains only invoices for third parties you are linked to as a sale representative. RevenueStamp=Revenue stamp +YouMustCreateInvoiceFromThird=This option is only available when creating invoice from tab "customer" of thirdparty +PDFCrabeDescription=Invoice PDF template Crabe. A complete invoice template (recommended Template) +TerreNumRefModelDesc1=Return number with format %syymm-nnnn for standard invoices and %syymm-nnnn for credit notes where yy is year, mm is month and nnnn is a sequence with no break and no return to 0 +MarsNumRefModelDesc1=Return number with format %syymm-nnnn for standard invoices, %syymm-nnnn for replacement invoices, %syymm-nnnn for credit notes and %syymm-nnnn for credit notes where yy is year, mm is month and nnnn is a sequence with no break and no return to 0 +TerreNumRefModelError=A bill starting with $syymm already exists and is not compatible with this model of sequence. Remove it or rename it to activate this module. ##### Types de contacts ##### TypeContact_facture_internal_SALESREPFOLL=Representative following-up customer invoice TypeContact_facture_external_BILLING=Customer invoice contact @@ -408,11 +411,3 @@ TypeContact_invoice_supplier_internal_SALESREPFOLL=Representative following-up s TypeContact_invoice_supplier_external_BILLING=Supplier invoice contact TypeContact_invoice_supplier_external_SHIPPING=Supplier shipping contact TypeContact_invoice_supplier_external_SERVICE=Supplier service contact -# crabe PDF Model -PDFCrabeDescription=Invoice PDF template Crabe. A complete invoice template (recommended Template) -# oursin PDF Model -PDFOursinDescription=Invoice PDF template Oursin. A complete invoice template (alternative Template) -# NumRef Modules -TerreNumRefModelDesc1=Return number with format %syymm-nnnn for standard invoices and %syymm-nnnn for credit notes where yy is year, mm is month and nnnn is a sequence with no break and no return to 0 -MarsNumRefModelDesc1=Return number with format %syymm-nnnn for standard invoices, %syymm-nnnn for replacement invoices, %syymm-nnnn for credit notes and %syymm-nnnn for credit notes where yy is year, mm is month and nnnn is a sequence with no break and no return to 0 -TerreNumRefModelError=A bill starting with $syymm already exists and is not compatible with this model of sequence. Remove it or rename it to activate this module. diff --git a/htdocs/langs/en_US/languages.lang b/htdocs/langs/en_US/languages.lang index 754a7a7154483c739bd7f97d1da60ea7bd160df2..fd67a42c2374780458206b778787c48d67fa6ce8 100644 --- a/htdocs/langs/en_US/languages.lang +++ b/htdocs/langs/en_US/languages.lang @@ -20,6 +20,7 @@ Language_en_US=English (United States) Language_en_ZA=English (South Africa) Language_es_ES=Spanish Language_es_AR=Spanish (Argentina) +Language_es_CL=Spanish (Chile) Language_es_HN=Spanish (Honduras) Language_es_MX=Spanish (Mexico) Language_es_PY=Spanish (Paraguay) diff --git a/htdocs/langs/en_US/margins.lang b/htdocs/langs/en_US/margins.lang index 680a303a2452b85078e539c00199b1b1a8bcbf2f..e8d5fed1af9a379298973a5c33a511cf77ea3706 100644 --- a/htdocs/langs/en_US/margins.lang +++ b/htdocs/langs/en_US/margins.lang @@ -18,12 +18,11 @@ MarginDetails=Margin details ProductMargins=Product margins CustomerMargins=Customer margins -AgentMargins=Agent margins +SalesRepresentativeMargins=Sales representative margins ProductService=Product or Service AllProducts=All products and services ChooseProduct/Service=Choose product or service -CommercialAgent=Commercial agent StartDate=Start date EndDate=End date diff --git a/htdocs/langs/es_CL/admin.lang b/htdocs/langs/es_CL/admin.lang new file mode 100644 index 0000000000000000000000000000000000000000..20f6fdfea33bbac57e0a9de338785067012deb3c --- /dev/null +++ b/htdocs/langs/es_CL/admin.lang @@ -0,0 +1,23 @@ +Module20Name=Cotizaciones +Module20Desc=Gestión de cotizaciones/propuestas comerciales +Permission21=Consultar cotizaciones +Permission22=Crear/modificar cotizaciones +Permission24=Validar cotizaciones +Permission25=Enviar las cotizaciones +Permission26=Cerrar cotizaciones +Permission27=Eliminar cotizaciones +Permission28=Exportar las cotizaciones +DictionnarySource=Orígenes de cotizaciones/pedidos +VATIsUsedDesc=El tipo de IVA propuesto por defecto en las creaciones de cotizaciones, facturas, pedidos, etc. Responde a la siguiente regla:<br>Si el vendedor no está sujeto a IVA, IVA por defecto=0. Final de regla.<br>Si el país del vendedor= país del comprador entonces IVA por defecto=IVA del producto vendido. Final de regla.<br>Si vendedor y comprador residen en la Comunidad Europea y el bien vendido= nuevo medio de transportes (auto, barco, avión), IVA por defecto=0 (el IVA debe ser pagado por comprador a la hacienda pública de su país y no al vendedor). Final de regla<br>Si vendedor y comprador residen en la Comunidad Europea y comprador= particular o empresa sin NIF intracomunitario entonces IVA por defecto=IVA del producto vendido. Final de regla.<br>Si vendedor y comprador residen en la Comunidad Europea y comprador= empresa con NIF intracomunitario entonces IVA por defecto=0. Final de regla.<br>Si no, IVA propuesto por defecto=0. Final de regla.<br> +VATIsNotUsedDesc=El tipo de IVA propuesto por defecto es 0. Este es el caso de asociaciones, particulares o algunas pequeñas sociedades. +VATIsUsedExampleFR=En Francia, se trata de las sociedades u organismos que eligen un régimen fiscal general (General simplificado o General normal), régimen en el cual se declara el IVA. +Delays_MAIN_DELAY_PROPALS_TO_CLOSE=Tolerancia de retraso antes de la alerta (en días) sobre cotizaciones a cerrar +Delays_MAIN_DELAY_PROPALS_TO_BILL=Tolerancia de retraso antes de la alerta (en días) sobre cotizaciones no facturadas +WebCalAddEventOnStatusPropal=Añadir evento en el calendario en el cambio de estado de las cotizaciones +PropalSetup=Configuración del módulo Cotizaciones +ProposalsNumberingModules=Módulos de numeración de cotizaciones +ProposalsPDFModules=Modelos de documentos de cotizaciones +HideTreadedPropal=Ocultar las cotizaciones procesados del listado +FreeLegalTextOnProposal=Texto libre en cotizaciones +WatermarkOnDraftProposal=Marca de agua en cotizaciones borrador (en caso de estar vacío) +FCKeditorForProductDetails=Creación/edición WYSIWIG de las líneas de detalle de los productos (en pedidos, cotizaciones, facturas, etc.) \ No newline at end of file diff --git a/htdocs/langs/es_CL/agenda.lang b/htdocs/langs/es_CL/agenda.lang new file mode 100644 index 0000000000000000000000000000000000000000..deefdc2275c6e54b48703d8b272389ed9ed424a9 --- /dev/null +++ b/htdocs/langs/es_CL/agenda.lang @@ -0,0 +1,2 @@ +PropalValidatedInDolibarr=Cotización %s validada +ProposalSentByEMail=Cotización %s enviada por e-mail \ No newline at end of file diff --git a/htdocs/langs/es_CL/bills.lang b/htdocs/langs/es_CL/bills.lang new file mode 100644 index 0000000000000000000000000000000000000000..63a78444437fe6307a13c57bd1e5be88a0b9ce66 --- /dev/null +++ b/htdocs/langs/es_CL/bills.lang @@ -0,0 +1 @@ +RelatedCommercialProposals=Cotizaciones asociadas \ No newline at end of file diff --git a/htdocs/langs/es_CL/boxes.lang b/htdocs/langs/es_CL/boxes.lang new file mode 100644 index 0000000000000000000000000000000000000000..970c91a8fe5204f50e5b1c5d585c92bd524c8712 --- /dev/null +++ b/htdocs/langs/es_CL/boxes.lang @@ -0,0 +1,5 @@ +BoxLastProposals=Últimas cotizaciones +BoxTitleLastPropals=Las %s últimas cotizaciones registradas +NoRecordedProposals=Sin cotizaciones registradas +BoxProposalsPerMonth=Cotizaciones por mes +ForProposals=Cotizaciones \ No newline at end of file diff --git a/htdocs/langs/es_CL/commercial.lang b/htdocs/langs/es_CL/commercial.lang new file mode 100644 index 0000000000000000000000000000000000000000..d468d7d5f19ce01edbf572b011f0f818785bfba1 --- /dev/null +++ b/htdocs/langs/es_CL/commercial.lang @@ -0,0 +1,4 @@ +SendPropalRef=Envío de la cotización %s +ActionAC_PROP=Envío cotización por correo +DraftPropals=Cotizaciones borrador +SearchPropal=Buscar una cotización \ No newline at end of file diff --git a/htdocs/langs/es_CL/companies.lang b/htdocs/langs/es_CL/companies.lang new file mode 100644 index 0000000000000000000000000000000000000000..daef89c75cf547605a1e1a0b21f1db2d407c5798 --- /dev/null +++ b/htdocs/langs/es_CL/companies.lang @@ -0,0 +1,2 @@ +ContactForProposals=Contacto de cotizaciones +NoContactForAnyProposal=Este contacto no es contacto de ninguna cotización \ No newline at end of file diff --git a/htdocs/langs/es_CL/compta.lang b/htdocs/langs/es_CL/compta.lang new file mode 100644 index 0000000000000000000000000000000000000000..bf18ae78c5fcbe66646002d820f698024d01c124 --- /dev/null +++ b/htdocs/langs/es_CL/compta.lang @@ -0,0 +1 @@ +ProposalStats=Estadísticas de cotizaciones \ No newline at end of file diff --git a/htdocs/langs/es_CL/ecm.lang b/htdocs/langs/es_CL/ecm.lang new file mode 100644 index 0000000000000000000000000000000000000000..3e20b3e66282f82e4efdcc7bfe540f6f745f9ace --- /dev/null +++ b/htdocs/langs/es_CL/ecm.lang @@ -0,0 +1,2 @@ +DocsProposals=Documentos cotizaciones +ECMDocsByProposals=Documentos asociados a cotizaciones \ No newline at end of file diff --git a/htdocs/langs/es_CL/install.lang b/htdocs/langs/es_CL/install.lang new file mode 100644 index 0000000000000000000000000000000000000000..40d447b8653f84f395f4e8fe63cbbf1fcdb66a39 --- /dev/null +++ b/htdocs/langs/es_CL/install.lang @@ -0,0 +1 @@ +MigrationProposal=Migración de datos de cotizaciones \ No newline at end of file diff --git a/htdocs/langs/es_CL/main.lang b/htdocs/langs/es_CL/main.lang new file mode 100644 index 0000000000000000000000000000000000000000..90e98cca31d645f9a5b1585a228d2033be73fb65 --- /dev/null +++ b/htdocs/langs/es_CL/main.lang @@ -0,0 +1 @@ +CommercialProposalsShort=Cotizaciones \ No newline at end of file diff --git a/htdocs/langs/es_CL/members.lang b/htdocs/langs/es_CL/members.lang new file mode 100644 index 0000000000000000000000000000000000000000..59fd53dd9937e6ea34ae57ea55d2d32f29f70db6 --- /dev/null +++ b/htdocs/langs/es_CL/members.lang @@ -0,0 +1 @@ +TurnoverOrBudget=Volumen de ventas (empresa) o Cotización (asociación o colectivo) \ No newline at end of file diff --git a/htdocs/langs/es_CL/orders.lang b/htdocs/langs/es_CL/orders.lang new file mode 100644 index 0000000000000000000000000000000000000000..8810a19bcf8dee46dd83b8430759d0c3f165d709 --- /dev/null +++ b/htdocs/langs/es_CL/orders.lang @@ -0,0 +1 @@ +OrderSource0=Cotización \ No newline at end of file diff --git a/htdocs/langs/es_CL/other.lang b/htdocs/langs/es_CL/other.lang new file mode 100644 index 0000000000000000000000000000000000000000..f2b10a1a2d2e64db2c27dd102ba014534684cde1 --- /dev/null +++ b/htdocs/langs/es_CL/other.lang @@ -0,0 +1,9 @@ +Notify_PROPAL_VALIDATE=Validación cotización cliente +Notify_PROPAL_SENTBYMAIL=Envío cotización por e-mail +PredefinedMailContentSendProposal=Buenos días, __CONTACTCIVNAME__ \n\n Nos ponemos en contacto con usted para facilitarle la cotización __PROPREF__\n\n Ante cualquier duda, consúltenos y será atendido a la mayor brevedad posible.\n\n __PERSONALIZED__Cordialmente\n\n__SIGNATURE__ +NumberOfProposals=Número de cotizaciones en los últimos 12 meses +NumberOfUnitsProposals=Número de unidades en las cotizaciones en los últimos 12 meses +EMailTextProposalValidated=La cotización %s que le concierne ha sido validado. +PropalClosedSignedInDolibarr=Cotización %s firmada en Dolibarr +PropalClosedRefusedInDolibarr=Cotización %s rechazada en Dolibarr +PropalValidatedInDolibarr=Cotización %s validada en Dolibarr \ No newline at end of file diff --git a/htdocs/langs/es_CL/products.lang b/htdocs/langs/es_CL/products.lang new file mode 100644 index 0000000000000000000000000000000000000000..cf82ea19c2b6f55537e661184f4431f3eab761cb --- /dev/null +++ b/htdocs/langs/es_CL/products.lang @@ -0,0 +1,3 @@ +AddToMyProposals=Añadir a mis cotizaciones +AddToOtherProposals=Añadir a otras cotizaciones +NoteNotVisibleOnBill=Nota (no visible en las facturas, cotizaciones, etc.) \ No newline at end of file diff --git a/htdocs/langs/es_CL/projects.lang b/htdocs/langs/es_CL/projects.lang new file mode 100644 index 0000000000000000000000000000000000000000..a5ee33a39a41ad0c3ef8391f3b74e1053dcf3e2e --- /dev/null +++ b/htdocs/langs/es_CL/projects.lang @@ -0,0 +1 @@ +ListProposalsAssociatedProject=Listado de cotizaciones asociadas al proyecto \ No newline at end of file diff --git a/htdocs/langs/es_CL/propal.lang b/htdocs/langs/es_CL/propal.lang new file mode 100644 index 0000000000000000000000000000000000000000..8242c7d90a463e0d68c10690ce519a9bbab4c6c5 --- /dev/null +++ b/htdocs/langs/es_CL/propal.lang @@ -0,0 +1,62 @@ +Proposals=Cotizaciones +Proposal=Cotización +ProposalShort=Cotización +ProposalsDraft=Cotizaciones borrador +ProposalDraft=Cotización borrador +ProposalsOpened=Cotizaciones abiertas +Prop=Cotizaciones +CommercialProposal=Cotización +CommercialProposals=Cotizaciones +ProposalCard=Ficha cotización +NewProp=Nueva cotización +NewProposal=Nueva cotización +NewPropal=Nueva cotización +DeletePop=Eliminar cotización +ValidateProp=Validar cotización +AddProp=Crear cotización +ConfirmDeleteProp=¿Está seguro de querer eliminar esta cotización? +ConfirmValidateProp=¿Está seguro de querer validar esta cotización bajo la referencia <b>%s</b> ? +LastClosedProposals=Las %s últimas cotizaciones cerradas +LastModifiedProposals=Las %s últimas cotizaciones modificadas +AllPropals=Todas las cotizacioness +LastProposals=Últimas cotizaciones +SearchAProposal=Buscar una cotización +ProposalsStatistics=Estadísticas de cotizaciones +NumberOfUnitsProposals=Número de unidades en las cotizaciones en los últimos 12 meses +NbOfProposals=Número cotizaciones +ShowPropal=Ver cotización +PropalStatusValidated=Validado (cotización abierta) +PropalStatusOpened=Validado (cotización abierta) +PropalsToClose=Cotizaciones a cerrar +PropalsToBill=Cotizaciones firmadas a facturar +ListOfProposals=Listado de cotizaciones +ActionsOnPropal=Eventos sobre la cotización +NoOpenedPropals=Sin cotizaciones abiertos +NoOtherOpenedPropals=Ninguna otra cotización abierta +RefProposal=Ref. cotización +SendPropalByMail=Enviar cotización por e-mail +AssociatedDocuments=Documentos asociados a la cotizacion +DatePropal=Fecha cotización +ErrorPropalNotFound=Presupuesto %s inexistente +Estimate=Cotización: +EstimateShort=Cotización +OtherPropals=Otras cotizaciones +AddToDraftProposals=Añadir a cotización borrador +NoDraftProposals=Sin cotizaciones borrador +CopyPropalFrom=Crear cotización por copia de una existente +CreateEmptyPropal=Crear cotización vacía +UseCustomerContactAsPropalRecipientIfExist=Utilizar dirección contacto de seguimiento de cliente definido en vez de la dirección del tercero como destinatario de las cotizaciones +ClonePropal=Clonar cotización +ConfirmClonePropal=¿Está seguro de querer clonar la cotización <b>%s</b>? +ConfirmReOpenProp=¿Está seguro de querer reabrir la cotización <b>%s</b> ? +ProposalsAndProposalsLines=Cotizaciones a clientes y líneas de cotizaciones +ProposalLine=Línea de cotización +##### Types de contacts ##### +TypeContact_propal_internal_SALESREPFOLL=Comercial seguimiento cotización +TypeContact_propal_external_BILLING=Contacto cliente de facturación cotización +TypeContact_propal_external_CUSTOMER=Contacto cliente seguimiento cotización +# Document models +DocModelAzurDescription=Modelo de cotización completa (logo...) +DocModelJauneDescription=Modelo de cotización Jaune +DefaultModelPropalToBill=Modelo por defecto al cerrar una cotización (a facturar) +DefaultModelPropalClosed=Modelo por defecto al cerrar una cotización (no facturado) \ No newline at end of file diff --git a/htdocs/langs/es_CL/workflow.lang b/htdocs/langs/es_CL/workflow.lang new file mode 100644 index 0000000000000000000000000000000000000000..17b2915fc39c7c68d2b33f835d5b3a2eb8635b22 --- /dev/null +++ b/htdocs/langs/es_CL/workflow.lang @@ -0,0 +1,3 @@ +descWORKFLOW_PROPAL_AUTOCREATE_ORDER=Crear un pedido de cliente automáticamente a la firma de una cotización +descWORKFLOW_PROPAL_AUTOCREATE_INVOICE=Crear una factura a cliente automáticamente a la firma de una cotización +descWORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL=Clasificar como facturada la cotización cuando el pedido de cliente relacionado se clasifique como pagado \ No newline at end of file diff --git a/htdocs/langs/es_ES/admin.lang b/htdocs/langs/es_ES/admin.lang index 701f03b26d53457824e46fb767fca2d2c8f5f072..c7d86713db616c10b3dcb6b05f94273d9d0a74ec 100644 --- a/htdocs/langs/es_ES/admin.lang +++ b/htdocs/langs/es_ES/admin.lang @@ -109,8 +109,8 @@ ParameterInDolibarr=Variable %s LanguageParameter=Variable idioma %s LanguageBrowserParameter=Variable %s LocalisationDolibarrParameters=Parámetros de localización -# ClientTZ=Client Time Zone (user) -# ClientHour=Client time (user) +ClientTZ=Zona horaria cliente (usuario) +ClientHour=Hora cliente (usuario) OSTZ=Zona horaria Servidor SO PHPTZ=Zona horaria Servidor PHP PHPServerOffsetWithGreenwich=Offset servidor con Greenwich (segundos) @@ -512,8 +512,8 @@ Module50200Name= Paypal Module50200Desc= Módulo para proporcionar un pago en línea con tarjeta de crédito mediante Paypal Module54000Name=PrintIPP Module54000Desc=Imprimir vía impresora Cups IPP. -# Module55000Name=Open Poll -# Module55000Desc=Module to make online polls (like Doodle, Studs, Rdvz, ...) +Module55000Name=OpenSurvey +Module55000Desc=Módulo para realizar encuestas online (Como Doodle, Studs, Rdvz, etc.) Module59000Name=Márgenes Module59000Desc=Módulo para gestionar los márgenes de beneficio Module60000Name=Comisiones @@ -732,8 +732,8 @@ Permission50101=Usar TPV Permission50201=Consultar las transacciones Permission50202=Importar las transacciones Permission54001=Imprimir -# Permission55001=Read polls -# Permission55002=Create/modify polls +Permission55001=Leer encuestas +Permission55002=Crear/modificar encuestas Permission59001=Leer márgenes comerciales Permission59002=Definir márgenes comerciales DictionaryCompanyType=Tipos de terceros diff --git a/htdocs/langs/es_ES/bills.lang b/htdocs/langs/es_ES/bills.lang index 009812e227af7f1e3e905f7128878ac88f91dc26..e007e8cff56013ac87a80075113185bac0f1cb06 100644 --- a/htdocs/langs/es_ES/bills.lang +++ b/htdocs/langs/es_ES/bills.lang @@ -28,9 +28,9 @@ InvoiceReplacementDesc=La <b>factura rectificativa</b> sirve para cancelar y par InvoiceAvoir=Abono InvoiceAvoirAsk=Abono para corregir la factura InvoiceAvoirDesc=El <b>abono</b> es una factura negativa destinada a compensar un importe de factura que difiere del importe realmente pagado (por haber pagado de más o por devolución de productos, por ejemplo). -# invoiceAvoirWithLines=Create Credit Note with lines from the origin invoice -# invoiceAvoirWithPaymentRestAmount=Create Credit Note with the amount of origin invoice payment's lake -# invoiceAvoirLineWithPaymentRestAmount=Credit Note amount of invoice payment's lake +invoiceAvoirWithLines=Crear abono con las líneas de la factura original +invoiceAvoirWithPaymentRestAmount=Crear abono con el importe pendiente de la factura origen +invoiceAvoirLineWithPaymentRestAmount=Abono del importe pendiente de la factura ReplaceInvoice=Rectificar la factura %s ReplacementInvoice=Rectificación factura ReplacedByInvoice=Rectificada por la factura %s diff --git a/htdocs/langs/es_ES/categories.lang b/htdocs/langs/es_ES/categories.lang index dc6ac951126d32d4cc27d25032a069c68f29d47b..42c24bbae9421f5672e2a79f0f9032023b854691 100644 --- a/htdocs/langs/es_ES/categories.lang +++ b/htdocs/langs/es_ES/categories.lang @@ -66,7 +66,7 @@ ReturnInCompany=Volver a la ficha cliente/cliente potencial ContentsVisibleByAll=El contenido será visible por todos ContentsVisibleByAllShort=Contenido visible por todos ContentsNotVisibleByAllShort=Contenido no visible por todos -# CategoriesTree=Categories tree +CategoriesTree=Árbol de categorías DeleteCategory=Eliminar categoría ConfirmDeleteCategory=¿Está seguro de querer eliminar esta categoría? RemoveFromCategory=Eliminar vínculo con categoría @@ -105,9 +105,9 @@ CatProdLinks=Productos CatCusLinks=Clientes/Clientes potenciales CatSupLinks=Proveedores DeleteFromCat=Eliminar de la categoría -# DeletePicture=Picture delete -# ConfirmDeletePicture=Confirm picture deletion? -# ExtraFieldsCategories=Complementary attributes -# CategoriesSetup=Categories setup -# CategorieRecursiv=Link with parent category automatically -# CategorieRecursivHelp=If activated, product will also linked to parent category when adding into a subcategory +DeletePicture=Eliminar imagen +ConfirmDeletePicture=¿Confirma la eliminación de la imagen? +ExtraFieldsCategories=Atributos complementarios +CategoriesSetup=Configuración de categorías +CategorieRecursiv=Enlazar con la categoría padre automáticamente +CategorieRecursivHelp=Si está activado, el producto se enlazará a la categoría padre si lo añadimos a una subcategoría diff --git a/htdocs/langs/es_ES/companies.lang b/htdocs/langs/es_ES/companies.lang index 819d317f6cee90da536b88084dfe08212ae7c7dd..68c151ef54965c082977ae3b12705451849020f6 100644 --- a/htdocs/langs/es_ES/companies.lang +++ b/htdocs/langs/es_ES/companies.lang @@ -405,4 +405,4 @@ OutstandingBill=Importe máximo para facturas pendientes OutstandingBillReached=Importe máximo alcanzado MonkeyNumRefModelDesc=Devuelve un número bajo el formato %syymm-nnnn para los códigos de clientes y %syymm-nnnn para los códigos de los proveedores, donde yy es el año, mm el mes y nnnn un contador secuencial sin ruptura y sin volver a 0. LeopardNumRefModelDesc=Código de cliente/proveedor libre sin verificación. Puede ser modificado en cualquier momento. -# ManagingDirectors=Manager(s) name (CEO, director, president...) +ManagingDirectors=Administrador(es) (CEO, director, presidente, etc.) diff --git a/htdocs/langs/es_ES/compta.lang b/htdocs/langs/es_ES/compta.lang index e0d24b151f2e6860bf707b949d6ea19ba4e4bd2b..d4ef8b56cf95530c68f9e48a74d75397cfc23991 100644 --- a/htdocs/langs/es_ES/compta.lang +++ b/htdocs/langs/es_ES/compta.lang @@ -41,20 +41,20 @@ VATToCollect=IVA compras VATSummary=Balance de IVA LT2SummaryES=Balance de IRPF VATPaid=IVA Pagado -# SalaryPaid=Salary paid +SalaryPaid=Pago salario LT2PaidES=IRPF Pagado LT2CustomerES=IRPF ventas LT2SupplierES=IRPF compras VATCollected=IVA recuperado ToPay=A pagar ToGet=A devolver -# SpecialExpensesArea=Area for all special paiements +SpecialExpensesArea=Área de pagos especiales TaxAndDividendsArea=Área impuestos, cargas sociales y dividendos SocialContribution=Carga social SocialContributions=Cargas sociales -# MenuSpecialExpenses=Special expenses +MenuSpecialExpenses=Pagos especiales MenuTaxAndDividends=Impuestos y cargas -# MenuSalaries=Salaries +MenuSalaries=Salarios MenuSocialContributions=Cargas sociales MenuNewSocialContribution=Nueva carga NewSocialContribution=Nueva carga social @@ -67,14 +67,14 @@ PaymentCustomerInvoice=Cobro factura a cliente PaymentSupplierInvoice=Pago factura de proveedor PaymentSocialContribution=Pago carga social PaymentVat=Pago IVA -# PaymentSalary=Salary payment +PaymentSalary=Pago salario ListPayment=Listado de pagos ListOfPayments=Listado de pagos ListOfCustomerPayments=Listado de pagos de clientes ListOfSupplierPayments=Listado de pagos a proveedores DatePayment=Fecha de pago -# DateStartPeriod=Date start period -# DateEndPeriod=Date end period +DateStartPeriod=Fecha inicio periodo +DateEndPeriod=Fecha final periodo NewVATPayment=Nuevo pago de IVA newLT2PaymentES=Nuevo pago de IRPF LT2PaymentES=Pago IRPF diff --git a/htdocs/langs/es_ES/deliveries.lang b/htdocs/langs/es_ES/deliveries.lang index a50da88213a9875e8282d0b362d7d5ea245f0c1c..4cfe6c9006562e875371212dc395c5aca0c108e0 100644 --- a/htdocs/langs/es_ES/deliveries.lang +++ b/htdocs/langs/es_ES/deliveries.lang @@ -23,4 +23,4 @@ GoodStatusDeclaration=He recibido la mercancía en buen estado, Deliverer=Destinatario : Sender=Origen Recipient=Destinatario -# ErrorStockIsNotEnough=There's not enough stock +ErrorStockIsNotEnough=No hay suficiente stock diff --git a/htdocs/langs/es_ES/exports.lang b/htdocs/langs/es_ES/exports.lang index 36725368d195e39ceb8f03aa9217780808218eb5..f0ac8c62a64a491fb6cf0221e9e02fec167db1ba 100644 --- a/htdocs/langs/es_ES/exports.lang +++ b/htdocs/langs/es_ES/exports.lang @@ -125,7 +125,7 @@ BankAccountNumber=Número cuenta BankAccountNumberKey=Dígito Control SpecialCode=Código especial ExportStringFilter=%% permite reemplazar uno o más carácteres en el texto -# ExportDateFilter='YYYY' 'YYYYMM' 'YYYYMMDD': filters by one year/month/day<br>'YYYY+YYYY' 'YYYYMM+YYYYMM' 'YYYYMMDD+YYYYMMDD': filters over a range of years/months/days<br>'>YYYY' '>YYYYMM' '>YYYYMMDD': filters on the following years/months/days<br>'<YYYY' '<YYYYMM' '<YYYYMMDD': filters on the previous years/months/days +ExportDateFilter='YYYY' 'YYYYMM' 'YYYYMMDD': filtro por un año/mes/día<br>'YYYY+YYYY' 'YYYYMM+YYYYMM' 'YYYYMMDD+YYYYMMDD': filtro en un rango de años/meses/días<br>'>YYYY' '>YYYYMM' '>YYYYMMDD': filtro en los siguentes años/meses/días<br>'<YYYY' '<YYYYMM' '<YYYYMMDD': filtro en los años/meses/días anteriores ExportNumericFilter='NNNNN' filtros para un valor<br>'NNNNN+NNNNN' filtros sobre un rango de valores<br>'>NNNNN' filtros para valores menores<br>'>NNNNN' filtros para valores mayores ## filters SelectFilterFields=Si quiere aplicar un filtro sobre algunos valores, introdúzcalos aquí. diff --git a/htdocs/langs/es_ES/mails.lang b/htdocs/langs/es_ES/mails.lang index 7af311a25c308f47164ce1f025d44c81bc66c7fd..e3207b409a0425148c1af598349805b16d686208 100644 --- a/htdocs/langs/es_ES/mails.lang +++ b/htdocs/langs/es_ES/mails.lang @@ -80,12 +80,12 @@ ActivateCheckRead=Activar confirmación de lectura y opción de desuscripción ActivateCheckReadKey=Clave usada para encriptar la URL de la confirmación de lectura y la función de desuscripción EMailSentToNRecipients=E-Mail enviado a %s destinatarios. EachInvoiceWillBeAttachedToEmail=Se creará y adjuntará a cada e-mail un documento usando el modelo de factura por defecto. -# MailTopicSendRemindUnpaidInvoices=Reminder of invoice %s (%s) -# SendRemind=Send reminder by EMails -# RemindSent=%s reminder(s) sent +MailTopicSendRemindUnpaidInvoices=Recordatorio de la factura %s (%s) +SendRemind=Enviar recordatorios por e-mail +RemindSent=%s recordatorio(s) enviados AllRecipientSelectedForRemind=Todos los terceros seleccionados y si hay e-mail definido (se enviará un e-mail por factura) -# NoRemindSent=No EMail reminder sent -# ResultOfMassSending=Result of mass EMail reminders sending +NoRemindSent=No se han enviado recordatorios por e-mail +ResultOfMassSending=Resultado del envío de recordatorios # Libelle des modules de liste de destinataires mailing MailingModuleDescContactCompanies=Contactos de terceros (clientes potenciales, clientes, proveedores...) diff --git a/htdocs/langs/es_ES/main.lang b/htdocs/langs/es_ES/main.lang index e34e6b8526840bffbbd6c48cc5cddc07ff17790a..dc957747d4fe6ab5088586928a87ef662979c8d0 100644 --- a/htdocs/langs/es_ES/main.lang +++ b/htdocs/langs/es_ES/main.lang @@ -34,7 +34,7 @@ ErrorFailedToOpenFile=Imposible abrir el archivo %s ErrorCanNotCreateDir=Imposible crear el directorio %s ErrorCanNotReadDir=Imposible leer el directorio %s ErrorConstantNotDefined=Parámetro %s no definido -# ErrorUnknown=Unknown error +ErrorUnknown=Error desconocido ErrorSQL=Error de SQL ErrorLogoFileNotFound=El archivo logo '%s' no se encuentra ErrorGoToGlobalSetup=Vaya a la Configuración ' Empresa/Institución ' para corregir @@ -60,8 +60,8 @@ ErrorNoSocialContributionForSellerCountry=Error, ningún tipo de carga social de ErrorFailedToSaveFile=Error, el registro del archivo falló. ErrorOnlyPngJpgSupported=Error, solamente se soportan los formatos de imagen jpg y png. ErrorImageFormatNotSupported=Su PHP no soporta las funciones de conversión de este formato de imagen. -# SetDate=Set date -# SelectDate=Select a date +SetDate=Fijar fecha +SelectDate=Seleccione una fecha SeeAlso=Ver también %s BackgroundColorByDefault=Color de fondo FileWasNotUploaded=Un archivo ha sido seleccionado para adjuntarlo, pero aún no se ha subido. Haga clic en "Adjuntar este archivo" para ello. @@ -669,7 +669,7 @@ OriginFileName=Nombre del archivo origen SetDemandReason=Definir origen ViewPrivateNote=Ver notas XMoreLines=%s línea(s) ocultas -# PublicUrl=Public URL +PublicUrl=URL pública # Week day Monday=Lunes diff --git a/htdocs/langs/es_ES/opensurvey.lang b/htdocs/langs/es_ES/opensurvey.lang index 71c9121525ebaa756ae23a0869406da16c70649a..799274ccf142b1de82c1f453acd956cc945c4877 100644 --- a/htdocs/langs/es_ES/opensurvey.lang +++ b/htdocs/langs/es_ES/opensurvey.lang @@ -1,18 +1,18 @@ # Dolibarr language file - Source file is en_US - opensurvey -# Survey=Poll -# Surveys=Polls -# OrganizeYourMeetingEasily=Organize your meetings and polls easily. First select type of poll... -# NewSurvey=New poll -# NoSurveysInDatabase=%s poll(s) into database. -# OpenSurveyArea=Polls area -# AddACommentForPoll=You can add a comment into poll... +Survey=Encuesta +Surveys=Encuestas +OrganizeYourMeetingEasily=Organice sus reuniones y encuestas fácilmente. Primero seleccione el tipo de encuesta... +NewSurvey=Nueva encuesta +NoSurveysInDatabase=$s encuesta(s) en la base de datos. +OpenSurveyArea=Área encuestas +AddACommentForPoll=Puede añadir un comentario en la encuesta... AddComment=Añadir comentario CreatePoll=Crear encuesta PollTitle=Título de la encuesta -# ToReceiveEMailForEachVote=Receive an email for each vote +ToReceiveEMailForEachVote=Recibir un e-mail por cada voto TypeDate=Tipo fecha TypeClassic=Tipo estándar -# OpenSurveyStep2=Select your dates amoung the free days (grey). The selected days are green. You can unselect a day previously selected by clicking again on it +OpenSurveyStep2=Seleccione sus fechas entre los días libres (en gris). Los días seleccionados son de color verde. Puede cancelar la selección de un día previamente seleccionado haciendo clic de nuevo sobre el mismo RemoveAllDays=Eliminar todos los días CopyHoursOfFirstDay=Copiar horas del primer día RemoveAllHours=Eliminar todas las horas @@ -24,10 +24,10 @@ OpenSurveyHowTo=Si está de acuerdo para votar en esta encuesta, tiene que dar s CommentsOfVoters=Comentarios de los votantes ConfirmRemovalOfPoll=¿Está seguro de que desea eliminar esta encuesta (y todos los votos)? RemovePoll=Eliminar encuesta -# UrlForSurvey=URL to communicate to get a direct access to poll +UrlForSurvey=URL para indicar el acceso directo a la encuesta PollOnChoice=Está creando una encuesta con multi-opciones. Primero introduzca todas las opciones posibles para esta encuesta: -# CreateSurveyDate=Create a date poll -# CreateSurveyStandard=Create a standard poll +CreateSurveyDate=Crear una encuesta de fecha +CreateSurveyStandard=Crear una encuesta estandard CheckBox=Checkbox simple YesNoList=Lista (vacío/sí/no) PourContreList=Lista (vacío/a favor/en contra) @@ -35,7 +35,7 @@ AddNewColumn=Añadir nueva columna TitleChoice=Título de la opción ExportSpreadsheet=Exportar resultados a una hoja de cálculo ExpireDate=Fecha límite -# NbOfSurveys=Number of polls +NbOfSurveys=Número de encuestas NbOfVoters=Núm. de votantes SurveyResults=Resultados PollAdminDesc=Está autorizado para cambiar todas las líneas de la encuesta con el botón "Editar". Puede, también, eliminar una columna o una línea con %s. También puede añadir una nueva columna con %s. diff --git a/htdocs/langs/es_ES/other.lang b/htdocs/langs/es_ES/other.lang index ea2353c74a7df5688f482f4e44ad0cc24fea4cc4..ead720384dbfd0120fd4dd97143a2a4255b2990e 100644 --- a/htdocs/langs/es_ES/other.lang +++ b/htdocs/langs/es_ES/other.lang @@ -22,7 +22,7 @@ Notify_WITHDRAW_CREDIT=Abono domiciliación Notify_WITHDRAW_EMIT=Emisión domiciliación Notify_ORDER_SENTBYMAIL=Envío pedido de cliente por e-mail Notify_COMPANY_CREATE=Creación tercero -# Notify_COMPANY_COMPANY_SENTBYMAIL=Mails sent from third party card +Notify_COMPANY_COMPANY_SENTBYMAIL=E-mail enviado desde la ficha del tercero Notify_PROPAL_SENTBYMAIL=Envío presupuesto por e-mail Notify_ORDER_SENTBYMAIL=Envío pedido de cliente por e-mail Notify_BILL_PAYED=Cobro factura a cliente @@ -41,7 +41,7 @@ Notify_MEMBER_VALIDATE=Validación miembro Notify_MEMBER_SUBSCRIPTION=Afiliación miembro Notify_MEMBER_RESILIATE=Baja miembro Notify_MEMBER_DELETE=Eliminación miembro -# Notify_PROJECT_CREATE=Project creation +Notify_PROJECT_CREATE=Creación de proyecto NbOfAttachedFiles=Número archivos/documentos adjuntos TotalSizeOfAttachedFiles=Tamaño total de los archivos/documentos adjuntos MaxSize=Tamaño máximo diff --git a/htdocs/langs/es_ES/products.lang b/htdocs/langs/es_ES/products.lang index 659a327c32203afab5dc7096cccfff1d25906566..b2782f4ad12dd6c0eb10c53cf981091e8c222bff 100644 --- a/htdocs/langs/es_ES/products.lang +++ b/htdocs/langs/es_ES/products.lang @@ -168,7 +168,7 @@ CloneProduct=Clonar producto/servicio ConfirmCloneProduct=¿Está seguro de querer clonar el producto o servicio <b>%s</b>? CloneContentProduct=Clonar solamente la información general del producto/servicio ClonePricesProduct=Clonar la información general y los precios -# CloneCompositionProduct=Clone virtual product/services +CloneCompositionProduct=Clonar producto/servicio virtual ProductIsUsed=Este producto es utilizado NewRefForClone=Ref. del nuevo producto/servicio CustomerPrices=Precios clientes diff --git a/htdocs/langs/es_ES/projects.lang b/htdocs/langs/es_ES/projects.lang index 6514c518246ee739516c830c52d4517559bc4ae3..32b46166f7c298021b91213d8d94aeb7f702c208 100644 --- a/htdocs/langs/es_ES/projects.lang +++ b/htdocs/langs/es_ES/projects.lang @@ -33,9 +33,9 @@ TimesSpent=Tiempos dedicados RefTask=Ref. tarea LabelTask=Etiqueta tarea TaskTimeSpent=Tiempo dedicado en tareas -# TaskTimeUser=User -# TaskTimeNote=Note -# TaskTimeDate=Date +TaskTimeUser=Usuario +TaskTimeNote=Nota +TaskTimeDate=Fecha NewTimeSpent=Nuevo tiempo dedicado MyTimeSpent=Mi tiempo dedicado MyTasks=Mis tareas diff --git a/htdocs/langs/es_ES/salaries.lang b/htdocs/langs/es_ES/salaries.lang index 159ac1dd9cb400a7049335afb0182a9e2c04aba9..d70ff842f5179b013f04e5fb839382829e22a0d5 100644 --- a/htdocs/langs/es_ES/salaries.lang +++ b/htdocs/langs/es_ES/salaries.lang @@ -1,6 +1,6 @@ # Dolibarr language file - Source file is en_US - users -# Employee=Employee -# NewSalaryPayment=New salary payment -# SalaryPayment=Salary payment -# SalariesPayments=Salaries payments -# ShowSalaryPayment=Show salary payment +Employee=Empleado +NewSalaryPayment=Nuevo pago +SalaryPayment=Pago de salario +SalariesPayments=Pagos de salarios +ShowSalaryPayment=Ver pago diff --git a/htdocs/margin/agentMargins.php b/htdocs/margin/agentMargins.php index 5bfa61cc7b6ad6194b53d3d1fabc6df5771e4b5f..b7c5b8d4701f82a6f4e070cec5bcc4b47e3af64b 100644 --- a/htdocs/margin/agentMargins.php +++ b/htdocs/margin/agentMargins.php @@ -84,7 +84,7 @@ dol_fiche_head($head, 'agentMargins', $titre, 0, $picto); print '<form method="post" name="sel" action="'.$_SERVER['PHP_SELF'].'">'; print '<table class="border" width="100%">'; -print '<tr><td width="20%">'.$langs->trans('CommercialAgent').'</td>'; +print '<tr><td width="20%">'.$langs->trans('SalesRepresentative').'</td>'; print '<td colspan="4">'; print $form->select_dolusers($agentid,'agentid',1); print '</td></tr>'; @@ -155,7 +155,7 @@ if ($result) if ($agentid > 0) print_liste_field_titre($langs->trans("Customer"),$_SERVER["PHP_SELF"],"s.nom","","&agentid=".$agentid,'',$sortfield,$sortorder); else - print_liste_field_titre($langs->trans("CommercialAgent"),$_SERVER["PHP_SELF"],"u.lastname","","&agentid=".$agentid,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("SalesRepresentative"),$_SERVER["PHP_SELF"],"u.lastname","","&agentid=".$agentid,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("SellingPrice"),$_SERVER["PHP_SELF"],"selling_price","","&agentid=".$agentid,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("BuyingPrice"),$_SERVER["PHP_SELF"],"buying_price","","&agentid=".$agentid,'align="right"',$sortfield,$sortorder); diff --git a/htdocs/margin/lib/margins.lib.php b/htdocs/margin/lib/margins.lib.php index 2dadd9500f270bf21215b4adf8597cef3fd2754c..a47b0a5d21f4d2475f9f4eb08d0ac4c16eb5971a 100644 --- a/htdocs/margin/lib/margins.lib.php +++ b/htdocs/margin/lib/margins.lib.php @@ -73,7 +73,7 @@ function marges_prepare_head() $h++; $head[$h][0] = DOL_URL_ROOT."/margin/agentMargins.php"; - $head[$h][1] = $langs->trans("AgentMargins"); + $head[$h][1] = $langs->trans("SalesRepresentativeMargins"); $head[$h][2] = 'agentMargins'; $h++; @@ -102,7 +102,7 @@ function getMarginInfos($pvht, $remise_percent, $tva_tx, $localtax1_tx, $localta if ($fk_pa > 0) { require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; $product = new ProductFournisseur($db); - if ($product->fetch_product_fournisseur_price($fk_pa)) + if ($product->fetch_product_fournisseur_price($fk_pa)) { $paht_ret = $product->fourn_unitprice * (1 - $product->fourn_remise_percent / 100); if ($conf->global->MARGIN_TYPE == "2" && $product->fourn_unitcharges > 0) @@ -113,11 +113,11 @@ function getMarginInfos($pvht, $remise_percent, $tva_tx, $localtax1_tx, $localta $paht_ret = $paht; } } - else + else { $paht_ret = $paht; } - + // Calculate selling unit price including line discount // We don't use calculate_price, because this function is dedicated to calculation of total with accuracy of total. We need an accuracy of a unit price. // Also we must not apply rounding on non decimal rule defined by option MAIN_ROUNDING_RULE_TOT diff --git a/htdocs/projet/document.php b/htdocs/projet/document.php index 89fc9549156c545e703386d54c7420f609eab227..8d545bf1e6aa6752c75b992d175aa3484974fea0 100644 --- a/htdocs/projet/document.php +++ b/htdocs/projet/document.php @@ -144,9 +144,8 @@ if ($object->id > 0) print "</table>\n"; print "</div>\n"; - $modulepart = 'projet'; + $modulepart = 'project'; $permission = ($userWrite > 0); - $param = '&id=' . $object->id; include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php'; } diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php index 8dd80223e6c29e8569c06cd8ed6e9893019929b8..0b876d0490a328efdf6cb840f8f0be066c0bf4f0 100644 --- a/htdocs/projet/tasks/document.php +++ b/htdocs/projet/tasks/document.php @@ -110,6 +110,7 @@ if ($id > 0 || ! empty($ref)) include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php'; + /* * View */ @@ -229,9 +230,11 @@ if ($object->id > 0) print '<br>'; - $modulepart = 'projet'; + $param=''; + if ($withproject) $param .= '&withproject=1'; + $modulepart = 'project_task'; $permission = $user->rights->projet->creer; - $param = '&id=' . $object->id; + $relativepathwithnofile=dol_sanitizeFileName($projectstatic->ref).'/'.dol_sanitizeFileName($object->ref).'/'; include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php'; } else diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index bf2b20843a1af8873d226194231d612318cc4a4e..5e16715445c4706bb0b1b5c3dfcb7ff981c78f16 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -23,10 +23,6 @@ * \brief Page of a project task */ -error_reporting(E_ALL); -ini_set('display_errors', true); -ini_set('html_errors', false); - require ("../../main.inc.php"); require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; diff --git a/test/phpunit/DateLibTest.php b/test/phpunit/DateLibTest.php index 8cf7520f9fd0ff503ba9a734e922149855b04384..c68272eafb793bfba79d0902803594f8b0caf7bf 100644 --- a/test/phpunit/DateLibTest.php +++ b/test/phpunit/DateLibTest.php @@ -313,15 +313,6 @@ class DateLibTest extends PHPUnit_Framework_TestCase $langs=$this->savlangs; $db=$this->savdb; - $conf->global->MAIN_OLD_DATE=1; - - $stime='19700102'; - $result=dol_stringtotime($stime); - print __METHOD__." result=".$result."\n"; - $this->assertEquals(86400,$result); - - $conf->global->MAIN_OLD_DATE=0; - $stime='19700102'; $result=dol_stringtotime($stime); print __METHOD__." result=".$result."\n"; diff --git a/test/phpunit/Example_import_company_1.csv b/test/phpunit/Example_import_company_1.csv index 34f99a6b728f80838e143a809d549b7f5e2c4f54..7ba7a797317825dd3f0fc47478f038a036a6ad56 100755 --- a/test/phpunit/Example_import_company_1.csv +++ b/test/phpunit/Example_import_company_1.csv @@ -1,2 +1,3 @@ "Name* (s.nom)";"Status (s.status)";"Customer* (s.client)";"Supplier* (s.fournisseur)";"DateCreation (s.datec)";"CustomerCode (s.code_client)";"SupplierCode (s.code_fournisseur)";"Address (s.address)";"Zip (s.cp)";"Town (s.ville)";"Phone (s.tel)";"Fax (s.fax)";"Url (s.url)";"Email (s.email)";"IdProf1 (s.siret)";"IdProf2 (s.siren)";"IdProf3 (s.ape)";"IdProf4 (s.idprof4)";"VATIntraShort (s.tva_intra)";"Capital (s.capital)";"Note (s.note)";"ThirdPartyType (s.fk_typent)";"Effectif (s.fk_effectif)";"JuridicalStatus (s.fk_forme_juridique)";"ProspectLevel (s.fk_prospectlevel)";"ProspectStatus (s.fk_stcomm)";"DefaultLanguage (s.default_lang)";"BarCode (s.barcode)" -"MyBigCompanyImport1";1;3;1;01/01/00;"CU01-0001";"SU01-0001";"61 jump street";123456;"Big town";101010101;101010102;"http://mycompany.com";"test@mycompany.com";;;;;"FR0123456789";10000;"This is an example of note for record";2;3;1;"PL_MEDIUM";1;"en_US";123456789 +"MyBigCompanyImport1";1;3;1;01/01/00;"CU01-0001";"SU01-0001";"61 jump street";123456;"Big town";101010101;101010111;"http://mycompany.com";"test@mycompany.com";;;;;"FR0123456781";10000;"This is an example of note for record 1";2;3;1;"PL_MEDIUM";1;"en_US";123456781 +"MyBigCompanyImport2";1;3;1;01/01/00;"auto";;"62 jump street";123456;"Big town";101010102;101010112;"http://mycompany2.com";"test@mycompany2.com";;;;;"FR0123456782";10000;"This is an example of note for record 2";2;3;1;"PL_MEDIUM";1;"en_US";auto diff --git a/test/phpunit/FilesLibTest.php b/test/phpunit/FilesLibTest.php index d38f73326b2b27e71f82f7bfe7405a96c68b1264..1e8d91ed08d13ad94c342511a4b1c062e1bb743c 100644 --- a/test/phpunit/FilesLibTest.php +++ b/test/phpunit/FilesLibTest.php @@ -162,7 +162,7 @@ class FilesLibTest extends PHPUnit_Framework_TestCase $file=dirname(__FILE__).'/Example_import_company_1.csv'; $result=dol_count_nb_of_line($file); print __METHOD__." result=".$result."\n"; - $this->assertEquals(2,$result); + $this->assertEquals(3,$result); return $result; } diff --git a/test/phpunit/FunctionsLibTest.php b/test/phpunit/FunctionsLibTest.php index 2ac3cce60f327fe20b537acc636e4500fbc7c394..ad46b7e5def1e75f7d2ff01e63b5ef2f21434f22 100755 --- a/test/phpunit/FunctionsLibTest.php +++ b/test/phpunit/FunctionsLibTest.php @@ -367,6 +367,14 @@ class FunctionsLibTest extends PHPUnit_Framework_TestCase */ public function testDolMkTime() { + global $conf; + + $savtz=date_default_timezone_get(); + + // Some test for UTC TZ + date_default_timezone_set('UTC'); + + // Check bad hours $result=dol_mktime(25,0,0,1,1,1970,1,1); // Error (25 hours) print __METHOD__." result=".$result."\n"; $this->assertEquals('',$result); @@ -390,7 +398,22 @@ class FunctionsLibTest extends PHPUnit_Framework_TestCase $result=dol_mktime(2,0,0,1,1,1970,0); // 1970-01-01 02:00:00 = 7200 in local area Europe/Paris = 3600 GMT print __METHOD__." result=".$result."\n"; $tz=getServerTimeZoneInt('winter'); // +1 in Europe/Paris at this time (this time is winter) - $this->assertEquals(7200-($tz*3600),$result); // Should be 7200 if we are at greenwich winter + $this->assertEquals(7200-($tz*3600),$result); // 7200 if we are at greenwich winter, 7200-($tz*3600) at local winter + + // Some test for local TZ Europe/Paris + date_default_timezone_set('Europe/Paris'); + + // Check that tz for paris in winter is used + $result=dol_mktime(2,0,0,1,1,1970,'server'); // 1970-01-01 02:00:00 = 7200 in local area Europe/Paris = 3600 GMT + print __METHOD__." result=".$result."\n"; + $this->assertEquals(3600,$result); // 7200 if we are at greenwich winter, 3600 at Europe/Paris + + // Check that daylight saving time is used + $result=dol_mktime(2,0,0,6,1,2014,0); // 2014-06-01 02:00:00 = 1401588000-3600(location)-3600(daylight) in local area Europe/Paris = 1401588000 GMT + print __METHOD__." result=".$result."\n"; + $this->assertEquals(1401588000-3600-3600,$result); // 1401588000 are at greenwich summer, 1401588000-3600(location)-3600(daylight) at Europe/Paris summer + + date_default_timezone_set($savtz); } @@ -574,11 +597,11 @@ class FunctionsLibTest extends PHPUnit_Framework_TestCase // Test RULE 2 (FR-FR) $vat=get_default_tva($companyfr,$companyfr,0); - $this->assertEquals(19.6,$vat); + $this->assertEquals(20,$vat); // Test RULE 2 (FR-MC) $vat=get_default_tva($companyfr,$companymc,0); - $this->assertEquals(19.6,$vat); + $this->assertEquals(20,$vat); // Test RULE 3 (FR-IT) $vat=get_default_tva($companyfr,$companyit,0); @@ -586,7 +609,7 @@ class FunctionsLibTest extends PHPUnit_Framework_TestCase // Test RULE 4 (FR-IT) $vat=get_default_tva($companyfr,$notcompanyit,0); - $this->assertEquals(19.6,$vat); + $this->assertEquals(20,$vat); // Test RULE 5 (FR-US) $vat=get_default_tva($companyfr,$companyus,0); diff --git a/test/phpunit/ImportTest.php b/test/phpunit/ImportTest.php index 378031be257bb8f2d8c77049ab4c6f3f408b2e9d..86d23a850e176049a9ba0684b61a1ca682b75f3b 100755 --- a/test/phpunit/ImportTest.php +++ b/test/phpunit/ImportTest.php @@ -125,7 +125,10 @@ class ImportTest extends PHPUnit_Framework_TestCase { $file=dirname(__FILE__).'/Example_import_company_1.csv'; - //if (! preg_match('/^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$/i','2012-03-23')) print 'eeeeeeeeeeee'; + // TODO + // Run import on file and check the record with field "auto" are filled + // according to option + return true; }